Comparing version 3.8.0 to 3.8.1
@@ -129,2 +129,5 @@ document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg"> | ||
<symbol id="vditor-icon-insert-row" viewBox="0 0 32 32"> | ||
<path d="M30.668 23.040h-29.336c-0.736 0-1.332-0.572-1.332-1.28v-18.56c0-0.708 0.596-1.28 1.332-1.28h29.332c0.736 0 1.332 0.572 1.332 1.28v18.56c0.004 0.708-0.592 1.28-1.328 1.28zM9.92 4.8h-7.040v6.4h7.040v-6.4zM9.92 13.76h-7.040v6.4h7.040v-6.4zM19.52 4.8h-7.040v6.4h7.040v-6.4zM19.52 13.76h-7.040v6.4h7.040v-6.4zM29.12 4.8h-7.040v6.4h7.040v-6.4zM29.12 13.76h-7.040v6.4h7.040v-6.4zM31.68 30.080h-31.36c-0.176 0-0.32-0.144-0.32-0.32v-3.2c0-0.176 0.144-0.32 0.32-0.32h31.36c0.176 0 0.32 0.144 0.32 0.32v3.2c0 0.176-0.144 0.32-0.32 0.32z"></path> | ||
</symbol> | ||
<symbol id="vditor-icon-insert-rowb" viewBox="0 0 32 32"> | ||
<path d="M30.668 8.96h-29.336c-0.736 0-1.332 0.572-1.332 1.28v18.56c0 0.708 0.596 1.28 1.332 1.28h29.332c0.736 0 1.332-0.572 1.332-1.28v-18.56c0.004-0.708-0.592-1.28-1.328-1.28zM9.92 27.2h-7.040v-6.4h7.040v6.4zM9.92 18.24h-7.040v-6.4h7.040v6.4zM19.52 27.2h-7.040v-6.4h7.040v6.4zM19.52 18.24h-7.040v-6.4h7.040v6.4zM29.12 27.2h-7.040v-6.4h7.040v6.4zM29.12 18.24h-7.040v-6.4h7.040v6.4zM31.68 1.92h-31.36c-0.176 0-0.32 0.144-0.32 0.32v3.2c0 0.176 0.144 0.32 0.32 0.32h31.36c0.176 0 0.32-0.144 0.32-0.32v-3.2c0-0.176-0.144-0.32-0.32-0.32z"></path> | ||
@@ -135,2 +138,5 @@ </symbol> | ||
</symbol> | ||
<symbol id="vditor-icon-insert-columnb" viewBox="0 0 32 32"> | ||
<path d="M2.24 32h3.2c0.176 0 0.32-0.144 0.32-0.32v-31.36c0-0.176-0.144-0.32-0.32-0.32h-3.2c-0.176 0-0.32 0.144-0.32 0.32v31.36c0 0.176 0.144 0.32 0.32 0.32zM10.24 32h18.56c0.708 0 1.28-0.596 1.28-1.332v-29.332c0-0.736-0.572-1.332-1.28-1.332h-18.56c-0.708 0-1.28 0.596-1.28 1.332v29.332c0 0.736 0.572 1.332 1.28 1.332zM20.8 2.88h6.4v7.040h-6.4v-7.040zM20.8 12.48h6.4v7.040h-6.4v-7.040zM20.8 22.080h6.4v7.040h-6.4v-7.040zM11.84 2.88h6.4v7.040h-6.4v-7.040zM11.84 12.48h6.4v7.040h-6.4v-7.040zM11.84 22.080h6.4v7.040h-6.4v-7.040z"></path> | ||
</symbol> | ||
<symbol id="vditor-icon-italic" viewBox="0 0 32 32"> | ||
@@ -137,0 +143,0 @@ <path d="M29 0h-19.636c-0.2 0-0.364 0.164-0.364 0.364v2.909c0 0.2 0.164 0.364 0.364 0.364h8.236l-7.091 24.727h-7.373c-0.2 0-0.364 0.164-0.364 0.364v2.909c0 0.2 0.164 0.364 0.364 0.364h19.636c0.2 0 0.364-0.164 0.364-0.364v-2.909c0-0.2-0.164-0.364-0.364-0.364h-8.482l7.091-24.727h7.618c0.2 0 0.364-0.164 0.364-0.364v-2.909c0-0.2-0.164-0.364-0.364-0.364z"></path> |
@@ -35,7 +35,25 @@ document.body.insertAdjacentHTML('afterBegin', `<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg"> | ||
</symbol> | ||
<symbol id="vditor-icon-insert-row" viewBox="0 0 32 32"> | ||
<path d="M1.462 5.493h21.543v3.276h-21.543v-3.276z"></path> | ||
<path d="M1.462 22.072h16.48v3.276h-16.48v-3.276z"></path> | ||
<path d="M1.462 13.783h21.543v3.276h-21.543v-3.276z"></path> | ||
<path d="M24.366 23.71l6.171 5.952-2.43 2.338-8.619-8.29 8.619-8.29 2.43 2.337-6.171 5.953z"></path> | ||
</symbol> | ||
<symbol id="vditor-icon-insert-rowb" viewBox="0 0 32 32"> | ||
<path d="M1.462 26.507h21.543v-3.276h-21.543v3.276z"></path> | ||
<path d="M1.462 9.928h16.48v-3.276h-16.48v3.276z"></path> | ||
<path d="M1.462 18.217h21.543v-3.276h-21.543v3.276z"></path> | ||
<path d="M24.366 8.29l6.171-5.952-2.43-2.338-8.619 8.29 8.619 8.29 2.43-2.337-6.171-5.953z"></path> | ||
</symbol> | ||
<symbol id="vditor-icon-insert-column" viewBox="0 0 32 32"> | ||
<path d="M26.667 0v23.111h-3.556v-23.111h3.556zM17.778 0v17.778h-3.556v-17.778h3.556zM5.333 0h3.556v23.111h-3.556v-23.111zM22.382 32l-6.382-6.364-6.382 6.364-2.507-2.507 8.889-8.889 8.889 8.889-2.507 2.507z"></path> | ||
<path d="M5.493 1.462v21.543h3.276v-21.543h-3.276z"></path> | ||
<path d="M22.072 1.462v16.48h3.276v-16.48h-3.276z"></path> | ||
<path d="M13.783 1.462v21.543h3.276v-21.543h-3.276z"></path> | ||
<path d="M23.71 24.366l5.952 6.171 2.338-2.43-8.29-8.619-8.29 8.619 2.337 2.43 5.953-6.171z"></path> | ||
</symbol> | ||
<symbol id="vditor-icon-insert-row" viewBox="0 0 32 32"> | ||
<path d="M0 26.667h23.111v-3.556h-23.111v3.556zM0 17.778h17.778v-3.556h-17.778v3.556zM0 5.333v3.556h23.111v-3.556h-23.111zM32 22.382l-6.364-6.382 6.364-6.382-2.507-2.507-8.889 8.889 8.889 8.889 2.507-2.507z"></path> | ||
<symbol id="vditor-icon-insert-columnb" viewBox="0 0 32 32"> | ||
<path d="M26.507 1.462v21.543h-3.276v-21.543h3.276z"></path> | ||
<path d="M9.928 1.462v16.48h-3.276v-16.48h3.276z"></path> | ||
<path d="M18.217 1.462v21.543h-3.276v-21.543h3.276z"></path> | ||
<path d="M8.29 24.366l-5.952 6.171-2.338-2.43 8.29-8.619 8.29 8.619-2.337 2.43-5.953-6.171z"></path> | ||
</symbol> | ||
@@ -42,0 +60,0 @@ <symbol id="vditor-icon-code-theme" viewBox="0 0 32 32"> |
@@ -27,3 +27,3 @@ /// <reference types="./types" /> | ||
/** plantuml渲染 */ | ||
static plantumlRender: (element: HTMLElement, cdn?: string) => void; | ||
static plantumlRender: (element?: HTMLElement | Document, cdn?: string) => void; | ||
/** 大纲渲染 */ | ||
@@ -30,0 +30,0 @@ static outlineRender: (contentElement: HTMLElement, targetElement: Element, vditor?: IVditor) => string; |
/*! | ||
* Vditor v3.8.0 - A markdown editor written in TypeScript. | ||
* Vditor v3.8.1 - A markdown editor written in TypeScript. | ||
* | ||
@@ -27,2 +27,2 @@ * MIT License | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Vditor=t():e.Vditor=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}([function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"h",(function(){return l})),n.d(t,"c",(function(){return d})),n.d(t,"g",(function(){return u})),n.d(t,"f",(function(){return m})),n.d(t,"d",(function(){return f}));var r=n(2),i=n(3),o=n(1),a=function(e){var t;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),e.isEqualNode(t.startContainer)||e.contains(t.startContainer))||(e.focus(),(t=e.ownerDocument.createRange()).setStart(e,0),t.collapse(!0)),t},s=function(e){var t=window.getSelection().getRangeAt(0);if(!e.contains(t.startContainer)&&!Object(o.e)(t.startContainer,"vditor-panel--none"))return{left:0,top:0};var n,r=e.parentElement.getBoundingClientRect();if(0===t.getClientRects().length)if(3===t.startContainer.nodeType){var i=t.startContainer.parentElement;if(!(i&&i.getClientRects().length>0))return{left:0,top:0};n=i.getClientRects()[0]}else{var a=t.startContainer.children;if(a[t.startOffset]&&a[t.startOffset].getClientRects().length>0)n=a[t.startOffset].getClientRects()[0];else if(t.startContainer.childNodes.length>0){var s=t.cloneRange();t.selectNode(t.startContainer.childNodes[Math.max(0,t.startOffset-1)]),n=t.getClientRects()[0],t.setEnd(s.endContainer,s.endOffset),t.setStart(s.startContainer,s.startOffset)}else n=t.startContainer.getClientRects()[0];if(!n){for(var c=t.startContainer.childNodes[t.startOffset];!c.getClientRects||c.getClientRects&&0===c.getClientRects().length;)c=c.parentElement;n=c.getClientRects()[0]}}else n=t.getClientRects()[0];return{left:n.left-r.left,top:n.top-r.top}},c=function(e,t){if(!t){if(0===getSelection().rangeCount)return!1;t=getSelection().getRangeAt(0)}var n=t.commonAncestorContainer;return e.isEqualNode(n)||e.contains(n)},l=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},d=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(c(t,n)){var i=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?i.setStart(e.childNodes[0].childNodes[0],0):i.selectNodeContents(e),i.setEnd(n.startContainer,n.startOffset),r.start=i.toString().length,r.end=r.start+n.toString().length}return r},u=function(e,t,n){var r=0,i=0,o=n.childNodes[i],a=!1,s=!1;e=Math.max(0,e),t=Math.max(0,t);var c=n.ownerDocument.createRange();for(c.setStart(o||n,0),c.collapse(!0);!s&&o;){var d=r+o.textContent.length;if(!a&&e>=r&&e<=d&&(0===e?c.setStart(o,0):3===o.childNodes[0].nodeType?c.setStart(o.childNodes[0],e-r):o.nextSibling?c.setStartBefore(o.nextSibling):c.setStartAfter(o),a=!0,e===t)){s=!0;break}a&&t>=r&&t<=d&&(0===t?c.setEnd(o,0):3===o.childNodes[0].nodeType?c.setEnd(o.childNodes[0],t-r):o.nextSibling?c.setEndBefore(o.nextSibling):c.setEndAfter(o),s=!0),r=d,o=n.childNodes[++i]}return!s&&n.childNodes[i-1]&&c.setStartBefore(n.childNodes[i-1]),l(c),c},m=function(e,t){var n=e.querySelector("wbr");if(n){if(n.previousElementSibling)if(n.previousElementSibling.isSameNode(n.previousSibling)){if(n.previousElementSibling.lastChild)return t.setStartBefore(n),t.collapse(!0),l(t),!Object(i.c)()||"EM"!==n.previousElementSibling.tagName&&"STRONG"!==n.previousElementSibling.tagName&&"S"!==n.previousElementSibling.tagName||(t.insertNode(document.createTextNode(r.a.ZWSP)),t.collapse(!1)),void n.remove();t.setStartAfter(n.previousElementSibling)}else t.setStart(n.previousSibling,n.previousSibling.textContent.length);else n.previousSibling?t.setStart(n.previousSibling,n.previousSibling.textContent.length):n.nextSibling?3===n.nextSibling.nodeType?t.setStart(n.nextSibling,0):t.setStartBefore(n.nextSibling):t.setStart(n.parentElement,0);t.collapse(!0),n.remove(),l(t)}},f=function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.querySelectorAll("p");1===r.length&&!r[0].previousSibling&&!r[0].nextSibling&&t[t.currentMode].element.children.length>0&&"P"===n.firstElementChild.tagName&&(e=r[0].innerHTML.trim());var i=document.createElement("div");i.innerHTML=e;var s=a(t[t.currentMode].element);if(""!==s.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),i.firstElementChild&&"0"===i.firstElementChild.getAttribute("data-block")){i.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var c=Object(o.c)(s.startContainer);c?c.insertAdjacentHTML("afterend",i.innerHTML):t[t.currentMode].element.insertAdjacentHTML("beforeend",i.innerHTML),m(t[t.currentMode].element,s)}else{var d=document.createElement("template");d.innerHTML=e,s.insertNode(d.content.cloneNode(!0)),s.collapse(!1),l(s)}}},function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"h",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"f",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"a",(function(){return u}));var r=n(6),i=function(e,t){for(var n=d(e,t),r=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(r=d(n.parentElement,t))?n=r:i=!0;return n||!1},o=function(e,t){for(var n=Object(r.b)(e,t),i=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(i=Object(r.b)(n.parentElement,t))?n=i:o=!0;return n||!1},a=function(e){var t=o(e,"UL"),n=o(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},s=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,i=!1;r&&!i&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?i=!0:r=r.parentElement;return i&&r},c=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=s(e,"data-block","0");if(r)return r;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},l=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.nodeName===t?r=!0:n=n.parentElement;return r&&n},d=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},u=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r="3.8.0",i=function(){function e(){}return e.ZWSP="",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],e.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","bash","cs","cpp","css","coffeescript","diff","xml","http","ini","json","java","javascript","js","makefile","markdown","nginx","objectivec","php","perl","properties","python","ruby","sql","shell","dart","erb","go","gradle","julia","kotlin","less","lua","matlab","rust","scss","typescript","ts","yaml"],e.CDN="https://cdn.jsdelivr.net/npm/vditor@3.8.0",e.MARKDOWN_OPTIONS={autoSpace:!1,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:e.CDN+"/dist/css/content-theme"},e}()},function(e,t,n){"use strict";n.d(t,"f",(function(){return r})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"g",(function(){return c})),n.d(t,"c",(function(){return l}));var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},i=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},o=function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}},a=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},s=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!e.metaKey||e.ctrlKey):!(e.metaKey||!e.ctrlKey)},c=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?(e=e.replace("ctrl","⌘").replace("shift","⇧").replace("alt","⌥")).indexOf("⇧")>-1&&(e=i()?e.replace(";",":").replace("=","+"):e.replace(":",";").replace("+","=").replace("_","-")):(e=e.replace("⌘","ctrl").replace("⇧","shift").replace("⌥","alt")).indexOf("shift")>-1&&(e=e.replace(";",":").replace("=","+")),e},l=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r={en_US:{alignCenter:"Center",alignLeft:"Left",alignRight:"Right",alternateText:"Alternate text",bold:"Blod",both:"editor & preview",check:"Task List",close:"Close",code:"Code Block","code-theme":"Code Block Theme Preview",column:"Column",comment:"Comment",confirm:"Confirm","content-theme":"Content Theme Preview",copied:"Copied",copy:"Copy","delete-column":"Delete Row","delete-row":"Delete Column",devtools:"DevTools",down:"Down",downloadTip:"The browser does not support the download function",edit:"Edit","edit-mode":"Toggle Edit Mode",emoji:"Emoji",export:"Export",fileTypeError:"file type is error",footnoteRef:"Footnote Ref",fullscreen:"Toggle Fullscreen",generate:"Generating",headings:"Headings",help:"Help",imageURL:"image URL",indent:"Indent",info:"Info","inline-code":"Inline Code","insert-after":"Insert line after","insert-before":"Insert line Before","insert-column":"Insert Column","insert-row":"Insert Row",instantRendering:"Instant Rendering",italic:"Italic",language:"Language",line:"Line",link:"Link",linkRef:"Link Ref",list:"List",more:"More",nameEmpty:"Name is empty","ordered-list":"Order List",outdent:"Outdent",outline:"Outline",over:"over",performanceTip:"Real-time preview requires ${x}ms, you can close it",preview:"Preview",quote:"Quote",record:"Start Record/End Record","record-tip":"The device does not support recording",recording:"recording...",redo:"Redo",remove:"Remove",row:"Row",spin:"Spin",splitView:"Split View",strike:"Strike",table:"Table",textIsNotEmpty:"text(no empty)",title:"Title",tooltipText:"Tooltip text",undo:"Undo",up:"Up",update:"Update",upload:"Upload image or file",uploadError:"upload error",uploading:"uploading...",wysiwyg:"WYSIWYG"},ja_JP:{alignCenter:"中央",alignLeft:"左側",alignRight:"右側",alternateText:"イメージタグ",bold:"太く",both:"エディター & プレビュー",check:"チェックリスト",close:"閉じる",code:"コードブロック挿入","code-theme":"コードブロックテーマ",column:"行列",comment:"コメント",confirm:"確認","content-theme":"コンテンツテーマ",copied:"コピー完了",copy:"コピー","delete-column":"列 消去","delete-row":"行 消去",devtools:"開発ツール",down:"ダウンロード",downloadTip:"ブラウザがダウンロード機能をサポートしていません。",edit:"修正","edit-mode":"編集モード",emoji:"絵文字",export:"書き出し",fileTypeError:"サポートしていません。",footnoteRef:"脚注参照",fullscreen:"全体画面",generate:"作成する",headings:"タイトル大きさ",help:"ヘルプ",imageURL:"イメージ URL",indent:"字下げ",info:"情報","inline-code":"インラインコード","insert-after":"ブロックの後ろに入力","insert-before":"ブロックの前に入力","insert-column":"列 挿入","insert-row":"行 挿入",instantRendering:"インスタントレンダリング",italic:"斜体",language:"言語",line:"段落分割",link:"リンク",linkRef:"リンク参照",list:"リスト",more:"詳しく見る",nameEmpty:"名前が入力されていません。","ordered-list":"順序のあるリスト",outdent:"ぶら下げインデント",outline:"概要",over:"オーバー",performanceTip:"リアルタイムプレビューには、${x}msが必要でエディター/プレビューボタンをクリックして閉じる事が出来ます。",preview:"プレビュー",quote:"引用段落",record:"録音開始/録音終了","record-tip":"録音がサポートされていません。",recording:"録音中...",redo:"戻る",remove:"消去",row:"列",spin:"スピン",splitView:"マークダウン",strike:"取り消し線",table:"表 挿入",textIsNotEmpty:"テキスト(no empty)",title:"題名",tooltipText:"ツールチップ",undo:"取り消す",up:"戻る",update:"アップデート",upload:"イメージをダウンロードする",uploadError:"アップロード失敗",uploading:"アップロード中",wysiwyg:"ウィジウィグ"},ko_KR:{alignCenter:"가운데",alignLeft:"왼쪽",alignRight:"오른쪽",alternateText:"이미지 태그",bold:"굵게",both:"에디터 & 미리보기",check:"체크박스",close:"닫기",code:"코드블럭삽입","code-theme":"코드블럭테마",column:"행",comment:"코멘트",confirm:"확인","content-theme":"컨텐츠테마",copied:"복사완료",copy:"복사","delete-column":"열 삭제","delete-row":"행 삭제",devtools:"개발툴",down:"다운",downloadTip:"브라우저가 다운로드 기능을 지원하지 않습니다",edit:"수정","edit-mode":"편집모드",emoji:"이모지",export:"내보내기",fileTypeError:"지원하지않습니다.",footnoteRef:"각주참조",fullscreen:"전체화면",generate:"생성",headings:"제목크기",help:"도움말",imageURL:"이미지 URL",indent:"들여쓰기",info:"정보","inline-code":"인라인코드","insert-after":"블락 뒤로 입력","insert-before":"블락 앞으로 입력","insert-column":"열 삽입","insert-row":"행 삽입",instantRendering:"타이포라",italic:"기울임꼴",language:"언어",line:"문단나눔",link:"링크",linkRef:"링크 참조",list:"순서없는 목록",more:"더보기",nameEmpty:"이름이 비어있습니다.","ordered-list":"순서있는 목록",outdent:"내어쓰기",outline:"개요",over:"오버",performanceTip:"실시간 미리보기에는 ${x}ms가 필요하며 에디터/미리보기 버튼을 클릭하여 닫을 수 있습니다.",preview:"미리보기",quote:"인용단락",record:"녹음시작/녹음종료","record-tip":"녹음을 지원하지 않습니다.",recording:"녹음중...",redo:"되돌리기",remove:"삭제",row:"열",spin:"회전",splitView:"마크다운",strike:"취소선",table:"표삽입",textIsNotEmpty:"텍스트(no empty)",title:"표제",tooltipText:"툴팁",undo:"취소하기",up:"위로",update:"업데이트",upload:"이미지 업로드하기",uploadError:"업로드 실패",uploading:"업로드중...",wysiwyg:"위지위그"},zh_CN:{alignCenter:"居中",alignLeft:"居左",alignRight:"居右",alternateText:"替代文本",bold:"粗体",both:"编辑 & 预览",check:"任务列表",close:"关闭",code:"代码块","code-theme":"代码块主题预览",column:"列",comment:"评论",confirm:"确定","content-theme":"内容主题预览",copied:"已复制",copy:"复制","delete-column":"删除列","delete-row":"删除行",devtools:"开发者工具",down:"下",downloadTip:"该浏览器不支持下载功能",edit:"编辑","edit-mode":"切换编辑模式",emoji:"表情",export:"导出",fileTypeError:"文件类型不允许上传",footnoteRef:"脚注标识",fullscreen:"全屏切换",generate:"生成中",headings:"标题",help:"帮助",imageURL:"图片地址",indent:"列表缩进",info:"关于","inline-code":"行内代码","insert-after":"末尾插入行","insert-before":"起始插入行","insert-column":"插入列","insert-row":"插入行",instantRendering:"即时渲染",italic:"斜体",language:"语言",line:"分隔线",link:"链接",linkRef:"引用标识",list:"无序列表",more:"更多",nameEmpty:"文件名不能为空","ordered-list":"有序列表",outdent:"列表反向缩进",outline:"大纲",over:"超过",performanceTip:"实时预览需 ${x}ms,可点击编辑 & 预览按钮进行关闭",preview:"预览",quote:"引用",record:"开始录音/结束录音","record-tip":"该设备不支持录音功能",recording:"录音中...",redo:"重做",remove:"删除",row:"行",spin:"旋转",splitView:"分屏预览",strike:"删除线",table:"表格",textIsNotEmpty:"文本(不能为空)",title:"标题",tooltipText:"提示文本",undo:"撤销",up:"上",update:"更新",upload:"上传图片或文件",uploadError:"上传错误",uploading:"上传中...",wysiwyg:"所见即所得"}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest;n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send("");var r=document.createElement("script");r.type="text/javascript",r.text=n.responseText,r.id=t,document.head.appendChild(r)},i=function(e,t){return new Promise((function(n,r){if(document.getElementById(t))return n(),!1;var i=document.createElement("script");i.src=e,i.async=!0,document.head.appendChild(i),i.onload=function(){if(document.getElementById(t))return i.remove(),n(),!1;i.id=t,n()}}))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?r=!0:n=n.parentElement;return r&&n},i=function(e){var t=r(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(2),i=n(5),o=n(8),a=n(9),s=function(e,t){var n=e.querySelectorAll(".language-math");if(0!==n.length){var s={cdn:r.a.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},s.math,t.math)),"KaTeX"===(t=Object.assign({},s,t)).math.engine)Object(o.a)(t.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),Object(i.a)(t.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then((function(){n.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&!e.getAttribute("data-math")){var t=Object(a.a)(e.textContent);e.setAttribute("data-math",t);try{e.innerHTML=katex.renderToString(t,{displayMode:"DIV"===e.tagName,output:"html"})}catch(t){e.innerHTML=t.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",(function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))}))}}))}));else if("MathJax"===t.math.engine){window.MathJax||(window.MathJax={loader:{paths:{mathjax:t.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:t.math.macros}}),Object(i.b)(t.cdn+"/dist/js/mathjax/tex-svg.js","vditorMathJaxScript");var c=function(e,t){var n=Object(a.a)(e.textContent).trim(),r=window.MathJax.getMetricsFor(e);r.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(n,r).then((function(r){e.innerHTML="",e.setAttribute("data-math",n),e.append(r),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var i=r.querySelector('[data-mml-node="merror"]');i&&""!==i.textContent.trim()&&(e.innerHTML=i.textContent.trim(),e.className="vditor-reset--error"),t&&t()}))};window.MathJax.startup.promise.then((function(){for(var e=[],t=function(t){var r=n[t];r.parentElement.classList.contains("vditor-wysiwyg__pre")||r.parentElement.classList.contains("vditor-ir__marker--pre")||r.getAttribute("data-math")||!Object(a.a)(r.textContent).trim()||e.push((function(e){t===n.length-1?c(r):c(r,e)}))},r=0;r<n.length;r++)t(r);!function(e){if(0!==e.length){var t=0,n=e[e.length-1],r=function(){var i=e[t++];i===n?i():i(r)};r()}}(e)}))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t){if(!document.getElementById(t)){var n=document.createElement("link");n.id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){return e.replace(/\u00a0/g," ")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(8),i=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),i=t+"/"+e+".css";n?n.href!==i&&(n.remove(),Object(r.a)(i,"vditorContentTheme")):Object(r.a)(i,"vditorContentTheme")}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.a.CDN);var n=e.querySelectorAll(".language-abc");n.length>0&&Object(i.a)(t+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then((function(){n.forEach((function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,e.textContent.trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.a.CDN);var o=e.querySelectorAll(".language-echarts");o.length>0&&Object(i.a)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then((function(){o.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=e.innerText.trim();if(t)try{if("true"===e.getAttribute("data-processed"))return;var r=JSON.parse(t);echarts.init(e,"dark"===n?"dark":void 0).setOption(r),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>"+t}}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4),i=n(9),o=function(e,t){void 0===t&&(t="zh_CN"),e.querySelectorAll("pre > code").forEach((function(n,o){if(!n.parentElement.classList.contains("vditor-wysiwyg__pre")&&!n.parentElement.classList.contains("vditor-ir__marker--pre")&&!(n.classList.contains("language-mermaid")||n.classList.contains("language-flowchart")||n.classList.contains("language-echarts")||n.classList.contains("language-mindmap")||n.classList.contains("language-plantuml")||n.classList.contains("language-abc")||n.classList.contains("language-graphviz")||n.classList.contains("language-math")||n.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&o>5)){var a=n.innerText;if(n.classList.contains("highlight-chroma")){var s=document.createElement("code");s.innerHTML=n.innerHTML,s.querySelectorAll(".highlight-ln").forEach((function(e){e.remove()})),a=s.innerText}var c=document.createElement("div");c.className="vditor-copy",c.innerHTML='<span aria-label="'+r.a[t].copy+"\"\nonmouseover=\"this.setAttribute('aria-label', '"+r.a[t].copy+"')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '"+r.a[t].copied+'\')"><svg><use xlink:href="#vditor-icon-copy"></use></svg></span>';var l=document.createElement("textarea");l.value=Object(i.a)(a),c.insertAdjacentElement("afterbegin",l),n.before(c),n.style.maxHeight=window.outerHeight-40+"px"}}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t){void 0===t&&(t=r.a.CDN);var n=e.querySelectorAll(".language-flowchart");0!==n.length&&Object(i.a)(t+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then((function(){n.forEach((function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(e.textContent);e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t){void 0===t&&(t=r.a.CDN);var n=e.querySelectorAll(".language-graphviz");0!==n.length&&Object(i.a)(t+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then((function(){n.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==e.textContent.trim()){try{var t=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),n=(window.URL||window.webkitURL).createObjectURL(t),r=new Worker(n);new Viz({worker:r}).renderSVGElement(e.textContent).then((function(t){e.innerHTML=t.outerHTML})).catch((function(t){e.innerHTML="graphviz render error: <br>"+t,e.className="vditor-reset--error"}))}catch(e){console.error("graphviz error",e)}e.setAttribute("data-processed","true")}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(2),i=n(5),o=n(8),a=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.a.CDN);var a=e.style;r.a.CODE_THEME.includes(a)||(a="github");var s=document.getElementById("vditorHljsStyle"),c=n+"/dist/js/highlight.js/styles/"+a+".css";(s&&s.href!==c&&s.remove(),Object(o.a)(n+"/dist/js/highlight.js/styles/"+a+".css","vditorHljsStyle"),!1!==e.enable)&&(0!==t.querySelectorAll("pre > code").length&&Object(i.a)(n+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then((function(){t.querySelectorAll("pre > code").forEach((function(t){if(!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchat")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))&&(hljs.highlightBlock(t),e.lineNumber)){t.classList.add("vditor-linenumber");var n=t.querySelector(".vditor-linenumber__temp");n||((n=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",n));var r=getComputedStyle(t).whiteSpace,i=!1;"pre-wrap"!==r&&"pre-line"!==r||(i=!0);var o="",a=t.textContent.split(/\r\n|\r|\n/g);a.pop(),a.map((function(e){var t="";i&&(n.textContent=e||"\n",t=' style="height:'+n.getBoundingClientRect().height+'px"'),o+="<span"+t+"></span>"})),n.style.display="none",o='<span class="vditor-linenumber__rows">'+o+"</span>",t.insertAdjacentHTML("beforeend",o)}}))})))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t,n){void 0===t&&(t=r.a.CDN);var o=e.querySelectorAll(".language-mermaid");0!==o.length&&Object(i.a)(t+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then((function(){var e={altFontFamily:"sans-serif",flowchart:{htmlLabels:!0,useMaxWidth:!0},fontFamily:"sans-serif",gantt:{leftPadding:75,rightPadding:20},securityLevel:"loose",sequence:{boxMargin:8,diagramMarginX:8,diagramMarginY:8,useMaxWidth:!0},startOnLoad:!1};"dark"===n&&(e.theme="dark",e.themeVariables={activationBkgColor:"hsl(180, 1.5873015873%, 28.3529411765%)",activationBorderColor:"#81B1DB",activeTaskBkgColor:"#81B1DB",activeTaskBorderColor:"#ffffff",actorBkg:"#1f2020",actorBorder:"#81B1DB",actorLineColor:"lightgrey",actorTextColor:"lightgrey",altBackground:"hsl(0, 0%, 40%)",altSectionBkgColor:"#333",arrowheadColor:"lightgrey",background:"#333",border1:"#81B1DB",border2:"rgba(255, 255, 255, 0.25)",classText:"#e0dfdf",clusterBkg:"hsl(180, 1.5873015873%, 28.3529411765%)",clusterBorder:"rgba(255, 255, 255, 0.25)",critBkgColor:"#E83737",critBorderColor:"#E83737",darkTextColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",defaultLinkColor:"lightgrey",doneTaskBkgColor:"lightgrey",doneTaskBorderColor:"grey",edgeLabelBackground:"hsl(0, 0%, 34.4117647059%)",errorBkgColor:"#a44141",errorTextColor:"#ddd",fillType0:"#1f2020",fillType1:"hsl(180, 1.5873015873%, 28.3529411765%)",fillType2:"hsl(244, 1.5873015873%, 12.3529411765%)",fillType3:"hsl(244, 1.5873015873%, 28.3529411765%)",fillType4:"hsl(116, 1.5873015873%, 12.3529411765%)",fillType5:"hsl(116, 1.5873015873%, 28.3529411765%)",fillType6:"hsl(308, 1.5873015873%, 12.3529411765%)",fillType7:"hsl(308, 1.5873015873%, 28.3529411765%)",fontFamily:'"trebuchet ms", verdana, arial',fontSize:"16px",gridColor:"lightgrey",labelBackground:"#181818",labelBoxBkgColor:"#1f2020",labelBoxBorderColor:"#81B1DB",labelColor:"#ccc",labelTextColor:"lightgrey",lineColor:"lightgrey",loopTextColor:"lightgrey",mainBkg:"#1f2020",mainContrastColor:"lightgrey",nodeBkg:"#1f2020",nodeBorder:"#81B1DB",noteBkgColor:"#fff5ad",noteBorderColor:"rgba(255, 255, 255, 0.25)",noteTextColor:"#1f2020",primaryBorderColor:"hsl(180, 0%, 2.3529411765%)",primaryColor:"#1f2020",primaryTextColor:"#e0dfdf",secondBkg:"hsl(180, 1.5873015873%, 28.3529411765%)",secondaryBorderColor:"hsl(180, 0%, 18.3529411765%)",secondaryColor:"hsl(180, 1.5873015873%, 28.3529411765%)",secondaryTextColor:"rgb(183.8476190475, 181.5523809523, 181.5523809523)",sectionBkgColor:"hsl(52.9411764706, 28.813559322%, 58.431372549%)",sectionBkgColor2:"#EAE8D9",sequenceNumberColor:"black",signalColor:"lightgrey",signalTextColor:"lightgrey",taskBkgColor:"hsl(180, 1.5873015873%, 35.3529411765%)",taskBorderColor:"#ffffff",taskTextClickableColor:"#003163",taskTextColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",taskTextDarkColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",taskTextLightColor:"lightgrey",taskTextOutsideColor:"lightgrey",tertiaryBorderColor:"hsl(20, 0%, 2.3529411765%)",tertiaryColor:"hsl(20, 1.5873015873%, 12.3529411765%)",tertiaryTextColor:"rgb(222.9999999999, 223.6666666666, 223.9999999999)",textColor:"#ccc",titleColor:"#F9FFFE",todayLineColor:"#DB5757"}),mermaid.initialize(e),o.forEach((function(e){"true"!==e.getAttribute("data-processed")&&""!==e.textContent.trim()&&(mermaid.init(void 0,e),e.setAttribute("data-processed","true"))}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.a.CDN);var o=e.querySelectorAll(".language-mindmap");o.length>0&&Object(i.a)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then((function(){o.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=e.getAttribute("data-code");if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===n?"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(e,t){var n;return(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>"+t}}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t){void 0===t&&(t=r.a.CDN);var n=e.querySelectorAll(".language-plantuml");0!==n.length&&Object(i.a)(t+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then((function(){n.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=e.innerText.trim();if(t)try{var n=plantumlEncoder.encode(t),r=document.createElement("img");r.setAttribute("loading","lazy"),r.setAttribute("src","http://www.plantuml.com/plantuml/svg/~1"+n),e.parentNode.insertBefore(r,e),e.remove()}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>"+t}}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){e&&e.querySelectorAll("a").forEach((function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'+t+'"></video>'),e.remove()}(e,t):t.match(/^.+.(mp3|wav|flac)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+t+'"></audio>'),e.remove()}(e,t):function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),r=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),o=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),a=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),c=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),l=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);n&&11===n[1].length?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+n[1]+(n[2]?"?start="+n[2]:"")+'"></iframe>'),e.remove()):r&&r[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+r[1]+'"></iframe>'),e.remove()):i&&i[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+i[1]+'"></iframe>'),e.remove()):o&&o[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'+o[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),e.remove()):a&&a[0]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='+encodeURIComponent(a[0])+'"></iframe>'),e.remove()):s&&s[2]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'+s[2]+'"></iframe>'),e.remove()):c&&c[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//player.bilibili.com/player.html?bvid='+c[1]+'"></iframe>'),e.remove()):l&&l[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+l[1]+'"></iframe>'),e.remove())}(e,t))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(4),i=function(e,t,n){void 0===t&&(t="zh_CN"),void 0===n&&(n="classic");var i=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+("dark"===n?" vditor--dark":"")+'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n '+r.a[t].spin+"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X "+r.a[t].close+'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: '+e.width+"px;height:"+e.height+"px;transform: translate3d("+i.left+"px, "+(i.top-36)+'px, 0)" src="'+e.getAttribute("src")+'">\n </div>\n</div>'),document.body.style.overflow="hidden";var o=document.querySelector(".vditor-img img"),a="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-e.naturalHeight)/2+"px, 0)";setTimeout((function(){o.setAttribute("style","transition: transform .3s ease-in-out;transform: "+a),setTimeout((function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)}),400)}));var s=document.querySelector(".vditor-img__btn");s.addEventListener("click",(function(){var t=parseInt(s.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>o.parentElement.clientHeight?o.style.transform="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+(e.naturalWidth/2-e.naturalHeight/2)+"px, 0) rotateZ("+t+"deg)":o.style.transform=a+" rotateZ("+t+"deg)",s.setAttribute("data-deg",t.toString()),setTimeout((function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)}),400)}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(8),o=function(e,t){void 0===t&&(t=r.a.CDN),r.a.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),o=t+"/dist/js/highlight.js/styles/"+e+".css";n?n.href!==o&&(n.remove(),Object(i.a)(o,"vditorHljsStyle")):Object(i.a)(o,"vditorHljsStyle")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(6),i=n(7),o=function(e,t,n){var o="",a=[];if(Array.from(e.children).forEach((function(e,t){if(Object(r.a)(e)){if(n){var i=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===i?void 0:i)+"_"+t}a.push(e.id),o+=e.outerHTML.replace("<wbr>","")}})),""===o)return t.innerHTML="","";var s=document.createElement("div");if(n)n.lute.SetToC(!0),"wysiwyg"!==n.currentMode||n.preview.element.contains(e)?"ir"!==n.currentMode||n.preview.element.contains(e)?s.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+o):s.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+o):s.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+o),n.lute.SetToC(n.options.preview.markdown.toc);else{var c=Lute.New();c.SetToC(!0),s.innerHTML=c.HTML2VditorDOM("<p>[ToC]</p>"+o)}var l=s.firstElementChild.querySelectorAll("li > span[data-target-id]");return l.forEach((function(e,t){e.nextElementSibling&&"UL"===e.nextElementSibling.tagName?e.innerHTML="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg><span>"+e.innerHTML+"</span>":e.innerHTML="<svg></svg><span>"+e.innerHTML+"</span>",e.setAttribute("data-target-id",a[t])})),o=s.firstElementChild.innerHTML,0===l.length?(t.innerHTML="",o):(t.innerHTML=o,n&&Object(i.a)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",(function(r){for(var i=r.target;i&&!i.isEqualNode(t);){if(i.classList.contains("vditor-outline__action")){i.classList.contains("vditor-outline__action--close")?(i.classList.remove("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:block")):(i.classList.add("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(i.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var o=document.getElementById(i.getAttribute("data-target-id"));if(!o)return;if(n)if("auto"===n.options.height){var a=o.offsetTop+n.element.offsetTop;n.options.toolbarConfig.pin||(a+=n.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,a)}else n.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,n.element.offsetTop),n.preview.element.contains(e)?e.parentElement.scrollTop=o.offsetTop:e.scrollTop=o.offsetTop;else window.scrollTo(window.scrollX,o.offsetTop);break}i=i.parentElement}})),o)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},i=function(e){for(var t in e)e.hasOwnProperty(t)&&("[object Object]"===Object.prototype.toString.call(e[t])?n[t]=r(n[t],e[t]):n[t]=e[t])},o=0;o<e.length;o++)i(e[o]);return n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},function(e,t,n){"use strict";n.r(t);var r=n(11),i=n(12),o=n(13),a=n(14),s=n(15),c=n(16),l=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",(function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src})),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach((function(e){e.getAttribute("data-src")&&t(e)})),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)}))):(window.vditorImageIntersectionObserver=new IntersectionObserver((function(e){e.forEach((function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)}))})),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)})))},d=n(7),u=n(20),m=n(17),f=n(18),p=n(23),g=n(19),h=n(2),v=n(10),b=n(5),y=n(1),w=n(24),S=n(25),T=n(0),E=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var n='<svg><use xlink:href="#vditor-icon-play"></use></svg>',r='<svg><use xlink:href="#vditor-icon-pause"></use></svg>',i=document.querySelector(".vditor-speech");if(!i){(i=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",i);var o=function(){var e,n;return speechSynthesis.getVoices().forEach((function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)})),e||(e=n),e};void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=o);var a=o();i.onclick=function(){if("vditor-speech"===i.className){var e=new SpeechSynthesisUtterance(i.getAttribute("data-text"));e.voice=a,e.onend=function(){i.className="vditor-speech",speechSynthesis.cancel(),i.innerHTML=n},speechSynthesis.speak(e),i.className="vditor-speech vditor-speech--current",i.innerHTML=r}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=r):(speechSynthesis.pause(),i.innerHTML=n));Object(T.h)(window.vditorSpeechRange)},document.body.addEventListener("click",(function(){""===getSelection().toString().trim()&&"block"===i.style.display&&(i.className="vditor-speech",speechSynthesis.cancel(),i.style.display="none")}))}e.addEventListener("mouseup",(function(e){var t=getSelection().toString().trim();if(speechSynthesis.cancel(),""!==getSelection().toString().trim()){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var r=getSelection().getRangeAt(0).getBoundingClientRect();i.innerHTML=n,i.style.display="block",i.style.top=r.top+r.height+document.querySelector("html").scrollTop-20+"px",i.style.left=e.screenX+2+"px",i.setAttribute("data-text",t)}else"block"===i.style.display&&(i.className="vditor-speech",i.style.display="none")}))}},C=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},x=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},L=function(e){var t={anchor:0,cdn:h.a.CDN,customEmoji:{},emojiPath:(e&&e.emojiPath||h.a.CDN)+"/dist/images/emoji",hljs:h.a.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:h.a.MARKDOWN_OPTIONS,math:h.a.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:h.a.THEME_OPTIONS};return Object(w.a)(t,e)},k=function(e,t){var n=L(t);return Object(b.a)(n.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then((function(){var r=Object(S.a)({autoSpace:n.markdown.autoSpace,codeBlockPreview:n.markdown.codeBlockPreview,emojiSite:n.emojiPath,emojis:n.customEmoji,fixTermTypo:n.markdown.fixTermTypo,footnotes:n.markdown.footnotes,headingAnchor:0!==n.anchor,inlineMathDigit:n.math.inlineDigit,lazyLoadImage:n.lazyLoadImage,linkBase:n.markdown.linkBase,linkPrefix:n.markdown.linkPrefix,listStyle:n.markdown.listStyle,mark:n.markdown.mark,mathBlockPreview:n.markdown.mathBlockPreview,paragraphBeginningSpace:n.markdown.paragraphBeginningSpace,sanitize:n.markdown.sanitize,toc:n.markdown.toc});return(null==t?void 0:t.renderers)&&r.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),r.Md2HTML(e)}))},j=function(e,t,n){return C(void 0,void 0,void 0,(function(){var p,h;return x(this,(function(w){switch(w.label){case 0:return p=L(n),[4,k(t,p)];case 1:return h=w.sent(),p.transform&&(h=p.transform(h)),e.innerHTML=h,e.classList.add("vditor-reset"),Object(v.a)(p.theme.current,p.theme.path),1===p.anchor&&e.classList.add("vditor-reset--anchor"),Object(o.a)(e,p.lang),Object(c.a)(p.hljs,e,p.cdn),Object(d.a)(e,{cdn:p.cdn,math:p.math}),Object(m.a)(e,p.cdn,p.mode),Object(a.a)(e,p.cdn),Object(s.a)(e,p.cdn),Object(i.a)(e,p.cdn,p.mode),Object(f.a)(e,p.cdn,p.mode),Object(g.a)(e,p.cdn),Object(r.a)(e,p.cdn),Object(u.a)(e),p.speech.enable&&E(e,p.lang),0!==p.anchor&&(S=p.anchor,document.querySelectorAll(".vditor-anchor").forEach((function(e){1===S&&e.classList.add("vditor-anchor--left"),e.onclick=function(){var t=e.getAttribute("href").substr(1),n=document.getElementById("vditorAnchor-"+t).offsetTop;document.querySelector("html").scrollTop=n}})),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),p.after&&p.after(),p.lazyLoadImage&&l(e),p.icon&&Object(b.a)(p.cdn+"/dist/js/icons/"+p.icon+".js","vditorIconScript"),e.addEventListener("click",(function(t){var n=Object(y.f)(t.target,"SPAN");if(n&&Object(y.e)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop)}else;})),[2]}var S}))}))},O=n(21),A=n(22),M=function(){function e(){}return e.previewImage=O.a,e.codeRender=o.a,e.graphvizRender=s.a,e.highlightRender=c.a,e.mathRender=d.a,e.mermaidRender=m.a,e.flowchartRender=a.a,e.chartRender=i.a,e.abcRender=r.a,e.mindmapRender=f.a,e.plantumlRender=g.a,e.outlineRender=p.a,e.mediaRender=u.a,e.speechRender=E,e.lazyLoadImageRender=l,e.md2html=k,e.preview=j,e.setCodeTheme=A.a,e.setContentTheme=v.a,e}();t.default=M}]).default})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Vditor=t():e.Vditor=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=26)}([function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"h",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"f",(function(){return c})),n.d(t,"e",(function(){return d})),n.d(t,"a",(function(){return u}));var r=n(6),i=function(e,t){for(var n=d(e,t),r=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(r=d(n.parentElement,t))?n=r:i=!0;return n||!1},o=function(e,t){for(var n=Object(r.b)(e,t),i=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(i=Object(r.b)(n.parentElement,t))?n=i:o=!0;return n||!1},a=function(e){var t=o(e,"UL"),n=o(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},s=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,i=!1;r&&!i&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?i=!0:r=r.parentElement;return i&&r},l=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=s(e,"data-block","0");if(r)return r;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},c=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.nodeName===t?r=!0:n=n.parentElement;return r&&n},d=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},u=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return l})),n.d(t,"h",(function(){return c})),n.d(t,"c",(function(){return d})),n.d(t,"g",(function(){return u})),n.d(t,"f",(function(){return m})),n.d(t,"d",(function(){return f}));var r=n(2),i=n(3),o=n(0),a=function(e){var t;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),e.isEqualNode(t.startContainer)||e.contains(t.startContainer))||(e.focus(),(t=e.ownerDocument.createRange()).setStart(e,0),t.collapse(!0)),t},s=function(e){var t=window.getSelection().getRangeAt(0);if(!e.contains(t.startContainer)&&!Object(o.e)(t.startContainer,"vditor-panel--none"))return{left:0,top:0};var n,r=e.parentElement.getBoundingClientRect();if(0===t.getClientRects().length)if(3===t.startContainer.nodeType){var i=t.startContainer.parentElement;if(!(i&&i.getClientRects().length>0))return{left:0,top:0};n=i.getClientRects()[0]}else{var a=t.startContainer.children;if(a[t.startOffset]&&a[t.startOffset].getClientRects().length>0)n=a[t.startOffset].getClientRects()[0];else if(t.startContainer.childNodes.length>0){var s=t.cloneRange();t.selectNode(t.startContainer.childNodes[Math.max(0,t.startOffset-1)]),n=t.getClientRects()[0],t.setEnd(s.endContainer,s.endOffset),t.setStart(s.startContainer,s.startOffset)}else n=t.startContainer.getClientRects()[0];if(!n){for(var l=t.startContainer.childNodes[t.startOffset];!l.getClientRects||l.getClientRects&&0===l.getClientRects().length;)l=l.parentElement;n=l.getClientRects()[0]}}else n=t.getClientRects()[0];return{left:n.left-r.left,top:n.top-r.top}},l=function(e,t){if(!t){if(0===getSelection().rangeCount)return!1;t=getSelection().getRangeAt(0)}var n=t.commonAncestorContainer;return e.isEqualNode(n)||e.contains(n)},c=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},d=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(l(t,n)){var i=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?i.setStart(e.childNodes[0].childNodes[0],0):i.selectNodeContents(e),i.setEnd(n.startContainer,n.startOffset),r.start=i.toString().length,r.end=r.start+n.toString().length}return r},u=function(e,t,n){var r=0,i=0,o=n.childNodes[i],a=!1,s=!1;e=Math.max(0,e),t=Math.max(0,t);var l=n.ownerDocument.createRange();for(l.setStart(o||n,0),l.collapse(!0);!s&&o;){var d=r+o.textContent.length;if(!a&&e>=r&&e<=d&&(0===e?l.setStart(o,0):3===o.childNodes[0].nodeType?l.setStart(o.childNodes[0],e-r):o.nextSibling?l.setStartBefore(o.nextSibling):l.setStartAfter(o),a=!0,e===t)){s=!0;break}a&&t>=r&&t<=d&&(0===t?l.setEnd(o,0):3===o.childNodes[0].nodeType?l.setEnd(o.childNodes[0],t-r):o.nextSibling?l.setEndBefore(o.nextSibling):l.setEndAfter(o),s=!0),r=d,o=n.childNodes[++i]}return!s&&n.childNodes[i-1]&&l.setStartBefore(n.childNodes[i-1]),c(l),l},m=function(e,t){var n=e.querySelector("wbr");if(n){if(n.previousElementSibling)if(n.previousElementSibling.isSameNode(n.previousSibling)){if(n.previousElementSibling.lastChild)return t.setStartBefore(n),t.collapse(!0),c(t),!Object(i.c)()||"EM"!==n.previousElementSibling.tagName&&"STRONG"!==n.previousElementSibling.tagName&&"S"!==n.previousElementSibling.tagName||(t.insertNode(document.createTextNode(r.a.ZWSP)),t.collapse(!1)),void n.remove();t.setStartAfter(n.previousElementSibling)}else t.setStart(n.previousSibling,n.previousSibling.textContent.length);else n.previousSibling?t.setStart(n.previousSibling,n.previousSibling.textContent.length):n.nextSibling?3===n.nextSibling.nodeType?t.setStart(n.nextSibling,0):t.setStartBefore(n.nextSibling):t.setStart(n.parentElement,0);t.collapse(!0),n.remove(),c(t)}},f=function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.querySelectorAll("p");1===r.length&&!r[0].previousSibling&&!r[0].nextSibling&&t[t.currentMode].element.children.length>0&&"P"===n.firstElementChild.tagName&&(e=r[0].innerHTML.trim());var i=document.createElement("div");i.innerHTML=e;var s=a(t[t.currentMode].element);if(""!==s.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),i.firstElementChild&&"0"===i.firstElementChild.getAttribute("data-block")){i.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var l=Object(o.c)(s.startContainer);l?l.insertAdjacentHTML("afterend",i.innerHTML):t[t.currentMode].element.insertAdjacentHTML("beforeend",i.innerHTML),m(t[t.currentMode].element,s)}else{var d=document.createElement("template");d.innerHTML=e,s.insertNode(d.content.cloneNode(!0)),s.collapse(!1),c(s)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r="3.8.1",i=function(){function e(){}return e.ZWSP="",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],e.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","bash","cs","cpp","css","coffeescript","diff","xml","http","ini","json","java","javascript","js","makefile","markdown","nginx","objectivec","php","perl","properties","python","ruby","sql","shell","dart","erb","go","gradle","julia","kotlin","less","lua","matlab","rust","scss","typescript","ts","yaml"],e.CDN="https://cdn.jsdelivr.net/npm/vditor@3.8.1",e.MARKDOWN_OPTIONS={autoSpace:!1,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:e.CDN+"/dist/css/content-theme"},e}()},function(e,t,n){"use strict";n.d(t,"f",(function(){return r})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"g",(function(){return l})),n.d(t,"c",(function(){return c}));var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},i=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},o=function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}},a=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},s=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!e.metaKey||e.ctrlKey):!(e.metaKey||!e.ctrlKey)},l=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?e.indexOf("⇧")>-1&&i()&&(e=e.replace(";",":").replace("=","+").replace("-","_")):(e=(e=e.startsWith("⌘")?e.replace("⌘","⌘+"):e.startsWith("⌥")&&"⌘"!==e.substr(1,1)?e.replace("⌥","⌥+"):e.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(e=e.replace(";",":").replace("=","+").replace("-","_")),e},c=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r={en_US:{alignCenter:"Center",alignLeft:"Left",alignRight:"Right",alternateText:"Alternate text",bold:"Blod",both:"editor & preview",check:"Task List",close:"Close",code:"Code Block","code-theme":"Code Block Theme Preview",column:"Column",comment:"Comment",confirm:"Confirm","content-theme":"Content Theme Preview",copied:"Copied",copy:"Copy","delete-column":"Delete Row","delete-row":"Delete Column",devtools:"DevTools",down:"Down",downloadTip:"The browser does not support the download function",edit:"Edit","edit-mode":"Toggle Edit Mode",emoji:"Emoji",export:"Export",fileTypeError:"file type is error",footnoteRef:"Footnote Ref",fullscreen:"Toggle Fullscreen",generate:"Generating",headings:"Headings",help:"Help",imageURL:"image URL",indent:"Indent",info:"Info","inline-code":"Inline Code","insert-after":"Insert line after","insert-before":"Insert line Before",insertColumnLeft:"Insert 1 left",insertColumnRight:"Insert 1 right",insertRowAbove:"Insert 1 above",insertRowBelow:"Insert 1 below",instantRendering:"Instant Rendering",italic:"Italic",language:"Language",line:"Line",link:"Link",linkRef:"Link Ref",list:"List",more:"More",nameEmpty:"Name is empty","ordered-list":"Order List",outdent:"Outdent",outline:"Outline",over:"over",performanceTip:"Real-time preview requires ${x}ms, you can close it",preview:"Preview",quote:"Quote",record:"Start Record/End Record","record-tip":"The device does not support recording",recording:"recording...",redo:"Redo",remove:"Remove",row:"Row",spin:"Spin",splitView:"Split View",strike:"Strike",table:"Table",textIsNotEmpty:"text(no empty)",title:"Title",tooltipText:"Tooltip text",undo:"Undo",up:"Up",update:"Update",upload:"Upload image or file",uploadError:"upload error",uploading:"uploading...",wysiwyg:"WYSIWYG"},ja_JP:{alignCenter:"中央",alignLeft:"左側",alignRight:"右側",alternateText:"イメージタグ",bold:"太く",both:"エディター & プレビュー",check:"チェックリスト",close:"閉じる",code:"コードブロック挿入","code-theme":"コードブロックテーマ",column:"行列",comment:"コメント",confirm:"確認","content-theme":"コンテンツテーマ",copied:"コピー完了",copy:"コピー","delete-column":"列 消去","delete-row":"行 消去",devtools:"開発ツール",down:"ダウンロード",downloadTip:"ブラウザがダウンロード機能をサポートしていません。",edit:"修正","edit-mode":"編集モード",emoji:"絵文字",export:"書き出し",fileTypeError:"サポートしていません。",footnoteRef:"脚注参照",fullscreen:"全体画面",generate:"作成する",headings:"タイトル大きさ",help:"ヘルプ",imageURL:"イメージ URL",indent:"字下げ",info:"情報","inline-code":"インラインコード","insert-after":"ブロックの後ろに入力","insert-before":"ブロックの前に入力",insertColumnLeft:"左側に列を挿入",insertColumnRight:"右側に列を挿入",insertRowAbove:"上に行を挿入",insertRowBelow:"下に行を挿入",instantRendering:"インスタントレンダリング",italic:"斜体",language:"言語",line:"段落分割",link:"リンク",linkRef:"リンク参照",list:"リスト",more:"詳しく見る",nameEmpty:"名前が入力されていません。","ordered-list":"順序のあるリスト",outdent:"ぶら下げインデント",outline:"概要",over:"オーバー",performanceTip:"リアルタイムプレビューには、${x}msが必要でエディター/プレビューボタンをクリックして閉じる事が出来ます。",preview:"プレビュー",quote:"引用段落",record:"録音開始/録音終了","record-tip":"録音がサポートされていません。",recording:"録音中...",redo:"戻る",remove:"消去",row:"列",spin:"スピン",splitView:"マークダウン",strike:"取り消し線",table:"表 挿入",textIsNotEmpty:"テキスト(no empty)",title:"題名",tooltipText:"ツールチップ",undo:"取り消す",up:"戻る",update:"アップデート",upload:"イメージをダウンロードする",uploadError:"アップロード失敗",uploading:"アップロード中",wysiwyg:"ウィジウィグ"},ko_KR:{alignCenter:"가운데",alignLeft:"왼쪽",alignRight:"오른쪽",alternateText:"이미지 태그",bold:"굵게",both:"에디터 & 미리보기",check:"체크박스",close:"닫기",code:"코드블럭삽입","code-theme":"코드블럭테마",column:"행",comment:"코멘트",confirm:"확인","content-theme":"컨텐츠테마",copied:"복사완료",copy:"복사","delete-column":"열 삭제","delete-row":"행 삭제",devtools:"개발툴",down:"다운",downloadTip:"브라우저가 다운로드 기능을 지원하지 않습니다",edit:"수정","edit-mode":"편집모드",emoji:"이모지",export:"내보내기",fileTypeError:"지원하지않습니다.",footnoteRef:"각주참조",fullscreen:"전체화면",generate:"생성",headings:"제목크기",help:"도움말",imageURL:"이미지 URL",indent:"들여쓰기",info:"정보","inline-code":"인라인코드","insert-after":"블락 뒤로 입력","insert-before":"블락 앞으로 입력",insertColumnLeft:"왼쪽에 열 삽입",insertColumnRight:"오른쪽에 열 삽입",insertRowAbove:"위에 행 삽입",insertRowBelow:"아래에 행 삽입",instantRendering:"타이포라",italic:"기울임꼴",language:"언어",line:"문단나눔",link:"링크",linkRef:"링크 참조",list:"순서없는 목록",more:"더보기",nameEmpty:"이름이 비어있습니다.","ordered-list":"순서있는 목록",outdent:"내어쓰기",outline:"개요",over:"오버",performanceTip:"실시간 미리보기에는 ${x}ms가 필요하며 에디터/미리보기 버튼을 클릭하여 닫을 수 있습니다.",preview:"미리보기",quote:"인용단락",record:"녹음시작/녹음종료","record-tip":"녹음을 지원하지 않습니다.",recording:"녹음중...",redo:"되돌리기",remove:"삭제",row:"열",spin:"회전",splitView:"마크다운",strike:"취소선",table:"표삽입",textIsNotEmpty:"텍스트(no empty)",title:"표제",tooltipText:"툴팁",undo:"취소하기",up:"위로",update:"업데이트",upload:"이미지 업로드하기",uploadError:"업로드 실패",uploading:"업로드중...",wysiwyg:"위지위그"},zh_CN:{alignCenter:"居中",alignLeft:"居左",alignRight:"居右",alternateText:"替代文本",bold:"粗体",both:"编辑 & 预览",check:"任务列表",close:"关闭",code:"代码块","code-theme":"代码块主题预览",column:"列",comment:"评论",confirm:"确定","content-theme":"内容主题预览",copied:"已复制",copy:"复制","delete-column":"删除列","delete-row":"删除行",devtools:"开发者工具",down:"下",downloadTip:"该浏览器不支持下载功能",edit:"编辑","edit-mode":"切换编辑模式",emoji:"表情",export:"导出",fileTypeError:"文件类型不允许上传",footnoteRef:"脚注标识",fullscreen:"全屏切换",generate:"生成中",headings:"标题",help:"帮助",imageURL:"图片地址",indent:"列表缩进",info:"关于","inline-code":"行内代码","insert-after":"末尾插入行","insert-before":"起始插入行",insertColumnLeft:"在左边插入一列",insertColumnRight:"在右边插入一列",insertRowAbove:"在上方插入一行",insertRowBelow:"在下方插入一行",instantRendering:"即时渲染",italic:"斜体",language:"语言",line:"分隔线",link:"链接",linkRef:"引用标识",list:"无序列表",more:"更多",nameEmpty:"文件名不能为空","ordered-list":"有序列表",outdent:"列表反向缩进",outline:"大纲",over:"超过",performanceTip:"实时预览需 ${x}ms,可点击编辑 & 预览按钮进行关闭",preview:"预览",quote:"引用",record:"开始录音/结束录音","record-tip":"该设备不支持录音功能",recording:"录音中...",redo:"重做",remove:"删除",row:"行",spin:"旋转",splitView:"分屏预览",strike:"删除线",table:"表格",textIsNotEmpty:"文本(不能为空)",title:"标题",tooltipText:"提示文本",undo:"撤销",up:"上",update:"更新",upload:"上传图片或文件",uploadError:"上传错误",uploading:"上传中...",wysiwyg:"所见即所得"}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest;n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send("");var r=document.createElement("script");r.type="text/javascript",r.text=n.responseText,r.id=t,document.head.appendChild(r)},i=function(e,t){return new Promise((function(n,r){if(document.getElementById(t))return n(),!1;var i=document.createElement("script");i.src=e,i.async=!0,document.head.appendChild(i),i.onload=function(){if(document.getElementById(t))return i.remove(),n(),!1;i.id=t,n()}}))}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var r=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?r=!0:n=n.parentElement;return r&&n},i=function(e){var t=r(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(2),i=n(5),o=n(8),a=n(9),s=function(e,t){var n=e.querySelectorAll(".language-math");if(0!==n.length){var s={cdn:r.a.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},s.math,t.math)),"KaTeX"===(t=Object.assign({},s,t)).math.engine)Object(o.a)(t.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),Object(i.a)(t.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then((function(){n.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&!e.getAttribute("data-math")){var t=Object(a.a)(e.textContent);e.setAttribute("data-math",t);try{e.innerHTML=katex.renderToString(t,{displayMode:"DIV"===e.tagName,output:"html"})}catch(t){e.innerHTML=t.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",(function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))}))}}))}));else if("MathJax"===t.math.engine){window.MathJax||(window.MathJax={loader:{paths:{mathjax:t.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:t.math.macros}}),Object(i.b)(t.cdn+"/dist/js/mathjax/tex-svg.js","vditorMathJaxScript");var l=function(e,t){var n=Object(a.a)(e.textContent).trim(),r=window.MathJax.getMetricsFor(e);r.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(n,r).then((function(r){e.innerHTML="",e.setAttribute("data-math",n),e.append(r),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var i=r.querySelector('[data-mml-node="merror"]');i&&""!==i.textContent.trim()&&(e.innerHTML=i.textContent.trim(),e.className="vditor-reset--error"),t&&t()}))};window.MathJax.startup.promise.then((function(){for(var e=[],t=function(t){var r=n[t];r.parentElement.classList.contains("vditor-wysiwyg__pre")||r.parentElement.classList.contains("vditor-ir__marker--pre")||r.getAttribute("data-math")||!Object(a.a)(r.textContent).trim()||e.push((function(e){t===n.length-1?l(r):l(r,e)}))},r=0;r<n.length;r++)t(r);!function(e){if(0!==e.length){var t=0,n=e[e.length-1],r=function(){var i=e[t++];i===n?i():i(r)};r()}}(e)}))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e,t){if(!document.getElementById(t)){var n=document.createElement("link");n.id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){return e.replace(/\u00a0/g," ")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(8),i=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),i=t+"/"+e+".css";n?n.href!==i&&(n.remove(),Object(r.a)(i,"vditorContentTheme")):Object(r.a)(i,"vditorContentTheme")}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.a.CDN);var n=e.querySelectorAll(".language-abc");n.length>0&&Object(i.a)(t+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then((function(){n.forEach((function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,e.textContent.trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.a.CDN);var o=e.querySelectorAll(".language-echarts");o.length>0&&Object(i.a)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then((function(){o.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=e.innerText.trim();if(t)try{if("true"===e.getAttribute("data-processed"))return;var r=JSON.parse(t);echarts.init(e,"dark"===n?"dark":void 0).setOption(r),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>"+t}}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(4),i=n(9),o=function(e,t){void 0===t&&(t="zh_CN"),e.querySelectorAll("pre > code").forEach((function(n,o){if(!n.parentElement.classList.contains("vditor-wysiwyg__pre")&&!n.parentElement.classList.contains("vditor-ir__marker--pre")&&!(n.classList.contains("language-mermaid")||n.classList.contains("language-flowchart")||n.classList.contains("language-echarts")||n.classList.contains("language-mindmap")||n.classList.contains("language-plantuml")||n.classList.contains("language-abc")||n.classList.contains("language-graphviz")||n.classList.contains("language-math")||n.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&o>5)){var a=n.innerText;if(n.classList.contains("highlight-chroma")){var s=document.createElement("code");s.innerHTML=n.innerHTML,s.querySelectorAll(".highlight-ln").forEach((function(e){e.remove()})),a=s.innerText}var l=document.createElement("div");l.className="vditor-copy",l.innerHTML='<span aria-label="'+r.a[t].copy+"\"\nonmouseover=\"this.setAttribute('aria-label', '"+r.a[t].copy+"')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '"+r.a[t].copied+'\')"><svg><use xlink:href="#vditor-icon-copy"></use></svg></span>';var c=document.createElement("textarea");c.value=Object(i.a)(a),l.insertAdjacentElement("afterbegin",c),n.before(l),n.style.maxHeight=window.outerHeight-40+"px"}}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t){void 0===t&&(t=r.a.CDN);var n=e.querySelectorAll(".language-flowchart");0!==n.length&&Object(i.a)(t+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then((function(){n.forEach((function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(e.textContent);e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t){void 0===t&&(t=r.a.CDN);var n=e.querySelectorAll(".language-graphviz");0!==n.length&&Object(i.a)(t+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then((function(){n.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==e.textContent.trim()){try{var t=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),n=(window.URL||window.webkitURL).createObjectURL(t),r=new Worker(n);new Viz({worker:r}).renderSVGElement(e.textContent).then((function(t){e.innerHTML=t.outerHTML})).catch((function(t){e.innerHTML="graphviz render error: <br>"+t,e.className="vditor-reset--error"}))}catch(e){console.error("graphviz error",e)}e.setAttribute("data-processed","true")}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(2),i=n(5),o=n(8),a=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.a.CDN);var a=e.style;r.a.CODE_THEME.includes(a)||(a="github");var s=document.getElementById("vditorHljsStyle"),l=n+"/dist/js/highlight.js/styles/"+a+".css";(s&&s.href!==l&&s.remove(),Object(o.a)(n+"/dist/js/highlight.js/styles/"+a+".css","vditorHljsStyle"),!1!==e.enable)&&(0!==t.querySelectorAll("pre > code").length&&Object(i.a)(n+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then((function(){t.querySelectorAll("pre > code").forEach((function(t){if(!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchat")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))&&(hljs.highlightBlock(t),e.lineNumber)){t.classList.add("vditor-linenumber");var n=t.querySelector(".vditor-linenumber__temp");n||((n=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",n));var r=getComputedStyle(t).whiteSpace,i=!1;"pre-wrap"!==r&&"pre-line"!==r||(i=!0);var o="",a=t.textContent.split(/\r\n|\r|\n/g);a.pop(),a.map((function(e){var t="";i&&(n.textContent=e||"\n",t=' style="height:'+n.getBoundingClientRect().height+'px"'),o+="<span"+t+"></span>"})),n.style.display="none",o='<span class="vditor-linenumber__rows">'+o+"</span>",t.insertAdjacentHTML("beforeend",o)}}))})))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t,n){void 0===t&&(t=r.a.CDN);var o=e.querySelectorAll(".language-mermaid");0!==o.length&&Object(i.a)(t+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then((function(){var e={altFontFamily:"sans-serif",flowchart:{htmlLabels:!0,useMaxWidth:!0},fontFamily:"sans-serif",gantt:{leftPadding:75,rightPadding:20},securityLevel:"loose",sequence:{boxMargin:8,diagramMarginX:8,diagramMarginY:8,useMaxWidth:!0},startOnLoad:!1};"dark"===n&&(e.theme="dark",e.themeVariables={activationBkgColor:"hsl(180, 1.5873015873%, 28.3529411765%)",activationBorderColor:"#81B1DB",activeTaskBkgColor:"#81B1DB",activeTaskBorderColor:"#ffffff",actorBkg:"#1f2020",actorBorder:"#81B1DB",actorLineColor:"lightgrey",actorTextColor:"lightgrey",altBackground:"hsl(0, 0%, 40%)",altSectionBkgColor:"#333",arrowheadColor:"lightgrey",background:"#333",border1:"#81B1DB",border2:"rgba(255, 255, 255, 0.25)",classText:"#e0dfdf",clusterBkg:"hsl(180, 1.5873015873%, 28.3529411765%)",clusterBorder:"rgba(255, 255, 255, 0.25)",critBkgColor:"#E83737",critBorderColor:"#E83737",darkTextColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",defaultLinkColor:"lightgrey",doneTaskBkgColor:"lightgrey",doneTaskBorderColor:"grey",edgeLabelBackground:"hsl(0, 0%, 34.4117647059%)",errorBkgColor:"#a44141",errorTextColor:"#ddd",fillType0:"#1f2020",fillType1:"hsl(180, 1.5873015873%, 28.3529411765%)",fillType2:"hsl(244, 1.5873015873%, 12.3529411765%)",fillType3:"hsl(244, 1.5873015873%, 28.3529411765%)",fillType4:"hsl(116, 1.5873015873%, 12.3529411765%)",fillType5:"hsl(116, 1.5873015873%, 28.3529411765%)",fillType6:"hsl(308, 1.5873015873%, 12.3529411765%)",fillType7:"hsl(308, 1.5873015873%, 28.3529411765%)",fontFamily:'"trebuchet ms", verdana, arial',fontSize:"16px",gridColor:"lightgrey",labelBackground:"#181818",labelBoxBkgColor:"#1f2020",labelBoxBorderColor:"#81B1DB",labelColor:"#ccc",labelTextColor:"lightgrey",lineColor:"lightgrey",loopTextColor:"lightgrey",mainBkg:"#1f2020",mainContrastColor:"lightgrey",nodeBkg:"#1f2020",nodeBorder:"#81B1DB",noteBkgColor:"#fff5ad",noteBorderColor:"rgba(255, 255, 255, 0.25)",noteTextColor:"#1f2020",primaryBorderColor:"hsl(180, 0%, 2.3529411765%)",primaryColor:"#1f2020",primaryTextColor:"#e0dfdf",secondBkg:"hsl(180, 1.5873015873%, 28.3529411765%)",secondaryBorderColor:"hsl(180, 0%, 18.3529411765%)",secondaryColor:"hsl(180, 1.5873015873%, 28.3529411765%)",secondaryTextColor:"rgb(183.8476190475, 181.5523809523, 181.5523809523)",sectionBkgColor:"hsl(52.9411764706, 28.813559322%, 58.431372549%)",sectionBkgColor2:"#EAE8D9",sequenceNumberColor:"black",signalColor:"lightgrey",signalTextColor:"lightgrey",taskBkgColor:"hsl(180, 1.5873015873%, 35.3529411765%)",taskBorderColor:"#ffffff",taskTextClickableColor:"#003163",taskTextColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",taskTextDarkColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",taskTextLightColor:"lightgrey",taskTextOutsideColor:"lightgrey",tertiaryBorderColor:"hsl(20, 0%, 2.3529411765%)",tertiaryColor:"hsl(20, 1.5873015873%, 12.3529411765%)",tertiaryTextColor:"rgb(222.9999999999, 223.6666666666, 223.9999999999)",textColor:"#ccc",titleColor:"#F9FFFE",todayLineColor:"#DB5757"}),mermaid.initialize(e),o.forEach((function(e){"true"!==e.getAttribute("data-processed")&&""!==e.textContent.trim()&&(mermaid.init(void 0,e),e.setAttribute("data-processed","true"))}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.a.CDN);var o=e.querySelectorAll(".language-mindmap");o.length>0&&Object(i.a)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then((function(){o.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=e.getAttribute("data-code");if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===n?"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(e,t){var n;return(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>"+t}}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(5),o=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.a.CDN);var n=e.querySelectorAll(".language-plantuml");0!==n.length&&Object(i.a)(t+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then((function(){n.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=e.innerText.trim();if(t)try{var n=plantumlEncoder.encode(t),r=document.createElement("img");r.setAttribute("loading","lazy"),r.setAttribute("src","http://www.plantuml.com/plantuml/svg/~1"+n),e.parentNode.insertBefore(r,e),e.remove()}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>"+t}}}))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){e&&e.querySelectorAll("a").forEach((function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'+t+'"></video>'),e.remove()}(e,t):t.match(/^.+.(mp3|wav|flac)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+t+'"></audio>'),e.remove()}(e,t):function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),r=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),o=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),a=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),l=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),c=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);n&&11===n[1].length?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+n[1]+(n[2]?"?start="+n[2]:"")+'"></iframe>'),e.remove()):r&&r[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+r[1]+'"></iframe>'),e.remove()):i&&i[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+i[1]+'"></iframe>'),e.remove()):o&&o[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'+o[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),e.remove()):a&&a[0]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='+encodeURIComponent(a[0])+'"></iframe>'),e.remove()):s&&s[2]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'+s[2]+'"></iframe>'),e.remove()):l&&l[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//player.bilibili.com/player.html?bvid='+l[1]+'"></iframe>'),e.remove()):c&&c[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+c[1]+'"></iframe>'),e.remove())}(e,t))}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(4),i=function(e,t,n){void 0===t&&(t="zh_CN"),void 0===n&&(n="classic");var i=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+("dark"===n?" vditor--dark":"")+'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n '+r.a[t].spin+"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X "+r.a[t].close+'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: '+e.width+"px;height:"+e.height+"px;transform: translate3d("+i.left+"px, "+(i.top-36)+'px, 0)" src="'+e.getAttribute("src")+'">\n </div>\n</div>'),document.body.style.overflow="hidden";var o=document.querySelector(".vditor-img img"),a="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-e.naturalHeight)/2+"px, 0)";setTimeout((function(){o.setAttribute("style","transition: transform .3s ease-in-out;transform: "+a),setTimeout((function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)}),400)}));var s=document.querySelector(".vditor-img__btn");s.addEventListener("click",(function(){var t=parseInt(s.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>o.parentElement.clientHeight?o.style.transform="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+(e.naturalWidth/2-e.naturalHeight/2)+"px, 0) rotateZ("+t+"deg)":o.style.transform=a+" rotateZ("+t+"deg)",s.setAttribute("data-deg",t.toString()),setTimeout((function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)}),400)}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(2),i=n(8),o=function(e,t){void 0===t&&(t=r.a.CDN),r.a.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),o=t+"/dist/js/highlight.js/styles/"+e+".css";n?n.href!==o&&(n.remove(),Object(i.a)(o,"vditorHljsStyle")):Object(i.a)(o,"vditorHljsStyle")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(6),i=n(7),o=function(e,t,n){var o="",a=[];if(Array.from(e.children).forEach((function(e,t){if(Object(r.a)(e)){if(n){var i=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===i?void 0:i)+"_"+t}a.push(e.id),o+=e.outerHTML.replace("<wbr>","")}})),""===o)return t.innerHTML="","";var s=document.createElement("div");if(n)n.lute.SetToC(!0),"wysiwyg"!==n.currentMode||n.preview.element.contains(e)?"ir"!==n.currentMode||n.preview.element.contains(e)?s.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+o):s.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+o):s.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+o),n.lute.SetToC(n.options.preview.markdown.toc);else{var l=Lute.New();l.SetToC(!0),s.innerHTML=l.HTML2VditorDOM("<p>[ToC]</p>"+o)}var c=s.firstElementChild.querySelectorAll("li > span[data-target-id]");return c.forEach((function(e,t){e.nextElementSibling&&"UL"===e.nextElementSibling.tagName?e.innerHTML="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg><span>"+e.innerHTML+"</span>":e.innerHTML="<svg></svg><span>"+e.innerHTML+"</span>",e.setAttribute("data-target-id",a[t])})),o=s.firstElementChild.innerHTML,0===c.length?(t.innerHTML="",o):(t.innerHTML=o,n&&Object(i.a)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",(function(r){for(var i=r.target;i&&!i.isEqualNode(t);){if(i.classList.contains("vditor-outline__action")){i.classList.contains("vditor-outline__action--close")?(i.classList.remove("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:block")):(i.classList.add("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(i.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var o=document.getElementById(i.getAttribute("data-target-id"));if(!o)return;if(n)if("auto"===n.options.height){var a=o.offsetTop+n.element.offsetTop;n.options.toolbarConfig.pin||(a+=n.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,a)}else n.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,n.element.offsetTop),n.preview.element.contains(e)?e.parentElement.scrollTop=o.offsetTop:e.scrollTop=o.offsetTop;else window.scrollTo(window.scrollX,o.offsetTop);break}i=i.parentElement}})),o)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},i=function(e){for(var t in e)e.hasOwnProperty(t)&&("[object Object]"===Object.prototype.toString.call(e[t])?n[t]=r(n[t],e[t]):n[t]=e[t])},o=0;o<e.length;o++)i(e[o]);return n}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},function(e,t,n){"use strict";n.r(t);var r=n(11),i=n(12),o=n(13),a=n(14),s=n(15),l=n(16),c=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",(function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src})),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach((function(e){e.getAttribute("data-src")&&t(e)})),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)}))):(window.vditorImageIntersectionObserver=new IntersectionObserver((function(e){e.forEach((function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)}))})),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)})))},d=n(7),u=n(20),m=n(17),f=n(18),p=n(23),g=n(19),h=n(2),v=n(10),b=n(5),y=n(0),w=n(24),S=n(25),T=n(1),C=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var n='<svg><use xlink:href="#vditor-icon-play"></use></svg>',r='<svg><use xlink:href="#vditor-icon-pause"></use></svg>',i=document.querySelector(".vditor-speech");if(!i){(i=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",i);var o=function(){var e,n;return speechSynthesis.getVoices().forEach((function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)})),e||(e=n),e};void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=o);var a=o();i.onclick=function(){if("vditor-speech"===i.className){var e=new SpeechSynthesisUtterance(i.getAttribute("data-text"));e.voice=a,e.onend=function(){i.className="vditor-speech",speechSynthesis.cancel(),i.innerHTML=n},speechSynthesis.speak(e),i.className="vditor-speech vditor-speech--current",i.innerHTML=r}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=r):(speechSynthesis.pause(),i.innerHTML=n));Object(T.h)(window.vditorSpeechRange)},document.body.addEventListener("click",(function(){""===getSelection().toString().trim()&&"block"===i.style.display&&(i.className="vditor-speech",speechSynthesis.cancel(),i.style.display="none")}))}e.addEventListener("mouseup",(function(e){var t=getSelection().toString().trim();if(speechSynthesis.cancel(),""!==getSelection().toString().trim()){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var r=getSelection().getRangeAt(0).getBoundingClientRect();i.innerHTML=n,i.style.display="block",i.style.top=r.top+r.height+document.querySelector("html").scrollTop-20+"px",i.style.left=e.screenX+2+"px",i.setAttribute("data-text",t)}else"block"===i.style.display&&(i.className="vditor-speech",i.style.display="none")}))}},E=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},L=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},x=function(e){var t={anchor:0,cdn:h.a.CDN,customEmoji:{},emojiPath:(e&&e.emojiPath||h.a.CDN)+"/dist/images/emoji",hljs:h.a.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:h.a.MARKDOWN_OPTIONS,math:h.a.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:h.a.THEME_OPTIONS};return Object(w.a)(t,e)},k=function(e,t){var n=x(t);return Object(b.a)(n.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then((function(){var r=Object(S.a)({autoSpace:n.markdown.autoSpace,codeBlockPreview:n.markdown.codeBlockPreview,emojiSite:n.emojiPath,emojis:n.customEmoji,fixTermTypo:n.markdown.fixTermTypo,footnotes:n.markdown.footnotes,headingAnchor:0!==n.anchor,inlineMathDigit:n.math.inlineDigit,lazyLoadImage:n.lazyLoadImage,linkBase:n.markdown.linkBase,linkPrefix:n.markdown.linkPrefix,listStyle:n.markdown.listStyle,mark:n.markdown.mark,mathBlockPreview:n.markdown.mathBlockPreview,paragraphBeginningSpace:n.markdown.paragraphBeginningSpace,sanitize:n.markdown.sanitize,toc:n.markdown.toc});return(null==t?void 0:t.renderers)&&r.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),r.Md2HTML(e)}))},j=function(e,t,n){return E(void 0,void 0,void 0,(function(){var p,h;return L(this,(function(w){switch(w.label){case 0:return p=x(n),[4,k(t,p)];case 1:return h=w.sent(),p.transform&&(h=p.transform(h)),e.innerHTML=h,e.classList.add("vditor-reset"),Object(v.a)(p.theme.current,p.theme.path),1===p.anchor&&e.classList.add("vditor-reset--anchor"),Object(o.a)(e,p.lang),Object(l.a)(p.hljs,e,p.cdn),Object(d.a)(e,{cdn:p.cdn,math:p.math}),Object(m.a)(e,p.cdn,p.mode),Object(a.a)(e,p.cdn),Object(s.a)(e,p.cdn),Object(i.a)(e,p.cdn,p.mode),Object(f.a)(e,p.cdn,p.mode),Object(g.a)(e,p.cdn),Object(r.a)(e,p.cdn),Object(u.a)(e),p.speech.enable&&C(e,p.lang),0!==p.anchor&&(S=p.anchor,document.querySelectorAll(".vditor-anchor").forEach((function(e){1===S&&e.classList.add("vditor-anchor--left"),e.onclick=function(){var t=e.getAttribute("href").substr(1),n=document.getElementById("vditorAnchor-"+t).offsetTop;document.querySelector("html").scrollTop=n}})),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),p.after&&p.after(),p.lazyLoadImage&&c(e),p.icon&&Object(b.a)(p.cdn+"/dist/js/icons/"+p.icon+".js","vditorIconScript"),e.addEventListener("click",(function(t){var n=Object(y.f)(t.target,"SPAN");if(n&&Object(y.e)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop)}else;})),[2]}var S}))}))},A=n(21),O=n(22),M=function(){function e(){}return e.previewImage=A.a,e.codeRender=o.a,e.graphvizRender=s.a,e.highlightRender=l.a,e.mathRender=d.a,e.mermaidRender=m.a,e.flowchartRender=a.a,e.chartRender=i.a,e.abcRender=r.a,e.mindmapRender=f.a,e.plantumlRender=g.a,e.outlineRender=p.a,e.mediaRender=u.a,e.speechRender=C,e.lazyLoadImageRender=c,e.md2html=k,e.preview=j,e.setCodeTheme=O.a,e.setContentTheme=v.a,e}();t.default=M}]).default})); |
@@ -6,2 +6,3 @@ /// <reference types="./types" /> | ||
static readonly ZWSP: string; | ||
static readonly DROP_EDITOR: string; | ||
static readonly MOBILE_WIDTH: number; | ||
@@ -8,0 +9,0 @@ static readonly CLASS_MENU_DISABLED: string; |
@@ -1,1 +0,1 @@ | ||
export declare const plantumlRender: (element: HTMLElement, cdn?: string) => void; | ||
export declare const plantumlRender: (element?: (HTMLElement | Document), cdn?: string) => void; |
@@ -25,3 +25,4 @@ /// <reference types="./types" /> | ||
export declare const insertRow: (vditor: IVditor, range: Range, cellElement: HTMLElement) => void; | ||
export declare const insertColumn: (vditor: IVditor, tableElement: HTMLTableElement, cellElement: HTMLElement) => void; | ||
export declare const insertRowAbove: (vditor: IVditor, range: Range, cellElement: HTMLElement) => void; | ||
export declare const insertColumn: (vditor: IVditor, tableElement: HTMLTableElement, cellElement: HTMLElement, type?: InsertPosition) => void; | ||
export declare const deleteRow: (vditor: IVditor, range: Range, cellElement: HTMLElement) => void; | ||
@@ -36,3 +37,3 @@ export declare const deleteColumn: (vditor: IVditor, range: Range, tableElement: HTMLTableElement, cellElement: HTMLElement) => void; | ||
export declare const fixFirefoxArrowUpTable: (event: KeyboardEvent, blockElement: false | HTMLElement, range: Range) => boolean; | ||
export declare const paste: (vditor: IVditor, event: ClipboardEvent & { | ||
export declare const paste: (vditor: IVditor, event: (ClipboardEvent | DragEvent) & { | ||
target: HTMLElement; | ||
@@ -39,0 +40,0 @@ }, callback: { |
{ | ||
"name": "vditor", | ||
"version": "3.8.0", | ||
"version": "3.8.1", | ||
"description": "♏ 易于使用的 Markdown 编辑器,为适配不同的应用场景而生", | ||
@@ -5,0 +5,0 @@ "author": "Vanessa <v@b3log.org> (http://vanessa.b3log.org)", |
@@ -229,3 +229,3 @@ <p align="center"> | ||
{ | ||
hotkey: '⌘-⇧-S', | ||
hotkey: '⇧⌘S', | ||
name: 'sponsor', | ||
@@ -247,3 +247,3 @@ tipPosition: 's', | ||
| tipPosition | 提示位置:'n', 'ne', 'nw', 's', 'se', 'sw', 'w', 'e' | - | | ||
| hotkey | 快捷键,格式为<kbd>⌘/ctrl-key</kbd> 或 <kbd>⌘/ctrl-⇧/shift-key</kbd> | - | | ||
| hotkey | 快捷键,格式为<kbd>⇧⌘</kbd>/<kbd>⌘</kbd>/<kbd>⌥⌘</kbd>| - | | ||
| suffix | 插入编辑器中的后缀 | - | | ||
@@ -568,2 +568,3 @@ | prefix | 插入编辑器中的前缀 | - | | ||
| mindmapRender(element: (HTMLElement \| Document) = document, cdn = options.cdn, theme = options.theme) | 脑图渲染 | | ||
| plantumlRender(element: (HTMLElement \| Document) = document, cdn = options.cdn) | plantuml 渲染 | | ||
| abcRender(element: (HTMLElement \| Document) = document, cdn = options.cdn) | 五线谱渲染 | | ||
@@ -570,0 +571,0 @@ | md2html(mdText: string, options?: IPreviewOptions): Promise\<string> | Markdown 文本转换为 HTML,该方法需使用[异步编程](https://ld246.com/article/1546828434083?r=Vanessa#toc_h3_1) | |
@@ -282,6 +282,7 @@ import VditorMethod from "./method"; | ||
range.collapse(true); | ||
// https://github.com/Vanessa219/vditor/issues/716 需使用 insertText,否则需要重写方法,不能使用 execCommand | ||
const tmpElement = document.createElement("template"); | ||
tmpElement.innerHTML = value; | ||
range.insertNode(tmpElement.content.cloneNode(true)); | ||
if (this.vditor.currentMode === "sv") { | ||
this.vditor.sv.preventInput = true; | ||
document.execCommand("insertText", false, value); | ||
if (render) { | ||
@@ -292,3 +293,2 @@ inputEvent(this.vditor); | ||
this.vditor.wysiwyg.preventInput = true; | ||
document.execCommand("insertText", false, value); | ||
if (render) { | ||
@@ -299,3 +299,2 @@ input(this.vditor, getSelection().getRangeAt(0)); | ||
this.vditor.ir.preventInput = true; | ||
document.execCommand("insertText", false, value); | ||
if (render) { | ||
@@ -302,0 +301,0 @@ irInput(this.vditor, getSelection().getRangeAt(0), true); |
@@ -9,2 +9,3 @@ declare const VDITOR_VERSION: string; | ||
public static readonly ZWSP: string = "\u200b"; | ||
public static readonly DROP_EDITOR: string = "application/editor"; | ||
public static readonly MOBILE_WIDTH: number = 520; | ||
@@ -11,0 +12,0 @@ public static readonly CLASS_MENU_DISABLED: string = "vditor-menu--disabled"; |
@@ -40,4 +40,6 @@ export const i18n: II18n = { | ||
"insert-before": "Insert line Before", | ||
"insert-column": "Insert Column", | ||
"insert-row": "Insert Row", | ||
"insertColumnLeft": "Insert 1 left", | ||
"insertColumnRight": "Insert 1 right", | ||
"insertRowAbove": "Insert 1 above", | ||
"insertRowBelow": "Insert 1 below", | ||
"instantRendering": "Instant Rendering", | ||
@@ -118,4 +120,6 @@ "italic": "Italic", | ||
"insert-before": "ブロックの前に入力", | ||
"insert-column": "列 挿入", | ||
"insert-row": "行 挿入", | ||
"insertColumnLeft": "左側に列を挿入", | ||
"insertColumnRight": "右側に列を挿入", | ||
"insertRowAbove": "上に行を挿入", | ||
"insertRowBelow": "下に行を挿入", | ||
"instantRendering": "インスタントレンダリング", | ||
@@ -196,4 +200,6 @@ "italic": "斜体", | ||
"insert-before": "블락 앞으로 입력", | ||
"insert-column": "열 삽입", | ||
"insert-row": "행 삽입", | ||
"insertColumnLeft": "왼쪽에 열 삽입", | ||
"insertColumnRight": "오른쪽에 열 삽입", | ||
"insertRowAbove": "위에 행 삽입", | ||
"insertRowBelow": "아래에 행 삽입", | ||
"instantRendering": "타이포라", | ||
@@ -274,4 +280,6 @@ "italic": "기울임꼴", | ||
"insert-before": "起始插入行", | ||
"insert-column": "插入列", | ||
"insert-row": "插入行", | ||
"insertColumnLeft": "在左边插入一列", | ||
"insertColumnRight": "在右边插入一列", | ||
"insertRowAbove": "在上方插入一行", | ||
"insertRowBelow": "在下方插入一行", | ||
"instantRendering": "即时渲染", | ||
@@ -278,0 +286,0 @@ "italic": "斜体", |
@@ -96,3 +96,3 @@ import {Constants} from "../constants"; | ||
} | ||
if (this.composingLock) { | ||
if (this.composingLock || event.data === "‘" || event.data === "“" || event.data === "《") { | ||
return; | ||
@@ -99,0 +99,0 @@ } |
@@ -163,3 +163,3 @@ import {Constants} from "../constants"; | ||
// enter++: 标题变大 | ||
if (matchHotKey("⌘-=", event)) { | ||
if (matchHotKey("⌘=", event)) { | ||
const headingMarkerElement = headingElement.querySelector(".vditor-ir__marker--heading"); | ||
@@ -174,3 +174,3 @@ if (headingMarkerElement && headingMarkerElement.textContent.trim().length > 1) { | ||
// enter++: 标题变小 | ||
if (matchHotKey("⌘--", event)) { | ||
if (matchHotKey("⌘-", event)) { | ||
const headingMarkerElement = headingElement.querySelector(".vditor-ir__marker--heading"); | ||
@@ -177,0 +177,0 @@ if (headingMarkerElement && headingMarkerElement.textContent.trim().length < 6) { |
@@ -8,3 +8,3 @@ import {Constants} from "../constants"; | ||
export const plantumlRender = (element: HTMLElement, cdn = Constants.CDN) => { | ||
export const plantumlRender = (element: (HTMLElement | Document) = document, cdn = Constants.CDN) => { | ||
const plantumlElements = element.querySelectorAll(".language-plantuml"); | ||
@@ -11,0 +11,0 @@ if (plantumlElements.length === 0) { |
@@ -88,3 +88,3 @@ import {isCtrl, isFirefox} from "../util/compatibility"; | ||
} | ||
if (this.composingLock) { | ||
if (this.composingLock || event.data === "‘" || event.data === "“" || event.data === "《") { | ||
return; | ||
@@ -91,0 +91,0 @@ } |
@@ -160,5 +160,5 @@ import {Constants} from "../constants"; | ||
panelElement.className = `vditor-hint${menuItem.level === 2 ? "" : " vditor-panel--arrow"}`; | ||
panelElement.innerHTML = `<button data-mode="wysiwyg">${i18n[vditor.options.lang].wysiwyg} <${updateHotkeyTip("⌘-⌥-7")}></button> | ||
<button data-mode="ir">${i18n[vditor.options.lang].instantRendering} <${updateHotkeyTip("⌘-⌥-8")}></button> | ||
<button data-mode="sv">${i18n[vditor.options.lang].splitView} <${updateHotkeyTip("⌘-⌥-9")}></button>`; | ||
panelElement.innerHTML = `<button data-mode="wysiwyg">${i18n[vditor.options.lang].wysiwyg} <${updateHotkeyTip("⌥⌘7")}></button> | ||
<button data-mode="ir">${i18n[vditor.options.lang].instantRendering} <${updateHotkeyTip("⌥⌘8")}></button> | ||
<button data-mode="sv">${i18n[vditor.options.lang].splitView} <${updateHotkeyTip("⌥⌘9")}></button>`; | ||
@@ -165,0 +165,0 @@ this.element.appendChild(panelElement); |
@@ -18,8 +18,8 @@ import {Constants} from "../constants"; | ||
panelElement.className = "vditor-hint vditor-panel--arrow"; | ||
panelElement.innerHTML = `<button data-tag="h1" data-value="# ">Heading 1 ${updateHotkeyTip("<⌘-⌥-1>")}</button> | ||
<button data-tag="h2" data-value="## ">Heading 2 <${updateHotkeyTip("⌘-⌥-2")}></button> | ||
<button data-tag="h3" data-value="### ">Heading 3 <${updateHotkeyTip("⌘-⌥-3")}></button> | ||
<button data-tag="h4" data-value="#### ">Heading 4 <${updateHotkeyTip("⌘-⌥-4")}></button> | ||
<button data-tag="h5" data-value="##### ">Heading 5 <${updateHotkeyTip("⌘-⌥-5")}></button> | ||
<button data-tag="h6" data-value="###### ">Heading 6 <${updateHotkeyTip("⌘-⌥-6")}></button>`; | ||
panelElement.innerHTML = `<button data-tag="h1" data-value="# ">Heading 1 ${updateHotkeyTip("<⌥⌘1>")}</button> | ||
<button data-tag="h2" data-value="## ">Heading 2 <${updateHotkeyTip("⌥⌘2")}></button> | ||
<button data-tag="h3" data-value="### ">Heading 3 <${updateHotkeyTip("⌥⌘3")}></button> | ||
<button data-tag="h4" data-value="#### ">Heading 4 <${updateHotkeyTip("⌥⌘4")}></button> | ||
<button data-tag="h5" data-value="##### ">Heading 5 <${updateHotkeyTip("⌥⌘5")}></button> | ||
<button data-tag="h6" data-value="###### ">Heading 6 <${updateHotkeyTip("⌥⌘6")}></button>`; | ||
@@ -26,0 +26,0 @@ this.element.appendChild(panelElement); |
@@ -41,23 +41,22 @@ export const isSafari = () => { | ||
}; | ||
// Mac,Windows 快捷键展示 | ||
export const updateHotkeyTip = (hotkey: string) => { | ||
if (/Mac/.test(navigator.platform) || navigator.platform === "iPhone") { | ||
hotkey = hotkey.replace("ctrl", "⌘").replace("shift", "⇧") | ||
.replace("alt", "⌥"); | ||
if (hotkey.indexOf("⇧") > -1) { | ||
if (!isFirefox()) { | ||
hotkey = hotkey.replace(":", ";").replace("+", "=") | ||
.replace("_", "-"); | ||
} else { | ||
// Mac Firefox 按下 shift 后,key 同 windows 系统 | ||
hotkey = hotkey.replace(";", ":").replace("=", "+"); | ||
} | ||
if (hotkey.indexOf("⇧") > -1 && isFirefox()) { | ||
// Mac Firefox 按下 shift 后,key 同 windows 系统 | ||
hotkey = hotkey.replace(";", ":").replace("=", "+").replace("-", "_"); | ||
} | ||
} else { | ||
hotkey = hotkey.replace("⌘", "ctrl").replace("⇧", "shift") | ||
.replace("⌥", "alt"); | ||
if (hotkey.indexOf("shift") > -1) { | ||
hotkey = hotkey.replace(";", ":").replace("=", "+"); | ||
if (hotkey.startsWith("⌘")) { | ||
hotkey = hotkey.replace("⌘", "⌘+"); | ||
} else if (hotkey.startsWith("⌥") && hotkey.substr(1, 1) !== "⌘") { | ||
hotkey = hotkey.replace("⌥", "⌥+"); | ||
} else { | ||
hotkey = hotkey.replace("⇧⌘", "⌘+⇧+").replace("⌥⌘", "⌥+⌘+"); | ||
} | ||
hotkey = hotkey.replace("⌘", "Ctrl").replace("⇧", "Shift") | ||
.replace("⌥", "Alt"); | ||
if (hotkey.indexOf("Shift") > -1) { | ||
hotkey = hotkey.replace(";", ":").replace("=", "+").replace("-", "_"); | ||
} | ||
} | ||
@@ -64,0 +63,0 @@ return hotkey; |
@@ -0,1 +1,2 @@ | ||
import {Constants} from "../constants"; | ||
import {processHeading} from "../ir/process"; | ||
@@ -9,3 +10,2 @@ import {processKeydown as irProcessKeydown} from "../ir/processKeydown"; | ||
import {hidePanel} from "../toolbar/setToolbar"; | ||
import {uploadFiles} from "../upload"; | ||
import {afterRenderEvent} from "../wysiwyg/afterRenderEvent"; | ||
@@ -15,2 +15,3 @@ import {processKeydown} from "../wysiwyg/processKeydown"; | ||
import {getEventName, isCtrl} from "./compatibility"; | ||
import {execAfterRender, paste} from "./fixBrowserBehavior"; | ||
import {getSelectText} from "./getSelectText"; | ||
@@ -56,15 +57,20 @@ import {hasClosestByAttribute, hasClosestByMatchTag} from "./hasClosest"; | ||
export const dropEvent = (vditor: IVditor, editorElement: HTMLElement) => { | ||
if (vditor.options.upload.url || vditor.options.upload.handler) { | ||
editorElement.addEventListener("drop", | ||
(event: CustomEvent & { dataTransfer?: DataTransfer, target: HTMLElement }) => { | ||
if (event.dataTransfer.types[0] !== "Files") { | ||
return; | ||
} | ||
const files = event.dataTransfer.items; | ||
if (files.length > 0) { | ||
uploadFiles(vditor, files); | ||
} | ||
event.preventDefault(); | ||
}); | ||
} | ||
editorElement.addEventListener("dragstart", (event) => { | ||
// 选中编辑器中的文字进行拖拽 | ||
event.dataTransfer.setData(Constants.DROP_EDITOR, Constants.DROP_EDITOR); | ||
}); | ||
editorElement.addEventListener("drop", | ||
(event: ClipboardEvent & { dataTransfer?: DataTransfer, target: HTMLElement }) => { | ||
if (event.dataTransfer.getData(Constants.DROP_EDITOR)) { | ||
// 编辑器内选中文字拖拽 | ||
execAfterRender(vditor); | ||
} else if (event.dataTransfer.types[0] === "Files" || event.dataTransfer.types.includes("text/html")) { | ||
// 外部文件拖入编辑器中或者编辑器内选中文字拖拽 | ||
paste(vditor, event, { | ||
pasteCode: (code: string) => { | ||
document.execCommand("insertHTML", false, code); | ||
}, | ||
}); | ||
} | ||
}); | ||
}; | ||
@@ -115,5 +121,5 @@ | ||
// 获取 comment | ||
// 重置 comment | ||
if (vditor.options.comment.enable && vditor.currentMode === "wysiwyg" && | ||
(event.key === "Backspace" || matchHotKey("⌘-X", event))) { | ||
(event.key === "Backspace" || matchHotKey("⌘X", event))) { | ||
vditor.wysiwyg.getComments(vditor); | ||
@@ -136,3 +142,3 @@ } | ||
if (vditor.options.ctrlEnter && matchHotKey("⌘-Enter", event)) { | ||
if (vditor.options.ctrlEnter && matchHotKey("⌘Enter", event)) { | ||
vditor.options.ctrlEnter(getMarkdown(vditor)); | ||
@@ -144,3 +150,3 @@ event.preventDefault(); | ||
// undo | ||
if (matchHotKey("⌘-Z", event) && !vditor.toolbar.elements.undo) { | ||
if (matchHotKey("⌘Z", event) && !vditor.toolbar.elements.undo) { | ||
vditor.undo.undo(vditor); | ||
@@ -152,3 +158,3 @@ event.preventDefault(); | ||
// redo | ||
if (matchHotKey("⌘-Y", event) && !vditor.toolbar.elements.redo) { | ||
if (matchHotKey("⌘Y", event) && !vditor.toolbar.elements.redo) { | ||
vditor.undo.redo(vditor); | ||
@@ -155,0 +161,0 @@ event.preventDefault(); |
@@ -1,11 +0,49 @@ | ||
import {isCtrl, isFirefox, updateHotkeyTip} from "./compatibility"; | ||
import {isCtrl, isFirefox} from "./compatibility"; | ||
// 是否匹配 ⌘-⇧-[] / ⌘-[] | ||
// 是否匹配 ⇧⌘[] / ⌘[] / ⌥[] / ⌥⌘[] / ⇧Tab / [] | ||
export const matchHotKey = (hotKey: string, event: KeyboardEvent) => { | ||
const hotKeys = updateHotkeyTip(hotKey).split("-"); | ||
const hasShift = hotKeys.length > 2 && (hotKeys[1] === "shift" || hotKeys[1] === "⇧"); | ||
let key = (hasShift ? hotKeys[2] : hotKeys[1]) || "-"; | ||
if (hasShift && key === "-" && (isFirefox() || !/Mac/.test(navigator.platform))) { | ||
key = "_"; | ||
if (hotKey === "") { | ||
return false; | ||
} | ||
// [] | ||
if (hotKey.indexOf("⇧") === -1 && hotKey.indexOf("⌘") === -1 && hotKey.indexOf("⌥") === -1) { | ||
if (!isCtrl(event) && !event.altKey && !event.shiftKey && event.code === hotKey) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
// 是否匹配 ⇧Tab | ||
if (hotKey === "⇧Tab") { | ||
if (!isCtrl(event) && !event.altKey && event.shiftKey && event.code === "Tab") { | ||
return true; | ||
} | ||
return false; | ||
} | ||
let hotKeys = hotKey.split(""); | ||
if (hotKey.startsWith("⌥")) { | ||
// 是否匹配 ⌥[] / ⌥⌘[] | ||
const keyCode = hotKeys.length === 3 ? hotKeys[2] : hotKeys[1]; | ||
if ((hotKeys.length === 3 ? isCtrl(event) : !isCtrl(event)) && event.altKey && !event.shiftKey && | ||
event.code === (/^[0-9]$/.test(keyCode) ? "Digit" : "Key") + keyCode) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
// 是否匹配 ⇧⌘[] / ⌘[] | ||
if (hotKey === "⌘Enter") { | ||
hotKeys = ["⌘", "Enter"]; | ||
} | ||
const hasShift = hotKeys.length > 2 && (hotKeys[0] === "⇧"); | ||
let key = (hasShift ? hotKeys[2] : hotKeys[1]); | ||
if (hasShift && (isFirefox() || !/Mac/.test(navigator.platform))) { | ||
if (key === "-") { | ||
key = "_"; | ||
} else if (key === "=") { | ||
key = "+"; | ||
} | ||
} | ||
if (isCtrl(event) && event.key.toLowerCase() === key.toLowerCase() && !event.altKey | ||
@@ -12,0 +50,0 @@ && ((!hasShift && !event.shiftKey) || (hasShift && event.shiftKey))) { |
@@ -166,3 +166,3 @@ import {Constants} from "../constants"; | ||
}, { | ||
hotkey: "⌘-E", | ||
hotkey: "⌘E", | ||
icon: '<svg><use xlink:href="#vditor-icon-emoji"></use></svg>', | ||
@@ -172,3 +172,3 @@ name: "emoji", | ||
}, { | ||
hotkey: "⌘-H", | ||
hotkey: "⌘H", | ||
icon: '<svg><use xlink:href="#vditor-icon-headings"></use></svg>', | ||
@@ -178,3 +178,3 @@ name: "headings", | ||
}, { | ||
hotkey: "⌘-B", | ||
hotkey: "⌘B", | ||
icon: '<svg><use xlink:href="#vditor-icon-bold"></use></svg>', | ||
@@ -186,3 +186,3 @@ name: "bold", | ||
}, { | ||
hotkey: "⌘-I", | ||
hotkey: "⌘I", | ||
icon: '<svg><use xlink:href="#vditor-icon-italic"></use></svg>', | ||
@@ -194,3 +194,3 @@ name: "italic", | ||
}, { | ||
hotkey: "⌘-D", | ||
hotkey: "⌘D", | ||
icon: '<svg><use xlink:href="#vditor-icon-strike"></use></svg>', | ||
@@ -202,3 +202,3 @@ name: "strike", | ||
}, { | ||
hotkey: "⌘-K", | ||
hotkey: "⌘K", | ||
icon: '<svg><use xlink:href="#vditor-icon-link"></use></svg>', | ||
@@ -212,3 +212,3 @@ name: "link", | ||
}, { | ||
hotkey: "⌘-L", | ||
hotkey: "⌘L", | ||
icon: '<svg><use xlink:href="#vditor-icon-list"></use></svg>', | ||
@@ -219,3 +219,3 @@ name: "list", | ||
}, { | ||
hotkey: "⌘-O", | ||
hotkey: "⌘O", | ||
icon: '<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>', | ||
@@ -226,3 +226,3 @@ name: "ordered-list", | ||
}, { | ||
hotkey: "⌘-J", | ||
hotkey: "⌘J", | ||
icon: '<svg><use xlink:href="#vditor-icon-check"></use></svg>', | ||
@@ -233,3 +233,3 @@ name: "check", | ||
}, { | ||
hotkey: "⌘-⇧-I", | ||
hotkey: "⇧⌘I", | ||
icon: '<svg><use xlink:href="#vditor-icon-outdent"></use></svg>', | ||
@@ -239,3 +239,3 @@ name: "outdent", | ||
}, { | ||
hotkey: "⌘-⇧-O", | ||
hotkey: "⇧⌘O", | ||
icon: '<svg><use xlink:href="#vditor-icon-indent"></use></svg>', | ||
@@ -247,3 +247,3 @@ name: "indent", | ||
}, { | ||
hotkey: "⌘-;", | ||
hotkey: "⌘;", | ||
icon: '<svg><use xlink:href="#vditor-icon-quote"></use></svg>', | ||
@@ -254,3 +254,3 @@ name: "quote", | ||
}, { | ||
hotkey: "⌘-⇧-H", | ||
hotkey: "⇧⌘H", | ||
icon: '<svg><use xlink:href="#vditor-icon-line"></use></svg>', | ||
@@ -261,3 +261,3 @@ name: "line", | ||
}, { | ||
hotkey: "⌘-U", | ||
hotkey: "⌘U", | ||
icon: '<svg><use xlink:href="#vditor-icon-code"></use></svg>', | ||
@@ -269,3 +269,3 @@ name: "code", | ||
}, { | ||
hotkey: "⌘-G", | ||
hotkey: "⌘G", | ||
icon: '<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>', | ||
@@ -277,3 +277,3 @@ name: "inline-code", | ||
}, { | ||
hotkey: "⌘-⇧-B", | ||
hotkey: "⇧⌘B", | ||
icon: '<svg><use xlink:href="#vditor-icon-before"></use></svg>', | ||
@@ -283,3 +283,3 @@ name: "insert-before", | ||
}, { | ||
hotkey: "⌘-⇧-E", | ||
hotkey: "⇧⌘E", | ||
icon: '<svg><use xlink:href="#vditor-icon-after"></use></svg>', | ||
@@ -299,3 +299,3 @@ name: "insert-after", | ||
}, { | ||
hotkey: "⌘-M", | ||
hotkey: "⌘M", | ||
icon: '<svg><use xlink:href="#vditor-icon-table"></use></svg>', | ||
@@ -309,3 +309,3 @@ name: "table", | ||
}, { | ||
hotkey: "⌘-Z", | ||
hotkey: "⌘Z", | ||
icon: '<svg><use xlink:href="#vditor-icon-undo"></use></svg>', | ||
@@ -315,3 +315,3 @@ name: "undo", | ||
}, { | ||
hotkey: "⌘-Y", | ||
hotkey: "⌘Y", | ||
icon: '<svg><use xlink:href="#vditor-icon-redo"></use></svg>', | ||
@@ -327,3 +327,3 @@ name: "redo", | ||
}, { | ||
hotkey: "⌘-'", | ||
hotkey: "⌘'", | ||
icon: '<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>', | ||
@@ -337,3 +337,3 @@ name: "fullscreen", | ||
}, { | ||
hotkey: "⌘-P", | ||
hotkey: "⌘P", | ||
icon: '<svg><use xlink:href="#vditor-icon-both"></use></svg>', | ||
@@ -340,0 +340,0 @@ name: "both", |
@@ -9,4 +9,11 @@ import {Constants} from "../constants"; | ||
import {scrollCenter} from "../util/editorCommonEvent"; | ||
import {deleteColumn, deleteRow, insertColumn, insertRow, setTableAlign} from "../util/fixBrowserBehavior"; | ||
import { | ||
deleteColumn, | ||
deleteRow, | ||
insertColumn, | ||
insertRow, | ||
insertRowAbove, | ||
setTableAlign, | ||
} from "../util/fixBrowserBehavior"; | ||
import { | ||
hasClosestByAttribute, | ||
@@ -247,3 +254,3 @@ hasClosestByClassName, | ||
left.setAttribute("aria-label", i18n[vditor.options.lang].alignLeft + | ||
"<" + updateHotkeyTip("⌘-⇧-L") + ">"); | ||
"<" + updateHotkeyTip("⇧⌘L") + ">"); | ||
left.setAttribute("data-type", "left"); | ||
@@ -260,3 +267,3 @@ left.innerHTML = '<svg><use xlink:href="#vditor-icon-align-left"></use></svg>'; | ||
center.setAttribute("aria-label", i18n[vditor.options.lang].alignCenter + | ||
"<" + updateHotkeyTip("⌘-⇧-C") + ">"); | ||
"<" + updateHotkeyTip("⇧⌘C") + ">"); | ||
center.setAttribute("data-type", "center"); | ||
@@ -273,3 +280,3 @@ center.innerHTML = '<svg><use xlink:href="#vditor-icon-align-center"></use></svg>'; | ||
right.setAttribute("aria-label", i18n[vditor.options.lang].alignRight + | ||
"<" + updateHotkeyTip("⌘-⇧-R") + ">"); | ||
"<" + updateHotkeyTip("⇧⌘R") + ">"); | ||
right.setAttribute("data-type", "right"); | ||
@@ -285,4 +292,4 @@ right.innerHTML = '<svg><use xlink:href="#vditor-icon-align-right"></use></svg>'; | ||
insertRowElement.setAttribute("type", "button"); | ||
insertRowElement.setAttribute("aria-label", i18n[vditor.options.lang]["insert-row"] + | ||
"<" + updateHotkeyTip("⌘-=") + ">"); | ||
insertRowElement.setAttribute("aria-label", i18n[vditor.options.lang].insertRowBelow + | ||
"<" + updateHotkeyTip("⌘=") + ">"); | ||
insertRowElement.setAttribute("data-type", "insertRow"); | ||
@@ -300,6 +307,22 @@ insertRowElement.innerHTML = '<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>'; | ||
const insertRowBElement = document.createElement("button"); | ||
insertRowBElement.setAttribute("type", "button"); | ||
insertRowBElement.setAttribute("aria-label", i18n[vditor.options.lang].insertRowAbove + | ||
"<" + updateHotkeyTip("⇧⌘F") + ">"); | ||
insertRowBElement.setAttribute("data-type", "insertRow"); | ||
insertRowBElement.innerHTML = '<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>'; | ||
insertRowBElement.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n"; | ||
insertRowBElement.onclick = () => { | ||
const startContainer = getSelection().getRangeAt(0).startContainer; | ||
const cellElement = hasClosestByMatchTag(startContainer, "TD") || | ||
hasClosestByMatchTag(startContainer, "TH"); | ||
if (cellElement) { | ||
insertRowAbove(vditor, range, cellElement); | ||
} | ||
}; | ||
const insertColumnElement = document.createElement("button"); | ||
insertColumnElement.setAttribute("type", "button"); | ||
insertColumnElement.setAttribute("aria-label", i18n[vditor.options.lang]["insert-column"] + | ||
"<" + updateHotkeyTip("⌘-⇧-=") + ">"); | ||
insertColumnElement.setAttribute("aria-label", i18n[vditor.options.lang].insertColumnRight + | ||
"<" + updateHotkeyTip("⇧⌘=") + ">"); | ||
insertColumnElement.setAttribute("data-type", "insertColumn"); | ||
@@ -317,6 +340,22 @@ insertColumnElement.innerHTML = '<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>'; | ||
const insertColumnBElement = document.createElement("button"); | ||
insertColumnBElement.setAttribute("type", "button"); | ||
insertColumnBElement.setAttribute("aria-label", i18n[vditor.options.lang].insertColumnLeft + | ||
"<" + updateHotkeyTip("⇧⌘G") + ">"); | ||
insertColumnBElement.setAttribute("data-type", "insertColumn"); | ||
insertColumnBElement.innerHTML = '<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>'; | ||
insertColumnBElement.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n"; | ||
insertColumnBElement.onclick = () => { | ||
const startContainer = getSelection().getRangeAt(0).startContainer; | ||
const cellElement = hasClosestByMatchTag(startContainer, "TD") || | ||
hasClosestByMatchTag(startContainer, "TH"); | ||
if (cellElement) { | ||
insertColumn(vditor, tableElement, cellElement, "beforebegin"); | ||
} | ||
}; | ||
const deleteRowElement = document.createElement("button"); | ||
deleteRowElement.setAttribute("type", "button"); | ||
deleteRowElement.setAttribute("aria-label", i18n[vditor.options.lang]["delete-row"] + | ||
"<" + updateHotkeyTip("⌘--") + ">"); | ||
"<" + updateHotkeyTip("⌘-") + ">"); | ||
deleteRowElement.setAttribute("data-type", "deleteRow"); | ||
@@ -337,3 +376,3 @@ deleteRowElement.innerHTML = '<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>'; | ||
deleteColumnElement.setAttribute("aria-label", i18n[vditor.options.lang]["delete-column"] + | ||
"<" + updateHotkeyTip("⌘-⇧--") + ">"); | ||
"<" + updateHotkeyTip("⇧⌘-") + ">"); | ||
deleteColumnElement.setAttribute("data-type", "deleteColumn"); | ||
@@ -413,3 +452,5 @@ deleteColumnElement.innerHTML = '<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>'; | ||
vditor.wysiwyg.popover.insertAdjacentElement("beforeend", right); | ||
vditor.wysiwyg.popover.insertAdjacentElement("beforeend", insertRowBElement); | ||
vditor.wysiwyg.popover.insertAdjacentElement("beforeend", insertRowElement); | ||
vditor.wysiwyg.popover.insertAdjacentElement("beforeend", insertColumnBElement); | ||
vditor.wysiwyg.popover.insertAdjacentElement("beforeend", insertColumnElement); | ||
@@ -437,3 +478,3 @@ vditor.wysiwyg.popover.insertAdjacentElement("beforeend", deleteRowElement); | ||
inputWrap.setAttribute("aria-label", i18n[vditor.options.lang].footnoteRef + | ||
"<" + updateHotkeyTip("⌥-Enter") + ">"); | ||
"<" + updateHotkeyTip("⌥Enter") + ">"); | ||
inputWrap.className = "vditor-tooltipped vditor-tooltipped__n"; | ||
@@ -443,3 +484,3 @@ const input = document.createElement("input"); | ||
input.className = "vditor-input"; | ||
input.setAttribute("placeholder", i18n[vditor.options.lang].footnoteRef + "<" + updateHotkeyTip("⌥-Enter") + ">"); | ||
input.setAttribute("placeholder", i18n[vditor.options.lang].footnoteRef + "<" + updateHotkeyTip("⌥Enter") + ">"); | ||
input.style.width = "120px"; | ||
@@ -482,3 +523,3 @@ input.value = footnotesRefElement.getAttribute("data-footnotes-label"); | ||
languageWrap.setAttribute("aria-label", i18n[vditor.options.lang].language + | ||
"<" + updateHotkeyTip("⌥-Enter") + ">"); | ||
"<" + updateHotkeyTip("⌥Enter") + ">"); | ||
languageWrap.className = "vditor-tooltipped vditor-tooltipped__n"; | ||
@@ -491,3 +532,4 @@ const language = document.createElement("input"); | ||
language.className = "vditor-input"; | ||
language.setAttribute("placeholder", i18n[vditor.options.lang].language + "<" + updateHotkeyTip("⌥-Enter") + ">"); | ||
language.setAttribute("placeholder", | ||
i18n[vditor.options.lang].language + "<" + updateHotkeyTip("⌥Enter") + ">"); | ||
language.value = codeElement.className.indexOf("language-") > -1 ? | ||
@@ -562,3 +604,3 @@ codeElement.className.split("-")[1].split(" ")[0] : ""; | ||
const inputWrap = document.createElement("span"); | ||
inputWrap.setAttribute("aria-label", "ID" + "<" + updateHotkeyTip("⌥-Enter") + ">"); | ||
inputWrap.setAttribute("aria-label", "ID" + "<" + updateHotkeyTip("⌥Enter") + ">"); | ||
inputWrap.className = "vditor-tooltipped vditor-tooltipped__n"; | ||
@@ -568,3 +610,3 @@ const input = document.createElement("input"); | ||
input.className = "vditor-input"; | ||
input.setAttribute("placeholder", "ID" + "<" + updateHotkeyTip("⌥-Enter") + ">"); | ||
input.setAttribute("placeholder", "ID" + "<" + updateHotkeyTip("⌥Enter") + ">"); | ||
input.style.width = "120px"; | ||
@@ -711,3 +753,3 @@ input.value = headingElement.getAttribute("data-id") || ""; | ||
upElement.setAttribute("aria-label", i18n[vditor.options.lang].up + | ||
"<" + updateHotkeyTip("⌘-⇧-U") + ">"); | ||
"<" + updateHotkeyTip("⇧⌘U") + ">"); | ||
upElement.innerHTML = '<svg><use xlink:href="#vditor-icon-up"></use></svg>'; | ||
@@ -735,3 +777,3 @@ upElement.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n"; | ||
downElement.setAttribute("aria-label", i18n[vditor.options.lang].down + | ||
"<" + updateHotkeyTip("⌘-⇧-D") + ">"); | ||
"<" + updateHotkeyTip("⇧⌘D") + ">"); | ||
downElement.innerHTML = '<svg><use xlink:href="#vditor-icon-down"></use></svg>'; | ||
@@ -755,3 +797,3 @@ downElement.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n"; | ||
close.setAttribute("aria-label", i18n[vditor.options.lang].remove + | ||
"<" + updateHotkeyTip("⌘-⇧-X") + ">"); | ||
"<" + updateHotkeyTip("⇧⌘X") + ">"); | ||
close.innerHTML = '<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>'; | ||
@@ -758,0 +800,0 @@ close.className = "vditor-icon vditor-tooltipped vditor-tooltipped__n"; |
@@ -334,3 +334,3 @@ import {Constants} from "../constants"; | ||
} | ||
if (this.composingLock) { | ||
if (this.composingLock || event.data === "‘" || event.data === "“" || event.data === "《") { | ||
return; | ||
@@ -337,0 +337,0 @@ } |
@@ -165,3 +165,3 @@ import {Constants} from "../constants"; | ||
// enter++: 标题变大 | ||
if (matchHotKey("⌘-=", event)) { | ||
if (matchHotKey("⌘=", event)) { | ||
const index = parseInt((headingElement as HTMLElement).tagName.substr(1), 10) - 1; | ||
@@ -177,3 +177,3 @@ if (index > 0) { | ||
// enter++: 标题变小 | ||
if (matchHotKey("⌘--", event)) { | ||
if (matchHotKey("⌘-", event)) { | ||
const index = parseInt((headingElement as HTMLElement).tagName.substr(1), 10) + 1; | ||
@@ -220,3 +220,3 @@ if (index < 7) { | ||
// 对有子工具栏的块上移 | ||
if (matchHotKey("⌘-⇧-U", event)) { | ||
if (matchHotKey("⇧⌘U", event)) { | ||
const itemElement: HTMLElement = vditor.wysiwyg.popover.querySelector('[data-type="up"]'); | ||
@@ -231,3 +231,3 @@ if (itemElement) { | ||
// 对有子工具栏的块下移 | ||
if (matchHotKey("⌘-⇧-D", event)) { | ||
if (matchHotKey("⇧⌘D", event)) { | ||
const itemElement: HTMLElement = vditor.wysiwyg.popover.querySelector('[data-type="down"]'); | ||
@@ -356,3 +356,3 @@ if (itemElement) { | ||
// 删除有子工具栏的块 | ||
if (matchHotKey("⌘-⇧-X", event)) { | ||
if (matchHotKey("⇧⌘X", event)) { | ||
const itemElement: HTMLElement = vditor.wysiwyg.popover.querySelector('[data-type="remove"]'); | ||
@@ -359,0 +359,0 @@ if (itemElement) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
13155797
37861
646
398