@nocobase/plugin-field-markdown-vditor 1.4.0-beta.1 → 1.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,4 +7,262 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/utils/client"),require("@nocobase/client"),require("antd"),require("@formily/react"),require("react")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-markdown-vditor",["@nocobase/utils/client","@nocobase/client","antd","@formily/react","react"],t):"object"==typeof exports?exports["@nocobase/plugin-field-markdown-vditor"]=t(require("@nocobase/utils/client"),require("@nocobase/client"),require("antd"),require("@formily/react"),require("react")):e["@nocobase/plugin-field-markdown-vditor"]=t(e["@nocobase/utils/client"],e["@nocobase/client"],e.antd,e["@formily/react"],e.react)}(self,function(e,t,n,r,o){return function(){var i={926:function(e,t,n){"use strict";var r=n(46),o=n.n(r),i=n(758),a=n.n(i),l=n(821),s=n.n(l),d=new URL(n(2),n.b),c=a()(o()),u=s()(d);c.push([e.id,'/*!\n * Vditor v3.10.4 - A markdown editor written in TypeScript.\n *\n * MIT License\n *\n * Copyright (c) 2018-present B3log 开源, b3log.org\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\n.vditor {\n --border-color: #d1d5da;\n --second-color: rgba(88, 96, 105, 0.36);\n --panel-background-color: #fff;\n --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n --toolbar-background-color: #f6f8fa;\n --toolbar-icon-color: #586069;\n --toolbar-icon-hover-color: #4285f4;\n --toolbar-height: 35px;\n --toolbar-divider-margin-top: 8px;\n --textarea-background-color: #fafbfc;\n --textarea-text-color: #24292e;\n --resize-icon-color: var(--toolbar-icon-color);\n --resize-background-color: var(--toolbar-background-color);\n --resize-hover-icon-color: var(--panel-background-color);\n --resize-hover-background-color: var(--toolbar-icon-hover-color);\n --count-background-color: rgba(27, 31, 35, 0.05);\n --heading-border-color: #eaecef;\n --blockquote-color: #6a737d;\n --ir-heading-color: #660e7a;\n --ir-title-color: #808080;\n --ir-bi-color: #0033b3;\n --ir-link-color: #008000;\n --ir-bracket-color: #0000ff;\n --ir-paren-color: #008000;\n}\n.vditor--dark {\n --border-color: #141414;\n --second-color: rgba(185, 185, 185, 0.36);\n --panel-background-color: #24292e;\n --panel-shadow: 0 1px 2px rgba(255, 255, 255, 0.2);\n --toolbar-background-color: #1d2125;\n --toolbar-icon-color: #b9b9b9;\n --toolbar-icon-hover-color: #fff;\n --textarea-background-color: #2f363d;\n --textarea-text-color: #d1d5da;\n --resize-icon-color: var(--border-color);\n --resize-background-color: var(--second-color);\n --resize-hover-icon-color: var(--toolbar-icon-hover-color);\n --resize-hover-background-color: rgba(185, 185, 185, 0.86);\n --count-background-color: rgba(66, 133, 244, 0.36);\n --heading-border-color: var(--textarea-text-color);\n --blockquote-color: var(--toolbar-icon-color);\n --ir-heading-color: #9876aa;\n --ir-title-color: #808080;\n --ir-bi-color: #cc7832;\n --ir-link-color: #ffc66d;\n --ir-bracket-color: #287bde;\n --ir-paren-color: #6a8759;\n}\n/**\n * tool tip.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 0.1.0.0, Jan 25, 2019\n */\n@keyframes tooltip-appear {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n.vditor-tooltipped {\n position: relative;\n cursor: pointer;\n}\n.vditor-tooltipped::after {\n position: absolute;\n z-index: 1000000;\n display: none;\n padding: 5px 8px;\n font-size: 11px;\n font-weight: normal;\n -webkit-font-smoothing: subpixel-antialiased;\n color: #fff;\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n pointer-events: none;\n content: attr(aria-label);\n background: #3b3e43;\n border-radius: 3px;\n line-height: 16px;\n opacity: 0;\n}\n.vditor-tooltipped::before {\n position: absolute;\n z-index: 1000001;\n display: none;\n width: 0;\n height: 0;\n color: #3b3e43;\n pointer-events: none;\n content: "";\n border: 5px solid transparent;\n opacity: 0;\n}\n.vditor-tooltipped--hover::before,\n.vditor-tooltipped--hover::after,\n.vditor-tooltipped:hover::before,\n.vditor-tooltipped:hover::after,\n.vditor-tooltipped:active::before,\n.vditor-tooltipped:active::after,\n.vditor-tooltipped:focus::before,\n.vditor-tooltipped:focus::after {\n display: inline-block;\n text-decoration: none;\nanimation-name: tooltip-appear;\nanimation-duration: 0.15s;\nanimation-fill-mode: forwards;\nanimation-timing-function: ease-in;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__se::after,\n.vditor-tooltipped__sw::after {\n top: 100%;\n right: 50%;\n margin-top: 5px;\n}\n.vditor-tooltipped__s::before,\n.vditor-tooltipped__se::before,\n.vditor-tooltipped__sw::before {\n top: auto;\n right: 50%;\n bottom: -5px;\n margin-right: -5px;\n border-bottom-color: #3b3e43;\n}\n.vditor-tooltipped__se::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__sw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__n::after,\n.vditor-tooltipped__ne::after,\n.vditor-tooltipped__nw::after {\n right: 50%;\n bottom: 100%;\n margin-bottom: 5px;\n}\n.vditor-tooltipped__n::before,\n.vditor-tooltipped__ne::before,\n.vditor-tooltipped__nw::before {\n top: -5px;\n right: 50%;\n bottom: auto;\n margin-right: -5px;\n border-top-color: #3b3e43;\n}\n.vditor-tooltipped__ne::after {\n right: auto;\n left: 50%;\n margin-left: -15px;\n}\n.vditor-tooltipped__nw::after {\n margin-right: -15px;\n}\n.vditor-tooltipped__s::after,\n.vditor-tooltipped__n::after {\n transform: translateX(50%);\n}\n.vditor-tooltipped__w::after {\n right: 100%;\n bottom: 50%;\n margin-right: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__w::before {\n top: 50%;\n bottom: 50%;\n left: -5px;\n margin-top: -5px;\n border-left-color: #3b3e43;\n}\n.vditor-tooltipped__e::after {\n bottom: 50%;\n left: 100%;\n margin-left: 5px;\n transform: translateY(50%);\n}\n.vditor-tooltipped__e::before {\n top: 50%;\n right: -5px;\n bottom: 50%;\n margin-top: -5px;\n border-right-color: #3b3e43;\n}\n@media screen and (max-width: 520px) {\n .vditor-tooltipped:before,\n .vditor-tooltipped:after {\n content: none;\n }\n}\n/**\n * panel.\n *\n * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>\n * @version 1.0.0.0, Jan 22, 2020\n */\n@keyframes scale-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n}\n.vditor-panel {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px;\n z-index: 3;\n font-size: 14px;\n display: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n max-width: 320px;\n min-width: 80px;\nanimation-duration: 0.15s;\nanimation-name: scale-in;\nanimation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n color: var(--toolbar-icon-color);\n}\n.vditor-panel--none {\n padding: 0;\nanimation: none;\n min-width: auto;\n max-width: none;\n white-space: nowrap;\n opacity: 0.86;\n}\n.vditor-panel--arrow:before {\n position: absolute;\n width: 0;\n height: 0;\n pointer-events: none;\n content: " ";\n border: 7px solid transparent;\n top: -14px;\n left: 5px;\n border-bottom-color: var(--panel-background-color);\n}\n.vditor-panel--left {\n right: 0;\n}\n.vditor-panel--left.vditor-panel--arrow:before {\n right: 5px;\n left: auto;\n}\n.vditor-input {\n border: 0;\n padding: 3px 5px;\n background-color: var(--panel-background-color);\n font-size: 12px;\n color: var(--textarea-text-color);\n}\n.vditor-input:focus {\n background-color: var(--toolbar-background-color);\n outline: none;\n}\n.vditor-icon {\n color: var(--toolbar-icon-color);\n cursor: pointer;\n float: left;\n padding: 4px 5px;\n height: 21px;\n width: 23px;\n background-color: transparent;\n border: 0;\n box-sizing: border-box;\n}\n.vditor-icon:hover,\n.vditor-icon--current {\n color: var(--toolbar-icon-hover-color);\n background-color: transparent;\n}\n.vditor-icon:focus {\n outline: none;\n}\n.vditor-icon svg {\n height: 13px !important;\n width: 13px !important;\n float: left;\n fill: currentColor;\n pointer-events: none;\n}\n.vditor-toolbar {\n background-color: var(--toolbar-background-color);\n border-bottom: 1px solid var(--border-color);\n padding: 0 5px;\n line-height: 1;\n}\n.vditor-toolbar--pin {\n position: -webkit-sticky;\n position: sticky;\n top: 0;\n z-index: 1;\n}\n.vditor-toolbar--hide {\n transition: all 0.15s ease-in-out;\n height: 5px;\n overflow: hidden;\n}\n.vditor-toolbar--hide:hover {\n background-color: var(--toolbar-background-color);\n height: auto;\n overflow: visible;\n}\n.vditor-toolbar__item {\n float: left;\n position: relative;\n}\n.vditor-toolbar__item .vditor-tooltipped {\n color: var(--toolbar-icon-color);\n border: 0;\n padding: 10px 5px;\n background-color: transparent;\n height: var(--toolbar-height);\n width: 25px;\n box-sizing: border-box;\n font-size: 0;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n outline: none;\n}\n.vditor-toolbar__item .vditor-tooltipped:focus {\n cursor: pointer;\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-toolbar__item svg {\n fill: currentColor;\n display: inline-block;\n stroke-width: 0;\n stroke: currentColor;\n width: 15px;\n height: 15px;\n}\n.vditor-toolbar__item input {\n position: absolute;\n width: 25px;\n height: var(--toolbar-height);\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0.001;\n overflow: hidden;\n}\n.vditor-toolbar__divider {\n float: left;\n height: -webkit-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: -moz-calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n height: calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));\n border-left: 1px solid var(--second-color);\n margin: var(--toolbar-divider-margin-top) 8px;\n}\n.vditor-toolbar__br {\n width: 100%;\n padding: 0 !important;\n height: 0 !important;\n}\n.vditor-menu--current {\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-menu--disabled {\n color: var(--second-color) !important;\n cursor: not-allowed !important;\n}\n.vditor-emojis {\n display: inline-block;\n overflow: auto;\n}\n.vditor-emojis::-webkit-scrollbar {\n display: none;\n}\n.vditor-emojis__tip {\n flex: 1;\n min-width: 1px;\n width: 200px;\n margin-right: 10px;\n color: var(--toolbar-icon-color);\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-emojis__tail {\n margin-top: 5px;\n font-size: 12px;\n color: var(--toolbar-icon-color);\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n}\n.vditor-emojis__tail a {\n text-decoration: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-emojis__tail a:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-emojis button {\n cursor: pointer;\n border-radius: 3px;\n float: left;\n height: 30px;\n width: 30px;\n text-align: center;\n line-height: 26px;\n padding: 3px;\n box-sizing: border-box;\n font-size: 16px;\n transition: all 0.15s ease-in-out;\n border: 0;\n margin: 0;\n background-color: transparent;\n overflow: hidden;\n}\n.vditor-emojis button:focus {\n outline: none;\n}\n.vditor-emojis button:hover .vditor-emojis__icon {\n display: inline-block;\n transform: scale(1.2);\n}\n.vditor-emojis img {\n height: 20px;\n width: 20px;\n float: left;\n margin: 3px 0 0 3px;\n}\n@media screen and (max-width: 520px) {\n .vditor-toolbar__item {\n padding: 0 12px;\n }\n .vditor-panel--left.vditor-panel--arrow:before {\n right: 17px;\n }\n}\n@media (hover: hover) and (pointer: fine) {\n .vditor-toolbar__item .vditor-tooltipped:hover {\n color: var(--toolbar-icon-hover-color);\n }\n}\n@keyframes slideInDown {\n from {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n.vditor {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n border: 1px solid var(--border-color);\n border-radius: 3px;\n box-sizing: border-box;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n}\n.vditor--fullscreen {\n position: fixed;\n top: 0;\n width: 100% !important;\n left: 0;\n height: 100vh !important;\n z-index: 90;\n border-radius: 0;\n}\n.vditor-content {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n min-height: 60px;\n flex: 1;\n min-width: 1px;\n position: relative;\n}\n.vditor-preview {\n flex: 1;\n min-width: 1px;\n overflow: auto;\n margin-left: -1px;\n border-left: 1px solid var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n background-color: var(--textarea-background-color);\n}\n.vditor-preview::-webkit-scrollbar {\n display: none;\n}\n.vditor-preview__action {\n text-align: center;\n padding: 10px;\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button {\n background-color: var(--toolbar-background-color);\n color: var(--toolbar-icon-color);\n line-height: 20px;\n border: 0;\n margin: 0 10px;\n cursor: pointer;\n padding: 0 7px;\n font-size: 12px;\n}\n.vditor-preview__action button.vditor-preview__action--current,\n.vditor-preview__action button:hover {\n color: var(--toolbar-icon-hover-color);\n background-color: var(--toolbar-background-color);\n}\n.vditor-preview__action button:focus {\n outline: none;\n}\n.vditor-preview__action button svg {\n fill: currentColor;\n height: 15px;\n width: 15px;\n vertical-align: middle;\n}\n.vditor-preview > .vditor-reset {\n padding: 10px;\n margin: 0 auto;\n}\n.vditor-preview img:not(.emoji) {\n cursor: pointer;\n}\n.vditor-devtools {\n display: none;\n background-color: var(--textarea-background-color);\n overflow: auto;\n flex: 1;\n min-width: 1px;\n box-shadow: inset 1px 0 var(--border-color);\n box-sizing: border-box;\n border-radius: 0 0 3px 0;\n padding: 10px;\n}\n.vditor-counter {\n padding: 3px;\n color: var(--toolbar-icon-color);\n background-color: var(--count-background-color);\n border-radius: 3px;\n font-size: 12px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n float: right;\n margin: 8px 3px 0 0;\n}\n.vditor-counter--error {\n color: #d23f31;\n background-color: rgba(210, 63, 49, 0.1);\n}\n.vditor-resize {\n padding: 3px 0;\n cursor: row-resize;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: absolute;\n width: 100%;\n}\n.vditor-resize--top {\n top: -3px;\n}\n.vditor-resize--bottom {\n bottom: -3px;\n}\n.vditor-resize > div {\n height: 3px;\n background-color: var(--resize-background-color);\n transition: all 0.15s ease-in-out;\n}\n.vditor-resize:hover > div,\n.vditor-resize--selected > div {\n background-color: var(--resize-hover-background-color);\n}\n.vditor-resize:hover svg,\n.vditor-resize--selected svg {\n color: var(--resize-hover-icon-color);\n}\n.vditor-resize svg {\n fill: currentColor;\n stroke-width: 0;\n stroke: currentColor;\n width: 13px;\n height: 3px;\n display: block;\n margin: 0 auto;\n color: var(--resize-icon-color);\n}\n.vditor-upload {\n position: absolute;\n height: 3px;\n left: 0;\n top: -2px;\n transition: all 0.15s ease-in-out;\n background-color: #4285f4;\n}\n.vditor-tip {\n position: absolute;\n font-size: 12px;\n top: 10px;\nanimation-duration: 0.15s;\nanimation-fill-mode: both;\n left: 50%;\n z-index: 5;\n}\n.vditor-tip--show {\n display: block;\nanimation-name: slideInDown;\n}\n.vditor-tip__content {\n text-align: left;\n display: inline-block;\n line-height: 16px;\n padding: 3px 10px;\n border-radius: 3px;\n background: var(--toolbar-background-color);\n position: relative;\n margin-left: -50%;\n color: var(--toolbar-icon-color);\n max-width: 100%;\n box-shadow: var(--panel-shadow);\n}\n.vditor-tip__content ul {\n margin: 2px 0;\n padding: 0 0 0 18px;\n}\n.vditor-tip__content a {\n color: #4285f4;\n}\n.vditor-tip__close {\n position: absolute;\n color: var(--toolbar-icon-color);\n top: -7px;\n right: -15px;\n font-weight: bold;\n cursor: pointer;\n}\n.vditor-tip__close:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n flex-direction: column;\n z-index: 100;\n}\n.vditor-img__bar {\n border-bottom: 1px solid var(--border-color);\n background-color: var(--toolbar-background-color);\n text-align: center;\n height: 36px;\n box-sizing: border-box;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.vditor-img__btn {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n cursor: pointer;\n margin-left: 24px;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n color: var(--toolbar-icon-color);\n}\n.vditor-img__btn:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-img__btn svg {\n height: 14px;\n width: 14px;\n margin-right: 8px;\n fill: currentColor;\n}\n.vditor-img__img {\n flex: 1;\n background-color: var(--textarea-background-color);\n overflow: auto;\n cursor: -webkit-zoom-out;\n cursor: -moz-zoom-out;\n cursor: zoom-out;\n}\n.vditor-img__img img {\n max-width: none;\n}\n.vditor-hint {\n background-color: var(--panel-background-color);\n position: absolute;\n box-shadow: var(--panel-shadow);\n border-radius: 3px;\n padding: 5px 0;\n z-index: 4;\n line-height: 20px;\n list-style: none;\n font-size: 12px;\n margin: 0;\n max-width: 250px;\n min-width: 80px;\n display: none;\n}\n.vditor-hint .vditor-hint {\n margin-top: -31px;\n left: 100%;\n right: auto;\n}\n.vditor-hint .vditor-hint.vditor-panel--left {\n right: 100%;\n left: auto;\n}\n.vditor-hint button {\n color: var(--toolbar-icon-color);\n display: block;\n padding: 3px 10px;\n border: 0;\n border-radius: 0;\n line-height: 20px;\n width: 100%;\n box-sizing: border-box;\n text-align: left;\n margin: 0;\n background-color: transparent;\n cursor: pointer;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n.vditor-hint button:focus {\n outline: none;\n}\n.vditor-hint--current,\n.vditor-hint button:not(.vditor-menu--disabled):hover {\n background-color: var(--toolbar-background-color) !important;\n color: var(--toolbar-icon-hover-color) !important;\n}\n.vditor-hint__emoji {\n font-size: 16px;\n float: left;\n margin-right: 3px;\n}\n.vditor-hint img {\n height: 20px;\n width: 20px;\n float: left;\n margin-right: 3px;\n}\n.vditor-reset {\n color: #24292e;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-wrap: break-word;\n overflow: auto;\n line-height: 1.5;\n font-size: 16px;\n word-break: break-word;\n}\n.vditor-reset--anchor {\n padding-left: 20px;\n}\n.vditor-reset--error {\n color: #d23f31;\n font-size: 12px;\n display: block;\n line-height: 16px;\n}\n.vditor-reset ul ul ul {\n list-style-type: square;\n}\n.vditor-reset ul ul {\n list-style-type: circle;\n}\n.vditor-reset ul {\n list-style-type: disc;\n}\n.vditor-reset ul,\n.vditor-reset ol {\n padding-left: 2em;\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset li + li {\n margin-top: 0.25em;\n}\n.vditor-reset li p {\n margin-top: 16px;\n}\n.vditor-reset audio {\n max-width: 100%;\n}\n.vditor-reset audio:focus {\n outline: none;\n}\n.vditor-reset video {\n max-height: 90vh;\n max-width: 100%;\n}\n.vditor-reset img {\n max-width: 100%;\n}\n.vditor-reset img.emoji {\n cursor: auto;\n max-width: 20px;\n vertical-align: sub;\n}\n.vditor-reset h1,\n.vditor-reset h2,\n.vditor-reset h3,\n.vditor-reset h4,\n.vditor-reset h5,\n.vditor-reset h6 {\n margin-top: 24px;\n margin-bottom: 16px;\n font-weight: 600;\n line-height: 1.25;\n}\n.vditor-reset h1:hover .vditor-anchor svg,\n.vditor-reset h2:hover .vditor-anchor svg,\n.vditor-reset h3:hover .vditor-anchor svg,\n.vditor-reset h4:hover .vditor-anchor svg,\n.vditor-reset h5:hover .vditor-anchor svg,\n.vditor-reset h6:hover .vditor-anchor svg {\n visibility: visible;\n}\n.vditor-reset h1 {\n font-size: 1.75em;\n}\n.vditor-reset h2 {\n font-size: 1.55em;\n}\n.vditor-reset h3 {\n font-size: 1.38em;\n}\n.vditor-reset h4 {\n font-size: 1.25em;\n}\n.vditor-reset h5 {\n font-size: 1.13em;\n}\n.vditor-reset h6 {\n font-size: 1em;\n}\n.vditor-reset hr {\n height: 2px;\n padding: 0;\n margin: 24px 0;\n background-color: #eaecef;\n border: 0;\n}\n.vditor-reset p {\n margin-top: 0;\n margin-bottom: 16px;\n}\n.vditor-reset blockquote {\n padding: 0 1em;\n color: #6a737d;\n border-left: 0.25em solid #eaecef;\n margin: 0 0 16px 0;\n}\n.vditor-reset blockquote > :first-child {\n margin-top: 0;\n}\n.vditor-reset blockquote > :last-child {\n margin-bottom: 0;\n}\n.vditor-reset ins > iframe {\n border: 0;\n}\n.vditor-reset iframe {\n border: 1px solid #d1d5da;\n max-width: 100%;\n box-sizing: border-box;\n}\n.vditor-reset iframe.iframe__video {\n min-width: 80%;\n min-height: 36vh;\n}\n.vditor-reset table {\n border-collapse: collapse;\n empty-cells: show;\n margin-bottom: 16px;\n overflow: auto;\n border-spacing: 0;\n display: block;\n word-break: keep-all;\n width: 100%;\n}\n.vditor-reset table tr {\n background-color: #fafbfc;\n border-top: 1px solid #c6cbd1;\n}\n.vditor-reset table td,\n.vditor-reset table th {\n padding: 6px 13px;\n border: 1px solid #dfe2e5;\n word-break: normal;\n white-space: nowrap;\n}\n.vditor-reset table td:first-child::after,\n.vditor-reset table th:first-child::after {\n content: "";\n display: inline-block;\n vertical-align: top;\n min-height: 24px;\n}\n.vditor-reset table th {\n font-weight: 600;\n}\n.vditor-reset table tbody tr:nth-child(2n) {\n background-color: #fff;\n}\n.vditor-reset code:not(.hljs):not(.highlight-chroma) {\n padding: 0.2em 0.4em;\n margin: 0;\n font-size: 85%;\n border-radius: 3px;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n word-break: break-word;\n background-size: 20px 20px;\n white-space: pre-wrap;\n}\n.vditor-reset pre {\n margin: 1em 0;\n}\n.vditor-reset pre > code {\n margin: 0;\n font-size: 85%;\n padding: 0.5em;\n border-radius: 5px;\n display: block;\n overflow: auto;\n white-space: pre;\n font-family: mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n background-size: 20px 20px;\n background-image: url('+u+');\n word-break: initial;\n word-wrap: normal;\n}\n.vditor-reset pre:hover div.vditor-copy {\n display: block;\n}\n.vditor-reset .language-math,\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap,\n.vditor-reset .language-plantuml,\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-abc,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n margin-bottom: 16px;\n}\n.vditor-reset .language-math mjx-container:focus {\n outline: none;\n cursor: context-menu;\n}\n.vditor-reset .language-echarts,\n.vditor-reset .language-mindmap {\n overflow: hidden;\n height: 420px;\n}\n.vditor-reset .language-mermaid,\n.vditor-reset .language-markmap,\n.vditor-reset .language-flowchart,\n.vditor-reset .language-graphviz {\n text-align: center;\n}\n.vditor-reset .language-graphviz parsererror {\n overflow: auto;\n}\n.vditor-reset kbd {\n display: inline-block;\n padding: 3px 5px;\n font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;\n line-height: 10px;\n color: #24292e;\n vertical-align: middle;\n background-color: #fafbfc;\n border: solid 1px #d1d5da;\n border-radius: 3px;\n box-shadow: inset 0 -1px 0 #d1d5da;\n}\n.vditor-reset summary {\n cursor: pointer;\n}\n.vditor-reset summary:focus {\n outline: none;\n}\n.vditor-reset svg {\n height: auto;\n width: auto;\n stroke-width: initial;\n}\n.vditor-reset p:last-child,\n.vditor-reset blockquote:last-child,\n.vditor-reset pre:last-child,\n.vditor-reset ul:last-child,\n.vditor-reset ol:last-child,\n.vditor-reset hr:last-child {\n margin-bottom: 0;\n}\n.vditor-comment {\n border-bottom: 2px solid #f8e6ab;\n}\n.vditor-comment--focus,\n.vditor-comment--hover {\n background-color: #faf1d1;\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-comment--focus .vditor-comment,\n.vditor-comment--hover .vditor-comment {\n border-bottom: 2px solid #ffc60a;\n}\n.vditor-task {\n list-style: none !important;\n word-break: break-all;\n}\n.vditor-task input {\n margin: 0 0.2em 0.25em -1.6em;\n font-size: 12px;\n vertical-align: middle;\n}\n.vditor-copy {\n position: relative;\n display: none;\n z-index: 1;\n}\n.vditor-copy textarea {\n position: absolute;\n left: -100000px;\n height: 10px;\n}\n.vditor-copy span {\n cursor: pointer;\n position: absolute;\n right: 15px;\n top: 0.5em;\n}\n.vditor-copy svg {\n color: #586069;\n height: 14px;\n width: 14px !important;\n display: block;\n fill: currentColor;\n}\n.vditor-linenumber {\n padding-left: 4em !important;\n position: relative;\n}\n.vditor-linenumber__rows {\n position: absolute;\n pointer-events: none;\n top: 0.5em;\n left: 0;\n width: 3em;\n /* works for line-numbers below 1000 lines */\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n counter-reset: linenumber;\n}\n.vditor-linenumber__rows > span {\n pointer-events: none;\n display: block;\n}\n.vditor-linenumber__rows > span::before {\n counter-increment: linenumber;\n content: counter(linenumber);\n color: rgba(158, 150, 150, 0.38);\n display: block;\n padding-right: 1em;\n text-align: right;\n}\n.vditor-speech {\n position: absolute;\n display: none;\n background-color: #f6f8fa;\n border: 1px solid #d1d5da;\n border-radius: 3px;\n padding: 3px;\n cursor: pointer;\n color: #586069;\n}\n.vditor-speech:hover,\n.vditor-speech--current {\n color: #4285f4;\n}\n.vditor-speech svg {\n height: 14px;\n width: 14px;\n fill: currentColor;\n display: block;\n stroke-width: 0;\n stroke: currentColor;\n}\n.vditor-anchor {\n margin-left: 5px;\n}\n.vditor-anchor--left {\n float: left;\n padding-right: 4px;\n margin-left: -20px;\n}\n.vditor-anchor svg {\n visibility: hidden;\n}\n.vditor-anchor:hover svg {\n visibility: visible;\n}\n.vditor-anchor:focus {\n outline: none;\n}\n.vditor-linkcard {\n margin: 31px auto 16px;\n transition: all 0.15s ease-in-out;\n cursor: pointer;\n max-width: 768px;\n padding: 0 10px;\n}\n.vditor-linkcard a {\n border-radius: 3px;\n background-color: #f6f8fa;\n overflow: hidden;\n max-height: 250px;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n text-decoration: none;\n flex-wrap: wrap-reverse;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);\n}\n.vditor-linkcard a:hover {\n box-shadow: 0 0 3px rgba(0, 0, 0, 0.13), 0 3px 6px rgba(0, 0, 0, 0.26);\n text-decoration: none;\n}\n.vditor-linkcard a:visited .vditor-linkcard__abstract {\n color: rgba(88, 96, 105, 0.36);\n}\n.vditor-linkcard__info {\n padding: 10px;\n min-width: 200px;\n box-sizing: border-box;\n flex: 1;\n}\n.vditor-linkcard__title {\n font-size: 14px;\n font-weight: 400;\n color: #24292e;\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n}\n.vditor-linkcard__title img {\n cursor: pointer;\n height: 20px;\n width: 20px;\n border-radius: 3px;\n flex-shrink: 0;\n margin-right: 5px;\n}\n.vditor-linkcard__abstract {\n word-wrap: break-word;\n word-break: break-all;\n -webkit-line-clamp: 2;\n overflow: hidden;\n text-overflow: ellipsis;\n -webkit-box-orient: vertical;\n display: -webkit-box;\n font-size: 13px;\n color: #586069;\n margin: 5px 0;\n}\n.vditor-linkcard__site {\n font-size: 12px;\n color: #4285f4;\n}\n.vditor-linkcard__image {\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center center;\n max-width: 250px;\n min-width: 126px;\n cursor: pointer;\n background-color: rgba(88, 96, 105, 0.36);\n}\n.vditor-footnotes__goto-ref {\n text-decoration: none;\n}\n.vditor-toc {\n margin-bottom: 16px;\n -webkit-user-select: text;\n -moz-user-select: text;\n user-select: text;\n color: #4285f4;\n}\n.vditor-toc .vditor-outline__action {\n display: none;\n}\n.vditor-toc ul {\n list-style: none !important;\n padding-left: 1em;\n}\n.vditor-toc > ul {\n padding-left: 0;\n}\n.vditor-toc span {\n cursor: pointer;\n}\n.vditor-toc li > span > svg {\n width: 0;\n height: 0;\n}\n.vditor-outline {\n width: 250px;\n border-right: 1px solid var(--border-color);\n background-color: var(--panel-background-color);\n display: none;\n overflow: auto;\n}\n.vditor-outline--right {\n border-right: 0;\n border-left: 1px solid var(--border-color);\n}\n.vditor-outline::-webkit-scrollbar {\n display: none;\n}\n.vditor-outline ul {\n list-style: none !important;\n padding-left: 1em;\n margin: 0;\n}\n.vditor-outline__content > ul {\n padding-left: 0;\n}\n.vditor-outline li > span {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n padding: 5px 10px;\n cursor: pointer;\n color: var(--textarea-text-color);\n}\n.vditor-outline li > span > svg {\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.vditor-outline li > span:hover {\n color: var(--toolbar-icon-hover-color);\n}\n.vditor-outline li > span > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.vditor-outline__title {\n border-bottom: 1px dashed var(--border-color);\n padding: 5px 10px;\n color: var(--toolbar-icon-color);\n font-size: 12px;\n}\n.vditor-outline__action {\n transition: all 0.15s ease-in-out;\n fill: currentColor;\n margin-right: 5px;\n flex-shrink: 0;\n}\n.vditor-outline__action--close {\n transform: rotate(-90deg);\n}\n.vditor-wysiwyg {\n box-sizing: border-box;\n flex: 1;\n position: relative;\n width: 100%;\n min-width: 1px;\n}\n.vditor-wysiwyg pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-wysiwyg pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-wysiwyg pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-wysiwyg pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-wysiwyg pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-wysiwyg blockquote:empty::before,\n.vditor-wysiwyg pre > code:empty::before,\n.vditor-wysiwyg p:empty::before,\n.vditor-wysiwyg h1:empty::after,\n.vditor-wysiwyg h2:empty::after,\n.vditor-wysiwyg h3:empty::after,\n.vditor-wysiwyg h4:empty::after,\n.vditor-wysiwyg h5:empty::after,\n.vditor-wysiwyg h6:empty::after {\n content: \' \';\n}\n.vditor-wysiwyg code[data-marker="`"] {\n padding-left: 0 !important;\n padding-right: 0 !important;\n}\n.vditor-wysiwyg__block pre:first-child {\n margin-bottom: -1em;\n}\n.vditor-wysiwyg__block pre:first-child code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-wysiwyg__block pre:last-child {\n margin-bottom: 1em;\n}\n.vditor-wysiwyg__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-wysiwyg > .vditor-reset > h1:before,\n.vditor-wysiwyg > .vditor-reset > h2:before,\n.vditor-wysiwyg > .vditor-reset > h3:before,\n.vditor-wysiwyg > .vditor-reset > h4:before,\n.vditor-wysiwyg > .vditor-reset > h5:before,\n.vditor-wysiwyg > .vditor-reset > h6:before,\n.vditor-wysiwyg div.vditor-wysiwyg__block:before,\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n.vditor-wysiwyg div[data-type="footnotes-block"]:before,\n.vditor-wysiwyg .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-wysiwyg > .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-wysiwyg > .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-wysiwyg > .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-wysiwyg > .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-wysiwyg > .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-wysiwyg div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block:before {\n content: "</>";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="yaml-front-matter"]:before {\n content: "F";\n}\n.vditor-wysiwyg div.vditor-wysiwyg__block[data-type="math-block"]:before {\n content: "$$";\n}\n.vditor-wysiwyg .vditor-toc:before {\n content: "ToC";\n}\n.vditor-wysiwyg hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-wysiwyg details {\n white-space: normal;\n white-space: initial;\n}\n.vditor-wysiwyg a {\n cursor: pointer;\n}\n.vditor-wysiwyg span[data-type="backslash"] > span {\n display: none;\n color: var(--second-color);\n}\n.vditor-wysiwyg span[data-type="link-ref"],\n.vditor-wysiwyg sup[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-wysiwyg span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n.vditor-wysiwyg div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-wysiwyg div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n@media screen and (max-width: 520px) {\n .vditor-wysiwyg h1:before,\n .vditor-wysiwyg h2:before,\n .vditor-wysiwyg h3:before,\n .vditor-wysiwyg h4:before,\n .vditor-wysiwyg h5:before,\n .vditor-wysiwyg h6:before,\n .vditor-wysiwyg div.vditor-wysiwyg__block:before,\n .vditor-wysiwyg div[data-type="link-ref-defs-block"]:before,\n .vditor-wysiwyg div[data-type="footnotes-block"]:before,\n .vditor-wysiwyg .vditor-toc:before {\n content: none;\n }\n}\n.vditor-ir {\n box-sizing: border-box;\n flex: 1;\n min-width: 1px;\n position: relative;\n width: 100%;\n}\n.vditor-ir__node[data-type="code-block"]:before,\n.vditor-ir__node[data-type="code-block"]:after,\n.vditor-ir__node[data-type="yaml-front-matter"]:before,\n.vditor-ir__node[data-type="yaml-front-matter"]:after,\n.vditor-ir__node[data-type="math-block"]:before,\n.vditor-ir__node[data-type="math-block"]:after {\n content: \' \';\n color: var(--second-color);\n}\n.vditor-ir__node:not(.vditor-ir__node--expand) .vditor-ir__marker {\n padding: 0 !important;\n}\n.vditor-ir__node:not(.vditor-ir__node--expand)[data-type="a"] {\n cursor: pointer;\n}\n.vditor-ir__node[data-type="link-ref"],\n.vditor-ir__node[data-type="footnotes-ref"] {\n color: #4285f4;\n}\n.vditor-ir__node[data-type="html-block"] {\n margin-bottom: 1em;\n}\n.vditor-ir__node .vditor-ir__marker {\n width: 0;\n overflow: hidden;\n display: inline-block;\n height: 0;\n transition: all 0.15s ease-in-out;\n}\n.vditor-ir__node--hidden .vditor-ir__marker {\n visibility: hidden;\n}\n.vditor-ir__node--expand .vditor-ir__marker {\n color: var(--second-color);\n display: inline;\n height: auto;\n width: auto;\n}\n.vditor-ir__node--expand .vditor-ir__marker--hide {\n display: none;\n}\n.vditor-ir__node--expand .vditor-ir__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--bracket {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir__node--expand .vditor-ir__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-ir__node--expand .vditor-ir__marker--pre code {\n color: var(--textarea-text-color);\n height: auto;\n text-align: left;\n}\n.vditor-ir__node--expand[data-type="code-block"]:before,\n.vditor-ir__node--expand[data-type="code-block"]:after {\n content: \'```\';\n}\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:before,\n.vditor-ir__node--expand[data-type="yaml-front-matter"]:after {\n content: \'---\';\n}\n.vditor-ir__node--expand[data-type="math-block"]:before,\n.vditor-ir__node--expand[data-type="math-block"]:after {\n content: \'$$\';\n}\n.vditor-ir__node span[data-type="code-block-open-marker"],\n.vditor-ir__node span[data-type="code-block-close-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-open-marker"],\n.vditor-ir__node span[data-type="yaml-front-matter-close-marker"],\n.vditor-ir__node span[data-type="math-block-open-marker"],\n.vditor-ir__node span[data-type="math-block-close-marker"] {\n display: none;\n}\n.vditor-ir__preview {\n cursor: pointer;\n white-space: normal;\n white-space: initial;\n min-height: 27px;\n}\n.vditor-ir__link {\n color: var(--ir-bracket-color);\n text-decoration: underline;\n}\n.vditor-ir pre.vditor-reset {\n background-color: var(--panel-background-color);\n margin: 0;\n white-space: pre-wrap;\n height: 100%;\n box-sizing: border-box;\n}\n.vditor-ir pre.vditor-reset[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-ir pre.vditor-reset:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-ir pre.vditor-reset:focus {\n outline: none;\n background-color: var(--textarea-background-color);\n}\n.vditor-ir pre.vditor-reset:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-ir pre.vditor-reset pre {\n margin: 0;\n}\n.vditor-ir hr {\n display: inline-block;\n margin: 12px 0;\n width: 100%;\n}\n.vditor-ir blockquote:empty::before,\n.vditor-ir pre > code:empty::before,\n.vditor-ir p:empty::before,\n.vditor-ir h1:empty::after,\n.vditor-ir h2:empty::after,\n.vditor-ir h3:empty::after,\n.vditor-ir h4:empty::after,\n.vditor-ir h5:empty::after,\n.vditor-ir h6:empty::after {\n content: \' \';\n}\n.vditor-ir .vditor-reset > h1:before,\n.vditor-ir .vditor-reset > h2:before,\n.vditor-ir .vditor-reset > h3:before,\n.vditor-ir .vditor-reset > h4:before,\n.vditor-ir .vditor-reset > h5:before,\n.vditor-ir .vditor-reset > h6:before,\n.vditor-ir div[data-type="link-ref-defs-block"]:before,\n.vditor-ir div[data-type="footnotes-block"]:before,\n.vditor-ir .vditor-toc:before {\n float: left;\n padding-right: 4px;\n margin-left: -29px;\n content: \'H1\';\n font-size: 0.85rem;\n font-weight: normal;\n color: var(--second-color);\n}\n.vditor-ir .vditor-reset > h2:before {\n content: \'H2\';\n}\n.vditor-ir .vditor-reset > h3:before {\n content: \'H3\';\n}\n.vditor-ir .vditor-reset > h4:before {\n content: \'H4\';\n}\n.vditor-ir .vditor-reset > h5:before {\n content: \'H5\';\n}\n.vditor-ir .vditor-reset > h6:before {\n content: \'H6\';\n}\n.vditor-ir div[data-type="link-ref-defs-block"] {\n color: var(--blockquote-color);\n}\n.vditor-ir div[data-type="link-ref-defs-block"]:before {\n content: \'"A"\';\n}\n.vditor-ir div[data-type="footnotes-block"] {\n border-top: 2px solid var(--heading-border-color);\n padding-top: 24px;\n margin-top: 24px;\n}\n.vditor-ir div[data-type="footnotes-block"]:before {\n content: \'^F\';\n}\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ul,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > ol,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > p,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > blockquote,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > pre,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > table,\n.vditor-ir div[data-type="footnotes-block"] > div[data-type="footnotes-def"] > hr {\n margin-left: 8px;\n}\n.vditor-ir .vditor-toc:before {\n content: "ToC";\n}\n.vditor-ir .vditor-toc span[data-type="toc-h"] {\n color: #4285f4;\n text-decoration: underline;\n}\n@media screen and (max-width: 520px) {\n .vditor-ir h1:before,\n .vditor-ir h2:before,\n .vditor-ir h3:before,\n .vditor-ir h4:before,\n .vditor-ir h5:before,\n .vditor-ir h6:before,\n .vditor-ir div[data-type="link-ref-defs-block"]:before,\n .vditor-ir div[data-type="footnotes-block"]:before,\n .vditor-ir .vditor-toc:before {\n content: none;\n }\n}\n.vditor-sv {\n font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols";\n margin: 0 1px 0 0;\n overflow: auto;\n width: 100%;\n flex: 1;\n min-width: 1px;\n border: 0;\n resize: none;\n padding: 10px 9px 10px 10px;\n box-sizing: border-box;\n background-color: var(--panel-background-color);\n outline: 0 none;\n font-size: 16px;\n line-height: 22px;\n color: var(--textarea-text-color);\n border-radius: 0 0 3px 3px;\n font-feature-settings: "liga", "clig off";\n font-variant-ligatures: no-common-ligatures;\n white-space: pre-wrap;\n word-break: break-word;\n word-wrap: break-word;\n}\n.vditor-sv[contenteditable="false"] {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.vditor-sv:empty::before {\n content: attr(placeholder);\n color: var(--second-color);\n}\n.vditor-sv:focus {\n background-color: var(--textarea-background-color);\n}\n.vditor-sv:after {\n content: "";\n height: var(--editor-bottom);\n display: block;\n}\n.vditor-sv span[data-type="newline"] + span[data-type="text"]:empty {\n display: inherit;\n}\n.vditor-sv .sup {\n vertical-align: super;\n font-size: smaller;\n}\n.vditor-sv .strong {\n font-weight: bold;\n}\n.vditor-sv .em {\n font-style: italic;\n}\n.vditor-sv .s {\n text-decoration: line-through;\n}\n.vditor-sv .mark:not(.vditor-sv__marker) {\n background-color: yellow;\n color: black;\n}\n.vditor-sv .h1 {\n font-size: 1.75em;\n line-height: 44px;\n}\n.vditor-sv .h2 {\n font-size: 1.55em;\n line-height: 38px;\n}\n.vditor-sv .h3 {\n font-size: 1.38em;\n line-height: 27px;\n}\n.vditor-sv .h4 {\n font-size: 1.25em;\n line-height: 25px;\n}\n.vditor-sv .h5 {\n font-size: 1.13em;\n}\n.vditor-sv .h6 {\n font-size: 1em;\n}\n.vditor-sv__marker {\n color: var(--second-color);\n}\n.vditor-sv__marker--heading {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--bi {\n color: var(--ir-bi-color);\n}\n.vditor-sv__marker--link {\n color: var(--ir-link-color);\n}\n.vditor-sv__marker--title {\n color: var(--ir-title-color);\n}\n.vditor-sv__marker--bracket {\n color: var(--ir-bracket-color);\n}\n.vditor-sv__marker--paren {\n color: var(--ir-paren-color);\n}\n.vditor-sv__marker--info {\n color: var(--ir-heading-color);\n}\n.vditor-sv__marker--strong {\n font-weight: bold;\n}\n\n',""]),t.Z=c},758:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var d=0;d<e.length;d++){var c=[].concat(e[d]);if(!r||!a[c[0]])void 0!==i&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=i),n&&(c[2]&&(c[1]="@media ".concat(c[2]," {").concat(c[1],"}")),c[2]=n),o&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=o):c[4]="".concat(o)),t.push(c)}},t}},821:function(e){"use strict";e.exports=function(e,t){return(!t&&(t={}),e)?(e=String(e.__esModule?e.default:e),/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),t.hash&&(e+=t.hash),/["'() \t\n]|(%20)/.test(e)||t.needQuotes)?'"'.concat(e.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):e:e}},46:function(e){"use strict";e.exports=function(e){return e[1]}},278:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},i=[],a=0;a<e.length;a++){var l=e[a],s=r.base?l[0]+r.base:l[0],d=o[s]||0,c="".concat(s," ").concat(d);o[s]=d+1;var u=n(c),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==u)t[u].references++,t[u].updater(p);else{var f=function(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)n.update(e=t)}else n.remove()}}(p,r);r.byIndex=a,t.splice(a,0,{identifier:c,updater:f,references:1})}i.push(c)}return i}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var a=0;a<i.length;a++){var l=n(i[a]);t[l].references--}for(var s=r(e,o),d=0;d<i.length;d++){var c=n(i[d]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}i=s}}},547:function(e){"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},593:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},604:function(e,t,n){"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},391:function(e){"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){var r,o,i,a,l,s;r=t,o=e,a="",(i=n).supports&&(a+="@supports (".concat(i.supports,") {")),i.media&&(a+="@media ".concat(i.media," {")),(l=void 0!==i.layer)&&(a+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),a+=i.css,l&&(a+="}"),i.media&&(a+="}"),i.supports&&(a+="}"),(s=i.sourceMap)&&"undefined"!=typeof btoa&&(a+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),o.styleTagTransform(a,r,o.options)},remove:function(){!function(e){if(null===e.parentNode)return;e.parentNode.removeChild(e)}(t)}}}},784:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},825:function(e){var t,n;t=0,n=()=>(()=>{var e={471:e=>{var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,o){void 0===o&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=o;if(null==e||null==n)throw Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===r&&(r=!0);var a=r,l=this.diff_commonPrefix(e,n),s=e.substring(0,l);e=e.substring(l),n=n.substring(l),l=this.diff_commonSuffix(e,n);var d=e.substring(e.length-l);e=e.substring(0,e.length-l),n=n.substring(0,n.length-l);var c=this.diff_compute_(e,n,a,i);return s&&c.unshift(new t.Diff(0,s)),d&&c.push(new t.Diff(0,d)),this.diff_cleanupMerge(c),c},t.prototype.diff_compute_=function(e,n,r,o){if(!e)return[new t.Diff(1,n)];if(!n)return[new t.Diff(-1,e)];var i,a=e.length>n.length?e:n,l=e.length>n.length?n:e,s=a.indexOf(l);if(-1!=s)return i=[new t.Diff(1,a.substring(0,s)),new t.Diff(0,l),new t.Diff(1,a.substring(s+l.length))],e.length>n.length&&(i[0][0]=i[2][0]=-1),i;if(1==l.length)return[new t.Diff(-1,e),new t.Diff(1,n)];var d=this.diff_halfMatch_(e,n);if(d){var c=d[0],u=d[1],p=d[2],f=d[3],m=d[4],v=this.diff_main(c,p,r,o),h=this.diff_main(u,f,r,o);return v.concat([new t.Diff(0,m)],h)}return r&&e.length>100&&n.length>100?this.diff_lineMode_(e,n,o):this.diff_bisect_(e,n,o)},t.prototype.diff_lineMode_=function(e,n,r){var o=this.diff_linesToChars_(e,n);e=o.chars1,n=o.chars2;var i=o.lineArray,a=this.diff_main(e,n,!1,r);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,s=0,d=0,c="",u="";l<a.length;){switch(a[l][0]){case 1:d++,u+=a[l][1];break;case -1:s++,c+=a[l][1];break;case 0:if(s>=1&&d>=1){a.splice(l-s-d,s+d),l=l-s-d;for(var p=this.diff_main(c,u,!1,r),f=p.length-1;f>=0;f--)a.splice(l,0,p[f]);l+=p.length}d=0,s=0,c="",u=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,n,r){for(var o=e.length,i=n.length,a=Math.ceil((o+i)/2),l=2*a,s=Array(l),d=Array(l),c=0;c<l;c++)s[c]=-1,d[c]=-1;s[a+1]=0,d[a+1]=0;for(var u=o-i,p=u%2!=0,f=0,m=0,v=0,h=0,g=0;g<a&&!((new Date).getTime()>r);g++){for(var b=-g+f;b<=g-m;b+=2){for(var y=a+b,w=(E=b==-g||b!=g&&s[y-1]<s[y+1]?s[y+1]:s[y-1]+1)-b;E<o&&w<i&&e.charAt(E)==n.charAt(w);)E++,w++;if(s[y]=E,E>o)m+=2;else if(w>i)f+=2;else if(p&&(S=a+u-b)>=0&&S<l&&-1!=d[S]&&E>=(x=o-d[S]))return this.diff_bisectSplit_(e,n,E,w,r)}for(var k=-g+v;k<=g-h;k+=2){for(var E,x,S=a+k,_=(x=k==-g||k!=g&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1)-k;x<o&&_<i&&e.charAt(o-x-1)==n.charAt(i-_-1);)x++,_++;if(d[S]=x,x>o)h+=2;else if(_>i)v+=2;else if(!p&&(y=a+u-k)>=0&&y<l&&-1!=s[y]&&(w=a+(E=s[y])-y,E>=(x=o-x)))return this.diff_bisectSplit_(e,n,E,w,r)}}return[new t.Diff(-1,e),new t.Diff(1,n)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,o){var i=e.substring(0,n),a=t.substring(0,r),l=e.substring(n),s=t.substring(r),d=this.diff_main(i,a,!1,o),c=this.diff_main(l,s,!1,o);return d.concat(c)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function o(e){for(var t="",o=0,a=-1,l=n.length;a<e.length-1;){-1==(a=e.indexOf("\n",o))&&(a=e.length-1);var s=e.substring(o,a+1);(r.hasOwnProperty?r.hasOwnProperty(s):void 0!==r[s])?t+=String.fromCharCode(r[s]):(l==i&&(s=e.substring(o),a=e.length),t+=String.fromCharCode(l),r[s]=l,n[l++]=s),o=a+1}return t}n[0]="";var i=4e4,a=o(e);return i=65535,{chars1:a,chars2:o(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],o=[],i=0;i<r.length;i++)o[i]=t[r.charCodeAt(i)];e[n][1]=o.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(i,o)==t.substring(i,o)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),o=r,i=0;n<o;)e.substring(e.length-o,e.length-i)==t.substring(t.length-o,t.length-i)?i=n=o:r=o,o=Math.floor((r-n)/2+n);return o},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var o=Math.min(n,r);if(e==t)return o;for(var i=0,a=1;;){var l=e.substring(o-a),s=t.indexOf(l);if(-1==s)return i;a+=s,0!=s&&e.substring(o-a)!=t.substring(0,a)||(i=a,a++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;var o=this;function i(e,t,n){for(var r,i,a,l,s=e.substring(n,n+Math.floor(e.length/4)),d=-1,c="";-1!=(d=t.indexOf(s,d+1));){var u=o.diff_commonPrefix(e.substring(n),t.substring(d)),p=o.diff_commonSuffix(e.substring(0,n),t.substring(0,d));c.length<p+u&&(c=t.substring(d-p,d)+t.substring(d,d+u),r=e.substring(0,n-p),i=e.substring(n+u),a=t.substring(0,d-p),l=t.substring(d+u))}return 2*c.length>=e.length?[r,i,a,l,c]:null}var a,l,s,d,c,u=i(n,r,Math.ceil(n.length/4)),p=i(n,r,Math.ceil(n.length/2));return u||p?(a=p?u&&u[4].length>p[4].length?u:p:u,e.length>t.length?(l=a[0],s=a[1],d=a[2],c=a[3]):(d=a[0],c=a[1],l=a[2],s=a[3]),[l,s,d,c,a[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var n=!1,r=[],o=0,i=null,a=0,l=0,s=0,d=0,c=0;a<e.length;)0==e[a][0]?(r[o++]=a,l=d,s=c,d=0,c=0,i=e[a][1]):(1==e[a][0]?d+=e[a][1].length:c+=e[a][1].length,i&&i.length<=Math.max(l,s)&&i.length<=Math.max(d,c)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,a=--o>0?r[o-1]:-1,l=0,s=0,d=0,c=0,i=null,n=!0)),a++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(-1==e[a-1][0]&&1==e[a][0]){var u=e[a-1][1],p=e[a][1],f=this.diff_commonOverlap_(u,p),m=this.diff_commonOverlap_(p,u);f>=m?(f>=u.length/2||f>=p.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,f))),e[a-1][1]=u.substring(0,u.length-f),e[a+1][1]=p.substring(f),a++):(m>=u.length/2||m>=p.length/2)&&(e.splice(a,0,new t.Diff(0,u.substring(0,m))),e[a-1][0]=1,e[a-1][1]=p.substring(0,p.length-m),e[a+1][0]=-1,e[a+1][1]=u.substring(m),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),o=n.charAt(0),i=r.match(t.nonAlphaNumericRegex_),a=o.match(t.nonAlphaNumericRegex_),l=i&&r.match(t.whitespaceRegex_),s=a&&o.match(t.whitespaceRegex_),d=l&&r.match(t.linebreakRegex_),c=s&&o.match(t.linebreakRegex_),u=d&&e.match(t.blanklineEndRegex_),p=c&&n.match(t.blanklineStartRegex_);return u||p?5:d||c?4:i&&!l&&s?3:l||s?2:i||a?1:0}for(var r=1;r<e.length-1;){if(0==e[r-1][0]&&0==e[r+1][0]){var o=e[r-1][1],i=e[r][1],a=e[r+1][1],l=this.diff_commonSuffix(o,i);if(l){var s=i.substring(i.length-l);o=o.substring(0,o.length-l),i=s+i.substring(0,i.length-l),a=s+a}for(var d=o,c=i,u=a,p=n(o,i)+n(i,a);i.charAt(0)===a.charAt(0);){o+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var f=n(o,i)+n(i,a);f>=p&&(p=f,d=o,c=i,u=a)}e[r-1][1]!=d&&(d?e[r-1][1]=d:(e.splice(r-1,1),r--),e[r][1]=c,u?e[r+1][1]=u:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var n=!1,r=[],o=0,i=null,a=0,l=!1,s=!1,d=!1,c=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(d||c)?(r[o++]=a,l=d,s=c,i=e[a][1]):(o=0,i=null),d=c=!1):(-1==e[a][0]?c=!0:d=!0,i&&(l&&s&&d&&c||i.length<this.Diff_EditCost/2&&l+s+d+c==3)&&(e.splice(r[o-1],0,new t.Diff(-1,i)),e[r[o-1]+1][0]=1,o--,i=null,l&&s?(d=c=!0,o=0):(a=--o>0?r[o-1]:-1,d=c=!1),n=!0)),a++;n&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var n,r=0,o=0,i=0,a="",l="";r<e.length;)switch(e[r][0]){case 1:i++,l+=e[r][1],r++;break;case -1:o++,a+=e[r][1],r++;break;case 0:o+i>1?(0!==o&&0!==i&&(0!==(n=this.diff_commonPrefix(l,a))&&(r-o-i>0&&0==e[r-o-i-1][0]?e[r-o-i-1][1]+=l.substring(0,n):(e.splice(0,0,new t.Diff(0,l.substring(0,n))),r++),l=l.substring(n),a=a.substring(n)),0!==(n=this.diff_commonSuffix(l,a))&&(e[r][1]=l.substring(l.length-n)+e[r][1],l=l.substring(0,l.length-n),a=a.substring(0,a.length-n))),r-=o+i,e.splice(r,o+i),a.length&&(e.splice(r,0,new t.Diff(-1,a)),r++),l.length&&(e.splice(r,0,new t.Diff(1,l)),r++),r++):0!==r&&0==e[r-1][0]?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,i=0,o=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var s=!1;for(r=1;r<e.length-1;)0==e[r-1][0]&&0==e[r+1][0]&&(e[r][1].substring(e[r][1].length-e[r-1][1].length)==e[r-1][1]?(e[r][1]=e[r-1][1]+e[r][1].substring(0,e[r][1].length-e[r-1][1].length),e[r+1][1]=e[r-1][1]+e[r+1][1],e.splice(r-1,1),s=!0):e[r][1].substring(0,e[r+1][1].length)==e[r+1][1]&&(e[r-1][1]+=e[r+1][1],e[r][1]=e[r][1].substring(e[r+1][1].length)+e[r+1][1],e.splice(r+1,1),s=!0)),r++;s&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var n,r=0,o=0,i=0,a=0;for(n=0;n<e.length&&(1!==e[n][0]&&(r+=e[n][1].length),-1!==e[n][0]&&(o+=e[n][1].length),!(r>t));n++)i=r,a=o;return e.length!=n&&-1===e[n][0]?a:a+(t-i)},t.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=/</g,o=/>/g,i=/\n/g,a=0;a<e.length;a++){var l=e[a][0],s=e[a][1].replace(n,"&amp;").replace(r,"&lt;").replace(o,"&gt;").replace(i,"&para;<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case -1:t[a]='<del style="background:#ffe6e6;">'+s+"</del>";break;case 0:t[a]="<span>"+s+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)-1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,n=0,r=0,o=0;o<e.length;o++){var i=e[o][0],a=e[o][1];switch(i){case 1:n+=a.length;break;case -1:r+=a.length;break;case 0:t+=Math.max(n,r),n=0,r=0}}return t+Math.max(n,r)},t.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]="+"+encodeURI(e[n][1]);break;case -1:t[n]="-"+e[n][1].length;break;case 0:t[n]="="+e[n][1].length}return t.join(" ").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,n){for(var r=[],o=0,i=0,a=n.split(/\t/g),l=0;l<a.length;l++){var s=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{r[o++]=new t.Diff(1,decodeURI(s))}catch(e){throw Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":var d=parseInt(s,10);if(isNaN(d)||d<0)throw Error("Invalid number in diff_fromDelta: "+s);var c=e.substring(i,i+=d);"="==a[l].charAt(0)?r[o++]=new t.Diff(0,c):r[o++]=new t.Diff(-1,c);break;default:if(a[l])throw Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(i!=e.length)throw Error("Delta length ("+i+") does not equal source text length ("+e.length+").");return r},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),o=this;function i(e,r){var i=e/t.length,a=Math.abs(n-r);return o.Match_Distance?i+a/o.Match_Distance:a?1:i}var a=this.Match_Threshold,l=e.indexOf(t,n);-1!=l&&(a=Math.min(i(0,l),a),-1!=(l=e.lastIndexOf(t,n+t.length))&&(a=Math.min(i(0,l),a)));var s,d,c=1<<t.length-1;l=-1;for(var u,p=t.length+e.length,f=0;f<t.length;f++){for(s=0,d=p;s<d;)i(f,n+d)<=a?s=d:p=d,d=Math.floor((p-s)/2+s);p=d;var m=Math.max(1,n-d+1),v=Math.min(n+d,e.length)+t.length,h=Array(v+2);h[v+1]=(1<<f)-1;for(var g=v;g>=m;g--){var b=r[e.charAt(g-1)];if(h[g]=0===f?(h[g+1]<<1|1)&b:(h[g+1]<<1|1)&b|(u[g+1]|u[g])<<1|1|u[g+1],h[g]&c){var y=i(f,g-1);if(y<=a){if(a=y,!((l=g-1)>n))break;m=Math.max(1,2*n-l)}}}if(i(f+1,n)>a)break;u=h}return l},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var r=n.substring(e.start2,e.start2+e.length1),o=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,r=n.substring(e.start2-o,e.start2+e.length1+o);o+=this.Patch_Margin;var i=n.substring(e.start2-o,e.start2);i&&e.diffs.unshift(new t.Diff(0,i));var a=n.substring(e.start2+e.length1,e.start2+e.length1+o);a&&e.diffs.push(new t.Diff(0,a)),e.start1-=i.length,e.start2-=i.length,e.length1+=i.length+a.length,e.length2+=i.length+a.length}},t.prototype.patch_make=function(e,n,r){var o,i;if("string"==typeof e&&"string"==typeof n&&void 0===r)o=e,(i=this.diff_main(o,n,!0)).length>2&&(this.diff_cleanupSemantic(i),this.diff_cleanupEfficiency(i));else if(e&&"object"==typeof e&&void 0===n&&void 0===r)i=e,o=this.diff_text1(i);else if("string"==typeof e&&n&&"object"==typeof n&&void 0===r)o=e,i=n;else{if("string"!=typeof e||"string"!=typeof n||!r||"object"!=typeof r)throw Error("Unknown call format to patch_make.");o=e,i=r}if(0===i.length)return[];for(var a=[],l=new t.patch_obj,s=0,d=0,c=0,u=o,p=o,f=0;f<i.length;f++){var m=i[f][0],v=i[f][1];switch(s||0===m||(l.start1=d,l.start2=c),m){case 1:l.diffs[s++]=i[f],l.length2+=v.length,p=p.substring(0,c)+v+p.substring(c);break;case -1:l.length1+=v.length,l.diffs[s++]=i[f],p=p.substring(0,c)+p.substring(c+v.length);break;case 0:v.length<=2*this.Patch_Margin&&s&&i.length!=f+1?(l.diffs[s++]=i[f],l.length1+=v.length,l.length2+=v.length):v.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(l,u),a.push(l),l=new t.patch_obj,s=0,u=p,d=c)}1!==m&&(d+=v.length),-1!==m&&(c+=v.length)}return s&&(this.patch_addContext_(l,u),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var o=e[r],i=new t.patch_obj;i.diffs=[];for(var a=0;a<o.diffs.length;a++)i.diffs[a]=new t.Diff(o.diffs[a][0],o.diffs[a][1]);i.start1=o.start1,i.start2=o.start2,i.length1=o.length1,i.length2=o.length2,n[r]=i}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var r=0,o=[],i=0;i<e.length;i++){var a,l,s=e[i].start2+r,d=this.diff_text1(e[i].diffs),c=-1;if(d.length>this.Match_MaxBits?-1!=(a=this.match_main(t,d.substring(0,this.Match_MaxBits),s))&&(-1==(c=this.match_main(t,d.substring(d.length-this.Match_MaxBits),s+d.length-this.Match_MaxBits))||a>=c)&&(a=-1):a=this.match_main(t,d,s),-1==a)o[i]=!1,r-=e[i].length2-e[i].length1;else if(o[i]=!0,r=a-s,d==(l=-1==c?t.substring(a,a+d.length):t.substring(a,c+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[i].diffs)+t.substring(a+d.length);else{var u=this.diff_main(d,l,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(u)/d.length>this.Patch_DeleteThreshold)o[i]=!1;else{this.diff_cleanupSemanticLossless(u);for(var p,f=0,m=0;m<e[i].diffs.length;m++){var v=e[i].diffs[m];0!==v[0]&&(p=this.diff_xIndex(u,f)),1===v[0]?t=t.substring(0,a+p)+v[1]+t.substring(a+p):-1===v[0]&&(t=t.substring(0,a+p)+t.substring(a+this.diff_xIndex(u,f+v[1].length))),-1!==v[0]&&(f+=v[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),o]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r="",o=1;o<=n;o++)r+=String.fromCharCode(o);for(o=0;o<e.length;o++)e[o].start1+=n,e[o].start2+=n;var i=e[0],a=i.diffs;if(0==a.length||0!=a[0][0])a.unshift(new t.Diff(0,r)),i.start1-=n,i.start2-=n,i.length1+=n,i.length2+=n;else if(n>a[0][1].length){var l=n-a[0][1].length;a[0][1]=r.substring(a[0][1].length)+a[0][1],i.start1-=l,i.start2-=l,i.length1+=l,i.length2+=l}return 0==(a=(i=e[e.length-1]).diffs).length||0!=a[a.length-1][0]?(a.push(new t.Diff(0,r)),i.length1+=n,i.length2+=n):n>a[a.length-1][1].length&&(l=n-a[a.length-1][1].length,a[a.length-1][1]+=r.substring(0,l),i.length1+=l,i.length2+=l),r},t.prototype.patch_splitMax=function(e){for(var n=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=n)){var o=e[r];e.splice(r--,1);for(var i=o.start1,a=o.start2,l="";0!==o.diffs.length;){var s=new t.patch_obj,d=!0;for(s.start1=i-l.length,s.start2=a-l.length,""!==l&&(s.length1=s.length2=l.length,s.diffs.push(new t.Diff(0,l)));0!==o.diffs.length&&s.length1<n-this.Patch_Margin;){var c=o.diffs[0][0],u=o.diffs[0][1];1===c?(s.length2+=u.length,a+=u.length,s.diffs.push(o.diffs.shift()),d=!1):-1===c&&1==s.diffs.length&&0==s.diffs[0][0]&&u.length>2*n?(s.length1+=u.length,i+=u.length,d=!1,s.diffs.push(new t.Diff(c,u)),o.diffs.shift()):(u=u.substring(0,n-s.length1-this.Patch_Margin),s.length1+=u.length,i+=u.length,0===c?(s.length2+=u.length,a+=u.length):d=!1,s.diffs.push(new t.Diff(c,u)),u==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(u.length))}l=(l=this.diff_text2(s.diffs)).substring(l.length-this.Patch_Margin);var p=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==p&&(s.length1+=p.length,s.length2+=p.length,0!==s.diffs.length&&0===s.diffs[s.diffs.length-1][0]?s.diffs[s.diffs.length-1][1]+=p:s.diffs.push(new t.Diff(0,p))),d||e.splice(++r,0,s)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var n=[];if(!e)return n;for(var r=e.split("\n"),o=0,i=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<r.length;){var a=r[o].match(i);if(!a)throw Error("Invalid patch string: "+r[o]);var l=new t.patch_obj;for(n.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),o++;o<r.length;){var s=r[o].charAt(0);try{var d=decodeURI(r[o].substring(1))}catch(e){throw Error("Illegal escape in patch_fromText: "+d)}if("-"==s)l.diffs.push(new t.Diff(-1,d));else if("+"==s)l.diffs.push(new t.Diff(1,d));else if(" "==s)l.diffs.push(new t.Diff(0,d));else{if("@"==s)break;if(""!==s)throw Error('Invalid patch mode "'+s+'" in: '+d)}o++}}return n},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],n=0;n<this.diffs.length;n++){switch(this.diffs[n][0]){case 1:e="+";break;case -1:e="-";break;case 0:e=" "}t[n+1]=e+encodeURI(this.diffs[n][1])+"\n"}return t.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},872:(e,t,n)=>{"use strict";n.d(t,{default:()=>N});var r=n(478),o=n(156),i=n(314),a=n(730),l=n(66),s=n(218),d=n(702),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)}))},u=n(466),p=n(554),f=n(40),m=n(563),v=n(749),h=n(818),g=n(408),b=n(54),y=n(227),w=n(526),k=n(827),E=n(640),x=n(895),S=n(393),_=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var n=function(){var e,n;return speechSynthesis.getVoices().forEach(function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)}),e||(e=n),e},r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',o='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',o='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var i=document.querySelector(".vditor-speech");i||((i=document.createElement("button")).className="vditor-speech",e.insertAdjacentElement("beforeend",i),void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=n));var a=n(),l=new SpeechSynthesisUtterance;l.voice=a,l.onend=l.onerror=function(){i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r},e.addEventListener(void 0!==window.ontouchstart?"touchend":"click",function(t){var n=t.target;if(n.classList.contains("vditor-speech")||n.parentElement.classList.contains("vditor-speech"))return i.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=o):(speechSynthesis.pause(),i.innerHTML=r)):(l.text=i.getAttribute("data-text"),speechSynthesis.speak(l),i.classList.add("vditor-speech--current"),i.innerHTML=o),(0,S.Hc)(window.vditorSpeechRange),void e.focus();if(i.style.display="none",speechSynthesis.cancel(),i.classList.remove("vditor-speech--current"),i.innerHTML=r,0!==getSelection().rangeCount){var a=getSelection().getRangeAt(0),s=a.toString().trim();if(s){window.vditorSpeechRange=a.cloneRange();var d=a.getBoundingClientRect();i.innerHTML=r,i.style.display="block",i.style.top=d.top+d.height+document.querySelector("html").scrollTop-20+"px",void 0!==window.ontouchstart?i.style.left=t.changedTouches[t.changedTouches.length-1].pageX+2+"px":i.style.left=t.clientX+2+"px",i.setAttribute("data-text",s)}}})}},L=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},T=function(e){var t,n={anchor:0,cdn:b.g.CDN,customEmoji:{},emojiPath:b.g.CDN+"/dist/images/emoji",hljs:b.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:b.g.MARKDOWN_OPTIONS,math:b.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:b.g.THEME_OPTIONS};return e.cdn&&((null===(t=e.theme)||void 0===t?void 0:t.path)||(n.theme.path=e.cdn+"/dist/css/content-theme"),e.emojiPath||(n.emojiPath=e.cdn+"/dist/images/emoji")),(0,E.T)(n,e)},C=function(e,t){var n=T(t);return(0,w.G)(n.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var r=(0,x.X)({autoSpace:n.markdown.autoSpace,gfmAutoLink:n.markdown.gfmAutoLink,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.SetHeadingID(!0),r.Md2HTML(e)})},M=function(e,t,n){var o,h,b,E;return o=void 0,h=void 0,b=void 0,E=function(){var o,h,b;return L(this,function(E){var x;switch(E.label){case 0:return[4,C(t,o=T(n))];case 1:if(h=E.sent(),o.transform&&(h=o.transform(h)),e.innerHTML=h,e.classList.add("vditor-reset"),o.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(o.lang))return[3,2];throw Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return b="vditorI18nScript"+o.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(e){e.id!==b&&document.head.removeChild(e)}),[4,(0,w.G)(o.cdn+"/dist/js/i18n/"+o.lang+".js",b)];case 3:E.sent(),E.label=4;case 4:return[3,6];case 5:window.VditorI18n=o.i18n,E.label=6;case 6:return o.icon?[4,(0,w.G)(o.cdn+"/dist/js/icons/"+o.icon+".js","vditorIconScript")]:[3,8];case 7:E.sent(),E.label=8;case 8:return(0,y.Z)(o.theme.current,o.theme.path),1===o.anchor&&e.classList.add("vditor-reset--anchor"),(0,a.O)(e,o.hljs),(0,d.s)(o.hljs,e,o.cdn),(0,u.H)(e,{cdn:o.cdn,math:o.math}),(0,f.i)(e,o.cdn,o.mode),(0,m.K)(e,o.cdn,o.mode),(0,l.P)(e,o.cdn),(0,s.v)(e,o.cdn),(0,i.p)(e,o.cdn,o.mode),(0,v.P)(e,o.cdn,o.mode),(0,g.B)(e,o.cdn),(0,r.Q)(e,o.cdn),o.render.media.enable&&(0,p.Y)(e),o.speech.enable&&_(e),0!==o.anchor&&(x=o.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(e){1===x&&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)}),o.after&&o.after(),o.lazyLoadImage&&c(e),e.addEventListener("click",function(t){var n=(0,k.lG)(t.target,"SPAN");if(n&&(0,k.fb)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop)}}),[2]}})},new(b||(b=Promise))(function(e,t){function n(e){try{i(E.next(e))}catch(e){t(e)}}function r(e){try{i(E.throw(e))}catch(e){t(e)}}function i(t){var o;t.done?e(t.value):((o=t.value)instanceof b?o:new b(function(e){e(o)})).then(n,r)}i((E=E.apply(o,h||[])).next())})},A=n(863),H=n(312);let N=function(){function e(){}return e.adapterRender=o,e.previewImage=A.E,e.codeRender=a.O,e.graphvizRender=s.v,e.highlightRender=d.s,e.mathRender=u.H,e.mermaidRender=f.i,e.markmapRender=m.K,e.flowchartRender=l.P,e.chartRender=i.p,e.abcRender=r.Q,e.mindmapRender=v.P,e.plantumlRender=g.B,e.outlineRender=h.k,e.mediaRender=p.Y,e.speechRender=_,e.lazyLoadImageRender=c,e.md2html=C,e.preview=M,e.setCodeTheme=H.Y,e.setContentTheme=y.Z,e}()},54:(e,t,n)=>{"use strict";n.d(t,{H:()=>r,g:()=>o});var r="3.10.4",o=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","js","ts","html","markmap","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],e.CDN="https://unpkg.com/vditor@3.10.4",e.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,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,defaultLang:"",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}()},478:(e,t,n)=>{"use strict";n.d(t,{Q:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.abcRenderAdapter.getElements(e);n.length>0&&(0,o.G)(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,i.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))})})}},156:(e,t,n)=>{"use strict";n.r(t),n.d(t,{abcRenderAdapter:()=>s,chartRenderAdapter:()=>l,flowchartRenderAdapter:()=>c,graphvizRenderAdapter:()=>d,markmapRenderAdapter:()=>i,mathRenderAdapter:()=>r,mermaidRenderAdapter:()=>o,mindmapRenderAdapter:()=>a,plantumlRenderAdapter:()=>u});var r={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},o={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-markmap")}},a={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},l={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},s={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},u={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},314:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=i.chartRenderAdapter.getElements(e);a.length>0&&(0,o.G)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){a.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.chartRenderAdapter.getCode(e).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}}})})}},730:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});var r=n(51),o=n(54),i=function(e,t){Array.from(e.querySelectorAll("pre > code")).filter(function(t,n){return!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-markmap")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))&&!(t.style.maxHeight.indexOf("px")>-1)&&!(e.classList.contains("vditor-preview")&&n>5)}).forEach(function(e){var n,i,a,l=e.innerText;if(e.classList.contains("highlight-chroma")){var s=e.cloneNode(!0);s.querySelectorAll(".highlight-ln").forEach(function(e){e.remove()}),l=s.innerText}else l.endsWith("\n")&&(l=l.substr(0,l.length-1));var d='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(d='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var c=document.createElement("div");c.className="vditor-copy",c.innerHTML='<span aria-label="'+((null===(n=window.VditorI18n)||void 0===n?void 0:n.copy)||"复制")+"\"\nonmouseover=\"this.setAttribute('aria-label', '"+((null===(i=window.VditorI18n)||void 0===i?void 0:i.copy)||"复制")+"')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '"+((null===(a=window.VditorI18n)||void 0===a?void 0:a.copied)||"已复制")+"');this.previousElementSibling.blur()\">"+d+"</span>";var u=document.createElement("textarea");u.value=(0,r.X)(l),c.insertAdjacentElement("afterbegin",u),t&&t.renderMenu&&t.renderMenu(e,c),e.before(c),e.style.maxHeight=window.outerHeight-40+"px",e.insertAdjacentHTML("afterend",'<span style="position: absolute">'+o.g.ZWSP+"</span>")})}},66:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.flowchartRenderAdapter.getElements(e);0!==n.length&&(0,o.G)(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(i.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}})})}},218:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t){void 0===t&&(t=r.g.CDN);var n=i.graphvizRenderAdapter.getElements(e);0!==n.length&&(0,o.G)(t+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){n.forEach(function(e){var t=i.graphvizRenderAdapter.getCode(e);if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var n=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),r=(window.URL||window.webkitURL).createObjectURL(n),o=new Worker(r);new Viz({worker:o}).renderSVGElement(t).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")}})})}},702:(e,t,n)=>{"use strict";n.d(t,{s:()=>a});var r=n(54),o=n(526),i=n(578),a=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.g.CDN);var a=e.style;r.g.CODE_THEME.includes(a)||(a="github");var l=document.getElementById("vditorHljsStyle"),s=n+"/dist/js/highlight.js/styles/"+a+".css";l&&l.getAttribute("href")!==s&&l.remove(),(0,i.c)(n+"/dist/js/highlight.js/styles/"+a+".css","vditorHljsStyle"),!1!==e.enable&&0!==t.querySelectorAll("pre > code").length&&(0,o.G)(n+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,o.G)(n+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,o.G)(n+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").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-flowchart")||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"))&&(""!==e.defaultLang&&-1===t.className.indexOf("language-")&&t.classList.add("language-"+e.defaultLang),hljs.highlightElement(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,o=!1;"pre-wrap"!==r&&"pre-line"!==r||(o=!0);var i="",a=t.textContent.split(/\r\n|\r|\n/g);a.pop(),a.map(function(e){var t="";o&&(n.textContent=e||"\n",t=' style="height:'+n.getBoundingClientRect().height+'px"'),i+="<span"+t+"></span>"}),n.style.display="none",i='<span class="vditor-linenumber__rows">'+i+"</span>",t.insertAdjacentHTML("beforeend",i)}})})})})}},563:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(54),o=n(526),i=n(156),a={},l=function(e,t){var n,r,o,i,l,s,d,c,u=window.markmap,p=u.Transformer,f=u.Markmap,m=u.deriveOptions,v=(u.globalCSS,new p);e.innerHTML='<svg style="width:100%"></svg>';var h=e.firstChild,g=f.create(h,null),b=(n=v,r=t,(i=Object.keys((o=n.transform(r)).features).filter(function(e){return!a[e]})).forEach(function(e){a[e]=!0}),s=(l=n.getAssets(i)).styles,d=l.scripts,c=window.markmap,s&&c.loadCSS(s),d&&c.loadJS(d),o),y=b.root,w=b.frontmatter,k=m(null==w?void 0:w.markmap);g.setData(y,k),g.fit()},s=function(e,t,n){void 0===t&&(t=r.g.CDN);var a=i.markmapRenderAdapter.getElements(e);0!==a.length&&(0,o.G)(t+"/dist/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){a.forEach(function(e){var t=i.markmapRenderAdapter.getCode(e);if("true"!==e.getAttribute("data-processed")&&""!==t.trim()){var n=document.createElement("div");n.className="language-markmap",e.parentNode.appendChild(n),l(n,t),"CODE"==e.parentNode.childNodes[0].nodeName&&e.parentNode.removeChild(e.parentNode.childNodes[0])}})})}},466:(e,t,n)=>{"use strict";n.d(t,{H:()=>s});var r=n(54),o=n(526),i=n(578),a=n(51),l=n(156),s=function(e,t){var n=l.mathRenderAdapter.getElements(e);if(0!==n.length){var s={cdn:r.g.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)(0,i.c)(t.cdn+"/dist/js/katex/katex.min.css?v=0.16.9","vditorKatexStyle"),(0,o.G)(t.cdn+"/dist/js/katex/katex.min.js?v=0.16.9","vditorKatexScript").then(function(){(0,o.G)(t.cdn+"/dist/js/katex/mhchem.min.js?v=0.16.9","vditorKatexChemScript").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 n=(0,a.X)(l.mathRenderAdapter.getCode(e));e.setAttribute("data-math",n);try{e.innerHTML=katex.renderToString(n,{displayMode:"DIV"===e.tagName,output:"html",macros:t.math.macros})}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.assign(window.MathJax,t.math.mathJaxOptions)),(0,o.J)(t.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var d=function(e,t){var n=(0,a.X)(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 o=r.querySelector('[data-mml-node="merror"]');o&&""!==o.textContent.trim()&&(e.innerHTML=o.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")||!(0,a.X)(r.textContent).trim()||e.push(function(e){t===n.length-1?d(r):d(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 o=e[t++];o===n?o():o(r)};r()}}(e)})}}}},554:(e,t,n)=>{"use strict";n.d(t,{Y:()=>o});var r=n(835),o=function(e){e&&e.querySelectorAll("a").forEach(function(e){var t,n,o,i,a=e.getAttribute("href");a&&(a.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?(t=e,n=a,t.insertAdjacentHTML("afterend",'<video controls="controls" src="'+n+'"></video>'),t.remove()):a.match(/^.+.(mp3|wav|flac)$/)?(o=e,i=a,o.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+i+'"></audio>'),o.remove()):function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),o=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),a=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),l=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),d=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),c=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(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();else if(o&&o[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+o[1]+'"></iframe>'),e.remove();else if(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();else if(a&&a[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'+a[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),e.remove();else if(l&&l[0])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='+encodeURIComponent(l[0])+'"></iframe>'),e.remove();else if(s&&s[2])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'+s[2]+'"></iframe>'),e.remove();else if(t.indexOf("bilibili.com")>-1&&(t.indexOf("bvid=")>-1||d&&d[1])){var u={bvid:(0,r.o)("bvid",t)||d&&d[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(t.startsWith("http")?t:"https:"+t).search.split("&").forEach(function(e,t){if(e){0===t&&(e=e.substr(1));var n=e.split("=");u[n[0]]=n[1]}});var p="https://player.bilibili.com/player.html?",f=Object.keys(u);f.forEach(function(e,t){p+=e+"="+u[e],t<f.length-1&&(p+="&")}),e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'+p+'"></iframe>'),e.remove()}else c&&c[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+c[1]+'"></iframe>'),e.remove())}(e,a))})}},40:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var r=n(54),o=n(526),i=n(156),a=n(835),l=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},s=function(e,t,n){void 0===t&&(t=r.g.CDN);var s=i.mermaidRenderAdapter.getElements(e);0!==s.length&&(0,o.G)(t+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var e={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};"dark"===n&&(e.theme="dark"),mermaid.initialize(e),s.forEach(function(e){var t,n,r,o;return t=void 0,n=void 0,r=void 0,o=function(){var t,n,r,o,s;return l(this,function(l){switch(l.label){case 0:if(t=i.mermaidRenderAdapter.getCode(e),"true"===e.getAttribute("data-processed")||""===t.trim())return[2];n="mermaid"+(0,a.W)(),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,mermaid.render(n,e.textContent)];case 2:return r=l.sent(),e.innerHTML=r.svg,[3,4];case 3:return o=l.sent(),s=document.querySelector("#"+n),e.innerHTML=s.outerHTML+'<br>\n<div style="text-align: left"><small>'+o.message.replace(/\n/,"<br>")+"</small></div>",s.parentElement.remove(),[3,4];case 4:return e.setAttribute("data-processed","true"),[2]}})},new(r||(r=Promise))(function(e,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(t){var n;t.done?e(t.value):((n=t.value)instanceof r?n:new r(function(e){e(n)})).then(a,l)}s((o=o.apply(t,n||[])).next())})})})}},749:(e,t,n)=>{"use strict";n.d(t,{P:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=i.mindmapRenderAdapter.getElements(e);a.length>0&&(0,o.G)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){a.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=i.mindmapRenderAdapter.getCode(e);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}}})})}},818:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=n(64),o=n(466),i=function(e,t,n){var i="",a=[];if(Array.from(e.children).forEach(function(e,t){if((0,r.W)(e)){if(n){var o=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===o?void 0:o)+"_"+t}a.push(e.id),i+=e.outerHTML.replace("<wbr>","")}}),""===i)return t.innerHTML="","";var l=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)?l.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+i):l.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+i),n.lute.SetToC(n.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var s=Lute.New();s.SetToC(!0),l.innerHTML=s.HTML2VditorDOM("<p>[ToC]</p>"+i)}var d=l.firstElementChild.querySelectorAll("li > span[data-target-id]");return d.forEach(function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var n="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(n='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML=n+"<span>"+e.innerHTML+"</span>"}else e.innerHTML="<svg></svg><span>"+e.innerHTML+"</span>";e.setAttribute("data-target-id",a[t])}),i=l.firstElementChild.innerHTML,0===d.length?t.innerHTML="":(t.innerHTML=i,n&&(0,o.H)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",function(r){for(var o=r.target;o&&!o.isEqualNode(t);){if(o.classList.contains("vditor-outline__action")){o.classList.contains("vditor-outline__action--close")?(o.classList.remove("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:block")):(o.classList.add("vditor-outline__action--close"),o.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(o.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var i=document.getElementById(o.getAttribute("data-target-id"));if(!i)return;if(n){if("auto"===n.options.height){var a=i.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=i.offsetTop:e.scrollTop=i.offsetTop}else window.scrollTo(window.scrollX,i.offsetTop);break}o=o.parentElement}})),i}},408:(e,t,n)=>{"use strict";n.d(t,{B:()=>a});var r=n(54),o=n(526),i=n(156),a=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=i.plantumlRenderAdapter.getElements(e);0!==n.length&&(0,o.G)(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=i.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(t)+'"/>'}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>"+t}}})})}},895:(e,t,n)=>{"use strict";n.d(t,{X:()=>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),t.SetGFMAutoLink(e.gfmAutoLink),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},863:(e,t,n)=>{"use strict";n.d(t,{E:()=>r});var r=function(e,t,n){void 0===t&&(t="zh_CN"),void 0===n&&(n="classic");var r=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 '+window.VditorI18n.spin+"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X &nbsp;"+window.VditorI18n.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("+r.left+"px, "+(r.top-36)+'px, 0)" src="'+e.getAttribute("src")+'">\n </div>\n</div>'),document.body.style.overflow="hidden";var o=document.querySelector(".vditor-img img"),i="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: "+i),setTimeout(function(){o.parentElement.scrollTo((o.parentElement.scrollWidth-o.parentElement.clientWidth)/2,(o.parentElement.scrollHeight-o.parentElement.clientHeight)/2)},400)});var a=document.querySelector(".vditor-img__btn");a.addEventListener("click",function(){var t=parseInt(a.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=i+" rotateZ("+t+"deg)",a.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)})}},312:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var r=n(54),o=n(578),i=function(e,t){void 0===t&&(t=r.g.CDN),r.g.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),i=t+"/dist/js/highlight.js/styles/"+e+".css";n?n.getAttribute("href")!==i&&(n.remove(),(0,o.c)(i,"vditorHljsStyle")):(0,o.c)(i,"vditorHljsStyle")}},227:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(578),o=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),o=t+"/"+e+".css";n?n.getAttribute("href")!==o&&(n.remove(),(0,r.c)(o,"vditorContentTheme")):(0,r.c)(o,"vditorContentTheme")}}},526:(e,t,n)=>{"use strict";n.d(t,{G:()=>o,J:()=>r});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)},o=function(e,t){return new Promise(function(n,r){if(document.getElementById(t))return n(),!1;var o=document.createElement("script");o.src=e,o.async=!0,document.head.appendChild(o),o.onerror=function(e){r(e)},o.onload=function(){if(document.getElementById(t))return o.remove(),n(),!1;o.id=t,n()}})}},578:(e,t,n)=>{"use strict";n.d(t,{c:()=>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)}}},51:(e,t,n)=>{"use strict";n.d(t,{X:()=>r});var r=function(e){return e.replace(/\u00a0/g," ")}},794:(e,t,n)=>{"use strict";n.d(t,{G6:()=>r,Le:()=>a,i7:()=>d,ns:()=>s,pK:()=>i,vU:()=>o,yl:()=>l});var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},o=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},i=function(){try{return"undefined"!=typeof localStorage}catch(e){return!1}},a=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},l=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!e.metaKey||e.ctrlKey):!(e.metaKey||!e.ctrlKey)},s=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?e.indexOf("⇧")>-1&&o()&&(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},d=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},835:(e,t,n)=>{"use strict";n.d(t,{W:()=>r,o:()=>o});var r=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(parseInt(e,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(e,10)/4).toString(16)})},o=function(e,t){void 0===t&&(t=window.location.search);var n=t.substring(t.indexOf("?")),r=n.indexOf("#");return new URLSearchParams(n.substring(0,r>=0?r:void 0)).get(e)}},827:(e,t,n)=>{"use strict";n.d(t,{DX:()=>u,E2:()=>i,F9:()=>s,JQ:()=>o,O9:()=>a,a1:()=>l,fb:()=>c,lG:()=>d});var r=n(64),o=function(e,t){for(var n=c(e,t),r=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(r=c(n.parentElement,t))?n=r:o=!0;return n||!1},i=function(e,t){for(var n=(0,r.S)(e,t),o=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(o=(0,r.S)(n.parentElement,t))?n=o:i=!0;return n||!1},a=function(e){var t=i(e,"UL"),n=i(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},l=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,o=!1;r&&!o&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?o=!0:r=r.parentElement;return o&&r},s=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=l(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},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.nodeName===t?r=!0:n=n.parentElement;return r&&n},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.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},u=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},64:(e,t,n)=>{"use strict";n.d(t,{S:()=>r,W:()=>o});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},o=function(e){var t=r(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},640:(e,t,n)=>{"use strict";n.d(t,{T:()=>r});var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},o=0;o<e.length;o++)!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])}(e[o]);return n}},393:(e,t,n)=>{"use strict";n.d(t,{$j:()=>u,Gb:()=>s,Hc:()=>d,Ny:()=>l,ib:()=>p,im:()=>c,oC:()=>f,zh:()=>a});var r=n(54),o=n(794),i=n(827),a=function(e){var t,n=e[e.currentMode].element;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),n.isEqualNode(t.startContainer)||n.contains(t.startContainer))?t:e[e.currentMode].range?e[e.currentMode].range:(n.focus(),(t=n.ownerDocument.createRange()).setStart(n,0),t.collapse(!0),t)},l=function(e){var t=window.getSelection().getRangeAt(0);if(!e.contains(t.startContainer)&&!(0,i.fb)(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 o=t.startContainer.parentElement;if(!(o&&o.getClientRects().length>0))return{left:0,top:0};n=o.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 l=t.cloneRange();t.selectNode(t.startContainer.childNodes[Math.max(0,t.startOffset-1)]),n=t.getClientRects()[0],t.setEnd(l.endContainer,l.endOffset),t.setStart(l.startContainer,l.startOffset)}else n=t.startContainer.getClientRects()[0];if(!n){for(var s=t.startContainer.childNodes[t.startOffset];!s.getClientRects||s.getClientRects&&0===s.getClientRects().length;)s=s.parentElement;n=s.getClientRects()[0]}}}else n=t.getClientRects()[0];return{left:n.left-r.left,top:n.top-r.top}},s=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)},d=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},c=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(s(t,n)){var o=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?o.setStart(e.childNodes[0].childNodes[0],0):o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),r.start=o.toString().length,r.end=r.start+n.toString().length}return r},u=function(e,t,n){var r=0,o=0,i=n.childNodes[o],a=!1,l=!1;e=Math.max(0,e),t=Math.max(0,t);var s=n.ownerDocument.createRange();for(s.setStart(i||n,0),s.collapse(!0);!l&&i;){var c=r+i.textContent.length;if(!a&&e>=r&&e<=c&&(0===e?s.setStart(i,0):3===i.childNodes[0].nodeType?s.setStart(i.childNodes[0],e-r):i.nextSibling?s.setStartBefore(i.nextSibling):s.setStartAfter(i),a=!0,e===t)){l=!0;break}a&&t>=r&&t<=c&&(0===t?s.setEnd(i,0):3===i.childNodes[0].nodeType?s.setEnd(i.childNodes[0],t-r):i.nextSibling?s.setEndBefore(i.nextSibling):s.setEndAfter(i),l=!0),r=c,i=n.childNodes[++o]}return!l&&n.childNodes[o-1]&&s.setStartBefore(n.childNodes[o-1]),d(s),s},p=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),d(t),(0,o.i7)()&&("EM"===n.previousElementSibling.tagName||"STRONG"===n.previousElementSibling.tagName||"S"===n.previousElementSibling.tagName)&&(t.insertNode(document.createTextNode(r.g.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(),d(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 o=document.createElement("div");o.innerHTML=e;var l=a(t);if(""!==l.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),o.firstElementChild&&"0"===o.firstElementChild.getAttribute("data-block")){o.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var s=(0,i.F9)(l.startContainer);s?s.insertAdjacentHTML("afterend",o.innerHTML):t[t.currentMode].element.insertAdjacentHTML("beforeend",o.innerHTML),p(t[t.currentMode].element,l)}else{var c=document.createElement("template");c.innerHTML=e,l.insertNode(c.content.cloneNode(!0)),l.collapse(!1),d(l)}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.d(r,{default:()=>nG});var e,t=n(872),o=n(54),i=n(51),a=function(e){return"sv"===e.currentMode?(0,i.X)((e.sv.element.textContent+"\n").replace(/\n\n$/,"\n")):"wysiwyg"===e.currentMode?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},l=n(526),s=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return e.prototype.renderEchart=function(e){var t=this;"block"===e.devtools.element.style.display&&(0,l.G)(e.options.cdn+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){t.ASTChart||(t.ASTChart=echarts.init(e.devtools.element.lastElementChild));try{t.element.lastElementChild.style.display="block",t.element.firstElementChild.innerHTML="",t.ASTChart.setOption({series:[{data:JSON.parse(e.lute.RenderEChartsJSON(a(e))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),t.ASTChart.resize()}catch(e){t.element.lastElementChild.style.display="none",t.element.firstElementChild.innerHTML=e}})},e}(),d=n(794),c=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains("vditor-menu--current")&&n.classList.remove("vditor-menu--current")}})},u=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains("vditor-menu--current")&&n.classList.add("vditor-menu--current")}})},p=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains(o.g.CLASS_MENU_DISABLED)&&n.classList.remove(o.g.CLASS_MENU_DISABLED)}})},f=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains(o.g.CLASS_MENU_DISABLED)&&n.classList.add(o.g.CLASS_MENU_DISABLED)}})},m=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="none")})},v=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="block")})},h=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(e){n&&e.isEqualNode(n)||(e.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},g=function(e,t,n,r){n.addEventListener((0,d.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(e){e.classList.remove("vditor-hint--current")}),"block"===t.style.display?t.style.display="none":(h(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},b=n(827),y=n(64),w=function(e,t,n,r){r&&console.log(e+" - "+n+": "+t)},k=n(478),E=n(314),x=n(730),S=n(66),_=n(218),L=n(702),T=n(466),C=n(40),M=n(563),A=n(749),H=n(408),N=function(e,t){if(e){if("html-block"!==e.parentElement.getAttribute("data-type")){var n=e.firstElementChild.className.replace("language-","");"abc"===n?(0,k.Q)(e,t.options.cdn):"mermaid"===n?(0,C.i)(e,t.options.cdn,t.options.theme):"markmap"===n?(0,M.K)(e,t.options.cdn,t.options.theme):"flowchart"===n?(0,S.P)(e,t.options.cdn):"echarts"===n?(0,E.p)(e,t.options.cdn,t.options.theme):"mindmap"===n?(0,A.P)(e,t.options.cdn,t.options.theme):"plantuml"===n?(0,H.B)(e,t.options.cdn):"graphviz"===n?(0,_.v)(e,t.options.cdn):"math"===n?(0,T.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find(function(r){if(r.language===n)return r.render(e,t),!0})||((0,L.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,x.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")}},O=n(393),D=function(e){if("sv"!==e.currentMode){var t=e[e.currentMode].element,n=e.outline.render(e);""===n&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=n,(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})})}},j=function(e,t){var n=(0,b.lG)(e.target,"SPAN");if(n&&(0,b.fb)(n,"vditor-toc")){var r=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(r){if("auto"===t.options.height){var o=r.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(o+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,o)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=r.offsetTop}}},I=function(e,t,n,r){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if("Backspace"===n.key&&0===(0,O.im)(e,t[t.currentMode].element,r).start)return e.previousElementSibling.remove(),ty(t),!0;if(tp(t,n,r,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if("Delete"===n.key&&(0,O.im)(e,t[t.currentMode].element,r).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),ty(t),!0;if(tu(t,n,r,e,e.nextElementSibling))return!0}if("Backspace"===n.key||"Delete"===n.key){var o=(0,b.fb)(r.startContainer,"vditor-toc");if(o)return o.remove(),ty(t),!0}},R=function(e,t,n,r){void 0===n&&(n=!1);var i=(0,b.F9)(t.startContainer);if(i&&!n&&"code-block"!==i.getAttribute("data-type")){if(tg(i.innerHTML)&&i.previousElementSibling||tb(i.innerHTML))return;for(var l=(0,O.im)(i,e.ir.element,t).start,s=!0,d=l-1;d>i.textContent.substr(0,l).lastIndexOf("\n");d--)if(" "!==i.textContent.charAt(d)&&" "!==i.textContent.charAt(d)){s=!1;break}0===l&&(s=!1);var c=!0;for(d=l-1;d<i.textContent.length;d++)if(" "!==i.textContent.charAt(d)&&"\n"!==i.textContent.charAt(d)){c=!1;break}if(s)return void("function"==typeof e.options.input&&e.options.input(a(e)));if(c&&!(0,b.fb)(t.startContainer,"vditor-ir__marker")){var u=t.startContainer.previousSibling;return u&&3!==u.nodeType&&u.classList.contains("vditor-ir__node--expand")&&u.classList.remove("vditor-ir__node--expand"),void("function"==typeof e.options.input&&e.options.input(a(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")}),i||(i=e.ir.element),!i.querySelector("wbr")){var p=(0,b.fb)(t.startContainer,"vditor-ir__preview");p?p.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),"link-ref-defs-block"===i.getAttribute("data-type")&&(i=e.ir.element);var f,m=i.isEqualNode(e.ir.element),v=(0,b.a1)(i,"data-type","footnotes-block"),h="";if(m)h=i.innerHTML;else{var g=(0,y.S)(t.startContainer,"BLOCKQUOTE"),k=(0,b.O9)(t.startContainer);if(k&&(i=k),g&&(!k||k&&!g.contains(k))&&(i=g),v&&(i=v),h=i.outerHTML,"UL"===i.tagName||"OL"===i.tagName){var E=i.previousElementSibling,x=i.nextElementSibling;E&&("UL"===E.tagName||"OL"===E.tagName)&&(h=E.outerHTML+h,E.remove()),x&&("UL"===x.tagName||"OL"===x.tagName)&&(h+=x.outerHTML,x.remove()),h=h.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else i.previousElementSibling&&""!==i.previousElementSibling.textContent.replace(o.g.ZWSP,"")&&r&&"insertParagraph"===r.inputType&&(h=i.previousElementSibling.outerHTML+h,i.previousElementSibling.remove());i.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!i.isEqualNode(e)&&(h+=e.outerHTML,e.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!i.isEqualNode(e)&&(h+=e.outerHTML,e.remove())}))}if(w("SpinVditorIRDOM",h,"argument",e.options.debugger),w("SpinVditorIRDOM",h=e.lute.SpinVditorIRDOM(h),"result",e.options.debugger),m)i.innerHTML=h;else if(i.outerHTML=h,v){var S=(0,b.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(S){var _=S.textContent,L=_.substring(1,_.indexOf("]:")),T=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+L+'"]');T&&T.setAttribute("aria-label",_.substr(L.length+3).trim().substr(0,24))}}var C,M=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");M.forEach(function(e,t){0===t?f=e:(f.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),M.length>0&&e.ir.element.insertAdjacentElement("beforeend",M[0]);var A=e.ir.element.querySelectorAll("[data-type='footnotes-block']");A.forEach(function(e,t){0===t?C=e:(C.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),A.length>0&&e.ir.element.insertAdjacentElement("beforeend",A[0]),(0,O.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){N(t,e)}),D(e),tR(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},P=function(e,t){if(""===e)return!1;if(-1===e.indexOf("⇧")&&-1===e.indexOf("⌘")&&-1===e.indexOf("⌥"))return!((0,d.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if("⇧Tab"===e)return!((0,d.yl)(t)||t.altKey||!t.shiftKey||"Tab"!==t.code);var n=e.split("");if(e.startsWith("⌥")){var r=3===n.length?n[2]:n[1];return!((3===n.length?!(0,d.yl)(t):(0,d.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(r)?"Digit":"Key")+r)}"⌘Enter"===e&&(n=["⌘","Enter"]);var o=n.length>2&&"⇧"===n[0],i=o?n[2]:n[1];return!o||!(0,d.vU)()&&/Mac/.test(navigator.platform)||("-"===i?i="_":"="===i&&(i="+")),!(!(0,d.yl)(t)||t.key.toLowerCase()!==i.toLowerCase()||t.altKey||!(!o&&!t.shiftKey||o&&t.shiftKey))},q=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")});var n=(0,b.JQ)(e.startContainer,"vditor-ir__node"),r=!e.collapsed&&(0,b.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===r){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,O.Hc)(e));var o,i,a,l=function(e){var t=e.startContainer;if(3===t.nodeType&&t.nodeValue.length!==e.startOffset)return!1;for(var n=t.nextSibling;n&&""===n.textContent;)n=n.nextSibling;if(!n){var r=(0,b.fb)(t,"vditor-ir__marker");if(r&&!r.nextSibling){var o=t.parentElement.parentElement.nextSibling;if(o&&3!==o.nodeType&&o.classList.contains("vditor-ir__node"))return o}return!1}return!(!n||3===n.nodeType||!n.classList.contains("vditor-ir__node")||n.getAttribute("data-block"))&&n}(e);if(l)return l.classList.add("vditor-ir__node--expand"),void l.classList.remove("vditor-ir__node--hidden");var s=(a=(i=(o=e).startContainer).previousSibling,!(3!==i.nodeType||0!==o.startOffset||!a||3===a.nodeType||!a.classList.contains("vditor-ir__node")||a.getAttribute("data-block"))&&a);return s?(s.classList.add("vditor-ir__node--expand"),void s.classList.remove("vditor-ir__node--hidden")):void 0}},B=n(863),z=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(e){for(var n=e.parentElement,r=n.nextSibling;r&&r.textContent.startsWith(" ");){var o=r;o.childNodes.forEach(function(e){n.append(e.cloneNode(!0))}),r=r.nextSibling,o.remove()}t&&t(n)})},U=function(e,t){var n,r=getSelection().getRangeAt(0).cloneRange(),o=r.startContainer;3!==r.startContainer.nodeType&&"DIV"===r.startContainer.tagName&&(o=r.startContainer.childNodes[r.startOffset-1]);var i=(0,b.a1)(o,"data-block","0");if(i&&t&&("deleteContentBackward"===t.inputType||" "===t.data)){for(var a=(0,O.im)(i,e.sv.element,r).start,l=!0,s=a-1;s>i.textContent.substr(0,a).lastIndexOf("\n");s--)if(" "!==i.textContent.charAt(s)&&" "!==i.textContent.charAt(s)){l=!1;break}if(0===a&&(l=!1),l)return void e5(e);if("deleteContentBackward"===t.inputType){var d,c=(0,b.a1)(o,"data-type","code-block-open-marker")||(0,b.a1)(o,"data-type","code-block-close-marker");if(c&&("code-block-close-marker"===c.getAttribute("data-type")&&(d=e1(o,"code-block-open-marker"))||"code-block-open-marker"===c.getAttribute("data-type")&&(d=e1(o,"code-block-close-marker",!1))))return d.textContent=c.textContent,void e5(e);var u=(0,b.a1)(o,"data-type","math-block-open-marker");if(u){var p=u.nextElementSibling.nextElementSibling;return void(p&&"math-block-close-marker"===p.getAttribute("data-type")&&(p.remove(),e5(e)))}i.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()}),i.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()});var f=(0,b.a1)(o,"data-type","heading-marker");if(f&&-1===f.textContent.indexOf("#"))return void e5(e)}if((" "===t.data||"deleteContentBackward"===t.inputType)&&((0,b.a1)(o,"data-type","padding")||(0,b.a1)(o,"data-type","li-marker")||(0,b.a1)(o,"data-type","task-marker")||(0,b.a1)(o,"data-type","blockquote-marker")))return void e5(e)}if(i&&"$$"===i.textContent.trimRight())e5(e);else{i||(i=e.sv.element),"link-ref-defs-block"===(null===(n=i.firstElementChild)||void 0===n?void 0:n.getAttribute("data-type"))&&(i=e.sv.element),(0,b.a1)(o,"data-type","footnotes-link")&&(i=e.sv.element),-1===i.textContent.indexOf(Lute.Caret)&&r.insertNode(document.createTextNode(Lute.Caret)),i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),i.querySelectorAll("font").forEach(function(e){e.outerHTML=e.innerHTML});var m=i.textContent,v=i.isEqualNode(e.sv.element);if(v)m=i.textContent;else{i.previousElementSibling&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove()),i.previousElementSibling&&0===m.indexOf("---\n")&&(m=i.previousElementSibling.textContent+m,i.previousElementSibling.remove());var h="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(e,t){e&&!i.isEqualNode(e.parentElement)&&(h+=e.parentElement.textContent+"\n",e.parentElement.remove())}),m=h+m}m=e2(m,e),v?i.innerHTML=m:i.outerHTML=m,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(t){e.sv.element.insertAdjacentElement("beforeend",t.parentElement)}),z(e.sv.element,function(t){e.sv.element.insertAdjacentElement("beforeend",t)}),(0,O.ib)(e.sv.element,r),eY(e),e5(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},V=n(227),W=function(e){"dark"===e.options.theme?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},G=function(e){var t=window.innerWidth<=o.g.MOBILE_WIDTH?10:35;if("none"!==e.wysiwyg.element.parentElement.style.display){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px "+Math.max(t,n)+"px"}"none"!==e.ir.element.parentElement.style.display&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px "+Math.max(t,n)+"px"),"block"!==e.preview.element.style.display?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+("left"===e.options.outline.position?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+("left"===e.options.outline.position?e.outline.element.offsetWidth:0)+"px"},F=function(e){if(e.options.typewriterMode){var t=window.innerHeight;"number"==typeof e.options.height?(t=e.options.height,"number"==typeof e.options.minHeight&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}};function K(){window.removeEventListener("resize",e)}var Z,J,X,Y,Q,$,ee,et,en,er,eo,ei,ea,el,es,ed,ec,eu,ep,ef,em,ev,eh,eg,eb=function(t){F(t),K(),window.addEventListener("resize",e=function(){G(t),F(t)});var n=(0,d.pK)()&&localStorage.getItem(t.options.cache.id);return t.options.cache.enable&&n||(t.options.value?n=t.options.value:t.originalInnerHTML?n=t.lute.HTML2Md(t.originalInnerHTML):t.options.cache.enable||(n="")),n||""},ey=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&(0,O.Gb)(e[e.currentMode].element)){c(e.toolbar.elements,o.g.EDIT_TOOLBARS),p(e.toolbar.elements,o.g.EDIT_TOOLBARS);var t=(0,O.zh)(e),n=t.startContainer;3===t.startContainer.nodeType&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),("sv"===e.currentMode?(0,b.a1)(n,"data-type","heading"):(0,y.W)(n))&&u(e.toolbar.elements,["headings"]),("sv"===e.currentMode?(0,b.a1)(n,"data-type","blockquote"):(0,b.lG)(n,"BLOCKQUOTE"))&&u(e.toolbar.elements,["quote"]),(0,b.a1)(n,"data-type","strong")&&u(e.toolbar.elements,["bold"]),(0,b.a1)(n,"data-type","em")&&u(e.toolbar.elements,["italic"]),(0,b.a1)(n,"data-type","s")&&u(e.toolbar.elements,["strike"]),(0,b.a1)(n,"data-type","a")&&u(e.toolbar.elements,["link"]);var r=(0,b.lG)(n,"LI");r?(r.classList.contains("vditor-task")?u(e.toolbar.elements,["check"]):"OL"===r.parentElement.tagName?u(e.toolbar.elements,["ordered-list"]):"UL"===r.parentElement.tagName&&u(e.toolbar.elements,["list"]),p(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,b.a1)(n,"data-type","code-block")&&(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),u(e.toolbar.elements,["code"])),(0,b.a1)(n,"data-type","code")&&(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),u(e.toolbar.elements,["inline-code"])),(0,b.a1)(n,"data-type","table")&&f(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},ew=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,d.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},ek=function(e){for(var t="",n=e.nextSibling;n;)3===n.nodeType?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},eE=function(e){for(var t="",n=e.previousSibling;n;)t=3===n.nodeType?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},ex=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(3===n.nodeType){var r=document.createElement("p");r.setAttribute("data-block","0"),r.textContent=n.textContent;var o=3===t.startContainer.nodeType?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(r,n),n.remove(),t.setStart(r.firstChild,Math.min(r.firstChild.textContent.length,o)),t.collapse(!0),(0,O.Hc)(t),!0}if(!n.getAttribute("data-block"))return"P"===n.tagName?n.remove():("DIV"===n.tagName?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>"):"BR"===n.tagName?n.outerHTML='<p data-block="0">'+n.outerHTML+"<wbr></p>":(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.outerHTML+"</p>"),(0,O.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},eS=function(e,t){var n=(0,O.zh)(e),r=(0,b.F9)(n.startContainer);r||(r=n.startContainer.childNodes[n.startOffset]),r||0!==e.wysiwyg.element.children.length||(r=e.wysiwyg.element),r&&!r.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),"<wbr>"===r.innerHTML.trim()&&(r.innerHTML="<wbr><br>"),"BLOCKQUOTE"===r.tagName||r.classList.contains("vditor-reset")?r.innerHTML="<"+t+' data-block="0">'+r.innerHTML.trim()+"</"+t+">":r.outerHTML="<"+t+' data-block="0">'+r.innerHTML.trim()+"</"+t+">",(0,O.ib)(e.wysiwyg.element,n),D(e))},e_=function(e){var t=getSelection().getRangeAt(0),n=(0,b.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>",(0,O.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},eL=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling,o=r.ownerDocument.createRange();"CODE"===r.tagName?(r.style.display="inline-block",n?o.setStart(r.firstChild,1):o.selectNodeContents(r)):(r.style.display="block",r.firstChild.firstChild||r.firstChild.appendChild(document.createTextNode("")),o.selectNodeContents(r.firstChild)),n?o.collapse(!0):o.collapse(!1),(0,O.Hc)(o),e.firstElementChild.classList.contains("language-mindmap")||eY(t)},eT=function(e,t){if(P("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},eC=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e.wysiwyg.element.getAttribute("contenteditable")&&(0,O.Gb)(e.wysiwyg.element)){c(e.toolbar.elements,o.g.EDIT_TOOLBARS),p(e.toolbar.elements,o.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=3===t.startContainer.nodeType?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var r=(0,b.a1)(n,"data-type","footnotes-block");if(r)return e.wysiwyg.popover.innerHTML="",eO(r,e),void eM(e,r);var i=(0,b.lG)(n,"LI");i?(i.classList.contains("vditor-task")?u(e.toolbar.elements,["check"]):"OL"===i.parentElement.tagName?u(e.toolbar.elements,["ordered-list"]):"UL"===i.parentElement.tagName&&u(e.toolbar.elements,["list"]),p(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,b.lG)(n,"BLOCKQUOTE")&&u(e.toolbar.elements,["quote"]),((0,b.lG)(n,"B")||(0,b.lG)(n,"STRONG"))&&u(e.toolbar.elements,["bold"]),((0,b.lG)(n,"I")||(0,b.lG)(n,"EM"))&&u(e.toolbar.elements,["italic"]),((0,b.lG)(n,"STRIKE")||(0,b.lG)(n,"S"))&&u(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(e){e.classList.remove("vditor-comment--focus")});var l=(0,b.fb)(n,"vditor-comment");if(l){var s=l.getAttribute("data-cmtids").split(" ");if(s.length>1&&l.nextSibling.isSameNode(l.nextElementSibling)){var m=l.nextElementSibling.getAttribute("data-cmtids").split(" ");s.find(function(e){if(m.includes(e))return s=[e],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){e.getAttribute("data-cmtids").indexOf(s[0])>-1&&e.classList.add("vditor-comment--focus")})}var v=(0,b.lG)(n,"A");v&&u(e.toolbar.elements,["link"]);var h=(0,b.lG)(n,"TABLE"),g=(0,y.W)(n);(0,b.lG)(n,"CODE")?(0,b.lG)(n,"PRE")?(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),u(e.toolbar.elements,["code"])):(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),u(e.toolbar.elements,["inline-code"])):g?(f(e.toolbar.elements,["bold"]),u(e.toolbar.elements,["headings"])):h&&f(e.toolbar.elements,["table"]);var w=(0,b.fb)(n,"vditor-toc");if(w)return e.wysiwyg.popover.innerHTML="",eO(w,e),void eM(e,w);var k=(0,y.S)(n,"BLOCKQUOTE");if(k&&(e.wysiwyg.popover.innerHTML="",eH(t,k,e),eN(t,k,e),eO(k,e),eM(e,k)),i&&(e.wysiwyg.popover.innerHTML="",eH(t,i,e),eN(t,i,e),eO(i,e),eM(e,i)),h){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var E=function(){var t=h.rows.length,n=h.rows[0].cells.length,r=parseInt(P.value,10)||t,o=parseInt(B.value,10)||n;if(r!==t||n!==o){if(n!==o)for(var i=o-n,l=0;l<h.rows.length;l++)if(i>0)for(var s=0;s<i;s++)0===l?h.rows[l].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):h.rows[l].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var d=n-1;d>=o;d--)h.rows[l].cells[d].remove();if(t!==r){var c=r-t;if(c>0){for(var u="<tr>",p=0;p<o;p++)u+="<td> </td>";for(var f=0;f<c;f++)h.querySelector("tbody")?h.querySelector("tbody").insertAdjacentHTML("beforeend",u):h.querySelector("thead").insertAdjacentHTML("afterend",u+"</tr>")}else for(p=t-1;p>=r;p--)h.rows[p].remove(),1===h.rows.length&&h.querySelector("tbody").remove()}"function"==typeof e.options.input&&e.options.input(a(e))}},x=function(n){th(h,n),"right"===n?(T.classList.remove("vditor-icon--current"),C.classList.remove("vditor-icon--current"),M.classList.add("vditor-icon--current")):"center"===n?(T.classList.remove("vditor-icon--current"),M.classList.remove("vditor-icon--current"),C.classList.add("vditor-icon--current")):(C.classList.remove("vditor-icon--current"),M.classList.remove("vditor-icon--current"),T.classList.add("vditor-icon--current")),(0,O.Hc)(t),ew(e)},S=(0,b.lG)(n,"TD"),_=(0,b.lG)(n,"TH"),L="left";S?L=S.getAttribute("align")||"left":_&&(L=_.getAttribute("align")||"center");var T=document.createElement("button");T.setAttribute("type","button"),T.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,d.ns)("⇧⌘L")+">"),T.setAttribute("data-type","left"),T.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',T.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("left"===L?" vditor-icon--current":""),T.onclick=function(){x("left")};var C=document.createElement("button");C.setAttribute("type","button"),C.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,d.ns)("⇧⌘C")+">"),C.setAttribute("data-type","center"),C.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',C.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("center"===L?" vditor-icon--current":""),C.onclick=function(){x("center")};var M=document.createElement("button");M.setAttribute("type","button"),M.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,d.ns)("⇧⌘R")+">"),M.setAttribute("data-type","right"),M.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',M.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("right"===L?" vditor-icon--current":""),M.onclick=function(){x("right")};var A=document.createElement("button");A.setAttribute("type","button"),A.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,d.ns)("⌘=")+">"),A.setAttribute("data-type","insertRow"),A.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',A.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",A.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&tx(e,t,r)};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,d.ns)("⇧⌘F")+">"),H.setAttribute("data-type","insertRow"),H.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",H.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&tS(e,t,r)};var D=document.createElement("button");D.setAttribute("type","button"),D.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,d.ns)("⇧⌘=")+">"),D.setAttribute("data-type","insertColumn"),D.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',D.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",D.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,b.lG)(t,"TD")||(0,b.lG)(t,"TH");n&&t_(e,h,n)};var j=document.createElement("button");j.setAttribute("type","button"),j.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,d.ns)("⇧⌘G")+">"),j.setAttribute("data-type","insertColumn"),j.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',j.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",j.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,b.lG)(t,"TD")||(0,b.lG)(t,"TH");n&&t_(e,h,n,"beforebegin")};var I=document.createElement("button");I.setAttribute("type","button"),I.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,d.ns)("⌘-")+">"),I.setAttribute("data-type","deleteRow"),I.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',I.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",I.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&tL(e,t,r)};var R=document.createElement("button");R.setAttribute("type","button"),R.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,d.ns)("⇧⌘-")+">"),R.setAttribute("data-type","deleteColumn"),R.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',R.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",R.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,b.lG)(n,"TD")||(0,b.lG)(n,"TH");r&&tT(e,t,h,r)},(J=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),J.className="vditor-tooltipped vditor-tooltipped__n";var P=document.createElement("input");J.appendChild(P),P.type="number",P.min="1",P.className="vditor-input",P.style.width="42px",P.style.textAlign="center",P.setAttribute("placeholder",window.VditorI18n.row),P.value=h.rows.length.toString(),P.oninput=function(){E()},P.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(B.focus(),B.select(),void n.preventDefault()):void(eT(e,n)||eI(n,t))};var q=document.createElement("span");q.setAttribute("aria-label",window.VditorI18n.column),q.className="vditor-tooltipped vditor-tooltipped__n";var B=document.createElement("input");q.appendChild(B),B.type="number",B.min="1",B.className="vditor-input",B.style.width="42px",B.style.textAlign="center",B.setAttribute("placeholder",window.VditorI18n.column),B.value=h.rows[0].cells.length.toString(),B.oninput=function(){E()},B.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(P.focus(),P.select(),void n.preventDefault()):void(eT(e,n)||eI(n,t))},eH(t,h,e),eN(t,h,e),eO(h,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",T),e.wysiwyg.popover.insertAdjacentElement("beforeend",C),e.wysiwyg.popover.insertAdjacentElement("beforeend",M),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",A),e.wysiwyg.popover.insertAdjacentElement("beforeend",j),e.wysiwyg.popover.insertAdjacentElement("beforeend",D),e.wysiwyg.popover.insertAdjacentElement("beforeend",I),e.wysiwyg.popover.insertAdjacentElement("beforeend",R),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",q),eM(e,h)}var z=(0,b.a1)(n,"data-type","link-ref");z&&eA(e,z,t);var U=(0,b.a1)(n,"data-type","footnotes-ref");if(U){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(J=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,d.ns)("⌥Enter")+">"),J.className="vditor-tooltipped vditor-tooltipped__n";var V=document.createElement("input");J.appendChild(V),V.className="vditor-input",V.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,d.ns)("⌥Enter")+">"),V.style.width="120px",V.value=U.getAttribute("data-footnotes-label"),V.oninput=function(){""!==V.value.trim()&&U.setAttribute("data-footnotes-label",V.value),"function"==typeof e.options.input&&e.options.input(a(e))},V.onkeydown=function(n){n.isComposing||eT(e,n)||eI(n,t)},eO(U,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),eM(e,U)}var W=(0,b.fb)(n,"vditor-wysiwyg__block"),G=!!W&&W.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){(!W||W&&G&&!W.contains(e))&&(e.previousElementSibling.style.display="none")}),W&&G){if(e.wysiwyg.popover.innerHTML="",eH(t,W,e),eN(t,W,e),eO(W,e),"code-block"===W.getAttribute("data-type")){var F=document.createElement("span");F.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,d.ns)("⌥Enter")+">"),F.className="vditor-tooltipped vditor-tooltipped__n";var K=document.createElement("input");F.appendChild(K);var Z=W.firstElementChild.firstElementChild;K.className="vditor-input",K.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,d.ns)("⌥Enter")+">"),K.value=Z.className.indexOf("language-")>-1?Z.className.split("-")[1].split(" ")[0]:"",K.oninput=function(n){""!==K.value.trim()?Z.className="language-"+K.value:(Z.className="",e.hint.recentLanguage=""),W.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(W.lastElementChild.innerHTML=W.firstElementChild.innerHTML,N(W.lastElementChild,e)),ew(e),1===n.detail&&(t.setStart(Z.firstChild,0),t.collapse(!0),(0,O.Hc)(t))},K.onkeydown=function(n){if(!n.isComposing&&!eT(e,n)){if("Escape"===n.key&&"block"===e.hint.element.style.display)return e.hint.element.style.display="none",void n.preventDefault();e.hint.select(n,e),eI(n,t)}},K.onkeyup=function(t){if(!t.isComposing&&"Enter"!==t.key&&"ArrowUp"!==t.key&&"Escape"!==t.key&&"ArrowDown"!==t.key){var n=[],r=K.value.substring(0,K.selectionStart);(e.options.preview.hljs.langs||o.g.CODE_LANGUAGES).forEach(function(e){e.indexOf(r.toLowerCase())>-1&&n.push({html:e,value:e})}),e.hint.genHTML(n,r,e),t.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",F)}eM(e,W)}else W=void 0;if(g){e.wysiwyg.popover.innerHTML="",(J=document.createElement("span")).setAttribute("aria-label","ID<"+(0,d.ns)("⌥Enter")+">"),J.className="vditor-tooltipped vditor-tooltipped__n";var J,X=document.createElement("input");J.appendChild(X),X.className="vditor-input",X.setAttribute("placeholder","ID<"+(0,d.ns)("⌥Enter")+">"),X.style.width="120px",X.value=g.getAttribute("data-id")||"",X.oninput=function(){g.setAttribute("data-id",X.value),"function"==typeof e.options.input&&e.options.input(a(e))},X.onkeydown=function(n){n.isComposing||eT(e,n)||eI(n,t)},eH(t,g,e),eN(t,g,e),eO(g,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),eM(e,g)}if(v&&ej(e,v,t),!(k||i||h||W||v||z||U||g||w)){var Y=(0,b.a1)(n,"data-block","0");Y&&Y.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",eH(t,Y,e),eN(t,Y,e),eO(Y,e),eM(e,Y)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(e){e.style.display="none"});var Q=(0,b.a1)(t.startContainer,"data-type","backslash");Q&&(Q.querySelector("span").style.display="inline")}},200)},eM=function(e,t){var n=t,r=(0,b.lG)(t,"TABLE");r&&(n=r),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},eA=function(e,t,n){void 0===n&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&("IMG"===t.tagName?t.setAttribute("alt",i.value):t.textContent=i.value),""!==s.value.trim()&&t.setAttribute("data-link-label",s.value),"function"==typeof e.options.input&&e.options.input(a(e))},o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.getAttribute("alt")||t.textContent,i.oninput=function(){r()},i.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,s)};var l=document.createElement("span");l.setAttribute("aria-label",window.VditorI18n.linkRef),l.className="vditor-tooltipped vditor-tooltipped__n";var s=document.createElement("input");l.appendChild(s),s.className="vditor-input",s.setAttribute("placeholder",window.VditorI18n.linkRef),s.value=t.getAttribute("data-link-label"),s.oninput=function(){r()},s.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,i)},eO(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",l),eM(e,t)},eH=function(e,t,n){var r=t.previousElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","up"),o.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,d.ns)("⇧⌘U")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,O.ib)(n.wysiwyg.element,e),ew(n),eC(n),eY(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},eN=function(e,t,n){var r=t.nextElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var o=document.createElement("button");o.setAttribute("type","button"),o.setAttribute("data-type","down"),o.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,d.ns)("⇧⌘D")+">"),o.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',o.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",o.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,O.ib)(n.wysiwyg.element,e),ew(n),eC(n),eY(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",o)}},eO=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,d.ns)("⇧⌘X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var n=(0,O.zh)(t);n.setStartAfter(e),(0,O.Hc)(n),e.remove(),ew(t),eC(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&D(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},eD=function(e,t,n,r){if(!n.isComposing){if("Tab"===n.key)return r.focus(),r.select(),void n.preventDefault();if(!(0,d.yl)(n)&&!n.shiftKey&&n.altKey&&"Enter"===n.key){var i=(0,O.zh)(e);t.insertAdjacentHTML("afterend",o.g.ZWSP),i.setStartAfter(t.nextSibling),i.collapse(!0),(0,O.Hc)(i),n.preventDefault()}}},ej=function(e,t,n){e.wysiwyg.popover.innerHTML="";var r=function(){""!==i.value.trim()&&(t.innerHTML=i.value),t.setAttribute("href",l.value),t.setAttribute("title",d.value),ew(e)};t.querySelectorAll("[data-marker]").forEach(function(e){e.removeAttribute("data-marker")});var o=document.createElement("span");o.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),o.className="vditor-tooltipped vditor-tooltipped__n";var i=document.createElement("input");o.appendChild(i),i.className="vditor-input",i.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),i.style.width="120px",i.value=t.innerHTML||"",i.oninput=function(){r()},i.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.link),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.link),l.value=t.getAttribute("href")||"",l.oninput=function(){r()},l.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,d)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.tooltipText),s.className="vditor-tooltipped vditor-tooltipped__n";var d=document.createElement("input");s.appendChild(d),d.className="vditor-input",d.setAttribute("placeholder",window.VditorI18n.tooltipText),d.style.width="60px",d.value=t.getAttribute("title")||"",d.oninput=function(){r()},d.onkeydown=function(r){eT(e,r)||eI(r,n)||eD(e,t,r,i)},eO(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",o),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),eM(e,t)},eI=function(e,t){if(!(0,d.yl)(e)&&!e.shiftKey&&"Enter"===e.key||"Escape"===e.key)return t&&(0,O.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},eR=function(e){"wysiwyg"===e.currentMode?eC(e):"ir"===e.currentMode&&ey(e)},eP=function(e,t,n){void 0===n&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var r=e.wysiwyg.element;r.innerHTML=e.lute.Md2VditorDOM(t),r.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){N(t,e),t.previousElementSibling.setAttribute("style","display:none")}),ew(e,n)},eq=function(e,t,n){for(var r,i,a,l,s,d,c,u=e.startContainer.parentElement,p=!1,f="",m="",v=(i=eE((r=e).startContainer),a=ek(r.startContainer),l=r.startContainer.textContent,s=r.startOffset,d="",c="",(""!==l.substr(0,s)&&l.substr(0,s)!==o.g.ZWSP||i)&&(d=""+i+l.substr(0,s)),(""!==l.substr(s)&&l.substr(s)!==o.g.ZWSP||a)&&(c=""+l.substr(s)+a),{afterHTML:c,beforeHTML:d}),h=v.beforeHTML,g=v.afterHTML;u&&!p;){var b=u.tagName;if("STRIKE"===b&&(b="S"),"I"===b&&(b="EM"),"B"===b&&(b="STRONG"),"S"===b||"STRONG"===b||"EM"===b){var y="",w="",k="";"0"!==u.parentElement.getAttribute("data-block")&&(w=eE(u),k=ek(u)),(h||w)&&(h=y=w+"<"+b+">"+h+"</"+b+">"),("bold"===n&&"STRONG"===b||"italic"===n&&"EM"===b||"strikeThrough"===n&&"S"===b)&&(y+=""+f+o.g.ZWSP+"<wbr>"+m,p=!0),(g||k)&&(y+=g="<"+b+">"+g+"</"+b+">"+k),"0"!==u.parentElement.getAttribute("data-block")?(u=u.parentElement).innerHTML=y:(u.outerHTML=y,u=u.parentElement),f="<"+b+">"+f,m="</"+b+">"+m}else p=!0}(0,O.ib)(t.wysiwyg.element,e)},eB=function(e,t){var n,r=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var i=t.hotkey?" <"+(0,d.ns)(t.hotkey)+">":"";2===t.level&&(i=t.hotkey?" &lt;"+(0,d.ns)(t.hotkey)+"&gt;":"");var a=t.tip?t.tip+i:""+window.VditorI18n[t.name]+i,l="upload"===t.name?"div":"button";if(2===t.level)this.element.innerHTML="<"+l+' data-type="'+t.name+'">'+a+"</"+l+">";else{this.element.classList.add("vditor-toolbar__item");var s=document.createElement(l);s.setAttribute("data-type",t.name),s.className="vditor-tooltipped vditor-tooltipped__"+t.tipPosition,s.setAttribute("aria-label",a),s.innerHTML=t.icon,this.element.appendChild(s)}t.prefix&&this.element.children[0].addEventListener((0,d.Le)(),function(n){n.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||("wysiwyg"===e.currentMode?function(e,t,n){if(!(e.wysiwyg.composingLock&&n instanceof CustomEvent)){var r=!0,i=!0;e.wysiwyg.element.querySelector("wbr")&&e.wysiwyg.element.querySelector("wbr").remove();var a=(0,O.zh)(e),l=t.getAttribute("data-type");if(t.classList.contains("vditor-menu--current")){if("strike"===l&&(l="strikeThrough"),"quote"===l){var s=(0,b.lG)(a.startContainer,"BLOCKQUOTE");s||(s=a.startContainer.childNodes[a.startOffset]),s&&(r=!1,t.classList.remove("vditor-menu--current"),a.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'+s.innerHTML+"</p>":s.innerHTML,(0,O.ib)(e.wysiwyg.element,a))}else if("inline-code"===l){var d=(0,b.lG)(a.startContainer,"CODE");d||(d=a.startContainer.childNodes[a.startOffset]),d&&(d.outerHTML=d.innerHTML.replace(o.g.ZWSP,"")+"<wbr>",(0,O.ib)(e.wysiwyg.element,a))}else"link"===l?(a.collapsed&&a.selectNode(a.startContainer.parentElement),document.execCommand("unlink",!1,"")):"check"===l||"list"===l||"ordered-list"===l?(tf(e,a,l),(0,O.ib)(e.wysiwyg.element,a),r=!1,t.classList.remove("vditor-menu--current")):(r=!1,t.classList.remove("vditor-menu--current"),""===a.toString()?eq(a,e,l):document.execCommand(l,!1,""))}else{0===e.wysiwyg.element.childNodes.length&&(e.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,O.ib)(e.wysiwyg.element,a));var u=(0,b.F9)(a.startContainer);if("quote"===l){if(u||(u=a.startContainer.childNodes[a.startOffset]),u){r=!1,t.classList.add("vditor-menu--current"),a.insertNode(document.createElement("wbr"));var p=(0,b.lG)(a.startContainer,"LI");p&&u.contains(p)?p.innerHTML='<blockquote data-block="0">'+p.innerHTML+"</blockquote>":u.outerHTML='<blockquote data-block="0">'+u.outerHTML+"</blockquote>",(0,O.ib)(e.wysiwyg.element,a)}}else if("check"===l||"list"===l||"ordered-list"===l)tf(e,a,l,!1),(0,O.ib)(e.wysiwyg.element,a),r=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current");else if("inline-code"===l){if(""===a.toString())(f=document.createElement("code")).textContent=o.g.ZWSP,a.insertNode(f),a.setStart(f.firstChild,1),a.collapse(!0),(0,O.Hc)(a);else if(3===a.startContainer.nodeType){var f=document.createElement("code");a.surroundContents(f),a.insertNode(f),(0,O.Hc)(a)}t.classList.add("vditor-menu--current")}else if("code"===l)(f=document.createElement("div")).className="vditor-wysiwyg__block",f.setAttribute("data-type","code-block"),f.setAttribute("data-block","0"),f.setAttribute("data-marker","```"),""===a.toString()?f.innerHTML="<pre><code><wbr>\n</code></pre>":(f.innerHTML="<pre><code>"+a.toString()+"<wbr></code></pre>",a.deleteContents()),a.insertNode(f),u&&(u.outerHTML=e.lute.SpinVditorDOM(u.outerHTML)),(0,O.ib)(e.wysiwyg.element,a),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){N(t,e)}),t.classList.add("vditor-menu--disabled");else if("link"===l){if(""===a.toString()){var m=document.createElement("a");m.innerText=o.g.ZWSP,a.insertNode(m),a.setStart(m.firstChild,1),a.collapse(!0),ej(e,m,a);var v=e.wysiwyg.popover.querySelector("input");v.value="",v.focus(),i=!1}else{(f=document.createElement("a")).setAttribute("href",""),f.innerHTML=a.toString(),a.surroundContents(f),a.insertNode(f),(0,O.Hc)(a),ej(e,f,a);var h=e.wysiwyg.popover.querySelectorAll("input");h[0].value=f.innerText,h[1].focus()}r=!1,t.classList.add("vditor-menu--current")}else if("table"===l){var g='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(""===a.toString().trim())u&&""===u.innerHTML.trim().replace(o.g.ZWSP,"")?u.outerHTML=g:document.execCommand("insertHTML",!1,g),a.selectNode(e.wysiwyg.element.querySelector("wbr").previousSibling),e.wysiwyg.element.querySelector("wbr").remove(),(0,O.Hc)(a);else{g='<table data-block="0"><thead><tr>';var y=a.toString().split("\n"),w=y[0].split(",").length>y[0].split(" ").length?",":" ";y.forEach(function(e,t){0===t?(e.split(w).forEach(function(e,t){g+=0===t?"<th>"+e+"<wbr></th>":"<th>"+e+"</th>"}),g+="</tr></thead>"):(g+=1===t?"<tbody><tr>":"<tr>",e.split(w).forEach(function(e){g+="<td>"+e+"</td>"}),g+="</tr>")}),g+="</tbody></table>",document.execCommand("insertHTML",!1,g),(0,O.ib)(e.wysiwyg.element,a)}r=!1,t.classList.add("vditor-menu--disabled")}else if("line"===l){if(u){var k='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===u.innerHTML.trim()?u.outerHTML=k:u.insertAdjacentHTML("afterend",k),(0,O.ib)(e.wysiwyg.element,a)}}else if(r=!1,t.classList.add("vditor-menu--current"),"strike"===l&&(l="strikeThrough"),""!==a.toString()||"bold"!==l&&"italic"!==l&&"strikeThrough"!==l)document.execCommand(l,!1,"");else{var E="strong";"italic"===l?E="em":"strikeThrough"===l&&(E="s"),(f=document.createElement(E)).textContent=o.g.ZWSP,a.insertNode(f),f.previousSibling&&f.previousSibling.textContent===o.g.ZWSP&&(f.previousSibling.textContent=""),a.setStart(f.firstChild,1),a.collapse(!0),(0,O.Hc)(a)}}r&&eC(e),i&&ew(e)}}(e,r.element.children[0],n):"ir"===e.currentMode?tB(e,r.element.children[0],t.prefix||"",t.suffix||""):e6(e,r.element.children[0],t.prefix||"",t.suffix||""))})},ez=(eh=function(e,t){return(eh=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}eh(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),eU=function(e,t,n){var r;if("string"!=typeof n?(h(e,["subToolbar","hint"]),n.preventDefault(),r=a(e)):r=n,e.currentMode!==t||"string"==typeof n){if(e.devtools&&e.devtools.renderEchart(e),"both"===e.options.preview.mode&&"sv"===t?e.preview.element.style.display="block":e.preview.element.style.display="none",p(e.toolbar.elements,o.g.EDIT_TOOLBARS),c(e.toolbar.elements,o.g.EDIT_TOOLBARS),f(e.toolbar.elements,["outdent","indent"]),"ir"===t)m(e.toolbar.elements,["both"]),v(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(r),tR(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),G(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){N(t,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})});else if("wysiwyg"===t)m(e.toolbar.elements,["both"]),v(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",G(e),eP(e,r,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if("sv"===t){v(e.toolbar.elements,["both"]),m(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",("both"===e.options.preview.mode||"editor"===e.options.preview.mode)&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var i=e2(r,e);"<div data-block='0'></div>"===i&&(i=""),e.sv.element.innerHTML=i,z(e.sv.element),e5(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),G(e)}e.undo.resetIcon(e),"string"!=typeof n&&(e[e.currentMode].element.focus(),eR(e)),D(e),F(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'+e.currentMode+'"]').classList.add("vditor-menu--current")),e.outline.toggle(e,"sv"!==e.currentMode&&e.options.outline.enable,"string"!=typeof n)}},eV=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint"+(2===n.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'+window.VditorI18n.wysiwyg+" &lt;"+(0,d.ns)("⌥⌘7")+'></button>\n<button data-mode="ir">'+window.VditorI18n.instantRendering+" &lt;"+(0,d.ns)("⌥⌘8")+'></button>\n<button data-mode="sv">'+window.VditorI18n.splitView+" &lt;"+(0,d.ns)("⌥⌘9")+"></button>",r.element.appendChild(o),r._bindEvent(t,o,n),r}return ez(t,e),t.prototype._bindEvent=function(e,t,n){g(e,t,this.element.children[0],n.level),t.children.item(0).addEventListener((0,d.Le)(),function(t){eU(e,"wysiwyg",t),t.preventDefault(),t.stopPropagation()}),t.children.item(1).addEventListener((0,d.Le)(),function(t){eU(e,"ir",t),t.preventDefault(),t.stopPropagation()}),t.children.item(2).addEventListener((0,d.Le)(),function(t){eU(e,"sv",t),t.preventDefault(),t.stopPropagation()})},t}(eB),eW=function(e,t){return(0,O.Gb)(e,t)?getSelection().toString():""},eG=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(a(e)),h(e,["subToolbar","hint"])})},eF=function(e,t){t.addEventListener("dblclick",function(t){"IMG"===t.target.tagName&&(e.options.image.preview?e.options.image.preview(t.target):e.options.image.isPreview&&(0,B.E)(t.target,e.options.lang,e.options.theme))})},eK=function(e,t){t.addEventListener("blur",function(t){if("ir"===e.currentMode){var n=e.ir.element.querySelector(".vditor-ir__node--expand");n&&n.classList.remove("vditor-ir__node--expand")}else"wysiwyg"!==e.currentMode||e.wysiwyg.selectPopover.contains(t.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,O.zh)(e),e.options.blur&&e.options.blur(a(e))})},eZ=function(e,t){t.addEventListener("dragstart",function(e){e.dataTransfer.setData(o.g.DROP_EDITOR,o.g.DROP_EDITOR)}),t.addEventListener("drop",function(t){t.dataTransfer.getData(o.g.DROP_EDITOR)?ty(e):(t.dataTransfer.types.includes("Files")||t.dataTransfer.types.includes("text/html"))&&tj(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})},eJ=function(e,t,n){t.addEventListener("copy",function(t){return n(t,e)})},eX=function(e,t,n){t.addEventListener("cut",function(t){n(t,e),e.options.comment.enable&&"wysiwyg"===e.currentMode&&e.wysiwyg.getComments(e),document.execCommand("delete")})},eY=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,O.Ny)(t).top;"auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),("auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},eQ=function(e,t){t.addEventListener("keydown",function(t){if(!t.isComposing&&e.options.keydown&&e.options.keydown(t),!(e.options.hint.extend.length>1||e.toolbar.elements.emoji)||!e.hint.select(t,e)){if(e.options.comment.enable&&"wysiwyg"===e.currentMode&&("Backspace"===t.key||P("⌘X",t))&&e.wysiwyg.getComments(e),"sv"===e.currentMode){if(function(e,t){if(e.sv.composingLock=t.isComposing,t.isComposing||(-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,d.yl)(t)&&"Escape"!==t.key))return!1;var n,r,o,i,a,l=(0,O.zh)(e),s=l.startContainer;3!==l.startContainer.nodeType&&"DIV"===l.startContainer.tagName&&(s=l.startContainer.childNodes[l.startOffset-1]);var c=(0,b.a1)(s,"data-type","text"),u=(0,b.a1)(s,"data-type","blockquote-marker");if(!u&&0===l.startOffset&&c&&c.previousElementSibling&&"blockquote-marker"===c.previousElementSibling.getAttribute("data-type")&&(u=c.previousElementSibling),u&&"Enter"===t.key&&!(0,d.yl)(t)&&!t.altKey&&""===u.nextElementSibling.textContent.trim()&&(0,O.im)(u,e.sv.element,l).start===u.textContent.length)return"padding"===(null===(n=u.previousElementSibling)||void 0===n?void 0:n.getAttribute("data-type"))&&u.previousElementSibling.setAttribute("data-action","enter-remove"),u.remove(),e5(e),t.preventDefault(),!0;var p=(0,b.a1)(s,"data-type","li-marker"),f=(0,b.a1)(s,"data-type","task-marker"),m=p;if(m||f&&"task-marker"!==f.nextElementSibling.getAttribute("data-type")&&(m=f),!m&&0===l.startOffset&&c&&c.previousElementSibling&&("li-marker"===c.previousElementSibling.getAttribute("data-type")||"task-marker"===c.previousElementSibling.getAttribute("data-type"))&&(m=c.previousElementSibling),m){var v=(0,O.im)(m,e.sv.element,l).start,h="task-marker"===m.getAttribute("data-type"),g=m;if(h&&(g=m.previousElementSibling.previousElementSibling.previousElementSibling),v===m.textContent.length){if("Enter"===t.key&&!(0,d.yl)(t)&&!t.altKey&&!t.shiftKey&&""===m.nextElementSibling.textContent.trim())return"padding"===(null===(r=g.previousElementSibling)||void 0===r?void 0:r.getAttribute("data-type"))?(g.previousElementSibling.remove(),U(e)):(h&&(g.remove(),m.previousElementSibling.previousElementSibling.remove(),m.previousElementSibling.remove()),m.nextElementSibling.remove(),m.remove(),e5(e)),t.preventDefault(),!0;if("Tab"===t.key)return g.insertAdjacentHTML("beforebegin",'<span data-type="padding">'+g.textContent.replace(/\S/g," ")+"</span>"),/^\d/.test(g.textContent)&&(g.textContent=g.textContent.replace(/^\d{1,}/,"1"),l.selectNodeContents(m.firstChild),l.collapse(!1)),U(e),t.preventDefault(),!0}}if(tk(e,l,t))return!0;var w=(0,b.a1)(s,"data-block","0"),k=(0,y.S)(s,"SPAN");if("Enter"===t.key&&!(0,d.yl)(t)&&!t.altKey&&!t.shiftKey&&w){var E=!1,x=w.textContent.match(/^\n+/);(0,O.im)(w,e.sv.element).start<=(x?x[0].length:0)&&(E=!0);var S="\n";if(k){if("enter-remove"===(null===(o=k.previousElementSibling)||void 0===o?void 0:o.getAttribute("data-action")))return k.previousElementSibling.remove(),e5(e),t.preventDefault(),!0;S+=e3(k)}return l.insertNode(document.createTextNode(S)),l.collapse(!1),w&&""!==w.textContent.trim()&&!E?U(e):e5(e),t.preventDefault(),!0}if("Backspace"===t.key&&!(0,d.yl)(t)&&!t.altKey&&!t.shiftKey){if(k&&"newline"===(null===(i=k.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-type"))&&1===(0,O.im)(k,e.sv.element,l).start&&-1===k.getAttribute("data-type").indexOf("code-block-"))return l.setStart(k,0),l.extractContents(),""!==k.textContent.trim()?U(e):e5(e),t.preventDefault(),!0;if(w&&0===(0,O.im)(w,e.sv.element,l).start&&w.previousElementSibling){l.extractContents();var _=w.previousElementSibling.lastElementChild;return"newline"===_.getAttribute("data-type")&&(_.remove(),_=w.previousElementSibling.lastElementChild),"newline"!==_.getAttribute("data-type")&&(_.insertAdjacentHTML("afterend",w.innerHTML),w.remove()),""===w.textContent.trim()||(null===(a=w.previousElementSibling)||void 0===a?void 0:a.querySelector('[data-type="code-block-open-marker"]'))?("newline"!==_.getAttribute("data-type")&&(l.selectNodeContents(_.lastChild),l.collapse(!1)),e5(e)):U(e),t.preventDefault(),!0}}return!1}(e,t))return}else if("wysiwyg"===e.currentMode){if(function(e,t){if(e.wysiwyg.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,O.zh)(e),r=n.startContainer;if(!to(t,e,r)||(ti(n,e,t),tO(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,d.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key))return!1;var i=(0,b.F9)(r),a=(0,b.lG)(r,"P");if(tE(t,e,a,n)||tw(n,e,a,t)||tC(e,t,n))return!0;var l=(0,b.fb)(r,"vditor-wysiwyg__block");if(l){if("Escape"===t.key&&2===l.children.length)return e.wysiwyg.popover.style.display="none",l.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),!0;if(!(0,d.yl)(t)&&!t.shiftKey&&t.altKey&&"Enter"===t.key&&"code-block"===l.getAttribute("data-type")){var s=e.wysiwyg.popover.querySelector(".vditor-input");return s.focus(),s.select(),t.preventDefault(),!0}if("0"===l.getAttribute("data-block")&&(tM(e,t,l.firstElementChild,n)||tu(e,t,n,l.firstElementChild,l)||"yaml-front-matter"!==l.getAttribute("data-type")&&tp(e,t,n,l.firstElementChild,l)))return!0}if(tA(e,n,t,a))return!0;var c=(0,b.E2)(r,"BLOCKQUOTE");if(c&&!t.shiftKey&&t.altKey&&"Enter"===t.key){(0,d.yl)(t)?n.setStartBefore(c):n.setStartAfter(c),(0,O.Hc)(n);var u=document.createElement("p");return u.setAttribute("data-block","0"),u.innerHTML="\n",n.insertNode(u),n.collapse(!0),(0,O.Hc)(n),ew(e),eY(e),t.preventDefault(),!0}var p,f=(0,y.W)(r);if(f){if("H6"===f.tagName&&r.textContent.length===n.startOffset&&!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey&&"Enter"===t.key){var m,v=document.createElement("p");return v.textContent="\n",v.setAttribute("data-block","0"),r.parentElement.insertAdjacentElement("afterend",v),n.setStart(v,0),(0,O.Hc)(n),ew(e),eY(e),t.preventDefault(),!0}if(P("⌘=",t))return(m=parseInt(f.tagName.substr(1),10)-1)>0&&(eS(e,"h"+m),ew(e)),t.preventDefault(),!0;if(P("⌘-",t))return(m=parseInt(f.tagName.substr(1),10)+1)<7&&(eS(e,"h"+m),ew(e)),t.preventDefault(),!0;"Backspace"!==t.key||(0,d.yl)(t)||t.shiftKey||t.altKey||1!==f.textContent.length||e_(e)}if(tH(e,n,t))return!0;if(t.altKey&&"Enter"===t.key&&!(0,d.yl)(t)&&!t.shiftKey){var h=(0,b.lG)(r,"A"),g=(0,b.a1)(r,"data-type","link-ref"),w=(0,b.a1)(r,"data-type","footnotes-ref");if(h||g||w||f&&2===f.tagName.length){var k=e.wysiwyg.popover.querySelector("input");k.focus(),k.select()}}if(eT(e,t))return!0;if(P("⇧⌘U",t)&&(p=e.wysiwyg.popover.querySelector('[data-type="up"]'))||P("⇧⌘D",t)&&(p=e.wysiwyg.popover.querySelector('[data-type="down"]')))return p.click(),t.preventDefault(),!0;if(tk(e,n,t))return!0;if(!(0,d.yl)(t)&&t.shiftKey&&!t.altKey&&"Enter"===t.key&&"LI"!==r.parentElement.tagName&&"P"!==r.parentElement.tagName)return["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName)?n.insertNode(document.createTextNode("\n"+o.g.ZWSP)):n.insertNode(document.createTextNode("\n")),n.collapse(!1),(0,O.Hc)(n),ew(e),eY(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(tN(e,n,t,a))return!0;if(i){if(i.previousElementSibling&&i.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&"0"===i.previousElementSibling.getAttribute("data-block")&&"UL"!==i.tagName&&"OL"!==i.tagName){var E=(0,O.im)(i,e.wysiwyg.element,n).start;if(0===E&&0===n.startOffset||1===E&&i.innerText.startsWith(o.g.ZWSP))return eL(i.previousElementSibling.lastElementChild,e,!1),""===i.innerHTML.trim().replace(o.g.ZWSP,"")&&(i.remove(),ew(e)),t.preventDefault(),!0}var x=n.startOffset;if(""===n.toString()&&3===r.nodeType&&"\n"===r.textContent.charAt(x-2)&&r.textContent.charAt(x-1)!==o.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName))return r.textContent=r.textContent.substring(0,x-1)+o.g.ZWSP,n.setStart(r,x),n.collapse(!0),ew(e),t.preventDefault(),!0;r.textContent===o.g.ZWSP&&1===n.startOffset&&!r.previousSibling&&function(e){for(var t=e.startContainer.nextSibling;t&&""===t.textContent;)t=t.nextSibling;return!(!t||3===t.nodeType||"CODE"!==t.tagName&&"math-inline"!==t.getAttribute("data-type")&&"html-entity"!==t.getAttribute("data-type")&&"html-inline"!==t.getAttribute("data-type"))}(n)&&(r.textContent=""),i.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"}),i.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"})}}if((0,d.vU)()&&1===n.startOffset&&r.textContent.indexOf(o.g.ZWSP)>-1&&r.previousSibling&&3!==r.previousSibling.nodeType&&"CODE"===r.previousSibling.tagName&&("Backspace"===t.key||"ArrowLeft"===t.key))return n.selectNodeContents(r.previousSibling),n.collapse(!1),t.preventDefault(),!0;if(tD(t,i,n))return t.preventDefault(),!0;if(ta(n,t.key),"ArrowDown"===t.key){var S=r.nextSibling;S&&3!==S.nodeType&&"math-inline"===S.getAttribute("data-type")&&n.setStartAfter(S)}return!(!i||!I(i,e,t,n)||(t.preventDefault(),0))}(e,t))return}else if("ir"===e.currentMode&&function(e,t){if(e.ir.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n,r=(0,O.zh)(e),i=r.startContainer;if(!to(t,e,i)||(ti(r,e,t),tO(r),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,d.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key))return!1;var a=(0,b.a1)(i,"data-newline","1");if(!(0,d.yl)(t)&&!t.altKey&&!t.shiftKey&&"Enter"===t.key&&a&&r.startOffset<a.textContent.length){var l=a.previousElementSibling;l&&(r.insertNode(document.createTextNode(l.textContent)),r.collapse(!1));var s=a.nextSibling;s&&(r.insertNode(document.createTextNode(s.textContent)),r.collapse(!0))}var c=(0,b.lG)(i,"P");if(tE(t,e,c,r)||tw(r,e,c,t)||tA(e,r,t,c))return!0;var u=(0,b.fb)(i,"vditor-ir__marker--pre");if(u&&"PRE"===u.tagName){var p=u.firstChild;if(tM(e,t,u,r)||("math-block"===p.getAttribute("data-type")||"html-block"===p.getAttribute("data-type"))&&tp(e,t,r,p,u.parentElement)||tu(e,t,r,p,u.parentElement))return!0}var f=(0,b.a1)(i,"data-type","code-block-info");if(f){if("Enter"===t.key||"Tab"===t.key)return r.selectNodeContents(f.nextElementSibling.firstChild),r.collapse(!0),t.preventDefault(),h(e,["hint"]),!0;if("Backspace"===t.key){var m=(0,O.im)(f,e.ir.element).start;1===m&&r.setStart(i,0),2===m&&(e.hint.recentLanguage="")}if(tp(e,t,r,f,f.parentElement))return h(e,["hint"]),!0}var v=(0,b.lG)(i,"TD")||(0,b.lG)(i,"TH");if(t.key.indexOf("Arrow")>-1&&v){var g=ts(v);if(g&&tp(e,t,r,v,g))return!0;var w=td(v);if(w&&tu(e,t,r,v,w))return!0}if(tC(e,t,r)||tH(e,r,t)||tk(e,r,t))return!0;var k=(0,y.W)(i);if(k){if(P("⌘=",t))return(n=k.querySelector(".vditor-ir__marker--heading"))&&n.textContent.trim().length>1&&tP(e,n.textContent.substr(1)),t.preventDefault(),!0;if(P("⌘-",t))return(n=k.querySelector(".vditor-ir__marker--heading"))&&n.textContent.trim().length<6&&tP(e,n.textContent.trim()+"# "),t.preventDefault(),!0}var E=(0,b.F9)(i);if("Backspace"===t.key&&!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey&&""===r.toString()){if(tN(e,r,t,c))return!0;if(E&&E.previousElementSibling&&"UL"!==E.tagName&&"OL"!==E.tagName&&("code-block"===E.previousElementSibling.getAttribute("data-type")||"math-block"===E.previousElementSibling.getAttribute("data-type"))){var x=(0,O.im)(E,e.ir.element,r).start;if(0===x||1===x&&E.innerText.startsWith(o.g.ZWSP))return r.selectNodeContents(E.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),r.collapse(!1),q(r,e),""===E.textContent.trim().replace(o.g.ZWSP,"")&&(E.remove(),tR(e)),t.preventDefault(),!0}if(k){var S=k.firstElementChild.textContent.length;(0,O.im)(k,e.ir.element).start===S&&(r.setStart(k.firstElementChild.firstChild,S-1),r.collapse(!0),(0,O.Hc)(r))}}return!(("ArrowUp"!==t.key&&"ArrowDown"!==t.key||!E||(E.querySelectorAll(".vditor-ir__node").forEach(function(e){e.contains(i)||e.classList.add("vditor-ir__node--hidden")}),!tD(t,E,r)))&&(ta(r,t.key),!E||!I(E,e,t,r)||(t.preventDefault(),0)))}(e,t))return;if(e.options.ctrlEnter&&P("⌘Enter",t))return e.options.ctrlEnter(a(e)),void t.preventDefault();if(P("⌘Z",t)&&!e.toolbar.elements.undo)return e.undo.undo(e),void t.preventDefault();if(P("⌘Y",t)&&!e.toolbar.elements.redo)return e.undo.redo(e),void t.preventDefault();if("Escape"===t.key)return"block"===e.hint.element.style.display?e.hint.element.style.display="none":e.options.esc&&!t.isComposing&&e.options.esc(a(e)),void t.preventDefault();if((0,d.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[1-6]$/.test(t.code)){if("wysiwyg"===e.currentMode){var n=t.code.replace("Digit","H");(0,b.lG)(getSelection().getRangeAt(0).startContainer,n)?e_(e):eS(e,n),ew(e)}else"sv"===e.currentMode?e4(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "):"ir"===e.currentMode&&tP(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" ");return t.preventDefault(),!0}if((0,d.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[7-9]$/.test(t.code))return"Digit7"===t.code?eU(e,"wysiwyg",t):"Digit8"===t.code?eU(e,"ir",t):"Digit9"===t.code&&eU(e,"sv",t),!0;e.options.toolbar.find(function(n){return!n.hotkey||n.toolbar?!!n.toolbar&&!!n.toolbar.find(function(n){return!!n.hotkey&&(P(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,d.Le)())),t.preventDefault(),!0):void 0)}):P(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,d.Le)())),t.preventDefault(),!0):void 0})}})},e$=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var t=eW(e[e.currentMode].element);t.trim()?("wysiwyg"===e.currentMode&&e.options.comment.enable&&((0,b.a1)(n.target,"data-type","footnotes-block")||(0,b.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(t)):"wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.hideComment()})}})},e0=function(e,t){var n=(0,O.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var r=(0,b.a1)(n.startContainer,"data-block","0");r||(r=e.sv.element);var o=e.lute.SpinVditorSVDOM(r.textContent);o="<div data-block='0'>"+o.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",r.isEqualNode(e.sv.element)?r.innerHTML=o:r.outerHTML=o,z(e.sv.element),(0,O.ib)(e.sv.element,n),eY(e)},e1=function(e,t,n){void 0===n&&(n=!0);var r=e;for(3===r.nodeType&&(r=r.parentElement);r;){if(r.getAttribute("data-type")===t)return r;r=n?r.previousElementSibling:r.nextElementSibling}return!1},e2=function(e,t){return w("SpinVditorSVDOM",e,"argument",t.options.debugger),w("SpinVditorSVDOM",e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>","result",t.options.debugger),e},e3=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,r=t&&"text"!==t&&"table"!==t&&"heading-marker"!==t&&"newline"!==t&&"yaml-front-matter-open-marker"!==t&&"yaml-front-matter-close-marker"!==t&&"code-block-info"!==t&&"code-block-close-marker"!==t&&"code-block-open-marker"!==t?e.textContent:"",o=!1;for("newline"===t&&(o=!0);n&&!o;){var i=n.getAttribute("data-type");if("li-marker"===i||"blockquote-marker"===i||"task-marker"===i||"padding"===i){var a=n.textContent;if("li-marker"!==i||"code-block-open-marker"!==t&&"code-block-info"!==t){if("code-block-close-marker"===t&&n.nextElementSibling.isSameNode(e)){var l=e1(e,"code-block-open-marker");l&&l.previousElementSibling&&(n=l.previousElementSibling,r=a+r)}else r=a+r}else r=a.replace(/\S/g," ")+r}else"newline"===i&&(o=!0);n=n.previousElementSibling}return r},e5=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,d.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},e4=function(e,t){var n=(0,O.zh)(e),r=(0,y.S)(n.startContainer,"SPAN");r&&""!==r.textContent.trim()&&(t="\n"+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},e6=function(e,t,n,r){var o=(0,O.zh)(e),i=t.getAttribute("data-type");0===e.sv.element.childNodes.length&&(e.sv.element.innerHTML='<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">\n</span></span>',(0,O.ib)(e.sv.element,o));var a=(0,b.F9)(o.startContainer),l=(0,y.S)(o.startContainer,"SPAN");if(a){if("link"===i){var s=void 0;return s=""===o.toString()?""+n+Lute.Caret+r:""+n+o.toString()+r.replace(")",Lute.Caret+")"),void document.execCommand("insertHTML",!1,s)}if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i||"line"===i)return s=void 0,s=""===o.toString()?""+n+Lute.Caret+("code"===i?"":r):""+n+o.toString()+Lute.Caret+("code"===i?"":r),"table"===i||"code"===i&&l&&""!==l.textContent?s="\n\n"+s:"line"===i&&(s="\n\n"+n+"\n"+Lute.Caret),void document.execCommand("insertHTML",!1,s);if(("check"===i||"list"===i||"ordered-list"===i||"quote"===i)&&l){var d="* ";"check"===i?d="* [ ] ":"ordered-list"===i?d="1. ":"quote"===i&&(d="> ");var c=e1(l,"newline");return c?c.insertAdjacentText("afterend",d):a.insertAdjacentText("afterbegin",d),void U(e)}(0,O.ib)(e.sv.element,o),e5(e)}},e8=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},e9=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},e7=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},te=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},tt=function(e,t,n){var r,o,i,a;return r=void 0,o=void 0,i=void 0,a=function(){var r,o,i,a,l,s,d,c,u,p,f,m,v,h;return e7(this,function(g){switch(g.label){case 0:for(r=[],o=!0===e.options.upload.multiple?t.length:1,m=0;m<o;m++)(i=t[m])instanceof DataTransferItem&&(i=i.getAsFile()),r.push(i);return e.options.upload.handler?[4,e.options.upload.handler(r)]:[3,2];case 1:return a=g.sent(),n&&(n.value=""),"string"==typeof a&&e.tip.show(a),[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(r)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:r=g.sent(),g.label=4;case 4:if(e.options.upload.validate&&"string"==typeof(a=e.options.upload.validate(r)))return e.tip.show(a),[2];if(l=e8(e),e.upload.range=(0,O.zh)(e),0===(s=function(e,t){e.tip.hide();for(var n=[],r="",o="",i=(e.options.lang,e.options,function(i,a){var l=t[a],s=!0;l.name||(r+="<li>"+window.VditorI18n.nameEmpty+"</li>",s=!1),l.size>e.options.upload.max&&(r+="<li>"+l.name+" "+window.VditorI18n.over+" "+e.options.upload.max/1024/1024+"M</li>",s=!1);var d=l.name.lastIndexOf("."),c=l.name.substr(d),u=e.options.upload.filename(l.name.substr(0,d))+c;e.options.upload.accept&&(e.options.upload.accept.split(",").some(function(e){var t=e.trim();if(0===t.indexOf(".")){if(c.toLowerCase()===t.toLowerCase())return!0}else if(l.type.split("/")[0]===t.split("/")[0])return!0;return!1})||(r+="<li>"+l.name+" "+window.VditorI18n.fileTypeError+"</li>",s=!1)),s&&(n.push(l),o+="<li>"+u+" "+window.VditorI18n.uploading+"</li>")}),a=t.length,l=0;l<a;l++)i(0,l);return e.tip.show("<ul>"+r+o+"</ul>"),n}(e,r)).length)return n&&(n.value=""),[2];for(d=new FormData,c=e.options.upload.extraData,u=0,p=Object.keys(c);u<p.length;u++)f=p[u],d.append(f,c[f]);for(m=0,v=s.length;m<v;m++)d.append(e.options.upload.fieldName,s[m]);return(h=new XMLHttpRequest).open("POST",e.options.upload.url),e.options.upload.token&&h.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(h.withCredentials=!0),e9(e,h),e.upload.isUploading=!0,l.setAttribute("contenteditable","false"),h.onreadystatechange=function(){if(h.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,l.setAttribute("contenteditable","true"),h.status>=200&&h.status<300){if(e.options.upload.success)e.options.upload.success(l,h.responseText);else{var r=h.responseText;e.options.upload.format&&(r=e.options.upload.format(t,h.responseText)),function(e,t){e8(t).focus();var n=JSON.parse(e),r="";1===n.code&&(r=""+n.msg),n.data.errFiles&&n.data.errFiles.length>0&&(r="<ul><li>"+r+"</li>",n.data.errFiles.forEach(function(e){var n=e.lastIndexOf("."),o=t.options.upload.filename(e.substr(0,n))+e.substr(n);r+="<li>"+o+" "+window.VditorI18n.uploadError+"</li>"}),r+="</ul>"),r?t.tip.show(r):t.tip.hide();var o="";Object.keys(n.data.succMap).forEach(function(e){var r=n.data.succMap[e],i=e.lastIndexOf("."),a=e.substr(i),l=t.options.upload.filename(e.substr(0,i))+a;0===(a=a.toLowerCase()).indexOf(".wav")||0===a.indexOf(".mp3")||0===a.indexOf(".ogg")?"wysiwyg"===t.currentMode?o+='<div class="vditor-wysiwyg__block" data-type="html-block"\n data-block="0"><pre><code>&lt;audio controls="controls" src="'+r+'"&gt;&lt;/audio&gt;</code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="'+r+'"></audio></pre></div>\n':"ir"===t.currentMode?o+='<audio controls="controls" src="'+r+'"></audio>\n':o+="["+l+"]("+r+")\n":0===a.indexOf(".apng")||0===a.indexOf(".bmp")||0===a.indexOf(".gif")||0===a.indexOf(".ico")||0===a.indexOf(".cur")||0===a.indexOf(".jpg")||0===a.indexOf(".jpeg")||0===a.indexOf(".jfif")||0===a.indexOf(".pjp")||0===a.indexOf(".pjpeg")||0===a.indexOf(".png")||0===a.indexOf(".svg")||0===a.indexOf(".webp")?"wysiwyg"===t.currentMode?o+='<img alt="'+l+'" src="'+r+'">\n':o+="!["+l+"]("+r+")\n":"wysiwyg"===t.currentMode?o+='<a href="'+r+'">'+l+"</a>\n":o+="["+l+"]("+r+")\n"}),(0,O.Hc)(t.upload.range),document.execCommand("insertHTML",!1,o),t.upload.range=getSelection().getRangeAt(0).cloneRange()}(r,e)}}else e.options.upload.error?e.options.upload.error(h.responseText):e.tip.show(h.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},h.upload.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total*100;e.upload.element.style.display="block",e.upload.element.style.width=n+"%"}},h.send(d),[2]}})},new(i||(i=Promise))(function(e,t){function n(e){try{s(a.next(e))}catch(e){t(e)}}function l(e){try{s(a.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(n,l)}s((a=a.apply(r,o||[])).next())})},tn=function(e,t,n){var r,i=(0,b.F9)(t.startContainer);if(i||(i=e.wysiwyg.element),n&&"formatItalic"!==n.inputType&&"deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&"formatBold"!==n.inputType&&"formatRemove"!==n.inputType&&"formatStrikeThrough"!==n.inputType&&"insertUnorderedList"!==n.inputType&&"insertOrderedList"!==n.inputType&&"formatOutdent"!==n.inputType&&"formatIndent"!==n.inputType&&""!==n.inputType||!n){var a=function(e){for(var t=e.previousSibling;t;){if(3!==t.nodeType&&"A"===t.tagName&&!t.previousSibling&&""===t.innerHTML.replace(o.g.ZWSP,"")&&t.nextSibling)return t;t=t.previousSibling}return!1}(t.startContainer);a&&a.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),i.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),i.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}),null===(r=i.previousElementSibling)||void 0===r||r.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))});var l="";"link-ref-defs-block"===i.getAttribute("data-type")&&(i=e.wysiwyg.element);var s,d=i.isEqualNode(e.wysiwyg.element),c=(0,b.a1)(i,"data-type","footnotes-block");if(d)l=i.innerHTML;else{var u=(0,b.O9)(t.startContainer);if(u&&!c&&(i=(0,y.S)(t.startContainer,"BLOCKQUOTE")?(0,b.F9)(t.startContainer)||i:u),c&&(i=c),l=i.outerHTML,"UL"===i.tagName||"OL"===i.tagName){var p=i.previousElementSibling,f=i.nextElementSibling;p&&("UL"===p.tagName||"OL"===p.tagName)&&(l=p.outerHTML+l,p.remove()),f&&("UL"===f.tagName||"OL"===f.tagName)&&(l+=f.outerHTML,f.remove()),l=l.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}i.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!i.isEqualNode(e)&&(l+=e.outerHTML,e.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!i.isEqualNode(e)&&(l+=e.outerHTML,e.remove())}))}if('<p data-block="0">```<wbr></p>'===(l=l.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""))&&e.hint.recentLanguage&&(l='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),w("SpinVditorDOM",l,"argument",e.options.debugger),w("SpinVditorDOM",l=e.lute.SpinVditorDOM(l),"result",e.options.debugger),d)i.innerHTML=l;else if(i.outerHTML=l,c){var m=(0,b.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(m){var v=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+m.getAttribute("data-marker")+'"]');v&&v.setAttribute("aria-label",m.textContent.trim().substr(0,24))}}var h,g=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");g.forEach(function(e,t){0===t?s=e:(s.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),g.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",g[0]);var k=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");k.forEach(function(e,t){0===t?h=e:(h.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),k.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",k[0]),(0,O.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){N(t,e)}),n&&("deleteContentBackward"===n.inputType||"deleteContentForward"===n.inputType)&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}D(e),ew(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},tr=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},to=function(e,t,n){if(229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&"sv"!==t.currentMode){var r=(0,b.F9)(n);if(r&&""===r.textContent.trim())return t[t.currentMode].composingLock=!0,!1}return!0},ti=function(e,t,n){if(!("Enter"===n.key||"Tab"===n.key||"Backspace"===n.key||n.key.indexOf("Arrow")>-1||(0,d.yl)(n)||"Escape"===n.key||n.shiftKey||n.altKey)){var r=(0,b.lG)(e.startContainer,"P")||(0,b.lG)(e.startContainer,"LI");if(r&&0===(0,O.im)(r,t[t.currentMode].element,e).start){r.nodeValue&&(r.nodeValue=r.nodeValue.replace(/\u2006/g,""));var i=document.createTextNode(o.g.ZWSP);e.insertNode(i),e.setStartAfter(i)}}},ta=function(e,t){if("ArrowDown"===t||"ArrowUp"===t){var n=(0,b.a1)(e.startContainer,"data-type","math-inline")||(0,b.a1)(e.startContainer,"data-type","html-entity")||(0,b.a1)(e.startContainer,"data-type","html-inline");n&&("ArrowDown"===t&&e.setStartAfter(n.parentElement),"ArrowUp"===t&&e.setStartBefore(n.parentElement))}},tl=function(e,t){var n=(0,O.zh)(e),r=(0,b.F9)(n.startContainer);r&&(r.insertAdjacentHTML(t,'<p data-block="0">'+o.g.ZWSP+"<wbr>\n</p>"),(0,O.ib)(e[e.currentMode].element,n),eR(e),ty(e))},ts=function(e){var t=(0,b.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},td=function(e){var t=(0,b.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},tc=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling;return r||(r=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:"TBODY"===e.parentElement.parentElement.tagName&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),r&&(t.selectNodeContents(r),n||t.collapse(!1),(0,O.Hc)(t)),r},tu=function(e,t,n,r,i){var a=(0,O.im)(r,e[e.currentMode].element,n);if("ArrowDown"===t.key&&-1===r.textContent.trimRight().substr(a.start).indexOf("\n")||"ArrowRight"===t.key&&a.start>=r.textContent.trimRight().length){var l=i.nextElementSibling;return!l||l&&("TABLE"===l.tagName||l.getAttribute("data-type"))?(i.insertAdjacentHTML("afterend",'<p data-block="0">'+o.g.ZWSP+"<wbr></p>"),(0,O.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(l),n.collapse(!0),(0,O.Hc)(n)),t.preventDefault(),!0}return!1},tp=function(e,t,n,r,i){var a=(0,O.im)(r,e[e.currentMode].element,n);if("ArrowUp"===t.key&&-1===r.textContent.substr(0,a.start).indexOf("\n")||("ArrowLeft"===t.key||"Backspace"===t.key&&""===n.toString())&&0===a.start){var l=i.previousElementSibling;return!l||l&&("TABLE"===l.tagName||l.getAttribute("data-type"))?(i.insertAdjacentHTML("beforebegin",'<p data-block="0">'+o.g.ZWSP+"<wbr></p>"),(0,O.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(l),n.collapse(!1),(0,O.Hc)(n)),t.preventDefault(),!0}return!1},tf=function(e,t,n,r){void 0===r&&(r=!0);var o=(0,b.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),r&&o){for(var i="",a=0;a<o.parentElement.childElementCount;a++){var l=o.parentElement.children[a].querySelector("input");l&&l.remove(),i+='<p data-block="0">'+o.parentElement.children[a].innerHTML.trimLeft()+"</p>"}o.parentElement.insertAdjacentHTML("beforebegin",i),o.parentElement.remove()}else if(o){if("check"===n)o.parentElement.querySelectorAll("li").forEach(function(e){e.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'+(0===e.textContent.indexOf(" ")?"":" ")),e.classList.add("vditor-task")});else{o.querySelector("input")&&o.parentElement.querySelectorAll("li").forEach(function(e){e.querySelector("input").remove(),e.classList.remove("vditor-task")});var s=void 0;"list"===n?(s=document.createElement("ul")).setAttribute("data-marker","*"):(s=document.createElement("ol")).setAttribute("data-marker","1."),s.setAttribute("data-block","0"),s.setAttribute("data-tight",o.parentElement.getAttribute("data-tight")),s.innerHTML=o.parentElement.innerHTML,o.parentElement.parentNode.replaceChild(s,o.parentElement)}}else{var d=(0,b.a1)(t.startContainer,"data-block","0");d||(e[e.currentMode].element.querySelector("wbr").remove(),(d=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),"check"===n?(d.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '+d.innerHTML+"</li></ul>"),d.remove()):"list"===n?(d.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'+d.innerHTML+"</li></ul>"),d.remove()):"ordered-list"===n&&(d.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'+d.innerHTML+"</li></ol>"),d.remove())}},tm=function(e,t,n){var r=t.previousElementSibling;if(t&&r){var o=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&o.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var i=r.parentElement,a="";o.forEach(function(e){var t=e.getAttribute("data-marker");1!==t.length&&(t="1"+t.slice(-1)),a+='<li data-node-id="'+e.getAttribute("data-node-id")+'" data-marker="'+t+'">'+e.innerHTML+"</li>",e.remove()}),r.insertAdjacentHTML("beforeend","<"+i.tagName+' data-block="0">'+a+"</"+i.tagName+">"),"wysiwyg"===e.currentMode?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,O.ib)(e[e.currentMode].element,n);var l=(0,b.O9)(n.startContainer);l&&l.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(t){N(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),ty(e),eR(e)}else e[e.currentMode].element.focus()},tv=function(e,t,n,r){var o=(0,b.lG)(t.parentElement,"LI");if(o){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var i=t.parentElement,a=i.cloneNode(),l=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&l.push(t),t=t.nextElementSibling)});var s=!1,d="";i.querySelectorAll("li").forEach(function(e){s&&(d+=e.outerHTML,e.nextElementSibling||e.previousElementSibling?e.remove():e.parentElement.remove()),e.isSameNode(l[l.length-1])&&(s=!0)}),l.reverse().forEach(function(e){o.insertAdjacentElement("afterend",e)}),d&&(a.innerHTML=d,l[0].insertAdjacentElement("beforeend",a)),"wysiwyg"===e.currentMode?r.outerHTML=e.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=e.lute.SpinVditorIRDOM(r.outerHTML),(0,O.ib)(e[e.currentMode].element,n);var c=(0,b.O9)(n.startContainer);c&&c.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(t){N(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),ty(e),eR(e)}else e[e.currentMode].element.focus()},th=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,r=e.rows[0].cells.length,o=e.rows.length,i=0,a=0;a<o;a++)for(var l=0;l<r;l++)if(e.rows[a].cells[l].isSameNode(n)){i=l;break}for(var s=0;s<o;s++)e.rows[s].cells[i].setAttribute("align",t)},tg=function(e){var t=e.trimRight().split("\n").pop();return""!==t&&(""===t.replace(/ |-/g,"")||""===t.replace(/ |_/g,"")||""===t.replace(/ |\*/g,""))&&t.replace(/ /g,"").length>2&&!(t.indexOf("-")>-1&&-1===t.trimLeft().indexOf(" ")&&e.trimRight().split("\n").length>1)&&0!==t.indexOf(" ")&&0!==t.indexOf(" ")},tb=function(e){var t=e.trimRight().split("\n");return 0!==(e=t.pop()).indexOf(" ")&&0!==e.indexOf(" ")&&""!==(e=e.trimLeft())&&0!==t.length&&(""===e.replace(/-/g,"")||""===e.replace(/=/g,""))},ty=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),"wysiwyg"===e.currentMode?ew(e,t):"ir"===e.currentMode?tR(e,t):"sv"===e.currentMode&&e5(e,t)},tw=function(e,t,n,r){var i,a=e.startContainer,l=(0,b.lG)(a,"LI");if(l){if(!(0,d.yl)(r)&&!r.altKey&&"Enter"===r.key&&!r.shiftKey&&n&&l.contains(n)&&n.nextElementSibling)return l&&!l.textContent.endsWith("\n")&&l.insertAdjacentText("beforeend","\n"),e.insertNode(document.createTextNode("\n\n")),e.collapse(!1),ty(t),r.preventDefault(),!0;if(!((0,d.yl)(r)||r.shiftKey||r.altKey||"Backspace"!==r.key||l.previousElementSibling||""!==e.toString()||0!==(0,O.im)(l,t[t.currentMode].element,e).start))return l.nextElementSibling?(l.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+l.innerHTML+"</p>"),l.remove()):l.parentElement.outerHTML='<p data-block="0"><wbr>'+l.innerHTML+"</p>",(0,O.ib)(t[t.currentMode].element,e),ty(t),r.preventDefault(),!0;if(!(0,d.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&""===l.textContent.trim().replace(o.g.ZWSP,"")&&""===e.toString()&&"LI"===(null===(i=l.previousElementSibling)||void 0===i?void 0:i.tagName))return l.previousElementSibling.insertAdjacentText("beforeend","\n\n"),e.selectNodeContents(l.previousElementSibling),e.collapse(!1),l.remove(),(0,O.ib)(t[t.currentMode].element,e),ty(t),r.preventDefault(),!0;if(!(0,d.yl)(r)&&!r.altKey&&"Tab"===r.key){var s=!1;if((0===e.startOffset&&(3===a.nodeType&&!a.previousSibling||3!==a.nodeType&&"LI"===a.nodeName)||l.classList.contains("vditor-task")&&1===e.startOffset&&3!==a.previousSibling.nodeType&&"INPUT"===a.previousSibling.tagName)&&(s=!0),s||""!==e.toString())return r.shiftKey?tv(t,l,e,l.parentElement):tm(t,l,e),r.preventDefault(),!0}}return!1},tk=function(e,t,n){if(e.options.tab&&"Tab"===n.key)return n.shiftKey||(""===t.toString()||t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)),(0,O.Hc)(t),ty(e),n.preventDefault(),!0},tE=function(e,t,n,r){if(n){if(!(0,d.yl)(e)&&!e.altKey&&"Enter"===e.key){var o,i,a=String.raw(eg||(o=["",""],i=["",""],Object.defineProperty?Object.defineProperty(o,"raw",{value:i}):o.raw=i,eg=o),n.textContent).replace(/\\\|/g,"").trim(),l=a.split("|");if(a.startsWith("|")&&a.endsWith("|")&&l.length>3){var s=l.map(function(){return"---"}).join("|");return s=n.textContent+"\n"+s.substring(3,s.length-3)+"\n|<wbr>",n.outerHTML=t.lute.SpinVditorDOM(s),(0,O.ib)(t[t.currentMode].element,r),ty(t),eY(t),e.preventDefault(),!0}if(tg(n.innerHTML)&&n.previousElementSibling){var c="",u=n.innerHTML.trimRight().split("\n");return u.length>1&&(u.pop(),c='<p data-block="0">'+u.join("\n")+"</p>"),n.insertAdjacentHTML("afterend",c+'<hr data-block="0"><p data-block="0"><wbr>\n</p>'),n.remove(),(0,O.ib)(t[t.currentMode].element,r),ty(t),eY(t),e.preventDefault(),!0}if(tb(n.innerHTML))return"wysiwyg"===t.currentMode?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'),(0,O.ib)(t[t.currentMode].element,r),ty(t),eY(t),e.preventDefault(),!0}if(r.collapsed&&n.previousElementSibling&&"Backspace"===e.key&&!(0,d.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split("\n").length>1&&0===(0,O.im)(n,t[t.currentMode].element,r).start){var p=(0,b.DX)(n.previousElementSibling);return p.textContent.endsWith("\n")||(p.textContent=p.textContent+"\n"),p.parentElement.insertAdjacentHTML("beforeend","<wbr>"+n.innerHTML),n.remove(),(0,O.ib)(t[t.currentMode].element,r),!1}return!1}},tx=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)r+='<td align="'+n.parentElement.children[o].getAttribute("align")+'"> </td>';"TH"===n.tagName?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>"+r+"</tr></tbody>"):n.parentElement.insertAdjacentHTML("afterend","<tr>"+r+"</tr>"),ty(e)},tS=function(e,t,n){for(var r="",o=0;o<n.parentElement.childElementCount;o++)"TH"===n.tagName?r+='<th align="'+n.parentElement.children[o].getAttribute("align")+'"> </th>':r+='<td align="'+n.parentElement.children[o].getAttribute("align")+'"> </td>';if("TH"===n.tagName){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>"+r+"</tr></thead>"),t.insertNode(document.createElement("wbr"));var i=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",i),n.parentElement.parentElement.remove(),(0,O.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>"+r+"</tr>");ty(e)},t_=function(e,t,n,r){void 0===r&&(r="afterend");for(var o=0,i=n.previousElementSibling;i;)o++,i=i.previousElementSibling;for(var a=0;a<t.rows.length;a++)0===a?t.rows[a].cells[o].insertAdjacentHTML(r,"<th> </th>"):t.rows[a].cells[o].insertAdjacentHTML(r,"<td> </td>");ty(e)},tL=function(e,t,n){if("TD"===n.tagName){var r=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(r.previousElementSibling.lastElementChild.lastElementChild),1===r.childElementCount?r.remove():n.parentElement.remove(),t.collapse(!1),(0,O.Hc)(t),ty(e)}},tT=function(e,t,n,r){for(var o=0,i=r.previousElementSibling;i;)o++,i=i.previousElementSibling;(r.previousElementSibling||r.nextElementSibling)&&(t.selectNodeContents(r.previousElementSibling||r.nextElementSibling),t.collapse(!0));for(var a=0;a<n.rows.length;a++){var l=n.rows[a].cells;if(1===l.length){n.remove(),eR(e);break}l[o].remove()}(0,O.Hc)(t),ty(e)},tC=function(e,t,n){var r=n.startContainer,o=(0,b.lG)(r,"TD")||(0,b.lG)(r,"TH");if(o){if(!(0,d.yl)(t)&&!t.altKey&&"Enter"===t.key){o.lastElementChild&&(!o.lastElementChild||o.lastElementChild.isSameNode(o.lastChild)&&"BR"===o.lastElementChild.tagName)||o.insertAdjacentHTML("beforeend","<br>");var i,a,l=document.createElement("br");return n.insertNode(l),n.setStartAfter(l),ty(e),eY(e),t.preventDefault(),!0}if("Tab"===t.key)return t.shiftKey?tc(o,n):((i=o.nextElementSibling)||(i=o.parentElement.nextElementSibling?o.parentElement.nextElementSibling.firstElementChild:"THEAD"===o.parentElement.parentElement.tagName&&o.parentElement.parentElement.nextElementSibling?o.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),i&&(n.selectNodeContents(i),(0,O.Hc)(n))),t.preventDefault(),!0;var s=o.parentElement.parentElement.parentElement;if("ArrowUp"===t.key){if(t.preventDefault(),"TH"===o.tagName)return s.previousElementSibling?(n.selectNodeContents(s.previousElementSibling),n.collapse(!1),(0,O.Hc)(n)):tl(e,"beforebegin"),!0;for(var c=0,u=o.parentElement;c<u.cells.length&&!u.cells[c].isSameNode(o);c++);var p=u.previousElementSibling;return p||(p=u.parentElement.previousElementSibling.firstChild),n.selectNodeContents(p.cells[c]),n.collapse(!1),(0,O.Hc)(n),!0}if("ArrowDown"===t.key){if(t.preventDefault(),!(u=o.parentElement).nextElementSibling&&"TD"===o.tagName)return s.nextElementSibling?(n.selectNodeContents(s.nextElementSibling),n.collapse(!0),(0,O.Hc)(n)):tl(e,"afterend"),!0;for(c=0;c<u.cells.length&&!u.cells[c].isSameNode(o);c++);return(i=u.nextElementSibling)||(i=u.parentElement.nextElementSibling.firstChild),n.selectNodeContents(i.cells[c]),n.collapse(!0),(0,O.Hc)(n),!0}if("wysiwyg"===e.currentMode&&!(0,d.yl)(t)&&"Enter"===t.key&&!t.shiftKey&&t.altKey){var f=e.wysiwyg.popover.querySelector(".vditor-input");return f.focus(),f.select(),t.preventDefault(),!0}if(!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey&&"Backspace"===t.key&&0===n.startOffset&&""===n.toString())return!tc(o,n,!1)&&s&&(""===s.textContent.trim()?(s.outerHTML='<p data-block="0"><wbr>\n</p>',(0,O.ib)(e[e.currentMode].element,n)):(n.setStartBefore(s),n.collapse(!0)),ty(e)),t.preventDefault(),!0;if(P("⇧⌘F",t))return tS(e,n,o),t.preventDefault(),!0;if(P("⌘=",t))return tx(e,n,o),t.preventDefault(),!0;if(P("⇧⌘G",t))return t_(e,s,o,"beforebegin"),t.preventDefault(),!0;if(P("⇧⌘=",t))return t_(e,s,o),t.preventDefault(),!0;if(P("⌘-",t))return tL(e,n,o),t.preventDefault(),!0;if(P("⇧⌘-",t))return tT(e,n,s,o),t.preventDefault(),!0;if(P("⇧⌘L",t)){if("ir"===e.currentMode)return th(s,"left"),ty(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="left"]'))return a.click(),t.preventDefault(),!0}if(P("⇧⌘C",t)){if("ir"===e.currentMode)return th(s,"center"),ty(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="center"]'))return a.click(),t.preventDefault(),!0}if(P("⇧⌘R",t)){if("ir"===e.currentMode)return th(s,"right"),ty(e),t.preventDefault(),!0;if(a=e.wysiwyg.popover.querySelector('[data-type="right"]'))return a.click(),t.preventDefault(),!0}}return!1},tM=function(e,t,n,r){if("PRE"===n.tagName&&P("⌘A",t))return r.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&"Tab"===t.key&&!t.shiftKey&&""===r.toString())return r.insertNode(document.createTextNode(e.options.tab)),r.collapse(!1),ty(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,d.yl)(t)&&!t.shiftKey&&!t.altKey){var o=(0,O.im)(n,e[e.currentMode].element,r);if((0===o.start||1===o.start&&"\n"===n.innerText)&&""===r.toString())return n.parentElement.outerHTML='<p data-block="0"><wbr>'+n.firstElementChild.innerHTML+"</p>",(0,O.ib)(e[e.currentMode].element,r),ty(e),t.preventDefault(),!0}return!(0,d.yl)(t)&&!t.altKey&&"Enter"===t.key&&(n.firstElementChild.textContent.endsWith("\n")||n.firstElementChild.insertAdjacentText("beforeend","\n"),r.extractContents(),r.insertNode(document.createTextNode("\n")),r.collapse(!1),(0,O.Hc)(r),(0,d.vU)()||("wysiwyg"===e.currentMode?tn(e,r):R(e,r)),eY(e),t.preventDefault(),!0)},tA=function(e,t,n,r){var i=t.startContainer,a=(0,b.lG)(i,"BLOCKQUOTE");if(a&&""===t.toString()){if("Backspace"===n.key&&!(0,d.yl)(n)&&!n.shiftKey&&!n.altKey&&0===(0,O.im)(a,e[e.currentMode].element,t).start)return t.insertNode(document.createElement("wbr")),a.outerHTML=a.innerHTML,(0,O.ib)(e[e.currentMode].element,t),ty(e),n.preventDefault(),!0;if(r&&"Enter"===n.key&&!(0,d.yl)(n)&&!n.shiftKey&&!n.altKey&&"BLOCKQUOTE"===r.parentElement.tagName){var l=!1;if("\n"===r.innerHTML.replace(o.g.ZWSP,"")||""===r.innerHTML.replace(o.g.ZWSP,"")?(l=!0,r.remove()):r.innerHTML.endsWith("\n\n")&&(0,O.im)(r,e[e.currentMode].element,t).start===r.textContent.length-1&&(r.innerHTML=r.innerHTML.substr(0,r.innerHTML.length-2),l=!0),l)return a.insertAdjacentHTML("afterend",'<p data-block="0">'+o.g.ZWSP+"<wbr>\n</p>"),(0,O.ib)(e[e.currentMode].element,t),ty(e),n.preventDefault(),!0}var s=(0,b.F9)(i);if("wysiwyg"===e.currentMode&&s&&P("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),s.outerHTML='<blockquote data-block="0">'+s.outerHTML+"</blockquote>",(0,O.ib)(e.wysiwyg.element,t),ew(e),n.preventDefault(),!0;if(tu(e,n,t,a,a)||tp(e,n,t,a,a))return!0}return!1},tH=function(e,t,n){var r=t.startContainer,o=(0,b.fb)(r,"vditor-task");if(o){if(P("⇧⌘J",n)){var i=o.firstElementChild;return i.checked?i.removeAttribute("checked"):i.setAttribute("checked","checked"),ty(e),n.preventDefault(),!0}if("Backspace"===n.key&&!(0,d.yl)(n)&&!n.shiftKey&&!n.altKey&&""===t.toString()&&1===t.startOffset&&(3===r.nodeType&&r.previousSibling&&"INPUT"===r.previousSibling.tagName||3!==r.nodeType)){var a=o.previousElementSibling;return(o.querySelector("input").remove(),a)?((0,b.DX)(a).parentElement.insertAdjacentHTML("beforeend","<wbr>"+o.innerHTML.trim()),o.remove()):(o.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+(o.innerHTML.trim()||"\n")+"</p>"),o.nextElementSibling?o.remove():o.parentElement.remove()),(0,O.ib)(e[e.currentMode].element,t),ty(e),n.preventDefault(),!0}if("Enter"===n.key&&!(0,d.yl)(n)&&!n.shiftKey&&!n.altKey){if(""===o.textContent.trim()){if((0,b.fb)(o.parentElement,"vditor-task")){var l=(0,b.O9)(r);l&&tv(e,o,t,l)}else if(o.nextElementSibling){var s="",c="",u=!1;Array.from(o.parentElement.children).forEach(function(e){o.isSameNode(e)?u=!0:u?s+=e.outerHTML:c+=e.outerHTML});var p=o.parentElement.tagName,f="OL"===o.parentElement.tagName?"":' data-marker="'+o.parentElement.getAttribute("data-marker")+'"',m="";c&&(m="UL"===o.parentElement.tagName?"":' start="1"',c="<"+p+' data-tight="true"'+f+' data-block="0">'+c+"</"+p+">"),o.parentElement.outerHTML=c+'<p data-block="0"><wbr>\n</p><'+p+'\n data-tight="true"'+f+' data-block="0"'+m+">"+s+"</"+p+">"}else o.parentElement.insertAdjacentHTML("afterend",'<p data-block="0"><wbr>\n</p>'),1===o.parentElement.querySelectorAll("li").length?o.parentElement.remove():o.remove()}else 3!==r.nodeType&&0===t.startOffset&&"INPUT"===r.firstChild.tagName?t.setStart(r.childNodes[1],1):(t.setEndAfter(o.lastChild),o.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'+o.getAttribute("data-marker")+'"><input type="checkbox"> <wbr></li>'),document.querySelector("wbr").after(t.extractContents()));return(0,O.ib)(e[e.currentMode].element,t),ty(e),eY(e),n.preventDefault(),!0}}return!1},tN=function(e,t,n,r){if(3!==t.startContainer.nodeType){var o=t.startContainer.children[t.startOffset];if(o&&"HR"===o.tagName)return t.selectNodeContents(o.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(r){var i=r.previousElementSibling;if(i&&0===(0,O.im)(r,e[e.currentMode].element,t).start&&((0,d.vU)()&&"HR"===i.tagName||"TABLE"===i.tagName)){if("TABLE"===i.tagName){var a=i.lastElementChild.lastElementChild.lastElementChild;a.innerHTML=a.innerHTML.trimLeft()+"<wbr>"+r.textContent.trim(),r.remove()}else i.remove();return(0,O.ib)(e[e.currentMode].element,t),ty(e),n.preventDefault(),!0}}return!1},tO=function(e){(0,d.vU)()&&3!==e.startContainer.nodeType&&"HR"===e.startContainer.tagName&&e.setStartBefore(e.startContainer)},tD=function(e,t,n){var r,o;if(!(0,d.vU)())return!1;if("ArrowUp"===e.key&&t&&"TABLE"===(null===(r=t.previousElementSibling)||void 0===r?void 0:r.tagName)){var i=t.previousElementSibling;return n.selectNodeContents(i.rows[i.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!("ArrowDown"!==e.key||!t||"TABLE"!==(null===(o=t.nextElementSibling)||void 0===o?void 0:o.tagName))&&(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0)},tj=function(e,t,n){var r,i,a,l;return r=void 0,i=void 0,a=void 0,l=function(){var r,i,a,l,s,d,c,u,p,f,m,v,h,g,y,w;return tr(this,function(k){switch(k.label){case 0:return"true"!==e[e.currentMode].element.getAttribute("contenteditable")?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(r=t.clipboardData.getData("text/html"),i=t.clipboardData.getData("text/plain"),a=t.clipboardData.files):(r=t.dataTransfer.getData("text/html"),i=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(a=t.dataTransfer.items)),l={},s=function(t,n){if(!n)return["",Lute.WalkContinue];var r=t.TokensStr();if(34===t.__internal_object__.Parent.Type&&r&&-1===r.indexOf("file://")&&e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&o.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(o.withCredentials=!0),e9(e,o),o.setRequestHeader("Content-Type","application/json; charset=utf-8"),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status){var t=o.responseText;e.options.upload.linkToImgFormat&&(t=e.options.upload.linkToImgFormat(o.responseText));var n=JSON.parse(t);if(0!==n.code)return void e.tip.show(n.msg);var r=n.data.originalURL;if("sv"===e.currentMode)e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(e){e.textContent===r&&(e.textContent=n.data.url)});else{var i=e[e.currentMode].element.querySelector('img[src="'+r+'"]');i.src=n.data.url,"ir"===e.currentMode&&(i.previousElementSibling.previousElementSibling.innerHTML=n.data.url)}ty(e)}else e.tip.show(o.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(o.responseText)}},o.send(JSON.stringify({url:r}))}return"ir"===e.currentMode?['<span class="vditor-ir__marker vditor-ir__marker--link">'+Lute.EscapeHTMLStr(r)+"</span>",Lute.WalkContinue]:"wysiwyg"===e.currentMode?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'+Lute.EscapeHTMLStr(r)+"</span>",Lute.WalkContinue]},r.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'+i+'">'+i+"</a>"&&r.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='\x3c!--StartFragment--\x3e<a href="'+i+'">'+i+"</a>\x3c!--EndFragment--\x3e"||(r=""),(d=(new DOMParser).parseFromString(r,"text/html")).body&&(r=d.body.innerHTML),r=Lute.Sanitize(r),e.wysiwyg.getComments(e),c=e[e.currentMode].element.scrollHeight,u=function(e,t,n){void 0===n&&(n="sv");var r=document.createElement("div");r.innerHTML=e;var o=!1;1===r.childElementCount&&r.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(o=!0);var i=r.querySelectorAll("pre");if(1===r.childElementCount&&1===i.length&&"vditor-wysiwyg"!==i[0].className&&"vditor-sv"!==i[0].className&&(o=!0),0===e.indexOf('\n<p class="p1">')&&(o=!0),1===r.childElementCount&&"TABLE"===r.firstElementChild.tagName&&r.querySelector(".line-number")&&r.querySelector(".line-content")&&(o=!0),o){var a=t||e;return/\n/.test(a)||1===i.length?"wysiwyg"===n?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'+a.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"<wbr></code></pre></div>":"\n```\n"+a.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"\n```":"wysiwyg"===n?"<code>"+a.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</code><wbr>":"`"+a+"`"}return!1}(r,i,e.currentMode),(p="sv"===e.currentMode?(0,b.a1)(t.target,"data-type","code-block"):(0,b.lG)(t.target,"CODE"))?("sv"===e.currentMode?document.execCommand("insertHTML",!1,i.replace(/&/g,"&amp;").replace(/</g,"&lt;")):(f=(0,O.im)(t.target,e[e.currentMode].element),"PRE"!==p.parentElement.tagName&&(i+=o.g.ZWSP),p.textContent=p.textContent.substring(0,f.start)+i+p.textContent.substring(f.end),(0,O.$j)(f.start+i.length,f.start+i.length,p.parentElement),(null===(w=p.parentElement)||void 0===w?void 0:w.nextElementSibling.classList.contains("vditor-"+e.currentMode+"__preview"))&&(p.parentElement.nextElementSibling.innerHTML=p.outerHTML,N(p.parentElement.nextElementSibling,e))),[3,8]):[3,1]);case 1:return u?(n.pasteCode(u),[3,8]):[3,2];case 2:return""===r.trim()?[3,3]:((m=document.createElement("div")).innerHTML=r,m.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),m.querySelectorAll(".vditor-copy").forEach(function(e){e.remove()}),"ir"===e.currentMode?(l.HTML2VditorIRDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,O.oC)(e.lute.HTML2VditorIRDOM(m.innerHTML),e)):"wysiwyg"===e.currentMode?(l.HTML2VditorDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,O.oC)(e.lute.HTML2VditorDOM(m.innerHTML),e)):(l.Md2VditorSVDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),e0(e,e.lute.HTML2Md(m.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return a.length>0?e.options.upload.url||e.options.upload.handler?[4,tt(e,a)]:[3,5]:[3,7];case 4:return k.sent(),[3,6];case 5:v=new FileReader,"clipboardData"in t?h=(a=t.clipboardData.files)[0]:t.dataTransfer.types.includes("Files")&&(h=(a=t.dataTransfer.items)[0].getAsFile()),h&&h.type.startsWith("image")&&(v.readAsDataURL(h),v.onload=function(){var t="";"wysiwyg"===e.currentMode?t+='<img alt="'+h.name+'" src="'+v.result.toString()+'">\n':t+="!["+h.name+"]("+v.result.toString()+")\n",document.execCommand("insertHTML",!1,t)}),k.label=6;case 6:return[3,8];case 7:""!==i.trim()&&0===a.length&&(""!==(y=(0,O.zh)(e)).toString()&&e.lute.IsValidLinkDest(i)&&(i="["+y.toString()+"]("+i+")"),"ir"===e.currentMode?(l.Md2VditorIRDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,O.oC)(e.lute.Md2VditorIRDOM(i),e)):"wysiwyg"===e.currentMode?(l.Md2VditorDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),(0,O.oC)(e.lute.Md2VditorDOM(i),e)):(l.Md2VditorSVDOM={renderLinkDest:s},e.lute.SetJSRenderers({renderers:l}),e0(e,i)),e.outline.render(e)),k.label=8;case 8:return"sv"!==e.currentMode&&((g=(0,b.F9)((0,O.zh)(e).startContainer))&&(y=(0,O.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),y.insertNode(document.createElement("wbr")),"wysiwyg"===e.currentMode?g.outerHTML=e.lute.SpinVditorDOM(g.outerHTML):g.outerHTML=e.lute.SpinVditorIRDOM(g.outerHTML),(0,O.ib)(e[e.currentMode].element,y)),e[e.currentMode].element.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(t){N(t,e)})),e.wysiwyg.triggerRemoveComment(e),ty(e),e[e.currentMode].element.scrollHeight-c>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&eY(e),[2]}})},new(a||(a=Promise))(function(e,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof a?r:new a(function(e){e(r)})).then(n,o)}s((l=l.apply(r,i||[])).next())})},tI=function(e){e.hint.render(e);var t=(0,O.zh)(e).startContainer,n=(0,b.a1)(t,"data-type","code-block-info");if(n){if(""===n.textContent.replace(o.g.ZWSP,"")&&e.hint.recentLanguage)n.textContent=o.g.ZWSP+e.hint.recentLanguage,(0,O.zh)(e).selectNodeContents(n);else{var r=[],i=n.textContent.substring(0,(0,O.im)(n,e.ir.element).start).replace(o.g.ZWSP,"");(e.options.preview.hljs.langs||o.g.CODE_LANGUAGES).forEach(function(e){e.indexOf(i.toLowerCase())>-1&&r.push({html:e,value:e})}),e.hint.genHTML(r,i,e)}}},tR=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&tI(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=a(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,d.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},tP=function(e,t){var n=(0,O.zh)(e),r=(0,b.F9)(n.startContainer)||n.startContainer;if(r){var o=r.querySelector(".vditor-ir__marker--heading");o?o.innerHTML=t:(r.insertAdjacentText("afterbegin",t),n.selectNodeContents(r),n.collapse(!1)),R(e,n.cloneRange()),ey(e)}},tq=function(e,t,n){var r=(0,b.a1)(e.startContainer,"data-type",n);if(r){r.firstElementChild.remove(),r.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var o=document.createElement("div");o.innerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),r.outerHTML=o.firstElementChild.innerHTML.trim()}},tB=function(e,t,n,r){var o=(0,O.zh)(e),i=t.getAttribute("data-type"),a=o.startContainer;3===a.nodeType&&(a=a.parentElement);var l=!0;if(t.classList.contains("vditor-menu--current")){if("quote"===i){var s=(0,b.lG)(a,"BLOCKQUOTE");s&&(o.insertNode(document.createElement("wbr")),s.outerHTML=""===s.innerHTML.trim()?'<p data-block="0">'+s.innerHTML+"</p>":s.innerHTML)}else if("link"===i){var d=(0,b.a1)(o.startContainer,"data-type","a");if(d){var u=(0,b.fb)(o.startContainer,"vditor-ir__link");u?(o.insertNode(document.createElement("wbr")),d.outerHTML=u.innerHTML):d.outerHTML=d.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else"italic"===i?tq(o,e,"em"):"bold"===i?tq(o,e,"strong"):"strike"===i?tq(o,e,"s"):"inline-code"===i?tq(o,e,"code"):"check"!==i&&"list"!==i&&"ordered-list"!==i||(tf(e,o,i),l=!1,t.classList.remove("vditor-menu--current"))}else{0===e.ir.element.childNodes.length&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,O.ib)(e.ir.element,o));var p=(0,b.F9)(o.startContainer);if("line"===i){if(p){var f='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===p.innerHTML.trim()?p.outerHTML=f:p.insertAdjacentHTML("afterend",f)}}else if("quote"===i)p&&(o.insertNode(document.createElement("wbr")),p.outerHTML='<blockquote data-block="0">'+p.outerHTML+"</blockquote>",l=!1,t.classList.add("vditor-menu--current"));else if("link"===i){var m=void 0;m=""===o.toString()?n+"<wbr>"+r:""+n+o.toString()+r.replace(")","<wbr>)"),document.execCommand("insertHTML",!1,m),l=!1,t.classList.add("vditor-menu--current")}else if("italic"===i||"bold"===i||"strike"===i||"inline-code"===i||"code"===i||"table"===i){m=void 0,""===o.toString()?m=n+"<wbr>"+r:(m="code"===i?n+"\n"+o.toString()+"<wbr>"+r:"table"===i?""+n+o.toString()+"<wbr>"+r:""+n+o.toString()+r+"<wbr>",o.deleteContents()),"table"!==i&&"code"!==i||(m="\n"+m+"\n\n");var v=document.createElement("span");v.innerHTML=m,o.insertNode(v),R(e,o),"table"===i&&(o.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,O.Hc)(o))}else"check"!==i&&"list"!==i&&"ordered-list"!==i||(tf(e,o,i,!1),l=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,O.ib)(e.ir.element,o),tR(e),l&&ey(e)},tz=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}},tU=function(){function e(e){var t=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(e,n){t.element.style.display="none";var r,i=decodeURIComponent(e.getAttribute("data-value")),a=window.getSelection().getRangeAt(0);if("ir"===n.currentMode){var l=(0,b.a1)(a.startContainer,"data-type","code-block-info");if(l)return l.textContent=o.g.ZWSP+i.trimRight(),a.selectNodeContents(l),a.collapse(!1),tR(n),l.parentElement.querySelectorAll("code").forEach(function(e){e.className="language-"+i.trimRight()}),N(l.parentElement.querySelector(".vditor-ir__preview"),n),void(t.recentLanguage=i.trimRight())}if("wysiwyg"===n.currentMode&&3!==a.startContainer.nodeType){var s=a.startContainer,d=void 0;if((d=s.classList.contains("vditor-input")?s:s.firstElementChild)&&d.classList.contains("vditor-input"))return d.value=i.trimRight(),a.selectNodeContents(d),a.collapse(!1),d.dispatchEvent(new CustomEvent("input",{detail:1})),void(t.recentLanguage=i.trimRight())}(a.setStart(a.startContainer,t.lastIndex),a.deleteContents(),n.options.hint.parse?"sv"===n.currentMode?(0,O.oC)(n.lute.SpinVditorSVDOM(i),n):"wysiwyg"===n.currentMode?(0,O.oC)(n.lute.SpinVditorDOM(i),n):(0,O.oC)(n.lute.SpinVditorIRDOM(i),n):(0,O.oC)(i,n),":"===t.splitChar&&i.indexOf(":")>-1&&"sv"!==n.currentMode&&a.insertNode(document.createTextNode(" ")),a.collapse(!1),(0,O.Hc)(a),"wysiwyg"===n.currentMode)?(r=(0,b.fb)(a.startContainer,"vditor-wysiwyg__block"))&&r.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(r.lastElementChild.innerHTML=r.firstElementChild.innerHTML,N(r.lastElementChild,n)):"ir"===n.currentMode&&(r=(0,b.fb)(a.startContainer,"vditor-ir__marker--pre"))&&r.nextElementSibling.classList.contains("vditor-ir__preview")&&(r.nextElementSibling.innerHTML=r.innerHTML,N(r.nextElementSibling,n)),ty(n)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",e.push({key:":"})}return e.prototype.render=function(e){var t=this;if(window.getSelection().focusNode){var n,r=getSelection().getRangeAt(0);n=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(n,e.options.hint.extend);if(void 0===o)this.element.style.display="none",clearTimeout(this.timeId);else if(":"===this.splitChar){var i=""===o?e.options.hint.emoji:e.lute.GetEmojis(),a=[];Object.keys(i).forEach(function(e){0===e.indexOf(o.toLowerCase())&&(i[e].indexOf(".")>-1?a.push({html:'<img src="'+i[e]+'" title=":'+e+':"/> :'+e+":",value:":"+e+":"}):a.push({html:'<span class="vditor-hint__emoji">'+i[e]+"</span>"+e,value:i[e]}))}),this.genHTML(a,o,e)}else e.options.hint.extend.forEach(function(n){n.key===t.splitChar&&(clearTimeout(t.timeId),t.timeId=window.setTimeout(function(){var r,i,a,l;return r=t,i=void 0,a=void 0,l=function(){var t;return tz(this,function(r){switch(r.label){case 0:return t=this.genHTML,[4,n.hint(o)];case 1:return t.apply(this,[r.sent(),o,e]),[2]}})},new(a||(a=Promise))(function(e,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function o(e){try{s(l.throw(e))}catch(e){t(e)}}function s(t){var r;t.done?e(t.value):((r=t.value)instanceof a?r:new a(function(e){e(r)})).then(n,o)}s((l=l.apply(r,i||[])).next())})},e.options.hint.delay))})}},e.prototype.genHTML=function(e,t,n){var r=this;if(0!==e.length){var o=n[n.currentMode].element,i=(0,O.Ny)(o),a=i.left+("left"===n.options.outline.position?n.outline.element.offsetWidth:0),l=i.top,s="";e.forEach(function(e,n){if(!(n>7)){var r=e.html;if(""!==t){var o=r.lastIndexOf(">")+1,i=r.substr(o),a=i.toLowerCase().indexOf(t.toLowerCase());a>-1&&(i=i.substring(0,a)+"<b>"+i.substring(a,a+t.length)+"</b>"+i.substring(a+t.length),r=r.substr(0,o)+i)}s+='<button type="button" data-value="'+encodeURIComponent(e.value)+' "\n'+(0===n?"class='vditor-hint--current'":"")+"> "+r+"</button>"}}),this.element.innerHTML=s;var d=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top=l+(d||22)+"px",this.element.style.left=a+"px",this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(e){e.addEventListener("click",function(t){r.fillEmoji(e,n),t.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top=l-this.element.offsetHeight+"px"),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")}else this.element.style.display="none"},e.prototype.select=function(e,t){if(0===this.element.querySelectorAll("button").length||"none"===this.element.style.display)return!1;var n=this.element.querySelector(".vditor-hint--current");if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.nextElementSibling?n.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.previousElementSibling)n.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!((0,d.yl)(e)||e.shiftKey||e.altKey||"Enter"!==e.key||e.isComposing)&&(e.preventDefault(),e.stopPropagation(),this.fillEmoji(n,t),!0)},e.prototype.getKey=function(e,t){var n,r=this;if(this.lastIndex=-1,this.splitChar="",t.forEach(function(t){var n=e.lastIndexOf(t.key);r.lastIndex<n&&(r.splitChar=t.key,r.lastIndex=n)}),-1===this.lastIndex)return n;var o=e.split(this.splitChar),a=o[o.length-1];if(o.length>1&&a.trim()===a){if(2===o.length&&""===o[0]&&o[1].length<32)n=o[1];else{var l=o[o.length-2].slice(-1);" "===(0,i.X)(l)&&a.length<32&&(n=a)}}return n},e}(),tV=function(){function e(e){this.composingLock=!1;var t=document.createElement("div");t.className="vditor-ir",t.innerHTML='<pre class="vditor-reset" placeholder="'+e.options.placeholder+'"\n contenteditable="true" spellcheck="false"></pre>',this.element=t.firstElementChild,this.bindEvent(e),eG(e,this.element),eF(e,this.element),eK(e,this.element),eQ(e,this.element),e$(e,this.element),eZ(e,this.element),eJ(e,this.element,this.copy),eX(e,this.element,this.copy)}return e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=document.createElement("div");r.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorIRDOM2Md(r.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){tj(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){h(e,["hint"])}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,d.vU)()||R(e,getSelection().getRangeAt(0).cloneRange()),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType)return t.preventInput?(t.preventInput=!1,void tR(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data||R(e,getSelection().getRangeAt(0).cloneRange(),!1,n))}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName)return n.target.checked?n.target.setAttribute("checked","checked"):n.target.removeAttribute("checked"),t.preventInput=!0,void tR(e);var r=(0,O.zh)(e),i=(0,b.fb)(n.target,"vditor-ir__preview");if(i||(i=(0,b.fb)(r.startContainer,"vditor-ir__preview")),i&&(i.previousElementSibling.firstElementChild?r.selectNodeContents(i.previousElementSibling.firstElementChild):r.selectNodeContents(i.previousElementSibling),r.collapse(!0),(0,O.Hc)(r),eY(e)),"IMG"===n.target.tagName){var a=n.target.parentElement.querySelector(".vditor-ir__marker--link");a&&(r.selectNode(a),(0,O.Hc)(r))}var l=(0,b.a1)(n.target,"data-type","a");if(!l||l.classList.contains("vditor-ir__node--expand")){if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&r.collapsed){var s=t.element.lastElementChild.getBoundingClientRect();n.y>s.top+s.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(o.g.ZWSP,"")?(r.selectNodeContents(t.element.lastElementChild),r.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+o.g.ZWSP+"<wbr></p>"),(0,O.ib)(t.element,r)))}""===r.toString()?q(r,e):setTimeout(function(){q((0,O.zh)(e),e)}),j(n,e),ey(e)}else e.options.link.click?e.options.link.click(l.querySelector(":scope > .vditor-ir__marker--link")):e.options.link.isOpen&&window.open(l.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(n){if(!n.isComposing&&!(0,d.yl)(n)){if("Enter"===n.key&&eY(e),ey(e),("Backspace"===n.key||"Delete"===n.key)&&""!==e.ir.element.innerHTML&&1===e.ir.element.childNodes.length&&e.ir.element.firstElementChild&&"P"===e.ir.element.firstElementChild.tagName&&0===e.ir.element.firstElementChild.childElementCount&&(""===e.ir.element.textContent||"\n"===e.ir.element.textContent))e.ir.element.innerHTML="";else{var r=(0,O.zh)(e);"Backspace"===n.key?((0,d.vU)()&&"\n"===r.startContainer.textContent&&1===r.startOffset&&(r.startContainer.textContent="",q(r,e)),t.element.querySelectorAll(".language-math").forEach(function(e){var t=e.querySelector("br");t&&t.remove()})):n.key.indexOf("Arrow")>-1?("ArrowLeft"!==n.key&&"ArrowRight"!==n.key||tI(e),q(r,e)):229===n.keyCode&&""===n.code&&"Unidentified"===n.key&&q(r,e);var i=(0,b.fb)(r.startContainer,"vditor-ir__preview");if(i){if("ArrowUp"===n.key||"ArrowLeft"===n.key)return i.previousElementSibling.firstElementChild?r.selectNodeContents(i.previousElementSibling.firstElementChild):r.selectNodeContents(i.previousElementSibling),r.collapse(!1),n.preventDefault(),!0;if("SPAN"===i.tagName&&("ArrowDown"===n.key||"ArrowRight"===n.key))return"html-entity"===i.parentElement.getAttribute("data-type")?(i.parentElement.insertAdjacentText("afterend",o.g.ZWSP),r.setStart(i.parentElement.nextSibling,1)):r.selectNodeContents(i.parentElement.lastElementChild),r.collapse(!1),n.preventDefault(),!0}}}})},e}(),tW=function(e){return"sv"===e.currentMode?e.lute.Md2HTML(a(e)):"wysiwyg"===e.currentMode?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},tG=n(895),tF=n(818),tK=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'+e+'</div>\n<div class="vditor-outline__content"></div>'}return e.prototype.render=function(e){return"block"===e.preview.element.style.display?(0,tF.k)(e.preview.previewElement,this.element.lastElementChild,e):(0,tF.k)(e[e.currentMode].element,this.element.lastElementChild,e)},e.prototype.toggle=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);var r,i=null===(r=e.toolbar.elements.outline)||void 0===r?void 0:r.firstElementChild;if(t&&window.innerWidth>=o.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(e),null==i||i.classList.add("vditor-menu--current")):(this.element.style.display="none",null==i||i.classList.remove("vditor-menu--current")),n&&getSelection().rangeCount>0){var a=getSelection().getRangeAt(0);e[e.currentMode].element.contains(a.startContainer)&&(0,O.Hc)(a)}G(e)},e}(),tZ=n(554),tJ=function(){function e(e){var t=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",e.options.classes.preview&&this.previewElement.classList.add(e.options.classes.preview),this.previewElement.style.maxWidth=e.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(n){if("TEXTAREA"!==n.target.tagName){var r=document.createElement("div");r.className="vditor-reset",r.appendChild(getSelection().getRangeAt(0).cloneContents()),t.copyToX(e,r,"default"),n.preventDefault()}}),this.previewElement.addEventListener("click",function(n){var r=(0,b.lG)(n.target,"SPAN");if(r&&(0,b.fb)(r,"vditor-toc")){var o=t.previewElement.querySelector("#"+r.getAttribute("data-target-id"));o&&(t.element.scrollTop=o.offsetTop)}else{if("A"===n.target.tagName)return e.options.link.click?e.options.link.click(n.target):e.options.link.isOpen&&window.open(n.target.getAttribute("href")),void n.preventDefault();"IMG"===n.target.tagName&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,B.E)(n.target,e.options.lang,e.options.theme))}}),this.element.appendChild(this.previewElement);var n=e.options.preview.actions;if(0!==n.length){var r=document.createElement("div");r.className="vditor-preview__action";for(var o=[],i=0;i<n.length;i++){var a=n[i];if("object"!=typeof a)switch(a){case"desktop":o.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":o.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":o.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":o.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":o.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}else o.push('<button type="button" data-type="'+a.key+'" class="'+a.className+'"'+(a.tooltip?' aria-label="'+a.tooltip+'"':"")+'">'+a.text+"</button>")}r.innerHTML=o.join(""),r.addEventListener((0,d.Le)(),function(o){var i=(0,y.S)(o.target,"BUTTON");if(i){var a=i.getAttribute("data-type"),l=n.find(function(e){return(null==e?void 0:e.key)===a});l?l.click(a):"mp-wechat"!==a&&"zhihu"!==a?(t.previewElement.style.width="desktop"===a?"auto":"tablet"===a?"780px":"360px",t.previewElement.scrollWidth>t.previewElement.parentElement.clientWidth&&(t.previewElement.style.width="auto"),t.render(e),r.querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-preview__action--current")}),i.classList.add("vditor-preview__action--current")):t.copyToX(e,t.previewElement.cloneNode(!0),a)}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(e,t){var n=this;if(clearTimeout(this.mdTimeoutId),"none"!==this.element.style.display){if(t)this.previewElement.innerHTML=t;else if(""!==a(e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")){var r=(new Date).getTime(),o=a(e);this.mdTimeoutId=window.setTimeout(function(){if(e.options.preview.url){var t=new XMLHttpRequest;t.open("POST",e.options.preview.url),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE){if(200===t.status){var i=JSON.parse(t.responseText);if(0!==i.code)return void e.tip.show(i.msg);e.options.preview.transform&&(i.data=e.options.preview.transform(i.data)),n.previewElement.innerHTML=i.data,n.afterRender(e,r)}else{var a=e.lute.Md2HTML(o);e.options.preview.transform&&(a=e.options.preview.transform(a)),n.previewElement.innerHTML=a,n.afterRender(e,r)}}},t.send(JSON.stringify({markdownText:o}))}else{var i=e.lute.Md2HTML(o);e.options.preview.transform&&(i=e.options.preview.transform(i)),n.previewElement.innerHTML=i,n.afterRender(e,r)}},e.options.preview.delay)}else this.previewElement.innerHTML=""}else"renderPerformance"===this.element.getAttribute("data-type")&&e.tip.hide()},e.prototype.afterRender=function(e,t){e.options.preview.parse&&e.options.preview.parse(this.element);var n=(new Date).getTime()-t;(new Date).getTime()-t>2600?(e.tip.show(window.VditorI18n.performanceTip.replace("${x}",n.toString())),e.preview.element.setAttribute("data-type","renderPerformance")):"renderPerformance"===e.preview.element.getAttribute("data-type")&&(e.tip.hide(),e.preview.element.removeAttribute("data-type"));var r=e.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,x.O)(e.preview.previewElement,e.options.preview.hljs),(0,L.s)(e.options.preview.hljs,e.preview.previewElement,e.options.cdn),(0,C.i)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,M.K)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,S.P)(e.preview.previewElement,e.options.cdn),(0,_.v)(e.preview.previewElement,e.options.cdn),(0,E.p)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,A.P)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,H.B)(e.preview.previewElement,e.options.cdn),(0,k.Q)(e.preview.previewElement,e.options.cdn),e.options.preview.render.media.enable&&(0,tZ.Y)(e.preview.previewElement),e.options.customRenders.forEach(function(t){t.render(e.preview.previewElement,e)});var o=e.preview.element,i=e.outline.render(e);""===i&&(i="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=i,(0,T.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),(0,T.H)(e.preview.previewElement,{cdn:e.options.cdn,math:e.options.preview.math})},e.prototype.copyToX=function(e,t,n){void 0===n&&(n="mp-wechat"),"zhihu"!==n?t.querySelectorAll(".katex-html .base").forEach(function(e){e.style.display="initial"}):t.querySelectorAll(".language-math").forEach(function(e){e.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'+e.getAttribute("data-math")+'\\" style="display: block; margin: 0 auto; max-width: 100%;">'}),t.style.backgroundColor="#fff",t.querySelectorAll("code").forEach(function(e){e.style.backgroundImage="none"}),this.element.append(t);var r=t.ownerDocument.createRange();r.selectNode(t),(0,O.Hc)(r),document.execCommand("copy"),t.remove(),e.tip.show(["zhihu","mp-wechat"].includes(n)?"已复制,可到"+("zhihu"===n?"知乎":"微信公众号平台")+"进行粘贴":"已复制到剪切板")},e}(),tX=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--"+e.options.resize.position,this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(e)}return e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("mousedown",function(n){var r=document,o=n.clientY,i=e.element.offsetHeight,a=63+e.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),t.element.classList.add("vditor-resize--selected"),r.onmousemove=function(t){"top"===e.options.resize.position?e.element.style.height=Math.max(a,i+(o-t.clientY))+"px":e.element.style.height=Math.max(a,i+(t.clientY-o))+"px",e.options.typewriterMode&&(e.sv.element.style.paddingBottom=e.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){e.options.resize.after&&e.options.resize.after(e.element.offsetHeight-i),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,t.element.classList.remove("vditor-resize--selected")}})},e}(),tY=function(){function e(e){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",e.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(e),eG(e,this.element),eK(e,this.element),eQ(e,this.element),e$(e,this.element),eZ(e,this.element),eJ(e,this.element,this.copy),eX(e,this.element,this.copy)}return e.prototype.copy=function(e,t){e.stopPropagation(),e.preventDefault(),e.clipboardData.setData("text/plain",eW(t[t.currentMode].element))},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){tj(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){if("block"===e.preview.element.style.display){var n=t.element.scrollTop,r=t.element.clientHeight,o=t.element.scrollHeight-parseFloat(t.element.style.paddingBottom||"0"),i=e.preview.element;i.scrollTop=n/r>.5?(n+r)*i.scrollHeight/o-r:n*i.scrollHeight/o}}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,d.vU)()||U(e,n),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&!t.composingLock&&"‘"!==n.data&&"“"!==n.data&&"《"!==n.data)return t.preventInput?(t.preventInput=!1,void e5(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void U(e,n)}),this.element.addEventListener("keyup",function(t){t.isComposing||(0,d.yl)(t)||(("Backspace"===t.key||"Delete"===t.key)&&""!==e.sv.element.innerHTML&&1===e.sv.element.childNodes.length&&e.sv.element.firstElementChild&&"DIV"===e.sv.element.firstElementChild.tagName&&2===e.sv.element.firstElementChild.childElementCount&&(""===e.sv.element.firstElementChild.textContent||"\n"===e.sv.element.textContent)?e.sv.element.innerHTML="":"Enter"===t.key&&eY(e))})},e}(),tQ=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(e,t){var n=this;void 0===t&&(t=6e3),this.element.className="vditor-tip vditor-tip--show",0===t?(this.element.innerHTML='<div class="vditor-tip__content">'+e+'\n<div class="vditor-tip__close">X</div></div>',this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){n.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'+e+"</div>",setTimeout(function(){n.hide()},t)),this.element.removeAttribute("style"),setTimeout(function(){n.element.getBoundingClientRect().top<46&&(n.element.style.position="fixed",n.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),t$=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),u(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",c(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},t0=(Z=function(e,t){return(Z=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),t1=function(e){function t(t,n){var r=e.call(this,t,n)||this;return"both"===t.options.preview.mode&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,d.Le)(),function(e){r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.preventDefault(),"sv"===t.currentMode&&("both"===t.options.preview.mode?t$("editor",t):t$("both",t)))}),r}return t0(t,e),t}(eB),t2=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},t3=n(312),t5=(J=function(e,t){return(J=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),t4=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=r.element.children[0],a=document.createElement("div");a.className="vditor-hint"+(2===n.level?"":" vditor-panel--arrow");var l="";return o.g.CODE_THEME.forEach(function(e){l+="<button>"+e+"</button>"}),a.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+l+"</div>",a.addEventListener((0,d.Le)(),function(e){"BUTTON"===e.target.tagName&&(h(t,["subToolbar"]),t.options.preview.hljs.style=e.target.textContent,(0,t3.Y)(e.target.textContent,t.options.cdn),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(a),g(t,a,i,n.level),r}return t5(t,e),t}(eB),t6=(X=function(e,t){return(X=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}X(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),t8=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");i.className="vditor-hint"+(2===n.level?"":" vditor-panel--arrow");var a="";return Object.keys(t.options.preview.theme.list).forEach(function(e){a+='<button data-type="'+e+'">'+t.options.preview.theme.list[e]+"</button>"}),i.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+a+"</div>",i.addEventListener((0,d.Le)(),function(e){"BUTTON"===e.target.tagName&&(h(t,["subToolbar"]),t.options.preview.theme.current=e.target.getAttribute("data-type"),(0,V.Z)(t.options.preview.theme.current,t.options.preview.theme.path),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(i),g(t,i,o,n.level),r}return t6(t,e),t}(eB),t9=function(){function e(e){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(e,"")}return e.prototype.render=function(e,t){var n=t.endsWith("\n")?t.length-1:t.length;if("text"===e.options.counter.type&&e[e.currentMode]){var r=e[e.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){e.remove()}),n=r.textContent.length}"number"==typeof e.options.counter.max?(n>e.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML=n+"/"+e.options.counter.max):this.element.innerHTML=""+n,this.element.setAttribute("aria-label",e.options.counter.type),e.options.counter.after&&e.options.counter.after(n,{enable:e.options.counter.enable,max:e.options.counter.max,type:e.options.counter.type})},e}(),t7=(Y=function(e,t){return(Y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ne=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].innerHTML=n.icon,r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),e.currentTarget.classList.contains(o.g.CLASS_MENU_DISABLED)||n.click(e,t)}),r}return t7(t,e),t}(eB),nt=(Q=function(e,t){return(Q=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.firstElementChild.addEventListener((0,d.Le)(),function(e){var n=r.element.firstElementChild;n.classList.contains(o.g.CLASS_MENU_DISABLED)||(e.preventDefault(),n.classList.contains("vditor-menu--current")?(n.classList.remove("vditor-menu--current"),t.devtools.element.style.display="none",G(t)):(n.classList.add("vditor-menu--current"),t.devtools.element.style.display="block",G(t),t.devtools.renderEchart(t)))}),r}return nt(t,e),t}(eB),nr=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},no=($=function(e,t){return($=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ni=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var i="";return Object.keys(t.options.hint.emoji).forEach(function(e){var n=t.options.hint.emoji[e];n.indexOf(".")>-1?i+='<button data-value=":'+e+': " data-key=":'+e+':"><img\ndata-value=":'+e+': " data-key=":'+e+':" class="vditor-emojis__icon" src="'+n+'"/></button>':i+='<button data-value="'+n+' "\n data-key="'+e+'"><span class="vditor-emojis__icon">'+n+"</span></button>"}),o.innerHTML='<div class="vditor-emojis" style="max-height: '+("auto"===t.options.height?"auto":t.options.height-80)+'px">'+i+'</div><div class="vditor-emojis__tail">\n <span class="vditor-emojis__tip"></span><span>'+(t.options.hint.emojiTail||"")+"</span>\n</div>",r.element.appendChild(o),g(t,o,r.element.firstElementChild,n.level),r.bindEvent(t),r}return no(t,e),t.prototype.bindEvent=function(e){var t=this;this.element.lastElementChild.addEventListener((0,d.Le)(),function(n){var r=(0,y.S)(n.target,"BUTTON");if(r){n.preventDefault();var o=r.getAttribute("data-value"),i=(0,O.zh)(e),a=o;if("wysiwyg"===e.currentMode?a=e.lute.SpinVditorDOM(o):"ir"===e.currentMode&&(a=e.lute.SpinVditorIRDOM(o)),o.indexOf(":")>-1&&"sv"!==e.currentMode){var l=document.createElement("div");l.innerHTML=a,a=l.firstElementChild.firstElementChild.outerHTML+" ",(0,O.oC)(a,e)}else i.extractContents(),i.insertNode(document.createTextNode(o));i.collapse(!1),(0,O.Hc)(i),t.element.lastElementChild.style.display="none",ty(e)}}),this.element.lastElementChild.addEventListener("mouseover",function(e){var n=(0,y.S)(e.target,"BUTTON");n&&(t.element.querySelector(".vditor-emojis__tip").innerHTML=n.getAttribute("data-key"))})},t}(eB),na=function(e,t,n){var r=document.createElement("a");"download"in r?(r.download=n,r.style.display="none",r.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(r),r.click(),r.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},nl=(ee=function(e,t){return(ee=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ee(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ns=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],i=document.createElement("div");return i.className="vditor-hint"+(2===n.level?"":" vditor-panel--arrow"),i.innerHTML='<button data-type="markdown">Markdown</button>\n<button data-type="pdf">PDF</button>\n<button data-type="html">HTML</button>',i.addEventListener((0,d.Le)(),function(e){var n,r,o,i,l,s=e.target;if("BUTTON"===s.tagName){;switch(s.getAttribute("data-type")){case"markdown":;r=a(n=t),na(n,r,r.substr(0,10)+".md");break;case"pdf":!function(e){e.tip.show(window.VditorI18n.generate,3800);var t=document.querySelector("#vditorExportIframe");t.contentDocument.open(),t.contentDocument.write('<link rel="stylesheet" href="'+e.options.cdn+'/dist/index.css"/>\n<script src="'+e.options.cdn+'/dist/method.min.js"><\/script>\n<div id="preview" style="width: 800px"></div>\n<script>\nwindow.addEventListener("message", (e) => {\n if(!e.data) {\n return;\n }\n Vditor.preview(document.getElementById(\'preview\'), e.data, {\n cdn: "'+e.options.cdn+'",\n markdown: {\n theme: '+JSON.stringify(e.options.preview.theme)+'\n },\n hljs: {\n style: "'+e.options.preview.hljs.style+'"\n }\n });\n setTimeout(() => {\n window.print();\n }, 3600);\n}, false);\n<\/script>'),t.contentDocument.close(),setTimeout(function(){t.contentWindow.postMessage(a(e),"*")},200)}(t);break;case"html":;i=tW(o=t),l='<html><head><link rel="stylesheet" type="text/css" href="'+o.options.cdn+'/dist/index.css"/>\n<script src="'+o.options.cdn+"/dist/js/i18n/"+o.options.lang+'.js"><\/script>\n<script src="'+o.options.cdn+'/dist/method.min.js"><\/script></head>\n<body><div class="vditor-reset" id="preview">'+i+"</div>\n<script>\n const previewElement = document.getElementById('preview')\n Vditor.setContentTheme('"+o.options.preview.theme.current+"', '"+o.options.preview.theme.path+"');\n Vditor.codeRender(previewElement);\n Vditor.highlightRender("+JSON.stringify(o.options.preview.hljs)+", previewElement, '"+o.options.cdn+"');\n Vditor.mathRender(previewElement, {\n cdn: '"+o.options.cdn+"',\n math: "+JSON.stringify(o.options.preview.math)+",\n });\n Vditor.mermaidRender(previewElement, '"+o.options.cdn+"', '"+o.options.theme+"');\n Vditor.markmapRender(previewElement, '"+o.options.cdn+"', '"+o.options.theme+"');\n Vditor.flowchartRender(previewElement, '"+o.options.cdn+"');\n Vditor.graphvizRender(previewElement, '"+o.options.cdn+"');\n Vditor.chartRender(previewElement, '"+o.options.cdn+"', '"+o.options.theme+"');\n Vditor.mindmapRender(previewElement, '"+o.options.cdn+"', '"+o.options.theme+"');\n Vditor.abcRender(previewElement, '"+o.options.cdn+"');\n "+(o.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"")+'\n Vditor.speechRender(previewElement);\n<\/script>\n<script src="'+o.options.cdn+"/dist/js/icons/"+o.options.icon+'.js"><\/script></body></html>',na(o,l,i.substr(0,10)+".html")}h(t,["subToolbar"]),e.preventDefault(),e.stopPropagation()}}),r.element.appendChild(i),g(t,i,o,n.level),r}return nl(t,e),t}(eB),nd=(et=function(e,t){return(et=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}et(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nc=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t,n),r}return nd(t,e),t.prototype._bindEvent=function(e,t){this.element.children[0].addEventListener((0,d.Le)(),function(n){n.preventDefault(),e.element.className.includes("vditor--fullscreen")?(t.level||(this.innerHTML=t.icon),e.element.style.zIndex="",document.body.style.overflow="",e.element.classList.remove("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__s","__n"),e.options.toolbar.forEach(function(e){"string"!=typeof e&&e.tipPosition&&e.name===n.dataset.type&&(n.className="vditor-tooltipped vditor-tooltipped__"+e.tipPosition)}))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__s","__n"))):(t.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),e.element.style.zIndex=e.options.fullscreen.index.toString(),document.body.style.overflow="hidden",e.element.classList.add("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__n","__s"))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__n","__s"))),e.devtools&&e.devtools.renderEchart(e),t.click&&t.click(n,e),G(e),F(e)})},t}(eB),nu=(en=function(e,t){return(en=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}en(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),np=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=document.createElement("div");return o.className="vditor-hint vditor-panel--arrow",o.innerHTML='<button data-tag="h1" data-value="# ">'+window.VditorI18n.heading1+" "+(0,d.ns)("&lt;⌥⌘1>")+'</button>\n<button data-tag="h2" data-value="## ">'+window.VditorI18n.heading2+" &lt;"+(0,d.ns)("⌥⌘2")+'></button>\n<button data-tag="h3" data-value="### ">'+window.VditorI18n.heading3+" &lt;"+(0,d.ns)("⌥⌘3")+'></button>\n<button data-tag="h4" data-value="#### ">'+window.VditorI18n.heading4+" &lt;"+(0,d.ns)("⌥⌘4")+'></button>\n<button data-tag="h5" data-value="##### ">'+window.VditorI18n.heading5+" &lt;"+(0,d.ns)("⌥⌘5")+'></button>\n<button data-tag="h6" data-value="###### ">'+window.VditorI18n.heading6+" &lt;"+(0,d.ns)("⌥⌘6")+"></button>",r.element.appendChild(o),r._bindEvent(t,o),r}return nu(t,e),t.prototype._bindEvent=function(e,t){var n=this.element.children[0];n.addEventListener((0,d.Le)(),function(r){r.preventDefault(),clearTimeout(e.wysiwyg.afterRenderTimeoutId),clearTimeout(e.ir.processTimeoutId),clearTimeout(e.sv.processTimeoutId),n.classList.contains(o.g.CLASS_MENU_DISABLED)||(n.blur(),n.classList.contains("vditor-menu--current")?("wysiwyg"===e.currentMode?(e_(e),ew(e)):"ir"===e.currentMode&&tP(e,""),n.classList.remove("vditor-menu--current")):(h(e,["subToolbar"]),t.style.display="block"))});for(var r=0;r<6;r++)t.children.item(r).addEventListener((0,d.Le)(),function(r){r.preventDefault(),"wysiwyg"===e.currentMode?(eS(e,r.target.getAttribute("data-tag")),ew(e),n.classList.add("vditor-menu--current")):"ir"===e.currentMode?(tP(e,r.target.getAttribute("data-value")),n.classList.add("vditor-menu--current")):e4(e,r.target.getAttribute("data-value")),t.style.display="none"})},t}(eB),nf=(er=function(e,t){return(er=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}er(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nm=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">\n<div style="margin-top: 14px;flex: 1">\n <div>Markdown 使用指南</div>\n <ul style="list-style: none">\n <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>\n <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>\n <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>\n <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>\n </ul>\n</div>\n<div style="margin-top: 14px;flex: 1">\n <div>Vditor 支持</div>\n <ul style="list-style: none">\n <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>\n <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>\n <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>\n <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>\n </ul>\n</div></div>',0)}),r}return nf(t,e),t}(eB),nv=(eo=function(e,t){return(eo=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}eo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nh=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,O.zh)(t),i=(0,b.lG)(n.startContainer,"LI");i&&tm(t,i,n)}}),r}return nv(t,e),t}(eB),ng=(ei=function(e,t){return(ei=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ei(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nb=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">\n<p style="text-align: center;margin: 14px 0">\n <em>下一代的 Markdown 编辑器,为未来而构建</em>\n</p>\n<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">\n <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>\n <div>&nbsp;&nbsp;</div>\n <div style="flex: 1;min-width: 250px">\n Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。\n 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。\n </div>\n</div>\n<div style="display: flex;flex-wrap: wrap;">\n <ul style="list-style: none;flex: 1;min-width:148px">\n <li>\n 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>\n </li>\n <li>\n 开源协议:MIT\n </li>\n </ul>\n <ul style="list-style: none;margin-right: 18px">\n <li>\n 组件版本:Vditor v'+o.H+" / Lute v"+Lute.Version+'\n </li>\n <li>\n 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>\n </li>\n </ul>\n</div>\n</div>',0)}),r}return ng(t,e),t}(eB),ny=(ea=function(e,t){return(ea=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ea(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nw=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||tl(t,"afterend")}),r}return ny(t,e),t}(eB),nk=(el=function(e,t){return(el=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}el(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nE=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||tl(t,"beforebegin")}),r}return nk(t,e),t}(eB),nx=(es=function(e,t){return(es=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}es(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nS=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,d.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,O.zh)(t),i=(0,b.lG)(n.startContainer,"LI");i&&tv(t,i,n,i.parentElement)}}),r}return nx(t,e),t}(eB),n_=(ed=function(e,t){return(ed=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ed(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nL=function(e){function t(t,n){var r=e.call(this,t,n)||this;return t.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),t.toolbar.elements.outline.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||(t.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),t.outline.toggle(t,t.options.outline.enable))}),r}return n_(t,e),t}(eB),nT=(ec=function(e,t){return(ec=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ec(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nC=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nT(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,d.Le)(),function(n){n.preventDefault();var r=t.element.firstElementChild;if(!r.classList.contains(o.g.CLASS_MENU_DISABLED)){var i=o.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);r.classList.contains("vditor-menu--current")?(r.classList.remove("vditor-menu--current"),"sv"===e.currentMode?(e.sv.element.style.display="block","both"===e.options.preview.mode?e.preview.element.style.display="block":e.preview.element.style.display="none"):(e[e.currentMode].element.parentElement.style.display="block",e.preview.element.style.display="none"),p(e.toolbar.elements,i),e.outline.render(e)):(f(e.toolbar.elements,i),e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),r.classList.add("vditor-menu--current"),h(e,["subToolbar","hint","popover"]),setTimeout(function(){e.outline.render(e)},e.options.preview.delay+10)),G(e)}})},t}(eB),nM=function(){function e(e){if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)t=new AudioContext;else{if(!webkitAudioContext)return;t=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=t.sampleRate;var t,n=t.createGain();t.createMediaStreamSource(e).connect(n),this.recorder=t.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(t.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(e,t){this.leftChannel.push(new Float32Array(e)),this.rightChannel.push(new Float32Array(t)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var e=this.mergeBuffers(this.leftChannel),t=this.mergeBuffers(this.rightChannel),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=.5*(e[r]+t[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var o=44+2*n.length,i=new DataView(new ArrayBuffer(o));this.writeUTFBytes(i,0,"RIFF"),i.setUint32(4,o,!0),this.writeUTFBytes(i,8,"WAVE"),this.writeUTFBytes(i,12,"fmt "),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,1,!0),i.setUint32(24,this.SAMPLE_RATE,!0),i.setUint32(28,2*this.SAMPLE_RATE,!0),i.setUint16(32,2,!0),i.setUint16(34,16,!0);var a=2*n.length;this.writeUTFBytes(i,36,"data"),i.setUint32(40,a,!0);for(var l=n.length,s=44,d=0;d<l;d++)i.setInt16(s,32767*n[d],!0),s+=2;return new Blob([i],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(e,t){if(t===this.DEFAULT_SAMPLE_RATE||t>this.DEFAULT_SAMPLE_RATE)return e;for(var n=this.DEFAULT_SAMPLE_RATE/t,r=Math.round(e.length/n),o=new Float32Array(r),i=0,a=0;i<o.length;){for(var l=Math.round((i+1)*n),s=0,d=0,c=a;c<l&&c<e.length;c++)s+=e[c],d++;o[i]=s/d,i++,a=l}return o},e.prototype.mergeBuffers=function(e){for(var t=new Float32Array(this.recordingLength),n=0,r=e.length,o=0;o<r;++o){var i=e[o];t.set(i,n),n+=i.length}return t},e.prototype.writeUTFBytes=function(e,t,n){for(var r=n.length,o=0;o<r;o++)e.setUint8(t+o,n.charCodeAt(o))},e}(),nA=(eu=function(e,t){return(eu=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}eu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nH=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nA(t,e),t.prototype._bindEvent=function(e){var t,n=this;this.element.children[0].addEventListener((0,d.Le)(),function(r){if(r.preventDefault(),!n.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)){var i=e[e.currentMode].element;t?t.isRecording?(t.stopRecording(),e.tip.hide(),tt(e,[new File([t.buildWavFileBlob()],"record"+(new Date).getTime()+".wav",{type:"video/webm"})]),n.element.children[0].classList.remove("vditor-menu--current")):(e.tip.show(window.VditorI18n.recording),i.setAttribute("contenteditable","false"),t.startRecordingNewWavFile(),n.element.children[0].classList.add("vditor-menu--current")):navigator.mediaDevices.getUserMedia({audio:!0}).then(function(r){(t=new nM(r)).recorder.onaudioprocess=function(e){if(t.isRecording){var n=e.inputBuffer.getChannelData(0),r=e.inputBuffer.getChannelData(1);t.cloneChannelData(n,r)}},t.startRecordingNewWavFile(),e.tip.show(window.VditorI18n.recording),i.setAttribute("contenteditable","false"),n.element.children[0].classList.add("vditor-menu--current")}).catch(function(){e.tip.show(window.VditorI18n["record-tip"])})}})},t}(eB),nN=(ep=function(e,t){return(ep=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ep(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nO=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||t.undo.redo(t)}),r}return nN(t,e),t}(eB),nD=(ef=function(e,t){return(ef=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ef(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nj=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,d.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED)||t.undo.undo(t)}),r}return nD(t,e),t}(eB),nI=(em=function(e,t){return(em=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}em(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),nR=function(e){function t(t,n){var r=e.call(this,t,n)||this,o='<input type="file"';return t.options.upload.multiple&&(o+=' multiple="multiple"'),t.options.upload.accept&&(o+=' accept="'+t.options.upload.accept+'"'),r.element.children[0].innerHTML=""+(n.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>')+o+">",r._bindEvent(t),r}return nI(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,d.Le)(),function(e){if(t.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED))return e.stopPropagation(),void e.preventDefault()}),this.element.querySelector("input").addEventListener("change",function(n){if(t.element.firstElementChild.classList.contains(o.g.CLASS_MENU_DISABLED))return n.stopPropagation(),void n.preventDefault();0!==n.target.files.length&&tt(e,n.target.files,n.target)})},t}(eB),nP=function(){function e(e){var t=this,n=e.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",n.toolbar.forEach(function(n,r){var o=t.genItem(e,n,r);if(t.element.appendChild(o),n.toolbar){var i=document.createElement("div");i.className="vditor-hint vditor-panel--arrow",i.addEventListener((0,d.Le)(),function(e){i.style.display="none"}),n.toolbar.forEach(function(n,o){n.level=2,i.appendChild(t.genItem(e,n,r+o))}),o.appendChild(i),g(e,i,o.children[0])}}),e.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),e.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),e.options.counter.enable&&(e.counter=new t9(e),this.element.appendChild(e.counter.element))}return e.prototype.genItem=function(e,t,n){var r;switch(t.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":r=new eB(e,t);break;case"emoji":r=new ni(e,t);break;case"headings":r=new np(e,t);break;case"|":r=new nr;break;case"br":r=new t2;break;case"undo":r=new nj(e,t);break;case"redo":r=new nO(e,t);break;case"help":r=new nm(e,t);break;case"both":r=new t1(e,t);break;case"preview":r=new nC(e,t);break;case"fullscreen":r=new nc(e,t);break;case"upload":r=new nR(e,t);break;case"record":r=new nH(e,t);break;case"info":r=new nb(e,t);break;case"edit-mode":r=new eV(e,t);break;case"devtools":r=new nn(e,t);break;case"outdent":r=new nS(e,t);break;case"indent":r=new nh(e,t);break;case"outline":r=new nL(e,t);break;case"insert-after":r=new nw(e,t);break;case"insert-before":r=new nE(e,t);break;case"code-theme":r=new t4(e,t);break;case"content-theme":r=new t8(e,t);break;case"export":r=new ns(e,t);break;default:r=new ne(e,t)}if(r){var o=t.name;return"br"!==o&&"|"!==o||(o+=n),this.elements[o]=r.element,r.element}},e}(),nq=n(471),nB=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new nq}return e.prototype.clearStack=function(e){this.resetStack(),this.resetIcon(e)},e.prototype.resetIcon=function(e){e.toolbar&&(this[e.currentMode].undoStack.length>1?p(e.toolbar.elements,["undo"]):f(e.toolbar.elements,["undo"]),0!==this[e.currentMode].redoStack.length?p(e.toolbar.elements,["redo"]):f(e.toolbar.elements,["redo"]))},e.prototype.undo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&!(this[e.currentMode].undoStack.length<2)){var t=this[e.currentMode].undoStack.pop();t&&(this[e.currentMode].redoStack.push(t),this.renderDiff(t,e),this[e.currentMode].hasUndo=!0,h(e,["hint"]))}},e.prototype.redo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")){var t=this[e.currentMode].redoStack.pop();t&&(this[e.currentMode].undoStack.push(t),this.renderDiff(t,e,!0))}},e.prototype.recordFirstPosition=function(e,t){if(0!==getSelection().rangeCount&&!(1!==this[e.currentMode].undoStack.length||0===this[e.currentMode].undoStack[0].length||this[e.currentMode].redoStack.length>0||(0,d.vU)()&&"Backspace"===t.key||(0,d.G6)())){var n=this.addCaret(e);n.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[e.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[e.currentMode].undoStack[0][0].diffs[0][1]=n,this[e.currentMode].lastText=n)}},e.prototype.addToUndoStack=function(e){var t=this.addCaret(e,!0),n=this.dmp.diff_main(t,this[e.currentMode].lastText,!0),r=this.dmp.patch_make(t,this[e.currentMode].lastText,n);0===r.length&&this[e.currentMode].undoStack.length>0||(this[e.currentMode].lastText=t,this[e.currentMode].undoStack.push(r),this[e.currentMode].undoStack.length>this.stackSize&&this[e.currentMode].undoStack.shift(),this[e.currentMode].hasUndo&&(this[e.currentMode].redoStack=[],this[e.currentMode].hasUndo=!1,f(e.toolbar.elements,["redo"])),this[e.currentMode].undoStack.length>1&&p(e.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(e,t,n){var r;if(void 0===n&&(n=!1),n){var o=this.dmp.patch_deepCopy(e).reverse();o.forEach(function(e){e.diffs.forEach(function(e){e[0]=-e[0]})}),r=this.dmp.patch_apply(o,this[t.currentMode].lastText)[0]}else r=this.dmp.patch_apply(e,this[t.currentMode].lastText)[0];if(this[t.currentMode].lastText=r,t[t.currentMode].element.innerHTML=r,"sv"!==t.currentMode&&t[t.currentMode].element.querySelectorAll(".vditor-"+t.currentMode+"__preview[data-render='2']").forEach(function(e){N(e,t)}),t[t.currentMode].element.querySelector("wbr"))(0,O.ib)(t[t.currentMode].element,t[t.currentMode].element.ownerDocument.createRange()),eY(t);else{var i=getSelection().getRangeAt(0);i.setEndBefore(t[t.currentMode].element),i.collapse(!1)}D(t),ty(t,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),eR(t),t[t.currentMode].element.querySelectorAll(".vditor-"+t.currentMode+"__preview[data-render='2']").forEach(function(e){N(e,t)}),this[t.currentMode].undoStack.length>1?p(t.toolbar.elements,["undo"]):f(t.toolbar.elements,["undo"]),0!==this[t.currentMode].redoStack.length?p(t.toolbar.elements,["redo"]):f(t.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(e,t){if(void 0===t&&(t=!1),0!==getSelection().rangeCount&&!e[e.currentMode].element.querySelector("wbr")){var n,r=getSelection().getRangeAt(0);if(e[e.currentMode].element.contains(r.startContainer)){n=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}e.ir.element.cloneNode(!0).querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='1']").forEach(function(e){e.firstElementChild&&(e.firstElementChild.classList.contains("language-echarts")||e.firstElementChild.classList.contains("language-plantuml")||e.firstElementChild.classList.contains("language-mindmap")?(e.firstElementChild.removeAttribute("_echarts_instance_"),e.firstElementChild.removeAttribute("data-processed"),e.firstElementChild.innerHTML=e.previousElementSibling.firstElementChild.innerHTML,e.setAttribute("data-render","2")):e.firstElementChild.classList.contains("language-math")&&(e.setAttribute("data-render","2"),e.firstElementChild.textContent=e.firstElementChild.getAttribute("data-math"),e.firstElementChild.removeAttribute("data-math")))});var i=e[e.currentMode].element.innerHTML;return e[e.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(e){e.remove()}),t&&n&&(0,O.Hc)(n),i.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),nz=n(640),nU=function(){function e(e){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:o.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"\uD83D\uDC4D","-1":"\uD83D\uDC4E",confused:"\uD83D\uDE15",eyes:"\uD83D\uDC40️",heart:"❤️",rocket:"\uD83D\uDE80️",smile:"\uD83D\uDE04",tada:"\uD83C\uDF89️"},emojiPath:o.g.CDN+"/dist/images/emoji",extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:o.g.HLJS_OPTIONS,markdown:o.g.MARKDOWN_OPTIONS,math:o.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:o.g.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(e){return e.replace(/\W/g,"")},linkToImgUrl:"",max:0xa00000,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=e}return e.prototype.merge=function(){this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),(null===(t=null===(e=this.options.preview)||void 0===e?void 0:e.theme)||void 0===t?void 0:t.list)&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),(null===(o=null===(r=null===(n=this.options.preview)||void 0===n?void 0:n.render)||void 0===r?void 0:r.media)||void 0===o?void 0:o.enable)&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),(null===(i=this.options.hint)||void 0===i?void 0:i.emoji)&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&((null===(l=null===(a=this.options.preview)||void 0===a?void 0:a.theme)||void 0===l?void 0:l.path)||(this.defaultOptions.preview.theme.path=this.options.cdn+"/dist/css/content-theme"),(null===(s=this.options.hint)||void 0===s?void 0:s.emojiPath)||(this.defaultOptions.hint.emojiPath=this.options.cdn+"/dist/images/emoji")));var e,t,n,r,o,i,a,l,s,d=(0,nz.T)(this.defaultOptions,this.options);if(d.cache.enable&&!d.cache.id)throw Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return d},e.prototype.mergeToolbar=function(e){var t=this,n=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"⌘E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"⌘H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"⌘B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"⌘K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"⌘L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"⇧⌘I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"⇧⌘O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"⌘;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"⇧⌘H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"⌘U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"⇧⌘B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"⇧⌘E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"⌘M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],r=[];return e.forEach(function(e){var o=e;n.forEach(function(t){"string"==typeof e&&t.name===e&&(o=t),"object"==typeof e&&t.name===e.name&&(o=Object.assign({},t,e))}),e.toolbar&&(o.toolbar=t.mergeToolbar(e.toolbar)),r.push(o)}),r},e}(),nV=function(){function e(e){var t=this;this.composingLock=!1,this.commentIds=[];var n=document.createElement("div");n.className="vditor-wysiwyg",n.innerHTML='<pre class="vditor-reset" placeholder="'+e.options.placeholder+'"\n contenteditable="true" spellcheck="false"></pre>\n<div class="vditor-panel vditor-panel--none"></div>\n<div class="vditor-panel vditor-panel--none">\n <button type="button" aria-label="'+window.VditorI18n.comment+'" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">\n <svg><use xlink:href="#vditor-icon-comment"></use></svg>\n </button>\n</div>',this.element=n.firstElementChild,this.popover=n.firstElementChild.nextElementSibling,this.selectPopover=n.lastElementChild,this.bindEvent(e),eG(e,this.element),eF(e,this.element),eK(e,this.element),eQ(e,this.element),e$(e,this.element),eZ(e,this.element),eJ(e,this.element,this.copy),eX(e,this.element,this.copy),e.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var n,r,i=Lute.NewNodeID(),a=getSelection().getRangeAt(0),l=a.cloneRange(),s=a.extractContents(),d=!1,c=!1;s.childNodes.forEach(function(e,t){var o=!1;if(3===e.nodeType?o=!0:e.classList.contains("vditor-comment")?e.classList.contains("vditor-comment")&&e.setAttribute("data-cmtids",e.getAttribute("data-cmtids")+" "+i):o=!0,o){if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&0===t&&l.startOffset>0)e.innerHTML='<span class="vditor-comment" data-cmtids="'+i+'">'+e.innerHTML+"</span>",n=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&t===s.childNodes.length-1&&l.endOffset<l.endContainer.textContent.length)e.innerHTML='<span class="vditor-comment" data-cmtids="'+i+'">'+e.innerHTML+"</span>",r=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block"))0===t?d=!0:t===s.childNodes.length-1&&(c=!0),e.innerHTML='<span class="vditor-comment" data-cmtids="'+i+'">'+e.innerHTML+"</span>";else{var a=document.createElement("span");a.classList.add("vditor-comment"),a.setAttribute("data-cmtids",i),e.parentNode.insertBefore(a,e),a.appendChild(e)}}});var u=(0,b.F9)(l.startContainer);u&&(n?(u.insertAdjacentHTML("beforeend",n.innerHTML),n.remove()):""===u.textContent.trim().replace(o.g.ZWSP,"")&&d&&u.remove());var p=(0,b.F9)(l.endContainer);p&&(r?(p.insertAdjacentHTML("afterbegin",r.innerHTML),r.remove()):""===p.textContent.trim().replace(o.g.ZWSP,"")&&c&&p.remove()),a.insertNode(s),e.options.comment.add(i,a.toString(),t.getComments(e,!0)),ew(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),t.hideComment()})}return e.prototype.getComments=function(e,t){var n=this;if(void 0===t&&(t=!1),"wysiwyg"!==e.currentMode||!e.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(e){n.commentIds=n.commentIds.concat(e.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return t?(this.commentIds.forEach(function(e){r.push({id:e,top:n.element.querySelector('.vditor-comment[data-cmtids="'+e+'"]').offsetTop})}),r):void 0},e.prototype.triggerRemoveComment=function(e){var t;if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.commentIds.length>0){var n=JSON.parse(JSON.stringify(this.commentIds));this.getComments(e);var r=(t=new Set(this.commentIds),n.filter(function(e){return!t.has(e)}));r.length>0&&e.options.comment.remove(r)}},e.prototype.showComment=function(){var e=(0,O.Ny)(this.element);this.selectPopover.setAttribute("style","left:"+e.left+"px;display:block;top:"+Math.max(-8,e.top-21)+"px")},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=(0,b.lG)(n.startContainer,"CODE"),o=(0,b.lG)(n.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var i="";return i="PRE"===r.parentElement.tagName?n.toString():"`"+n.toString()+"`",e.clipboardData.setData("text/plain",i),void e.clipboardData.setData("text/html","")}var a=(0,b.lG)(n.startContainer,"A"),l=(0,b.lG)(n.endContainer,"A");if(a&&l&&l.isSameNode(a)){var s=a.getAttribute("title")||"";return s&&(s=' "'+s+'"'),e.clipboardData.setData("text/plain","["+n.toString()+"]("+a.getAttribute("href")+s+")"),void e.clipboardData.setData("text/html","")}var d=document.createElement("div");d.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorDOM2Md(d.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(h(e,["hint"]),"block"===t.popover.style.display&&"block"===t.selectPopover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10);if("auto"===e.options.height){if(e.options.toolbarConfig.pin){var r=Math.max(n,window.scrollY-e.element.offsetTop-8)+"px";"block"===t.popover.style.display&&(t.popover.style.top=r),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=r)}}else if(e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top){var o=Math.max(window.scrollY-e.element.offsetTop-8,Math.min(n-e.wysiwyg.element.scrollTop,t.element.clientHeight-21))+"px";"block"===t.popover.style.display&&(t.popover.style.top=o),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",function(){if(h(e,["hint"]),e.options.comment&&e.options.comment.enable&&e.options.comment.scroll&&e.options.comment.scroll(e.wysiwyg.element.scrollTop),"block"===t.popover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10)-e.wysiwyg.element.scrollTop,r=-8;e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top&&(r=window.scrollY-e.element.offsetTop+r);var o=Math.max(r,Math.min(n,t.element.clientHeight-21))+"px";t.popover.style.top=o,t.selectPopover.style.top=o}}),this.element.addEventListener("paste",function(t){tj(e,t,{pasteCode:function(t){var n=(0,O.zh)(e),r=document.createElement("template");r.innerHTML=t,n.insertNode(r.content.cloneNode(!0));var o=(0,b.a1)(n.startContainer,"data-block","0");o?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):e.wysiwyg.element.innerHTML=e.lute.SpinVditorDOM(e.wysiwyg.element.innerHTML),(0,O.ib)(e.wysiwyg.element,n)}})}),this.element.addEventListener("compositionstart",function(){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){var r=(0,y.W)(getSelection().getRangeAt(0).startContainer);r&&""===r.textContent?D(e):((0,d.vU)()||tn(e,getSelection().getRangeAt(0).cloneRange(),n),t.composingLock=!1)}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput)return t.preventInput=!1,void ew(e);if(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data)ew(e);else{var r=getSelection().getRangeAt(0),o=(0,b.F9)(r.startContainer);if(o||(ex(e,r),o=(0,b.F9)(r.startContainer)),o){for(var i=(0,O.im)(o,e.wysiwyg.element,r).start,l=!0,s=i-1;s>o.textContent.substr(0,i).lastIndexOf("\n");s--)if(" "!==o.textContent.charAt(s)&&" "!==o.textContent.charAt(s)){l=!1;break}0===i&&(l=!1);var d=!0;for(s=i-1;s<o.textContent.length;s++)if(" "!==o.textContent.charAt(s)&&"\n"!==o.textContent.charAt(s)){d=!1;break}var c=(0,y.W)(getSelection().getRangeAt(0).startContainer);c&&""===c.textContent&&(D(e),c.remove()),l&&"code-block"!==o.getAttribute("data-type")||d||tb(o.innerHTML)||tg(o.innerHTML)&&o.previousElementSibling?"function"==typeof e.options.input&&e.options.input(a(e)):("insertParagraph"===n.inputType&&"<p><br></p><p><br></p>"===t.element.innerHTML&&o.previousElementSibling.remove(),tn(e,r,n))}}}}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName){var r,i,l,s,d,c,u,p,f,m,v=n.target;return v.checked?v.setAttribute("checked","checked"):v.removeAttribute("checked"),t.preventInput=!0,void ew(e)}if("IMG"!==n.target.tagName||n.target.parentElement.classList.contains("vditor-wysiwyg__preview")){var h=(0,b.lG)(n.target,"A");if(h)return e.options.link.click?e.options.link.click(h):e.options.link.isOpen&&window.open(h.getAttribute("href")),void n.preventDefault();var g=(0,O.zh)(e);if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&g.collapsed){var y=t.element.lastElementChild.getBoundingClientRect();n.y>y.top+y.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(o.g.ZWSP,"")?(g.selectNodeContents(t.element.lastElementChild),g.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+o.g.ZWSP+"<wbr></p>"),(0,O.ib)(t.element,g)))}eC(e);var w=(0,b.fb)(n.target,"vditor-wysiwyg__preview");w||(w=(0,b.fb)((0,O.zh)(e).startContainer,"vditor-wysiwyg__preview")),w&&eL(w,e),j(n,e)}else{;"link-ref"===n.target.getAttribute("data-type")?eA(e,n.target):(r=n,i=e,l=r.target,i.wysiwyg.popover.innerHTML="",s=function(){l.setAttribute("src",c.value),l.setAttribute("alt",p.value),l.setAttribute("title",m.value),"function"==typeof i.options.input&&i.options.input(a(i))},(d=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.imageURL),d.className="vditor-tooltipped vditor-tooltipped__n",c=document.createElement("input"),d.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.imageURL),c.value=l.getAttribute("src")||"",c.oninput=function(){s()},c.onkeydown=function(e){eT(i,e)},(u=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.alternateText),u.className="vditor-tooltipped vditor-tooltipped__n",p=document.createElement("input"),u.appendChild(p),p.className="vditor-input",p.setAttribute("placeholder",window.VditorI18n.alternateText),p.style.width="52px",p.value=l.getAttribute("alt")||"",p.oninput=function(){s()},p.onkeydown=function(e){eT(i,e)},(f=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.title),f.className="vditor-tooltipped vditor-tooltipped__n",m=document.createElement("input"),f.appendChild(m),m.className="vditor-input",m.setAttribute("placeholder",window.VditorI18n.title),m.value=l.getAttribute("title")||"",m.oninput=function(){s()},m.onkeydown=function(e){eT(i,e)},eO(l,i),i.wysiwyg.popover.insertAdjacentElement("beforeend",d),i.wysiwyg.popover.insertAdjacentElement("beforeend",u),i.wysiwyg.popover.insertAdjacentElement("beforeend",f),eM(i,l))}}),this.element.addEventListener("keyup",function(t){if(!t.isComposing&&!(0,d.yl)(t)){"Enter"===t.key&&eY(e),("Backspace"===t.key||"Delete"===t.key)&&""!==e.wysiwyg.element.innerHTML&&1===e.wysiwyg.element.childNodes.length&&e.wysiwyg.element.firstElementChild&&"P"===e.wysiwyg.element.firstElementChild.tagName&&0===e.wysiwyg.element.firstElementChild.childElementCount&&(""===e.wysiwyg.element.textContent||"\n"===e.wysiwyg.element.textContent)&&(e.wysiwyg.element.innerHTML="");var n=(0,O.zh)(e);if("Backspace"===t.key&&(0,d.vU)()&&"\n"===n.startContainer.textContent&&1===n.startOffset&&(n.startContainer.textContent=""),ex(e,n),eC(e),"ArrowDown"===t.key||"ArrowRight"===t.key||"Backspace"===t.key||"ArrowLeft"===t.key||"ArrowUp"===t.key){"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||e.hint.render(e);var r=(0,b.fb)(n.startContainer,"vditor-wysiwyg__preview");if(!r&&3!==n.startContainer.nodeType&&n.startOffset>0&&(i=n.startContainer).classList.contains("vditor-wysiwyg__block")&&(r=i.lastElementChild),r){if("none"!==r.previousElementSibling.style.display){var o=r.previousElementSibling;if("PRE"===o.tagName&&(o=o.firstElementChild),"ArrowDown"===t.key||"ArrowRight"===t.key){var i,a=function(e){for(var t=e;t&&!t.nextSibling;)t=t.parentElement;return t.nextSibling}(i=r.parentElement);if(a&&3!==a.nodeType){var l=a.querySelector(".vditor-wysiwyg__preview");if(l)return void eL(l,e)}if(3===a.nodeType){for(;0===a.textContent.length&&a.nextSibling;)a=a.nextSibling;n.setStart(a,1)}else n.setStart(a.firstChild,0)}else n.selectNodeContents(o),n.collapse(!1)}else"ArrowDown"===t.key||"ArrowRight"===t.key?eL(r,e):eL(r,e,!1)}}}})},e}(),nW=(ev=function(e,t){return(ev=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ev(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});let nG=function(e){function t(t,n){var r=e.call(this)||this;if(r.version=o.H,"string"==typeof t){if(n?n.cache?n.cache.id||(n.cache.id="vditor"+t):n.cache={id:"vditor"+t}:n={cache:{id:"vditor"+t}},!document.getElementById(t))return r.showErrorTip("Failed to get element by id: "+t),r;t=document.getElementById(t)}var i=new nU(n).merge();if(i.i18n)window.VditorI18n=i.i18n,r.init(t,i);else{if(!["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(i.lang))throw Error("options.lang error, see https://ld246.com/article/1549638745630#options");var a="vditorI18nScript"+i.lang;document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(e){e.id!==a&&document.head.removeChild(e)}),(0,l.G)(i.cdn+"/dist/js/i18n/"+i.lang+".js",a).then(function(){r.init(t,i)}).catch(function(e){r.showErrorTip("GET "+i.cdn+"/dist/js/i18n/"+i.lang+".js net::ERR_ABORTED 404 (Not Found)")})}return r}return nW(t,e),t.prototype.showErrorTip=function(e){var t=new tQ;document.body.appendChild(t.element),t.show(e,0)},t.prototype.setTheme=function(e,t,n,r){this.vditor.options.theme=e,W(this.vditor),t&&(this.vditor.options.preview.theme.current=t,(0,V.Z)(t,r||this.vditor.options.preview.theme.path)),n&&(this.vditor.options.preview.hljs.style=n,(0,t3.Y)(n,this.vditor.options.cdn))},t.prototype.getValue=function(){return a(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.focus():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.focus():"ir"===this.vditor.currentMode&&this.vditor.ir.element.focus()},t.prototype.blur=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.blur():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.blur():"ir"===this.vditor.currentMode&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){h(this.vditor,["subToolbar","hint","popover"]),f(this.vditor.toolbar.elements,o.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){p(this.vditor.toolbar.elements,o.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){return"wysiwyg"===this.vditor.currentMode?eW(this.vditor.wysiwyg.element):"sv"===this.vditor.currentMode?eW(this.vditor.sv.element):"ir"===this.vditor.currentMode?eW(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(e){this.vditor.preview.render(this.vditor,e)},t.prototype.getCursorPosition=function(){return(0,O.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(e){return this.vditor.lute.HTML2Md(e)},t.prototype.exportJSON=function(e){return this.vditor.lute.RenderJSON(e)},t.prototype.getHTML=function(){return tW(this.vditor)},t.prototype.tip=function(e,t){this.vditor.tip.show(e,t)},t.prototype.setPreviewMode=function(e){t$(e,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(e){document.execCommand("insertHTML",!1,e)},t.prototype.insertValue=function(e,t){void 0===t&&(t=!0);var n=(0,O.zh)(this.vditor);n.collapse(!0);var r=document.createElement("template");r.innerHTML=e,n.insertNode(r.content.cloneNode(!0)),n.collapse(!1),"sv"===this.vditor.currentMode?(this.vditor.sv.preventInput=!0,t&&U(this.vditor)):"wysiwyg"===this.vditor.currentMode?t&&tn(this.vditor,getSelection().getRangeAt(0)):"ir"===this.vditor.currentMode&&(this.vditor.ir.preventInput=!0,t&&R(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t=!1),"sv"===this.vditor.currentMode?(this.vditor.sv.element.innerHTML="<div data-block='0'>"+this.vditor.lute.SpinVditorSVDOM(e)+"</div>",e5(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):"wysiwyg"===this.vditor.currentMode?eP(this.vditor,e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(e),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){N(e,n.vditor)}),tR(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),e||(h(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),t&&this.clearStack()},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var e=document.getElementById("vditorIconScript");e&&e.remove(),this.clearCache(),K(),this.vditor.wysiwyg.unbindListener()},t.prototype.getCommentIds=function(){return"wysiwyg"!==this.vditor.currentMode?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){t.classList.remove("vditor-comment--hover"),e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.unHlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.removeCommentIds=function(e){var t=this;if("wysiwyg"===this.vditor.currentMode){var n=function(e,n){var r=e.getAttribute("data-cmtids").split(" ");r.find(function(e,t){if(e===n)return r.splice(t,1),!0}),0===r.length?(e.outerHTML=e.innerHTML,(0,O.zh)(t.vditor).collapse(!0)):e.setAttribute("data-cmtids",r.join(" "))};e.forEach(function(e){t.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)}),"none"!==t.vditor.preview.element.style.display&&t.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)})}),ew(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(e,t){var n=this;this.vditor={currentMode:t.mode,element:e,hint:new tU(t.hint.extend),lute:void 0,options:t,originalInnerHTML:e.innerHTML,outline:new tK(window.VditorI18n.outline),tip:new tQ},this.vditor.sv=new tY(this.vditor),this.vditor.undo=new nB,this.vditor.wysiwyg=new nV(this.vditor),this.vditor.ir=new tV(this.vditor),this.vditor.toolbar=new nP(this.vditor),t.resize.enable&&(this.vditor.resize=new tX(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new s),(t.upload.url||t.upload.handler)&&(this.vditor.upload=new te),(0,l.G)(t._lutePath||t.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){n.vditor.lute=(0,tG.X)({autoSpace:n.vditor.options.preview.markdown.autoSpace,gfmAutoLink:n.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:n.vditor.options.preview.markdown.codeBlockPreview,emojiSite:n.vditor.options.hint.emojiPath,emojis:n.vditor.options.hint.emoji,fixTermTypo:n.vditor.options.preview.markdown.fixTermTypo,footnotes:n.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:n.vditor.options.preview.math.inlineDigit,linkBase:n.vditor.options.preview.markdown.linkBase,linkPrefix:n.vditor.options.preview.markdown.linkPrefix,listStyle:n.vditor.options.preview.markdown.listStyle,mark:n.vditor.options.preview.markdown.mark,mathBlockPreview:n.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:n.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:n.vditor.options.preview.markdown.sanitize,toc:n.vditor.options.preview.markdown.toc}),n.vditor.preview=new tJ(n.vditor),function(e){e.element.innerHTML="",e.element.classList.add("vditor"),e.options.rtl&&e.element.setAttribute("dir","rtl"),W(e),(0,V.Z)(e.options.preview.theme.current,e.options.preview.theme.path),"number"==typeof e.options.height?e.element.style.height=e.options.height+"px":e.element.style.height=e.options.height,"number"==typeof e.options.minHeight&&(e.element.style.minHeight=e.options.minHeight+"px"),"number"==typeof e.options.width?e.element.style.width=e.options.width+"px":e.element.style.width=e.options.width,e.element.appendChild(e.toolbar.element);var t=document.createElement("div");if(t.className="vditor-content","left"===e.options.outline.position&&t.appendChild(e.outline.element),t.appendChild(e.wysiwyg.element.parentElement),t.appendChild(e.sv.element),t.appendChild(e.ir.element.parentElement),t.appendChild(e.preview.element),e.toolbar.elements.devtools&&t.appendChild(e.devtools.element),"right"===e.options.outline.position&&(e.outline.element.classList.add("vditor-outline--right"),t.appendChild(e.outline.element)),e.upload&&t.appendChild(e.upload.element),e.options.resize.enable&&t.appendChild(e.resize.element),t.appendChild(e.hint.element),t.appendChild(e.tip.element),e.element.appendChild(t),t.addEventListener("click",function(){h(e,["subToolbar"])}),e.toolbar.elements.export&&e.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),eU(e,e.options.mode,eb(e)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&void 0!==window.visualViewport){var n=!1,r=function(t){n||(n=!0,requestAnimationFrame(function(){n=!1;var t=e.toolbar.element;t.style.transform="none",t.getBoundingClientRect().top<0&&(t.style.transform="translate(0, "+-t.getBoundingClientRect().top+"px)")}))};window.visualViewport.addEventListener("scroll",r),window.visualViewport.addEventListener("resize",r)}}(n.vditor),t.after&&t.after(),t.icon&&(0,l.J)(t.cdn+"/dist/js/icons/"+t.icon+".js","vditorIconScript")})},t}(t.default)})(),r=r.default})(),e.exports=n()},2:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg=="},505:function(e){"use strict";e.exports=r},772:function(e){"use strict";e.exports=t},584:function(t){"use strict";t.exports=e},721:function(e){"use strict";e.exports=n},156:function(e){"use strict";e.exports=o}},a={};function l(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={id:e,exports:{}};return i[e].call(n.exports,n,n.exports,l),n.exports}l.m=i,l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.nc=void 0,l.b=document.baseURI||self.location.href;var s={};return!function(){"use strict";l.r(s),l.d(s,{PluginFieldMarkdownVditorClient:function(){return et},default:function(){return en}});var e=l("772"),t=l("278"),n=l.n(t),r=l("391"),o=l.n(r),i=l("547"),a=l.n(i),d=l("604"),c=l.n(d),u=l("593"),p=l.n(u),f=l("784"),m=l.n(f),v=l("926"),h={};h.styleTagTransform=m(),h.setAttributes=c(),h.insert=a().bind(null,"head"),h.domAPI=o(),h.insertStyleElement=p(),n()(v.Z,h),v.Z&&v.Z.locals&&v.Z.locals;var g=l("505"),b=l("721"),y=l("156"),w=l.n(y),k=l("825"),E=l.n(k),x=function(){return(0,e.usePlugin)(et).getCDN()},S=(0,e.genStyleHook)("nb-field-markdown-vditor",function(e){var t,n,r;return t={},n=e.componentCls,r={".vditor-reset":{fontSize:"".concat(e.fontSize,"px !important")},".vditor":{borderRadius:8},".vditor .vditor-content":{borderRadius:"0 0 8px 8px",overflow:"hidden"},".vditor .vditor-toolbar":{paddingLeft:" 16px !important",borderRadius:"8px 8px 0 0"},".vditor .vditor-content .vditor-ir .vditor-reset":{paddingLeft:" 16px !important"}},n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t});function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T=function(e){if(e){var t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width}};function C(e){var t,n=(0,y.useRef)(null),r=S(),o=r.wrapSSR,i=r.componentCls,a=r.hashId,l=x();return(0,y.useEffect)(function(){var t;E().preview(n.current,null!==(t=e.value)&&void 0!==t?t:"",{mode:"light",cdn:l})},[e.value]),o(w().createElement("div",{className:"".concat(a," ").concat(i)},w().createElement("div",{ref:n,style:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r,o,i;r=e,o=t,i=n[t],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({border:"none"},null!==(t=null==e?void 0:e.style)&&void 0!==t?t:{})})))}var M=(0,e.withDynamicSchemaProps)(function(e){var t,n=(0,g.useField)(),r=null!==(t=e.value)&&void 0!==t?t:n.value,o=x(),i=(0,y.useRef)(),a=L((0,y.useState)(!1),2),l=a[0],s=a[1],d=L((0,y.useState)(!1),2),c=d[0],u=d[1],p=L((0,y.useState)(""),2),f=p[0],m=p[1],v=(0,y.useRef)();(0,y.useEffect)(function(){if(e.value&&n.value){if(e.ellipsis)E().md2html(e.value,{mode:"light",cdn:o}).then(function(e){var t,n,r;m((t=e,(n=document.createElement("div")).innerHTML=t,r=n.innerText,n=null,(null==r?void 0:r.replace(/[\n\r]/g,""))||""))}).catch(function(){return m("")});else{var t;E().preview(i.current,null!==(t=e.value)&&void 0!==t?t:n.value,{mode:"light",cdn:o})}}},[e.value,e.ellipsis,n.value]);var h=(0,y.useCallback)(function(){var e;if(!v.current)return!1;return T(v.current)>(null===(e=v.current)||void 0===e?void 0:e.offsetWidth)},[v]);return e.ellipsis?w().createElement(b.Popover,{open:l,onOpenChange:function(e){s(c&&e)},content:w().createElement(C,{value:r,style:{maxWidth:500,maxHeight:400,overflowY:"auto"}})},w().createElement("div",{ref:v,style:{overflow:"hidden",overflowWrap:"break-word",textOverflow:"ellipsis",whiteSpace:"nowrap",wordBreak:"break-all"},onMouseEnter:function(e){var t=e.target;h()&&u(t.scrollWidth>=t.clientWidth)}},f)):w().createElement(C,{value:r})}),A=l("584");function H(e){return(0,A.tval)(e,{ns:"field-markdown-vditor"})}function N(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D(e){return(D=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}var R=e.interfacesProperties.defaultProps,P=e.interfacesProperties.operators,q=["headings","bold","italic","strike","link","list","ordered-list","check","quote","line","code","inline-code","upload","fullscreen"],B=function(e){var t,n,r;function o(){var e,t,n,r,i,a;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),t=this,n=o,r=arguments,n=D(n),O(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,I()?Reflect.construct(n,r||[],D(t).constructor):n.apply(t,r)),"name","vditor"),O(e,"type","object"),O(e,"group","media"),O(e,"order",1),O(e,"title",H("Vditor")),O(e,"sortable",!0),O(e,"default",{type:"text",length:"long",uiSchema:{type:"string","x-component":"MarkdownVditor"}}),O(e,"availableTypes",["text","json","string"]),O(e,"properties",(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){O(e,t,n[t])})}return e}({},R),a=(a={"uiSchema.x-component-props.fileCollection":{type:"string",title:H("File collection"),"x-component":"CollectionSelect","x-component-props":{filter:function(e){var t;return(null==e?void 0:null===(t=e.options)||void 0===t?void 0:t.template)==="file"}},"x-decorator":"FormItem",default:"","x-reactions":{fulfill:{schema:{description:H("Used to store files uploaded in the Markdown editor")}}}},"uiSchema.x-component-props.toolbar":{type:"array",title:H("Toolbar"),"x-component":"Select","x-component-props":{mode:"multiple"},"x-decorator":"FormItem",default:q,enum:[{value:"emoji",label:H("Emoji")},{value:"headings",label:H("Headings")},{value:"bold",label:H("Bold")},{value:"italic",label:H("Italic")},{value:"strike",label:H("Strike")},{value:"line",label:H("Line")},{value:"quote",label:H("Quote")},{value:"list",label:H("List")},{value:"ordered-list",label:H("OrderedList")},{value:"check",label:H("Check")},{value:"outdent",label:H("Outdent")},{value:"indent",label:H("Indent")},{value:"code",label:H("Code")},{value:"inline-code",label:H("InlineCode")},{value:"insert-after",label:H("InsertAfter")},{value:"insert-before",label:H("InsertBefore")},{value:"undo",label:H("Undo")},{value:"redo",label:H("Redo")},{value:"upload",label:H("Upload")},{value:"link",label:H("Link")},{value:"record",label:H("Record")},{value:"table",label:H("Table")},{value:"edit-mode",label:H("EditMode")},{value:"both",label:H("Both")},{value:"preview",label:H("Preview")},{value:"fullscreen",label:H("Fullscreen")},{value:"outline",label:H("Outline")}]}},a),Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i)),O(e,"filterable",{operators:P.bigField}),O(e,"titleUsable",!0),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&j(e,t)}(o,e),t=o,n=[{key:"schemaInitialize",value:function(e,t){["Table","Kanban"].includes(t.block)&&(e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].ellipsis=!0)}}],N(t.prototype,n),o}(e.CollectionFieldInterface);function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var U=["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"],V=(0,e.withDynamicSchemaProps)(function(t){var n,r,o=t.disabled,i=t.onChange,a=t.value,l=t.fileCollection,s=t.toolbar;var d=(n=(0,y.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(l)throw r}}return i}}(n,2)||function(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(e,t)}}(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=d[0],u=d[1],p=(0,y.useRef)(),f=(0,y.useRef)(!1),m=(0,y.useRef)(null),v=(0,y.useRef)(null),h=(0,e.useApp)(),g=(0,e.useAPIClient)(),b=x(),k=S(),_=k.wrapSSR,L=k.hashId,T=k.componentCls,C=g.auth.locale,M=(0,y.useMemo)(function(){var e=C.replace(/-/g,"_");return U.includes(e)?e:"en_US"},[C]);return(0,y.useEffect)(function(){if(m.current){var e=l||"attachments",t=null!=s?s:q,n=new(E())(m.current,{value:null!=a?a:"",lang:M,cache:{enable:!1},undoDelay:0,preview:{math:{engine:"KaTeX"}},toolbar:t,fullscreen:{index:1200},cdn:b,minHeight:200,after:function(){p.current=n,u(!0),n.setValue(null!=a?a:""),o?n.disabled():n.enable()},input:function(e){i(e)},upload:{url:h.getApiUrl("".concat(e,":create")),headers:g.getHeaders(),multiple:!1,fieldName:"file",max:0x40000000,format:function(e,t){var n,r,o,i=JSON.parse(t);return JSON.stringify({msg:"",code:0,data:{errFiles:[],succMap:(n={},r=i.data.filename,o=i.data.url,r in n?Object.defineProperty(n,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[r]=o,n)}})}}});return function(){var e;null===(e=p.current)||void 0===e||e.destroy(),p.current=void 0}}},[l,null==s?void 0:s.join(",")]),(0,y.useEffect)(function(){if(c&&p.current){var e=p.current;if(a!==e.getValue()){e.setValue(null!=a?a:"");var t,n=null===(t=m.current)||void 0===t?void 0:t.querySelector("div.vditor-content > div.vditor-ir > pre");if(n){var r=document.createRange(),o=window.getSelection();o&&(r.selectNodeContents(n),r.collapse(!1),o.removeAllRanges(),o.addRange(r))}}}},[a,c]),(0,y.useEffect)(function(){c&&p.current&&(o?p.current.disabled():p.current.enable())},[o,c]),(0,y.useLayoutEffect)(function(){if(m.current){var e=new ResizeObserver(function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a,l=o.value.target;l.className.includes("vditor--fullscreen")?(document.body.appendChild(l),f.current=!0):f.current&&(null===(a=v.current)||void 0===a||a.appendChild(l),f.current=!1)}}catch(e){n=!0,r=e}finally{try{!t&&null!=i.return&&i.return()}finally{if(n)throw r}}});return e.observe(m.current),function(){e.unobserve(m.current)}}},[]),_(w().createElement("div",{ref:v,className:"".concat(L," ").concat(T)},w().createElement("div",{id:L,ref:m})))}),W=(0,e.withDynamicSchemaProps)((0,g.connect)(V,(0,g.mapReadPretty)(M)));function G(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,o)}function F(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){G(i,r,o,a,l,"next",e)}function l(e){G(i,r,o,a,l,"throw",e)}a(void 0)})}}function K(e,t,n){return(K=$()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Y(o,n.prototype),o}).apply(null,arguments)}function Z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X(e){return(X=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Q(e){var t="function"==typeof Map?new Map:void 0;return(Q=function(e){var n;if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return K(e,arguments,X(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Y(r,e)})(e)}function $(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($=function(){return!!e})()}function ee(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var et=function(e){var t,n,r;function o(){var e,t,n;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e=this,t=o,n=arguments,t=X(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,$()?Reflect.construct(t,n||[],X(e).constructor):t.apply(e,n))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Y(e,t)}(o,e),t=o,n=[{key:"afterAdd",value:function(){return F(function(){return ee(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return F(function(){return ee(this,function(e){return[2]})})()}},{key:"load",value:function(){var e=this;return F(function(){return ee(this,function(t){return e.app.addComponents({MarkdownVditor:W}),e.initVditorDependency(),e.app.dataSourceManager.addFieldInterfaces([B]),[2]})})()}},{key:"getCDN",value:function(){return this.app.getPublicPath()+"static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client/vditor"}},{key:"initVditorDependency",value:function(){var e=this,t=this.getCDN();try{var n,r="plugin-field-markdown-vditor-dep",o=(n={},J(n,"".concat(r,".katex"),"".concat(t,"/dist/js/katex/katex.min.js?v=0.16.9")),J(n,"".concat(r,".ABCJS"),"".concat(t,"/dist/js/abcjs/abcjs_basic.min")),J(n,"".concat(r,".plantumlEncoder"),"".concat(t,"/dist/js/plantuml/plantuml-encoder.min")),J(n,"".concat(r,".echarts"),"".concat(t,"/dist/js/echarts/echarts.min")),J(n,"".concat(r,".flowchart"),"".concat(t,"/dist/js/flowchart.js/flowchart.min")),J(n,"".concat(r,".Viz"),"".concat(t,"/dist/js/graphviz/viz")),J(n,"".concat(r,".mermaid"),"".concat(t,"/dist/js/mermaid/mermaid.min")),n);this.app.requirejs.require.config({waitSeconds:120,paths:o}),Object.keys(o).forEach(function(t){e.app.requirejs.require([t],function(e){window[t.split(".")[1]]=e})})}catch(e){console.log("initVditorDependency failed",e)}}}],Z(t.prototype,n),o}(Q(e.Plugin)),en=et}(),s}()});
10
+ (function(){"use strict";try{if(typeof document!="undefined"){var o=document.createElement("style");o.id="@nocobase/plugin-field-markdown-vditor",o.appendChild(document.createTextNode(`/*!
11
+ * Vditor v3.10.4 - A markdown editor written in TypeScript.
12
+ *
13
+ * MIT License
14
+ *
15
+ * Copyright (c) 2018-present B3log 开源, b3log.org
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ * of this software and associated documentation files (the "Software"), to deal
19
+ * in the Software without restriction, including without limitation the rights
20
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ * copies of the Software, and to permit persons to whom the Software is
22
+ * furnished to do so, subject to the following conditions:
23
+ *
24
+ * The above copyright notice and this permission notice shall be included in all
25
+ * copies or substantial portions of the Software.
26
+ *
27
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ * SOFTWARE.
34
+ *
35
+ */.vditor{--border-color: #d1d5da;--second-color: rgba(88, 96, 105, .36);--panel-background-color: #fff;--panel-shadow: 0 1px 2px rgba(0, 0, 0, .2);--toolbar-background-color: #f6f8fa;--toolbar-icon-color: #586069;--toolbar-icon-hover-color: #4285f4;--toolbar-height: 35px;--toolbar-divider-margin-top: 8px;--textarea-background-color: #fafbfc;--textarea-text-color: #24292e;--resize-icon-color: var(--toolbar-icon-color);--resize-background-color: var(--toolbar-background-color);--resize-hover-icon-color: var(--panel-background-color);--resize-hover-background-color: var(--toolbar-icon-hover-color);--count-background-color: rgba(27, 31, 35, .05);--heading-border-color: #eaecef;--blockquote-color: #6a737d;--ir-heading-color: #660e7a;--ir-title-color: #808080;--ir-bi-color: #0033b3;--ir-link-color: #008000;--ir-bracket-color: #0000ff;--ir-paren-color: #008000}.vditor--dark{--border-color: #141414;--second-color: rgba(185, 185, 185, .36);--panel-background-color: #24292e;--panel-shadow: 0 1px 2px rgba(255, 255, 255, .2);--toolbar-background-color: #1d2125;--toolbar-icon-color: #b9b9b9;--toolbar-icon-hover-color: #fff;--textarea-background-color: #2f363d;--textarea-text-color: #d1d5da;--resize-icon-color: var(--border-color);--resize-background-color: var(--second-color);--resize-hover-icon-color: var(--toolbar-icon-hover-color);--resize-hover-background-color: rgba(185, 185, 185, .86);--count-background-color: rgba(66, 133, 244, .36);--heading-border-color: var(--textarea-text-color);--blockquote-color: var(--toolbar-icon-color);--ir-heading-color: #9876aa;--ir-title-color: #808080;--ir-bi-color: #cc7832;--ir-link-color: #ffc66d;--ir-bracket-color: #287bde;--ir-paren-color: #6a8759}@-webkit-keyframes tooltip-appear{0%{opacity:0}to{opacity:1}}@keyframes tooltip-appear{0%{opacity:0}to{opacity:1}}.vditor-tooltipped{position:relative;cursor:pointer}.vditor-tooltipped:after{position:absolute;z-index:1000000;display:none;padding:5px 8px;font-size:11px;font-weight:400;-webkit-font-smoothing:subpixel-antialiased;color:#fff;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:#3b3e43;border-radius:3px;line-height:16px;opacity:0}.vditor-tooltipped:before{position:absolute;z-index:1000001;display:none;width:0;height:0;color:#3b3e43;pointer-events:none;content:"";border:5px solid transparent;opacity:0}.vditor-tooltipped--hover:before,.vditor-tooltipped--hover:after,.vditor-tooltipped:hover:before,.vditor-tooltipped:hover:after,.vditor-tooltipped:active:before,.vditor-tooltipped:active:after,.vditor-tooltipped:focus:before,.vditor-tooltipped:focus:after{display:inline-block;text-decoration:none;-webkit-animation-name:tooltip-appear;animation-name:tooltip-appear;-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}.vditor-tooltipped__s:after,.vditor-tooltipped__se:after,.vditor-tooltipped__sw:after{top:100%;right:50%;margin-top:5px}.vditor-tooltipped__s:before,.vditor-tooltipped__se:before,.vditor-tooltipped__sw:before{top:auto;right:50%;bottom:-5px;margin-right:-5px;border-bottom-color:#3b3e43}.vditor-tooltipped__se:after{right:auto;left:50%;margin-left:-15px}.vditor-tooltipped__sw:after{margin-right:-15px}.vditor-tooltipped__n:after,.vditor-tooltipped__ne:after,.vditor-tooltipped__nw:after{right:50%;bottom:100%;margin-bottom:5px}.vditor-tooltipped__n:before,.vditor-tooltipped__ne:before,.vditor-tooltipped__nw:before{top:-5px;right:50%;bottom:auto;margin-right:-5px;border-top-color:#3b3e43}.vditor-tooltipped__ne:after{right:auto;left:50%;margin-left:-15px}.vditor-tooltipped__nw:after{margin-right:-15px}.vditor-tooltipped__s:after,.vditor-tooltipped__n:after{transform:translate(50%)}.vditor-tooltipped__w:after{right:100%;bottom:50%;margin-right:5px;transform:translateY(50%)}.vditor-tooltipped__w:before{top:50%;bottom:50%;left:-5px;margin-top:-5px;border-left-color:#3b3e43}.vditor-tooltipped__e:after{bottom:50%;left:100%;margin-left:5px;transform:translateY(50%)}.vditor-tooltipped__e:before{top:50%;right:-5px;bottom:50%;margin-top:-5px;border-right-color:#3b3e43}@media screen and (max-width: 520px){.vditor-tooltipped:before,.vditor-tooltipped:after{content:none}}@-webkit-keyframes scale-in{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}@keyframes scale-in{0%{opacity:0;transform:scale(.5)}to{opacity:1;transform:scale(1)}}.vditor-panel{background-color:var(--panel-background-color);position:absolute;box-shadow:var(--panel-shadow);border-radius:3px;padding:5px;z-index:3;font-size:14px;display:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-width:320px;min-width:80px;-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-name:scale-in;animation-name:scale-in;-webkit-animation-timing-function:cubic-bezier(.2,0,.13,1.5);animation-timing-function:cubic-bezier(.2,0,.13,1.5);color:var(--toolbar-icon-color)}.vditor-panel--none{padding:0;-webkit-animation:none;animation:none;min-width:auto;max-width:none;white-space:nowrap;opacity:.86}.vditor-panel--arrow:before{position:absolute;width:0;height:0;pointer-events:none;content:" ";border:7px solid transparent;top:-14px;left:5px;border-bottom-color:var(--panel-background-color)}.vditor-panel--left{right:0}.vditor-panel--left.vditor-panel--arrow:before{right:5px;left:auto}.vditor-input{border:0;padding:3px 5px;background-color:var(--panel-background-color);font-size:12px;color:var(--textarea-text-color)}.vditor-input:focus{background-color:var(--toolbar-background-color);outline:none}.vditor-icon{color:var(--toolbar-icon-color);cursor:pointer;float:left;padding:4px 5px;height:21px;width:23px;background-color:transparent;border:0;box-sizing:border-box}.vditor-icon:hover,.vditor-icon--current{color:var(--toolbar-icon-hover-color);background-color:transparent}.vditor-icon:focus{outline:none}.vditor-icon svg{height:13px!important;width:13px!important;float:left;fill:currentColor;pointer-events:none}.vditor-toolbar{background-color:var(--toolbar-background-color);border-bottom:1px solid var(--border-color);padding:0 5px;line-height:1}.vditor-toolbar--pin{position:-webkit-sticky;position:sticky;top:0;z-index:1}.vditor-toolbar--hide{transition:all .15s ease-in-out;height:5px;overflow:hidden}.vditor-toolbar--hide:hover{background-color:var(--toolbar-background-color);height:auto;overflow:visible}.vditor-toolbar__item{float:left;position:relative}.vditor-toolbar__item .vditor-tooltipped{color:var(--toolbar-icon-color);border:0;padding:10px 5px;background-color:transparent;height:var(--toolbar-height);width:25px;box-sizing:border-box;font-size:0}.vditor-toolbar__item .vditor-tooltipped:focus{outline:none}.vditor-toolbar__item .vditor-tooltipped:focus{cursor:pointer;color:var(--toolbar-icon-hover-color)}.vditor-toolbar__item svg{fill:currentColor;display:inline-block;stroke-width:0;stroke:currentColor;width:15px;height:15px}.vditor-toolbar__item input{position:absolute;width:25px;height:var(--toolbar-height);top:0;left:0;cursor:pointer;opacity:.001;overflow:hidden}.vditor-toolbar__divider{float:left;height:calc(var(--toolbar-height) - (var(--toolbar-divider-margin-top) * 2));border-left:1px solid var(--second-color);margin:var(--toolbar-divider-margin-top) 8px}.vditor-toolbar__br{width:100%;padding:0!important;height:0!important}.vditor-menu--current{color:var(--toolbar-icon-hover-color)!important}.vditor-menu--disabled{color:var(--second-color)!important;cursor:not-allowed!important}.vditor-emojis{display:inline-block;overflow:auto}.vditor-emojis::-webkit-scrollbar{display:none}.vditor-emojis__tip{flex:1;min-width:1px;width:200px;margin-right:10px;color:var(--toolbar-icon-color);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.vditor-emojis__tail{margin-top:5px;font-size:12px;color:var(--toolbar-icon-color);display:flex}.vditor-emojis__tail a{text-decoration:none;color:var(--toolbar-icon-color)}.vditor-emojis__tail a:hover{color:var(--toolbar-icon-hover-color)}.vditor-emojis button{cursor:pointer;border-radius:3px;float:left;height:30px;width:30px;text-align:center;line-height:26px;padding:3px;box-sizing:border-box;font-size:16px;transition:all .15s ease-in-out;border:0;margin:0;background-color:transparent;overflow:hidden}.vditor-emojis button:focus{outline:none}.vditor-emojis button:hover .vditor-emojis__icon{display:inline-block;transform:scale(1.2)}.vditor-emojis img{height:20px;width:20px;float:left;margin:3px 0 0 3px}@media screen and (max-width: 520px){.vditor-toolbar__item{padding:0 12px}.vditor-panel--left.vditor-panel--arrow:before{right:17px}}@media (hover: hover) and (pointer: fine){.vditor-toolbar__item .vditor-tooltipped:hover{color:var(--toolbar-icon-hover-color)}}@-webkit-keyframes slideInDown{0%{transform:translate3d(0,-100%,0);visibility:visible}to{transform:translateZ(0)}}@keyframes slideInDown{0%{transform:translate3d(0,-100%,0);visibility:visible}to{transform:translateZ(0)}}.vditor{display:flex;flex-direction:column;border:1px solid var(--border-color);border-radius:3px;box-sizing:border-box;font-family:Helvetica Neue,Luxi Sans,DejaVu Sans,Hiragino Sans GB,Microsoft Yahei,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",Segoe UI Symbol,"Android Emoji",EmojiSymbols}.vditor--fullscreen{position:fixed;top:0;width:100%!important;left:0;height:100vh!important;z-index:90;border-radius:0}.vditor-content{display:flex;min-height:60px;flex:1;min-width:1px;position:relative}.vditor-preview{flex:1;min-width:1px;overflow:auto;margin-left:-1px;border-left:1px solid var(--border-color);box-sizing:border-box;border-radius:0 0 3px;background-color:var(--textarea-background-color)}.vditor-preview::-webkit-scrollbar{display:none}.vditor-preview__action{text-align:center;padding:10px;background-color:var(--toolbar-background-color)}.vditor-preview__action button{background-color:var(--toolbar-background-color);color:var(--toolbar-icon-color);line-height:20px;border:0;margin:0 10px;cursor:pointer;padding:0 7px;font-size:12px}.vditor-preview__action button.vditor-preview__action--current,.vditor-preview__action button:hover{color:var(--toolbar-icon-hover-color);background-color:var(--toolbar-background-color)}.vditor-preview__action button:focus{outline:none}.vditor-preview__action button svg{fill:currentColor;height:15px;width:15px;vertical-align:middle}.vditor-preview>.vditor-reset{padding:10px;margin:0 auto}.vditor-preview img:not(.emoji){cursor:pointer}.vditor-devtools{display:none;background-color:var(--textarea-background-color);overflow:auto;flex:1;min-width:1px;box-shadow:inset 1px 0 var(--border-color);box-sizing:border-box;border-radius:0 0 3px;padding:10px}.vditor-counter{padding:3px;color:var(--toolbar-icon-color);background-color:var(--count-background-color);border-radius:3px;font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;float:right;margin:8px 3px 0 0}.vditor-counter--error{color:#d23f31;background-color:#d23f311a}.vditor-resize{padding:3px 0;cursor:row-resize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;width:100%}.vditor-resize--top{top:-3px}.vditor-resize--bottom{bottom:-3px}.vditor-resize>div{height:3px;background-color:var(--resize-background-color);transition:all .15s ease-in-out}.vditor-resize:hover>div,.vditor-resize--selected>div{background-color:var(--resize-hover-background-color)}.vditor-resize:hover svg,.vditor-resize--selected svg{color:var(--resize-hover-icon-color)}.vditor-resize svg{fill:currentColor;stroke-width:0;stroke:currentColor;width:13px;height:3px;display:block;margin:0 auto;color:var(--resize-icon-color)}.vditor-upload{position:absolute;height:3px;left:0;top:-2px;transition:all .15s ease-in-out;background-color:#4285f4}.vditor-tip{position:absolute;font-size:12px;top:10px;-webkit-animation-duration:.15s;animation-duration:.15s;-webkit-animation-fill-mode:both;animation-fill-mode:both;left:50%;z-index:5}.vditor-tip--show{display:block;-webkit-animation-name:slideInDown;animation-name:slideInDown}.vditor-tip__content{text-align:left;display:inline-block;line-height:16px;padding:3px 10px;border-radius:3px;background:var(--toolbar-background-color);position:relative;margin-left:-50%;color:var(--toolbar-icon-color);max-width:100%;box-shadow:var(--panel-shadow)}.vditor-tip__content ul{margin:2px 0;padding:0 0 0 18px}.vditor-tip__content a{color:#4285f4}.vditor-tip__close{position:absolute;color:var(--toolbar-icon-color);top:-7px;right:-15px;font-weight:700;cursor:pointer}.vditor-tip__close:hover{color:var(--toolbar-icon-hover-color)}.vditor-img{position:fixed;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;z-index:100}.vditor-img__bar{border-bottom:1px solid var(--border-color);background-color:var(--toolbar-background-color);text-align:center;height:36px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.vditor-img__btn{display:flex;align-items:center;cursor:pointer;margin-left:24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--toolbar-icon-color)}.vditor-img__btn:hover{color:var(--toolbar-icon-hover-color)}.vditor-img__btn svg{height:14px;width:14px;margin-right:8px;fill:currentColor}.vditor-img__img{flex:1;background-color:var(--textarea-background-color);overflow:auto;cursor:zoom-out}.vditor-img__img img{max-width:none}.vditor-hint{background-color:var(--panel-background-color);position:absolute;box-shadow:var(--panel-shadow);border-radius:3px;padding:5px 0;z-index:4;line-height:20px;list-style:none;font-size:12px;margin:0;max-width:250px;min-width:80px;display:none}.vditor-hint .vditor-hint{margin-top:-31px;left:100%;right:auto}.vditor-hint .vditor-hint.vditor-panel--left{right:100%;left:auto}.vditor-hint button{color:var(--toolbar-icon-color);display:block;padding:3px 10px;border:0;border-radius:0;line-height:20px;width:100%;box-sizing:border-box;text-align:left;margin:0;background-color:transparent;cursor:pointer;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.vditor-hint button:focus{outline:none}.vditor-hint--current,.vditor-hint button:not(.vditor-menu--disabled):hover{background-color:var(--toolbar-background-color)!important;color:var(--toolbar-icon-hover-color)!important}.vditor-hint__emoji{font-size:16px;float:left;margin-right:3px}.vditor-hint img{height:20px;width:20px;float:left;margin-right:3px}.vditor-reset{color:#24292e;font-variant-ligatures:no-common-ligatures;font-family:Helvetica Neue,Luxi Sans,DejaVu Sans,Hiragino Sans GB,Microsoft Yahei,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",Segoe UI Symbol,"Android Emoji",EmojiSymbols;word-wrap:break-word;overflow:auto;line-height:1.5;font-size:16px;word-break:break-word}.vditor-reset--anchor{padding-left:20px}.vditor-reset--error{color:#d23f31;font-size:12px;display:block;line-height:16px}.vditor-reset ul ul ul{list-style-type:square}.vditor-reset ul ul{list-style-type:circle}.vditor-reset ul{list-style-type:disc}.vditor-reset ul,.vditor-reset ol{padding-left:2em;margin-top:0;margin-bottom:16px}.vditor-reset li+li{margin-top:.25em}.vditor-reset li p{margin-top:16px}.vditor-reset audio{max-width:100%}.vditor-reset audio:focus{outline:none}.vditor-reset video{max-height:90vh;max-width:100%}.vditor-reset img{max-width:100%}.vditor-reset img.emoji{cursor:auto;max-width:20px;vertical-align:sub}.vditor-reset h1,.vditor-reset h2,.vditor-reset h3,.vditor-reset h4,.vditor-reset h5,.vditor-reset h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.vditor-reset h1:hover .vditor-anchor svg,.vditor-reset h2:hover .vditor-anchor svg,.vditor-reset h3:hover .vditor-anchor svg,.vditor-reset h4:hover .vditor-anchor svg,.vditor-reset h5:hover .vditor-anchor svg,.vditor-reset h6:hover .vditor-anchor svg{visibility:visible}.vditor-reset h1{font-size:1.75em}.vditor-reset h2{font-size:1.55em}.vditor-reset h3{font-size:1.38em}.vditor-reset h4{font-size:1.25em}.vditor-reset h5{font-size:1.13em}.vditor-reset h6{font-size:1em}.vditor-reset hr{height:2px;padding:0;margin:24px 0;background-color:#eaecef;border:0}.vditor-reset p{margin-top:0;margin-bottom:16px}.vditor-reset blockquote{padding:0 1em;color:#6a737d;border-left:.25em solid #eaecef;margin:0 0 16px}.vditor-reset blockquote>:first-child{margin-top:0}.vditor-reset blockquote>:last-child{margin-bottom:0}.vditor-reset ins>iframe{border:0}.vditor-reset iframe{border:1px solid #d1d5da;max-width:100%;box-sizing:border-box}.vditor-reset iframe.iframe__video{min-width:80%;min-height:36vh}.vditor-reset table{border-collapse:collapse;empty-cells:show;margin-bottom:16px;overflow:auto;border-spacing:0;display:block;word-break:keep-all;width:100%}.vditor-reset table tr{background-color:#fafbfc;border-top:1px solid #c6cbd1}.vditor-reset table td,.vditor-reset table th{padding:6px 13px;border:1px solid #dfe2e5;word-break:normal;white-space:nowrap}.vditor-reset table td:first-child:after,.vditor-reset table th:first-child:after{content:"";display:inline-block;vertical-align:top;min-height:24px}.vditor-reset table th{font-weight:600}.vditor-reset table tbody tr:nth-child(2n){background-color:#fff}.vditor-reset code:not(.hljs):not(.highlight-chroma){padding:.2em .4em;margin:0;font-size:85%;border-radius:3px;font-family:mononoki,Consolas,Liberation Mono,Menlo,Courier,monospace,"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",Segoe UI Symbol,"Android Emoji",EmojiSymbols;word-break:break-word;background-size:20px 20px;white-space:pre-wrap}.vditor-reset pre{margin:1em 0}.vditor-reset pre>code{margin:0;font-size:85%;padding:.5em;border-radius:5px;display:block;overflow:auto;white-space:pre;font-family:mononoki,Consolas,Liberation Mono,Menlo,Courier,monospace,"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",Segoe UI Symbol,"Android Emoji",EmojiSymbols;background-size:20px 20px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg==);word-break:initial;word-wrap:normal}.vditor-reset pre:hover div.vditor-copy{display:block}.vditor-reset .language-math,.vditor-reset .language-echarts,.vditor-reset .language-mindmap,.vditor-reset .language-plantuml,.vditor-reset .language-mermaid,.vditor-reset .language-markmap,.vditor-reset .language-abc,.vditor-reset .language-flowchart,.vditor-reset .language-graphviz{margin-bottom:16px}.vditor-reset .language-math mjx-container:focus{outline:none;cursor:context-menu}.vditor-reset .language-echarts,.vditor-reset .language-mindmap{overflow:hidden;height:420px}.vditor-reset .language-mermaid,.vditor-reset .language-markmap,.vditor-reset .language-flowchart,.vditor-reset .language-graphviz{text-align:center}.vditor-reset .language-graphviz parsererror{overflow:auto}.vditor-reset kbd{display:inline-block;padding:3px 5px;font:11px Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:10px;color:#24292e;vertical-align:middle;background-color:#fafbfc;border:solid 1px #d1d5da;border-radius:3px;box-shadow:inset 0 -1px #d1d5da}.vditor-reset summary{cursor:pointer}.vditor-reset summary:focus{outline:none}.vditor-reset svg{height:auto;width:auto;stroke-width:initial}.vditor-reset p:last-child,.vditor-reset blockquote:last-child,.vditor-reset pre:last-child,.vditor-reset ul:last-child,.vditor-reset ol:last-child,.vditor-reset hr:last-child{margin-bottom:0}.vditor-comment{border-bottom:2px solid #f8e6ab}.vditor-comment--focus,.vditor-comment--hover{background-color:#faf1d1;border-bottom:2px solid #ffc60a}.vditor-comment--focus .vditor-comment,.vditor-comment--hover .vditor-comment{border-bottom:2px solid #ffc60a}.vditor-task{list-style:none!important;word-break:break-all}.vditor-task input{margin:0 .2em .25em -1.6em;font-size:12px;vertical-align:middle}.vditor-copy{position:relative;display:none;z-index:1}.vditor-copy textarea{position:absolute;left:-100000px;height:10px}.vditor-copy span{cursor:pointer;position:absolute;right:15px;top:.5em}.vditor-copy svg{color:#586069;height:14px;width:14px!important;display:block;fill:currentColor}.vditor-linenumber{padding-left:4em!important;position:relative}.vditor-linenumber__rows{position:absolute;pointer-events:none;top:.5em;left:0;width:3em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;counter-reset:linenumber}.vditor-linenumber__rows>span{pointer-events:none;display:block}.vditor-linenumber__rows>span:before{counter-increment:linenumber;content:counter(linenumber);color:#9e969661;display:block;padding-right:1em;text-align:right}.vditor-speech{position:absolute;display:none;background-color:#f6f8fa;border:1px solid #d1d5da;border-radius:3px;padding:3px;cursor:pointer;color:#586069}.vditor-speech:hover,.vditor-speech--current{color:#4285f4}.vditor-speech svg{height:14px;width:14px;fill:currentColor;display:block;stroke-width:0;stroke:currentColor}.vditor-anchor{margin-left:5px}.vditor-anchor--left{float:left;padding-right:4px;margin-left:-20px}.vditor-anchor svg{visibility:hidden}.vditor-anchor:hover svg{visibility:visible}.vditor-anchor:focus{outline:none}.vditor-linkcard{margin:31px auto 16px;transition:all .15s ease-in-out;cursor:pointer;max-width:768px;padding:0 10px}.vditor-linkcard a{border-radius:3px;background-color:#f6f8fa;overflow:hidden;max-height:250px;display:flex;text-decoration:none;flex-wrap:wrap-reverse;box-shadow:0 1px 2px #0003}.vditor-linkcard a:hover{box-shadow:0 0 3px #00000021,0 3px 6px #00000042;text-decoration:none}.vditor-linkcard a:visited .vditor-linkcard__abstract{color:#5860695c}.vditor-linkcard__info{padding:10px;min-width:200px;box-sizing:border-box;flex:1}.vditor-linkcard__title{font-size:14px;font-weight:400;color:#24292e;display:flex;align-items:center}.vditor-linkcard__title img{cursor:pointer;height:20px;width:20px;border-radius:3px;flex-shrink:0;margin-right:5px}.vditor-linkcard__abstract{word-wrap:break-word;word-break:break-all;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical;display:-webkit-box;font-size:13px;color:#586069;margin:5px 0}.vditor-linkcard__site{font-size:12px;color:#4285f4}.vditor-linkcard__image{background-size:cover;background-repeat:no-repeat;background-position:center center;max-width:250px;min-width:126px;cursor:pointer;background-color:#5860695c}.vditor-footnotes__goto-ref{text-decoration:none}.vditor-toc{margin-bottom:16px;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;color:#4285f4}.vditor-toc .vditor-outline__action{display:none}.vditor-toc ul{list-style:none!important;padding-left:1em}.vditor-toc>ul{padding-left:0}.vditor-toc span{cursor:pointer}.vditor-toc li>span>svg{width:0;height:0}.vditor-outline{width:250px;border-right:1px solid var(--border-color);background-color:var(--panel-background-color);display:none;overflow:auto}.vditor-outline--right{border-right:0;border-left:1px solid var(--border-color)}.vditor-outline::-webkit-scrollbar{display:none}.vditor-outline ul{list-style:none!important;padding-left:1em;margin:0}.vditor-outline__content>ul{padding-left:0}.vditor-outline li>span{display:flex;align-items:center;padding:5px 10px;cursor:pointer;color:var(--textarea-text-color)}.vditor-outline li>span>svg{height:10px;width:10px;flex-shrink:0}.vditor-outline li>span:hover{color:var(--toolbar-icon-hover-color)}.vditor-outline li>span>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vditor-outline__title{border-bottom:1px dashed var(--border-color);padding:5px 10px;color:var(--toolbar-icon-color);font-size:12px}.vditor-outline__action{transition:all .15s ease-in-out;fill:currentColor;margin-right:5px;flex-shrink:0}.vditor-outline__action--close{transform:rotate(-90deg)}.vditor-wysiwyg{box-sizing:border-box;flex:1;position:relative;width:100%;min-width:1px}.vditor-wysiwyg pre.vditor-reset{background-color:var(--panel-background-color);margin:0;white-space:pre-wrap;height:100%;box-sizing:border-box}.vditor-wysiwyg pre.vditor-reset[contenteditable=false]{opacity:.3;cursor:not-allowed}.vditor-wysiwyg pre.vditor-reset:empty:before{content:attr(placeholder);color:var(--second-color)}.vditor-wysiwyg pre.vditor-reset:focus{outline:none;background-color:var(--textarea-background-color)}.vditor-wysiwyg pre.vditor-reset:after{content:"";height:var(--editor-bottom);display:block}.vditor-wysiwyg blockquote:empty:before,.vditor-wysiwyg pre>code:empty:before,.vditor-wysiwyg p:empty:before,.vditor-wysiwyg h1:empty:after,.vditor-wysiwyg h2:empty:after,.vditor-wysiwyg h3:empty:after,.vditor-wysiwyg h4:empty:after,.vditor-wysiwyg h5:empty:after,.vditor-wysiwyg h6:empty:after{content:" "}.vditor-wysiwyg code[data-marker="\`"]{padding-left:0!important;padding-right:0!important}.vditor-wysiwyg__block pre:first-child{margin-bottom:-1em}.vditor-wysiwyg__block pre:first-child code{color:var(--textarea-text-color);height:auto;text-align:left}.vditor-wysiwyg__block pre:last-child{margin-bottom:1em}.vditor-wysiwyg__preview{cursor:pointer;white-space:initial;min-height:27px}.vditor-wysiwyg>.vditor-reset>h1:before,.vditor-wysiwyg>.vditor-reset>h2:before,.vditor-wysiwyg>.vditor-reset>h3:before,.vditor-wysiwyg>.vditor-reset>h4:before,.vditor-wysiwyg>.vditor-reset>h5:before,.vditor-wysiwyg>.vditor-reset>h6:before,.vditor-wysiwyg div.vditor-wysiwyg__block:before,.vditor-wysiwyg div[data-type=link-ref-defs-block]:before,.vditor-wysiwyg div[data-type=footnotes-block]:before,.vditor-wysiwyg .vditor-toc:before{float:left;padding-right:4px;margin-left:-29px;content:"H1";font-size:.85rem;font-weight:400;color:var(--second-color)}.vditor-wysiwyg>.vditor-reset>h2:before{content:"H2"}.vditor-wysiwyg>.vditor-reset>h3:before{content:"H3"}.vditor-wysiwyg>.vditor-reset>h4:before{content:"H4"}.vditor-wysiwyg>.vditor-reset>h5:before{content:"H5"}.vditor-wysiwyg>.vditor-reset>h6:before{content:"H6"}.vditor-wysiwyg div[data-type=link-ref-defs-block]:before{content:'"A"'}.vditor-wysiwyg div[data-type=footnotes-block]:before{content:"^F"}.vditor-wysiwyg div.vditor-wysiwyg__block:before{content:"</>"}.vditor-wysiwyg div.vditor-wysiwyg__block[data-type=yaml-front-matter]:before{content:"F"}.vditor-wysiwyg div.vditor-wysiwyg__block[data-type=math-block]:before{content:"$$"}.vditor-wysiwyg .vditor-toc:before{content:"ToC"}.vditor-wysiwyg hr{display:inline-block;margin:12px 0;width:100%}.vditor-wysiwyg details{white-space:initial}.vditor-wysiwyg a{cursor:pointer}.vditor-wysiwyg span[data-type=backslash]>span{display:none;color:var(--second-color)}.vditor-wysiwyg span[data-type=link-ref],.vditor-wysiwyg sup[data-type=footnotes-ref]{color:#4285f4}.vditor-wysiwyg span[data-type=toc-h]{color:#4285f4;text-decoration:underline}.vditor-wysiwyg div[data-type=footnotes-block]{border-top:2px solid var(--heading-border-color);padding-top:24px;margin-top:24px}.vditor-wysiwyg div[data-type=link-ref-defs-block]{color:var(--blockquote-color)}@media screen and (max-width: 520px){.vditor-wysiwyg h1:before,.vditor-wysiwyg h2:before,.vditor-wysiwyg h3:before,.vditor-wysiwyg h4:before,.vditor-wysiwyg h5:before,.vditor-wysiwyg h6:before,.vditor-wysiwyg div.vditor-wysiwyg__block:before,.vditor-wysiwyg div[data-type=link-ref-defs-block]:before,.vditor-wysiwyg div[data-type=footnotes-block]:before,.vditor-wysiwyg .vditor-toc:before{content:none}}.vditor-ir{box-sizing:border-box;flex:1;min-width:1px;position:relative;width:100%}.vditor-ir__node[data-type=code-block]:before,.vditor-ir__node[data-type=code-block]:after,.vditor-ir__node[data-type=yaml-front-matter]:before,.vditor-ir__node[data-type=yaml-front-matter]:after,.vditor-ir__node[data-type=math-block]:before,.vditor-ir__node[data-type=math-block]:after{content:" ";color:var(--second-color)}.vditor-ir__node:not(.vditor-ir__node--expand) .vditor-ir__marker{padding:0!important}.vditor-ir__node:not(.vditor-ir__node--expand)[data-type=a]{cursor:pointer}.vditor-ir__node[data-type=link-ref],.vditor-ir__node[data-type=footnotes-ref]{color:#4285f4}.vditor-ir__node[data-type=html-block]{margin-bottom:1em}.vditor-ir__node .vditor-ir__marker{width:0;overflow:hidden;display:inline-block;height:0;transition:all .15s ease-in-out}.vditor-ir__node--hidden .vditor-ir__marker{visibility:hidden}.vditor-ir__node--expand .vditor-ir__marker{color:var(--second-color);display:inline;height:auto;width:auto}.vditor-ir__node--expand .vditor-ir__marker--hide{display:none}.vditor-ir__node--expand .vditor-ir__marker--heading{color:var(--ir-heading-color)}.vditor-ir__node--expand .vditor-ir__marker--bi{color:var(--ir-bi-color)}.vditor-ir__node--expand .vditor-ir__marker--link{color:var(--ir-link-color)}.vditor-ir__node--expand .vditor-ir__marker--title{color:var(--ir-title-color)}.vditor-ir__node--expand .vditor-ir__marker--bracket{color:var(--ir-bracket-color);text-decoration:underline}.vditor-ir__node--expand .vditor-ir__marker--paren{color:var(--ir-paren-color)}.vditor-ir__node--expand .vditor-ir__marker--info{color:var(--ir-heading-color)}.vditor-ir__node--expand .vditor-ir__marker--pre code{color:var(--textarea-text-color);height:auto;text-align:left}.vditor-ir__node--expand[data-type=code-block]:before,.vditor-ir__node--expand[data-type=code-block]:after{content:"\`\`\`"}.vditor-ir__node--expand[data-type=yaml-front-matter]:before,.vditor-ir__node--expand[data-type=yaml-front-matter]:after{content:"---"}.vditor-ir__node--expand[data-type=math-block]:before,.vditor-ir__node--expand[data-type=math-block]:after{content:"$$"}.vditor-ir__node span[data-type=code-block-open-marker],.vditor-ir__node span[data-type=code-block-close-marker],.vditor-ir__node span[data-type=yaml-front-matter-open-marker],.vditor-ir__node span[data-type=yaml-front-matter-close-marker],.vditor-ir__node span[data-type=math-block-open-marker],.vditor-ir__node span[data-type=math-block-close-marker]{display:none}.vditor-ir__preview{cursor:pointer;white-space:initial;min-height:27px}.vditor-ir__link{color:var(--ir-bracket-color);text-decoration:underline}.vditor-ir pre.vditor-reset{background-color:var(--panel-background-color);margin:0;white-space:pre-wrap;height:100%;box-sizing:border-box}.vditor-ir pre.vditor-reset[contenteditable=false]{opacity:.3;cursor:not-allowed}.vditor-ir pre.vditor-reset:empty:before{content:attr(placeholder);color:var(--second-color)}.vditor-ir pre.vditor-reset:focus{outline:none;background-color:var(--textarea-background-color)}.vditor-ir pre.vditor-reset:after{content:"";height:var(--editor-bottom);display:block}.vditor-ir pre.vditor-reset pre{margin:0}.vditor-ir hr{display:inline-block;margin:12px 0;width:100%}.vditor-ir blockquote:empty:before,.vditor-ir pre>code:empty:before,.vditor-ir p:empty:before,.vditor-ir h1:empty:after,.vditor-ir h2:empty:after,.vditor-ir h3:empty:after,.vditor-ir h4:empty:after,.vditor-ir h5:empty:after,.vditor-ir h6:empty:after{content:" "}.vditor-ir .vditor-reset>h1:before,.vditor-ir .vditor-reset>h2:before,.vditor-ir .vditor-reset>h3:before,.vditor-ir .vditor-reset>h4:before,.vditor-ir .vditor-reset>h5:before,.vditor-ir .vditor-reset>h6:before,.vditor-ir div[data-type=link-ref-defs-block]:before,.vditor-ir div[data-type=footnotes-block]:before,.vditor-ir .vditor-toc:before{float:left;padding-right:4px;margin-left:-29px;content:"H1";font-size:.85rem;font-weight:400;color:var(--second-color)}.vditor-ir .vditor-reset>h2:before{content:"H2"}.vditor-ir .vditor-reset>h3:before{content:"H3"}.vditor-ir .vditor-reset>h4:before{content:"H4"}.vditor-ir .vditor-reset>h5:before{content:"H5"}.vditor-ir .vditor-reset>h6:before{content:"H6"}.vditor-ir div[data-type=link-ref-defs-block]{color:var(--blockquote-color)}.vditor-ir div[data-type=link-ref-defs-block]:before{content:'"A"'}.vditor-ir div[data-type=footnotes-block]{border-top:2px solid var(--heading-border-color);padding-top:24px;margin-top:24px}.vditor-ir div[data-type=footnotes-block]:before{content:"^F"}.vditor-ir div[data-type=footnotes-block]>div[data-type=footnotes-def]>ul,.vditor-ir div[data-type=footnotes-block]>div[data-type=footnotes-def]>ol,.vditor-ir div[data-type=footnotes-block]>div[data-type=footnotes-def]>p,.vditor-ir div[data-type=footnotes-block]>div[data-type=footnotes-def]>blockquote,.vditor-ir div[data-type=footnotes-block]>div[data-type=footnotes-def]>pre,.vditor-ir div[data-type=footnotes-block]>div[data-type=footnotes-def]>table,.vditor-ir div[data-type=footnotes-block]>div[data-type=footnotes-def]>hr{margin-left:8px}.vditor-ir .vditor-toc:before{content:"ToC"}.vditor-ir .vditor-toc span[data-type=toc-h]{color:#4285f4;text-decoration:underline}@media screen and (max-width: 520px){.vditor-ir h1:before,.vditor-ir h2:before,.vditor-ir h3:before,.vditor-ir h4:before,.vditor-ir h5:before,.vditor-ir h6:before,.vditor-ir div[data-type=link-ref-defs-block]:before,.vditor-ir div[data-type=footnotes-block]:before,.vditor-ir .vditor-toc:before{content:none}}.vditor-sv{font-family:Helvetica Neue,Luxi Sans,DejaVu Sans,Hiragino Sans GB,Microsoft Yahei,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",Segoe UI Symbol,"Android Emoji",EmojiSymbols;margin:0 1px 0 0;overflow:auto;width:100%;flex:1;min-width:1px;border:0;resize:none;padding:10px 9px 10px 10px;box-sizing:border-box;background-color:var(--panel-background-color);outline:0 none;font-size:16px;line-height:22px;color:var(--textarea-text-color);border-radius:0 0 3px 3px;font-variant-ligatures:no-common-ligatures;white-space:pre-wrap;word-break:break-word;word-wrap:break-word}.vditor-sv[contenteditable=false]{opacity:.3;cursor:not-allowed}.vditor-sv:empty:before{content:attr(placeholder);color:var(--second-color)}.vditor-sv:focus{background-color:var(--textarea-background-color)}.vditor-sv:after{content:"";height:var(--editor-bottom);display:block}.vditor-sv span[data-type=newline]+span[data-type=text]:empty{display:inherit}.vditor-sv .sup{vertical-align:super;font-size:smaller}.vditor-sv .strong{font-weight:700}.vditor-sv .em{font-style:italic}.vditor-sv .s{text-decoration:line-through}.vditor-sv .mark:not(.vditor-sv__marker){background-color:#ff0;color:#000}.vditor-sv .h1{font-size:1.75em;line-height:44px}.vditor-sv .h2{font-size:1.55em;line-height:38px}.vditor-sv .h3{font-size:1.38em;line-height:27px}.vditor-sv .h4{font-size:1.25em;line-height:25px}.vditor-sv .h5{font-size:1.13em}.vditor-sv .h6{font-size:1em}.vditor-sv__marker{color:var(--second-color)}.vditor-sv__marker--heading{color:var(--ir-heading-color)}.vditor-sv__marker--bi{color:var(--ir-bi-color)}.vditor-sv__marker--link{color:var(--ir-link-color)}.vditor-sv__marker--title{color:var(--ir-title-color)}.vditor-sv__marker--bracket{color:var(--ir-bracket-color)}.vditor-sv__marker--paren{color:var(--ir-paren-color)}.vditor-sv__marker--info{color:var(--ir-heading-color)}.vditor-sv__marker--strong{font-weight:700}`)),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
36
+ (function(be,de){typeof exports=="object"&&typeof module!="undefined"?de(exports,require("@nocobase/client"),require("@formily/react"),require("react/jsx-runtime"),require("antd"),require("react"),require("@nocobase/utils/client")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@formily/react","react/jsx-runtime","antd","react","@nocobase/utils/client"],de):(be=typeof globalThis!="undefined"?globalThis:be||self,de(be["@nocobase/plugin-field-markdown-vditor"]={},be["@nocobase/client"],be["@formily/react"],be.jsxRuntime,be.antd,be.react,be["@nocobase/utils"]))})(this,function(be,de,Me,Ke,kt,Ae,jt){"use strict";var Di=Object.defineProperty,Oi=Object.defineProperties;var Ii=Object.getOwnPropertyDescriptors;var Jn=Object.getOwnPropertySymbols;var ji=Object.prototype.hasOwnProperty,Ri=Object.prototype.propertyIsEnumerable;var nn=(be,de,Me)=>de in be?Di(be,de,{enumerable:!0,configurable:!0,writable:!0,value:Me}):be[de]=Me,rn=(be,de)=>{for(var Me in de||(de={}))ji.call(de,Me)&&nn(be,Me,de[Me]);if(Jn)for(var Me of Jn(de))Ri.call(de,Me)&&nn(be,Me,de[Me]);return be},Xn=(be,de)=>Oi(be,Ii(de));var We=(be,de,Me)=>(nn(be,typeof de!="symbol"?de+"":de,Me),Me);var It=(be,de,Me)=>new Promise((Ke,kt)=>{var Ae=Ze=>{try{ft(Me.next(Ze))}catch(ot){kt(ot)}},jt=Ze=>{try{ft(Me.throw(Ze))}catch(ot){kt(ot)}},ft=Ze=>Ze.done?Ke(Ze.value):Promise.resolve(Ze.value).then(Ae,jt);ft((Me=Me.apply(be,de)).next())});var ft=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ze(ae){return ae&&ae.__esModule&&Object.prototype.hasOwnProperty.call(ae,"default")?ae.default:ae}var ot={exports:{}};(function(ae,ye){(function(pe,ce){ae.exports=ce()})(ft,()=>(()=>{var pe={471:J=>{var M=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},b=-1;M.Diff=function(d,m){return[d,m]},M.prototype.diff_main=function(d,m,s,w){w===void 0&&(w=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var l=w;if(d==null||m==null)throw new Error("Null input. (diff_main)");if(d==m)return d?[new M.Diff(0,d)]:[];s===void 0&&(s=!0);var u=s,f=this.diff_commonPrefix(d,m),E=d.substring(0,f);d=d.substring(f),m=m.substring(f),f=this.diff_commonSuffix(d,m);var L=d.substring(d.length-f);d=d.substring(0,d.length-f),m=m.substring(0,m.length-f);var S=this.diff_compute_(d,m,u,l);return E&&S.unshift(new M.Diff(0,E)),L&&S.push(new M.Diff(0,L)),this.diff_cleanupMerge(S),S},M.prototype.diff_compute_=function(d,m,s,w){var l;if(!d)return[new M.Diff(1,m)];if(!m)return[new M.Diff(b,d)];var u=d.length>m.length?d:m,f=d.length>m.length?m:d,E=u.indexOf(f);if(E!=-1)return l=[new M.Diff(1,u.substring(0,E)),new M.Diff(0,f),new M.Diff(1,u.substring(E+f.length))],d.length>m.length&&(l[0][0]=l[2][0]=b),l;if(f.length==1)return[new M.Diff(b,d),new M.Diff(1,m)];var L=this.diff_halfMatch_(d,m);if(L){var S=L[0],C=L[1],y=L[2],k=L[3],p=L[4],_=this.diff_main(S,y,s,w),N=this.diff_main(C,k,s,w);return _.concat([new M.Diff(0,p)],N)}return s&&d.length>100&&m.length>100?this.diff_lineMode_(d,m,w):this.diff_bisect_(d,m,w)},M.prototype.diff_lineMode_=function(d,m,s){var w=this.diff_linesToChars_(d,m);d=w.chars1,m=w.chars2;var l=w.lineArray,u=this.diff_main(d,m,!1,s);this.diff_charsToLines_(u,l),this.diff_cleanupSemantic(u),u.push(new M.Diff(0,""));for(var f=0,E=0,L=0,S="",C="";f<u.length;){switch(u[f][0]){case 1:L++,C+=u[f][1];break;case b:E++,S+=u[f][1];break;case 0:if(E>=1&&L>=1){u.splice(f-E-L,E+L),f=f-E-L;for(var y=this.diff_main(S,C,!1,s),k=y.length-1;k>=0;k--)u.splice(f,0,y[k]);f+=y.length}L=0,E=0,S="",C=""}f++}return u.pop(),u},M.prototype.diff_bisect_=function(d,m,s){for(var w=d.length,l=m.length,u=Math.ceil((w+l)/2),f=u,E=2*u,L=new Array(E),S=new Array(E),C=0;C<E;C++)L[C]=-1,S[C]=-1;L[f+1]=0,S[f+1]=0;for(var y=w-l,k=y%2!=0,p=0,_=0,N=0,q=0,D=0;D<u&&!(new Date().getTime()>s);D++){for(var Z=-D+p;Z<=D-_;Z+=2){for(var te=f+Z,ge=(_e=Z==-D||Z!=D&&L[te-1]<L[te+1]?L[te+1]:L[te-1]+1)-Z;_e<w&&ge<l&&d.charAt(_e)==m.charAt(ge);)_e++,ge++;if(L[te]=_e,_e>w)_+=2;else if(ge>l)p+=2;else if(k&&(we=f+y-Z)>=0&&we<E&&S[we]!=-1&&_e>=(ue=w-S[we]))return this.diff_bisectSplit_(d,m,_e,ge,s)}for(var fe=-D+N;fe<=D-q;fe+=2){for(var ue,we=f+fe,De=(ue=fe==-D||fe!=D&&S[we-1]<S[we+1]?S[we+1]:S[we-1]+1)-fe;ue<w&&De<l&&d.charAt(w-ue-1)==m.charAt(l-De-1);)ue++,De++;if(S[we]=ue,ue>w)q+=2;else if(De>l)N+=2;else if(!k&&(te=f+y-fe)>=0&&te<E&&L[te]!=-1){var _e;if(ge=f+(_e=L[te])-te,_e>=(ue=w-ue))return this.diff_bisectSplit_(d,m,_e,ge,s)}}}return[new M.Diff(b,d),new M.Diff(1,m)]},M.prototype.diff_bisectSplit_=function(d,m,s,w,l){var u=d.substring(0,s),f=m.substring(0,w),E=d.substring(s),L=m.substring(w),S=this.diff_main(u,f,!1,l),C=this.diff_main(E,L,!1,l);return S.concat(C)},M.prototype.diff_linesToChars_=function(d,m){var s=[],w={};function l(E){for(var L="",S=0,C=-1,y=s.length;C<E.length-1;){(C=E.indexOf(`
37
+ `,S))==-1&&(C=E.length-1);var k=E.substring(S,C+1);(w.hasOwnProperty?w.hasOwnProperty(k):w[k]!==void 0)?L+=String.fromCharCode(w[k]):(y==u&&(k=E.substring(S),C=E.length),L+=String.fromCharCode(y),w[k]=y,s[y++]=k),S=C+1}return L}s[0]="";var u=4e4,f=l(d);return u=65535,{chars1:f,chars2:l(m),lineArray:s}},M.prototype.diff_charsToLines_=function(d,m){for(var s=0;s<d.length;s++){for(var w=d[s][1],l=[],u=0;u<w.length;u++)l[u]=m[w.charCodeAt(u)];d[s][1]=l.join("")}},M.prototype.diff_commonPrefix=function(d,m){if(!d||!m||d.charAt(0)!=m.charAt(0))return 0;for(var s=0,w=Math.min(d.length,m.length),l=w,u=0;s<l;)d.substring(u,l)==m.substring(u,l)?u=s=l:w=l,l=Math.floor((w-s)/2+s);return l},M.prototype.diff_commonSuffix=function(d,m){if(!d||!m||d.charAt(d.length-1)!=m.charAt(m.length-1))return 0;for(var s=0,w=Math.min(d.length,m.length),l=w,u=0;s<l;)d.substring(d.length-l,d.length-u)==m.substring(m.length-l,m.length-u)?u=s=l:w=l,l=Math.floor((w-s)/2+s);return l},M.prototype.diff_commonOverlap_=function(d,m){var s=d.length,w=m.length;if(s==0||w==0)return 0;s>w?d=d.substring(s-w):s<w&&(m=m.substring(0,s));var l=Math.min(s,w);if(d==m)return l;for(var u=0,f=1;;){var E=d.substring(l-f),L=m.indexOf(E);if(L==-1)return u;f+=L,L!=0&&d.substring(l-f)!=m.substring(0,f)||(u=f,f++)}},M.prototype.diff_halfMatch_=function(d,m){if(this.Diff_Timeout<=0)return null;var s=d.length>m.length?d:m,w=d.length>m.length?m:d;if(s.length<4||2*w.length<s.length)return null;var l=this;function u(p,_,N){for(var q,D,Z,te,ge=p.substring(N,N+Math.floor(p.length/4)),fe=-1,ue="";(fe=_.indexOf(ge,fe+1))!=-1;){var we=l.diff_commonPrefix(p.substring(N),_.substring(fe)),De=l.diff_commonSuffix(p.substring(0,N),_.substring(0,fe));ue.length<De+we&&(ue=_.substring(fe-De,fe)+_.substring(fe,fe+we),q=p.substring(0,N-De),D=p.substring(N+we),Z=_.substring(0,fe-De),te=_.substring(fe+we))}return 2*ue.length>=p.length?[q,D,Z,te,ue]:null}var f,E,L,S,C,y=u(s,w,Math.ceil(s.length/4)),k=u(s,w,Math.ceil(s.length/2));return y||k?(f=k?y&&y[4].length>k[4].length?y:k:y,d.length>m.length?(E=f[0],L=f[1],S=f[2],C=f[3]):(S=f[0],C=f[1],E=f[2],L=f[3]),[E,L,S,C,f[4]]):null},M.prototype.diff_cleanupSemantic=function(d){for(var m=!1,s=[],w=0,l=null,u=0,f=0,E=0,L=0,S=0;u<d.length;)d[u][0]==0?(s[w++]=u,f=L,E=S,L=0,S=0,l=d[u][1]):(d[u][0]==1?L+=d[u][1].length:S+=d[u][1].length,l&&l.length<=Math.max(f,E)&&l.length<=Math.max(L,S)&&(d.splice(s[w-1],0,new M.Diff(b,l)),d[s[w-1]+1][0]=1,w--,u=--w>0?s[w-1]:-1,f=0,E=0,L=0,S=0,l=null,m=!0)),u++;for(m&&this.diff_cleanupMerge(d),this.diff_cleanupSemanticLossless(d),u=1;u<d.length;){if(d[u-1][0]==b&&d[u][0]==1){var C=d[u-1][1],y=d[u][1],k=this.diff_commonOverlap_(C,y),p=this.diff_commonOverlap_(y,C);k>=p?(k>=C.length/2||k>=y.length/2)&&(d.splice(u,0,new M.Diff(0,y.substring(0,k))),d[u-1][1]=C.substring(0,C.length-k),d[u+1][1]=y.substring(k),u++):(p>=C.length/2||p>=y.length/2)&&(d.splice(u,0,new M.Diff(0,C.substring(0,p))),d[u-1][0]=1,d[u-1][1]=y.substring(0,y.length-p),d[u+1][0]=b,d[u+1][1]=C.substring(p),u++),u++}u++}},M.prototype.diff_cleanupSemanticLossless=function(d){function m(p,_){if(!p||!_)return 6;var N=p.charAt(p.length-1),q=_.charAt(0),D=N.match(M.nonAlphaNumericRegex_),Z=q.match(M.nonAlphaNumericRegex_),te=D&&N.match(M.whitespaceRegex_),ge=Z&&q.match(M.whitespaceRegex_),fe=te&&N.match(M.linebreakRegex_),ue=ge&&q.match(M.linebreakRegex_),we=fe&&p.match(M.blanklineEndRegex_),De=ue&&_.match(M.blanklineStartRegex_);return we||De?5:fe||ue?4:D&&!te&&ge?3:te||ge?2:D||Z?1:0}for(var s=1;s<d.length-1;){if(d[s-1][0]==0&&d[s+1][0]==0){var w=d[s-1][1],l=d[s][1],u=d[s+1][1],f=this.diff_commonSuffix(w,l);if(f){var E=l.substring(l.length-f);w=w.substring(0,w.length-f),l=E+l.substring(0,l.length-f),u=E+u}for(var L=w,S=l,C=u,y=m(w,l)+m(l,u);l.charAt(0)===u.charAt(0);){w+=l.charAt(0),l=l.substring(1)+u.charAt(0),u=u.substring(1);var k=m(w,l)+m(l,u);k>=y&&(y=k,L=w,S=l,C=u)}d[s-1][1]!=L&&(L?d[s-1][1]=L:(d.splice(s-1,1),s--),d[s][1]=S,C?d[s+1][1]=C:(d.splice(s+1,1),s--))}s++}},M.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,M.whitespaceRegex_=/\s/,M.linebreakRegex_=/[\r\n]/,M.blanklineEndRegex_=/\n\r?\n$/,M.blanklineStartRegex_=/^\r?\n\r?\n/,M.prototype.diff_cleanupEfficiency=function(d){for(var m=!1,s=[],w=0,l=null,u=0,f=!1,E=!1,L=!1,S=!1;u<d.length;)d[u][0]==0?(d[u][1].length<this.Diff_EditCost&&(L||S)?(s[w++]=u,f=L,E=S,l=d[u][1]):(w=0,l=null),L=S=!1):(d[u][0]==b?S=!0:L=!0,l&&(f&&E&&L&&S||l.length<this.Diff_EditCost/2&&f+E+L+S==3)&&(d.splice(s[w-1],0,new M.Diff(b,l)),d[s[w-1]+1][0]=1,w--,l=null,f&&E?(L=S=!0,w=0):(u=--w>0?s[w-1]:-1,L=S=!1),m=!0)),u++;m&&this.diff_cleanupMerge(d)},M.prototype.diff_cleanupMerge=function(d){d.push(new M.Diff(0,""));for(var m,s=0,w=0,l=0,u="",f="";s<d.length;)switch(d[s][0]){case 1:l++,f+=d[s][1],s++;break;case b:w++,u+=d[s][1],s++;break;case 0:w+l>1?(w!==0&&l!==0&&((m=this.diff_commonPrefix(f,u))!==0&&(s-w-l>0&&d[s-w-l-1][0]==0?d[s-w-l-1][1]+=f.substring(0,m):(d.splice(0,0,new M.Diff(0,f.substring(0,m))),s++),f=f.substring(m),u=u.substring(m)),(m=this.diff_commonSuffix(f,u))!==0&&(d[s][1]=f.substring(f.length-m)+d[s][1],f=f.substring(0,f.length-m),u=u.substring(0,u.length-m))),s-=w+l,d.splice(s,w+l),u.length&&(d.splice(s,0,new M.Diff(b,u)),s++),f.length&&(d.splice(s,0,new M.Diff(1,f)),s++),s++):s!==0&&d[s-1][0]==0?(d[s-1][1]+=d[s][1],d.splice(s,1)):s++,l=0,w=0,u="",f=""}d[d.length-1][1]===""&&d.pop();var E=!1;for(s=1;s<d.length-1;)d[s-1][0]==0&&d[s+1][0]==0&&(d[s][1].substring(d[s][1].length-d[s-1][1].length)==d[s-1][1]?(d[s][1]=d[s-1][1]+d[s][1].substring(0,d[s][1].length-d[s-1][1].length),d[s+1][1]=d[s-1][1]+d[s+1][1],d.splice(s-1,1),E=!0):d[s][1].substring(0,d[s+1][1].length)==d[s+1][1]&&(d[s-1][1]+=d[s+1][1],d[s][1]=d[s][1].substring(d[s+1][1].length)+d[s+1][1],d.splice(s+1,1),E=!0)),s++;E&&this.diff_cleanupMerge(d)},M.prototype.diff_xIndex=function(d,m){var s,w=0,l=0,u=0,f=0;for(s=0;s<d.length&&(d[s][0]!==1&&(w+=d[s][1].length),d[s][0]!==b&&(l+=d[s][1].length),!(w>m));s++)u=w,f=l;return d.length!=s&&d[s][0]===b?f:f+(m-u)},M.prototype.diff_prettyHtml=function(d){for(var m=[],s=/&/g,w=/</g,l=/>/g,u=/\n/g,f=0;f<d.length;f++){var E=d[f][0],L=d[f][1].replace(s,"&amp;").replace(w,"&lt;").replace(l,"&gt;").replace(u,"&para;<br>");switch(E){case 1:m[f]='<ins style="background:#e6ffe6;">'+L+"</ins>";break;case b:m[f]='<del style="background:#ffe6e6;">'+L+"</del>";break;case 0:m[f]="<span>"+L+"</span>"}}return m.join("")},M.prototype.diff_text1=function(d){for(var m=[],s=0;s<d.length;s++)d[s][0]!==1&&(m[s]=d[s][1]);return m.join("")},M.prototype.diff_text2=function(d){for(var m=[],s=0;s<d.length;s++)d[s][0]!==b&&(m[s]=d[s][1]);return m.join("")},M.prototype.diff_levenshtein=function(d){for(var m=0,s=0,w=0,l=0;l<d.length;l++){var u=d[l][0],f=d[l][1];switch(u){case 1:s+=f.length;break;case b:w+=f.length;break;case 0:m+=Math.max(s,w),s=0,w=0}}return m+=Math.max(s,w)},M.prototype.diff_toDelta=function(d){for(var m=[],s=0;s<d.length;s++)switch(d[s][0]){case 1:m[s]="+"+encodeURI(d[s][1]);break;case b:m[s]="-"+d[s][1].length;break;case 0:m[s]="="+d[s][1].length}return m.join(" ").replace(/%20/g," ")},M.prototype.diff_fromDelta=function(d,m){for(var s=[],w=0,l=0,u=m.split(/\t/g),f=0;f<u.length;f++){var E=u[f].substring(1);switch(u[f].charAt(0)){case"+":try{s[w++]=new M.Diff(1,decodeURI(E))}catch(C){throw new Error("Illegal escape in diff_fromDelta: "+E)}break;case"-":case"=":var L=parseInt(E,10);if(isNaN(L)||L<0)throw new Error("Invalid number in diff_fromDelta: "+E);var S=d.substring(l,l+=L);u[f].charAt(0)=="="?s[w++]=new M.Diff(0,S):s[w++]=new M.Diff(b,S);break;default:if(u[f])throw new Error("Invalid diff operation in diff_fromDelta: "+u[f])}}if(l!=d.length)throw new Error("Delta length ("+l+") does not equal source text length ("+d.length+").");return s},M.prototype.match_main=function(d,m,s){if(d==null||m==null||s==null)throw new Error("Null input. (match_main)");return s=Math.max(0,Math.min(s,d.length)),d==m?0:d.length?d.substring(s,s+m.length)==m?s:this.match_bitap_(d,m,s):-1},M.prototype.match_bitap_=function(d,m,s){if(m.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var w=this.match_alphabet_(m),l=this;function u(ge,fe){var ue=ge/m.length,we=Math.abs(s-fe);return l.Match_Distance?ue+we/l.Match_Distance:we?1:ue}var f=this.Match_Threshold,E=d.indexOf(m,s);E!=-1&&(f=Math.min(u(0,E),f),(E=d.lastIndexOf(m,s+m.length))!=-1&&(f=Math.min(u(0,E),f)));var L,S,C=1<<m.length-1;E=-1;for(var y,k=m.length+d.length,p=0;p<m.length;p++){for(L=0,S=k;L<S;)u(p,s+S)<=f?L=S:k=S,S=Math.floor((k-L)/2+L);k=S;var _=Math.max(1,s-S+1),N=Math.min(s+S,d.length)+m.length,q=Array(N+2);q[N+1]=(1<<p)-1;for(var D=N;D>=_;D--){var Z=w[d.charAt(D-1)];if(q[D]=p===0?(q[D+1]<<1|1)&Z:(q[D+1]<<1|1)&Z|(y[D+1]|y[D])<<1|1|y[D+1],q[D]&C){var te=u(p,D-1);if(te<=f){if(f=te,!((E=D-1)>s))break;_=Math.max(1,2*s-E)}}}if(u(p+1,s)>f)break;y=q}return E},M.prototype.match_alphabet_=function(d){for(var m={},s=0;s<d.length;s++)m[d.charAt(s)]=0;for(s=0;s<d.length;s++)m[d.charAt(s)]|=1<<d.length-s-1;return m},M.prototype.patch_addContext_=function(d,m){if(m.length!=0){if(d.start2===null)throw Error("patch not initialized");for(var s=m.substring(d.start2,d.start2+d.length1),w=0;m.indexOf(s)!=m.lastIndexOf(s)&&s.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)w+=this.Patch_Margin,s=m.substring(d.start2-w,d.start2+d.length1+w);w+=this.Patch_Margin;var l=m.substring(d.start2-w,d.start2);l&&d.diffs.unshift(new M.Diff(0,l));var u=m.substring(d.start2+d.length1,d.start2+d.length1+w);u&&d.diffs.push(new M.Diff(0,u)),d.start1-=l.length,d.start2-=l.length,d.length1+=l.length+u.length,d.length2+=l.length+u.length}},M.prototype.patch_make=function(d,m,s){var w,l;if(typeof d=="string"&&typeof m=="string"&&s===void 0)w=d,(l=this.diff_main(w,m,!0)).length>2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(d&&typeof d=="object"&&m===void 0&&s===void 0)l=d,w=this.diff_text1(l);else if(typeof d=="string"&&m&&typeof m=="object"&&s===void 0)w=d,l=m;else{if(typeof d!="string"||typeof m!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");w=d,l=s}if(l.length===0)return[];for(var u=[],f=new M.patch_obj,E=0,L=0,S=0,C=w,y=w,k=0;k<l.length;k++){var p=l[k][0],_=l[k][1];switch(E||p===0||(f.start1=L,f.start2=S),p){case 1:f.diffs[E++]=l[k],f.length2+=_.length,y=y.substring(0,S)+_+y.substring(S);break;case b:f.length1+=_.length,f.diffs[E++]=l[k],y=y.substring(0,S)+y.substring(S+_.length);break;case 0:_.length<=2*this.Patch_Margin&&E&&l.length!=k+1?(f.diffs[E++]=l[k],f.length1+=_.length,f.length2+=_.length):_.length>=2*this.Patch_Margin&&E&&(this.patch_addContext_(f,C),u.push(f),f=new M.patch_obj,E=0,C=y,L=S)}p!==1&&(L+=_.length),p!==b&&(S+=_.length)}return E&&(this.patch_addContext_(f,C),u.push(f)),u},M.prototype.patch_deepCopy=function(d){for(var m=[],s=0;s<d.length;s++){var w=d[s],l=new M.patch_obj;l.diffs=[];for(var u=0;u<w.diffs.length;u++)l.diffs[u]=new M.Diff(w.diffs[u][0],w.diffs[u][1]);l.start1=w.start1,l.start2=w.start2,l.length1=w.length1,l.length2=w.length2,m[s]=l}return m},M.prototype.patch_apply=function(d,m){if(d.length==0)return[m,[]];d=this.patch_deepCopy(d);var s=this.patch_addPadding(d);m=s+m+s,this.patch_splitMax(d);for(var w=0,l=[],u=0;u<d.length;u++){var f,E,L=d[u].start2+w,S=this.diff_text1(d[u].diffs),C=-1;if(S.length>this.Match_MaxBits?(f=this.match_main(m,S.substring(0,this.Match_MaxBits),L))!=-1&&((C=this.match_main(m,S.substring(S.length-this.Match_MaxBits),L+S.length-this.Match_MaxBits))==-1||f>=C)&&(f=-1):f=this.match_main(m,S,L),f==-1)l[u]=!1,w-=d[u].length2-d[u].length1;else if(l[u]=!0,w=f-L,S==(E=C==-1?m.substring(f,f+S.length):m.substring(f,C+this.Match_MaxBits)))m=m.substring(0,f)+this.diff_text2(d[u].diffs)+m.substring(f+S.length);else{var y=this.diff_main(S,E,!1);if(S.length>this.Match_MaxBits&&this.diff_levenshtein(y)/S.length>this.Patch_DeleteThreshold)l[u]=!1;else{this.diff_cleanupSemanticLossless(y);for(var k,p=0,_=0;_<d[u].diffs.length;_++){var N=d[u].diffs[_];N[0]!==0&&(k=this.diff_xIndex(y,p)),N[0]===1?m=m.substring(0,f+k)+N[1]+m.substring(f+k):N[0]===b&&(m=m.substring(0,f+k)+m.substring(f+this.diff_xIndex(y,p+N[1].length))),N[0]!==b&&(p+=N[1].length)}}}}return[m=m.substring(s.length,m.length-s.length),l]},M.prototype.patch_addPadding=function(d){for(var m=this.Patch_Margin,s="",w=1;w<=m;w++)s+=String.fromCharCode(w);for(w=0;w<d.length;w++)d[w].start1+=m,d[w].start2+=m;var l=d[0],u=l.diffs;if(u.length==0||u[0][0]!=0)u.unshift(new M.Diff(0,s)),l.start1-=m,l.start2-=m,l.length1+=m,l.length2+=m;else if(m>u[0][1].length){var f=m-u[0][1].length;u[0][1]=s.substring(u[0][1].length)+u[0][1],l.start1-=f,l.start2-=f,l.length1+=f,l.length2+=f}return(u=(l=d[d.length-1]).diffs).length==0||u[u.length-1][0]!=0?(u.push(new M.Diff(0,s)),l.length1+=m,l.length2+=m):m>u[u.length-1][1].length&&(f=m-u[u.length-1][1].length,u[u.length-1][1]+=s.substring(0,f),l.length1+=f,l.length2+=f),s},M.prototype.patch_splitMax=function(d){for(var m=this.Match_MaxBits,s=0;s<d.length;s++)if(!(d[s].length1<=m)){var w=d[s];d.splice(s--,1);for(var l=w.start1,u=w.start2,f="";w.diffs.length!==0;){var E=new M.patch_obj,L=!0;for(E.start1=l-f.length,E.start2=u-f.length,f!==""&&(E.length1=E.length2=f.length,E.diffs.push(new M.Diff(0,f)));w.diffs.length!==0&&E.length1<m-this.Patch_Margin;){var S=w.diffs[0][0],C=w.diffs[0][1];S===1?(E.length2+=C.length,u+=C.length,E.diffs.push(w.diffs.shift()),L=!1):S===b&&E.diffs.length==1&&E.diffs[0][0]==0&&C.length>2*m?(E.length1+=C.length,l+=C.length,L=!1,E.diffs.push(new M.Diff(S,C)),w.diffs.shift()):(C=C.substring(0,m-E.length1-this.Patch_Margin),E.length1+=C.length,l+=C.length,S===0?(E.length2+=C.length,u+=C.length):L=!1,E.diffs.push(new M.Diff(S,C)),C==w.diffs[0][1]?w.diffs.shift():w.diffs[0][1]=w.diffs[0][1].substring(C.length))}f=(f=this.diff_text2(E.diffs)).substring(f.length-this.Patch_Margin);var y=this.diff_text1(w.diffs).substring(0,this.Patch_Margin);y!==""&&(E.length1+=y.length,E.length2+=y.length,E.diffs.length!==0&&E.diffs[E.diffs.length-1][0]===0?E.diffs[E.diffs.length-1][1]+=y:E.diffs.push(new M.Diff(0,y))),L||d.splice(++s,0,E)}}},M.prototype.patch_toText=function(d){for(var m=[],s=0;s<d.length;s++)m[s]=d[s];return m.join("")},M.prototype.patch_fromText=function(d){var m=[];if(!d)return m;for(var s=d.split(`
38
+ `),w=0,l=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;w<s.length;){var u=s[w].match(l);if(!u)throw new Error("Invalid patch string: "+s[w]);var f=new M.patch_obj;for(m.push(f),f.start1=parseInt(u[1],10),u[2]===""?(f.start1--,f.length1=1):u[2]=="0"?f.length1=0:(f.start1--,f.length1=parseInt(u[2],10)),f.start2=parseInt(u[3],10),u[4]===""?(f.start2--,f.length2=1):u[4]=="0"?f.length2=0:(f.start2--,f.length2=parseInt(u[4],10)),w++;w<s.length;){var E=s[w].charAt(0);try{var L=decodeURI(s[w].substring(1))}catch(S){throw new Error("Illegal escape in patch_fromText: "+L)}if(E=="-")f.diffs.push(new M.Diff(b,L));else if(E=="+")f.diffs.push(new M.Diff(1,L));else if(E==" ")f.diffs.push(new M.Diff(0,L));else{if(E=="@")break;if(E!=="")throw new Error('Invalid patch mode "'+E+'" in: '+L)}w++}}return m},(M.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var d,m=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@
39
+ `],s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case 1:d="+";break;case b:d="-";break;case 0:d=" "}m[s+1]=d+encodeURI(this.diffs[s][1])+`
40
+ `}return m.join("").replace(/%20/g," ")},J.exports=M,J.exports.diff_match_patch=M,J.exports.DIFF_DELETE=b,J.exports.DIFF_INSERT=1,J.exports.DIFF_EQUAL=0},872:(J,M,b)=>{b.d(M,{default:()=>Lt});var d=b(478),m=b(156),s=b(314),w=b(730),l=b(66),u=b(218),f=b(702),E=function(K){K===void 0&&(K=document);var Ee=function(U){var j=document.createElement("img");j.src=U.getAttribute("data-src"),j.addEventListener("load",function(){U.getAttribute("style")||U.getAttribute("class")||U.getAttribute("width")||U.getAttribute("height")||j.naturalHeight>j.naturalWidth&&j.naturalWidth/j.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&j.naturalHeight>window.innerHeight-40&&(U.style.height=window.innerHeight-40+"px"),U.src=j.src}),U.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return K.querySelectorAll("img").forEach(function(U){U.getAttribute("data-src")&&Ee(U)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),K.querySelectorAll("img").forEach(function(U){window.vditorImageIntersectionObserver.observe(U)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(U){U.forEach(function(j){(j.isIntersecting===void 0?j.intersectionRatio!==0:j.isIntersecting)&&j.target.getAttribute("data-src")&&Ee(j.target)})}),K.querySelectorAll("img").forEach(function(U){window.vditorImageIntersectionObserver.observe(U)}))},L=b(466),S=b(554),C=b(40),y=b(563),k=b(749),p=b(818),_=b(408),N=b(54),q=b(227),D=b(526),Z=b(827),te=b(640),ge=b(895),fe=b(393),ue=function(K,Ee){if(Ee===void 0&&(Ee="zh_CN"),typeof speechSynthesis!="undefined"&&typeof SpeechSynthesisUtterance!="undefined"){var U=function(){var ve,he;return speechSynthesis.getVoices().forEach(function(Y){Y.lang===Ee.replace("_","-")&&(ve=Y),Y.default&&(he=Y)}),ve||(ve=he),ve},j='<svg><use xlink:href="#vditor-icon-play"></use></svg>',ie='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(j='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',ie='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var se=document.querySelector(".vditor-speech");se||((se=document.createElement("button")).className="vditor-speech",K.insertAdjacentElement("beforeend",se),speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=U));var oe=U(),Ie=new SpeechSynthesisUtterance;Ie.voice=oe,Ie.onend=Ie.onerror=function(){se.style.display="none",speechSynthesis.cancel(),se.classList.remove("vditor-speech--current"),se.innerHTML=j},K.addEventListener(window.ontouchstart!==void 0?"touchend":"click",function(ve){var he=ve.target;if(he.classList.contains("vditor-speech")||he.parentElement.classList.contains("vditor-speech"))return se.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),se.innerHTML=ie):(speechSynthesis.pause(),se.innerHTML=j)):(Ie.text=se.getAttribute("data-text"),speechSynthesis.speak(Ie),se.classList.add("vditor-speech--current"),se.innerHTML=ie),(0,fe.Hc)(window.vditorSpeechRange),void K.focus();if(se.style.display="none",speechSynthesis.cancel(),se.classList.remove("vditor-speech--current"),se.innerHTML=j,getSelection().rangeCount!==0){var Y=getSelection().getRangeAt(0),Je=Y.toString().trim();if(Je){window.vditorSpeechRange=Y.cloneRange();var tt=Y.getBoundingClientRect();se.innerHTML=j,se.style.display="block",se.style.top=tt.top+tt.height+document.querySelector("html").scrollTop-20+"px",window.ontouchstart!==void 0?se.style.left=ve.changedTouches[ve.changedTouches.length-1].pageX+2+"px":se.style.left=ve.clientX+2+"px",se.setAttribute("data-text",Je)}}})}},we=function(K,Ee,U,j){return new(U||(U=Promise))(function(ie,se){function oe(he){try{ve(j.next(he))}catch(Y){se(Y)}}function Ie(he){try{ve(j.throw(he))}catch(Y){se(Y)}}function ve(he){var Y;he.done?ie(he.value):(Y=he.value,Y instanceof U?Y:new U(function(Je){Je(Y)})).then(oe,Ie)}ve((j=j.apply(K,[])).next())})},De=function(K,Ee){var U,j,ie,se,oe={label:0,sent:function(){if(1&ie[0])throw ie[1];return ie[1]},trys:[],ops:[]};return se={next:Ie(0),throw:Ie(1),return:Ie(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function Ie(ve){return function(he){return function(Y){if(U)throw new TypeError("Generator is already executing.");for(;oe;)try{if(U=1,j&&(ie=2&Y[0]?j.return:Y[0]?j.throw||((ie=j.return)&&ie.call(j),0):j.next)&&!(ie=ie.call(j,Y[1])).done)return ie;switch(j=0,ie&&(Y=[2&Y[0],ie.value]),Y[0]){case 0:case 1:ie=Y;break;case 4:return oe.label++,{value:Y[1],done:!1};case 5:oe.label++,j=Y[1],Y=[0];continue;case 7:Y=oe.ops.pop(),oe.trys.pop();continue;default:if(ie=oe.trys,!((ie=ie.length>0&&ie[ie.length-1])||Y[0]!==6&&Y[0]!==2)){oe=0;continue}if(Y[0]===3&&(!ie||Y[1]>ie[0]&&Y[1]<ie[3])){oe.label=Y[1];break}if(Y[0]===6&&oe.label<ie[1]){oe.label=ie[1],ie=Y;break}if(ie&&oe.label<ie[2]){oe.label=ie[2],oe.ops.push(Y);break}ie[2]&&oe.ops.pop(),oe.trys.pop();continue}Y=Ee.call(K,oe)}catch(Je){Y=[6,Je],j=0}finally{U=ie=0}if(5&Y[0])throw Y[1];return{value:Y[0]?Y[1]:void 0,done:!0}}([ve,he])}}},_e=function(K){var Ee,U={anchor:0,cdn:N.g.CDN,customEmoji:{},emojiPath:N.g.CDN+"/dist/images/emoji",hljs:N.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:N.g.MARKDOWN_OPTIONS,math:N.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:N.g.THEME_OPTIONS};return K.cdn&&(!((Ee=K.theme)===null||Ee===void 0)&&Ee.path||(U.theme.path=K.cdn+"/dist/css/content-theme"),K.emojiPath||(U.emojiPath=K.cdn+"/dist/images/emoji")),(0,te.T)(U,K)},$e=function(K,Ee){var U=_e(Ee);return(0,D.G)(U.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var j=(0,ge.X)({autoSpace:U.markdown.autoSpace,gfmAutoLink:U.markdown.gfmAutoLink,codeBlockPreview:U.markdown.codeBlockPreview,emojiSite:U.emojiPath,emojis:U.customEmoji,fixTermTypo:U.markdown.fixTermTypo,footnotes:U.markdown.footnotes,headingAnchor:U.anchor!==0,inlineMathDigit:U.math.inlineDigit,lazyLoadImage:U.lazyLoadImage,linkBase:U.markdown.linkBase,linkPrefix:U.markdown.linkPrefix,listStyle:U.markdown.listStyle,mark:U.markdown.mark,mathBlockPreview:U.markdown.mathBlockPreview,paragraphBeginningSpace:U.markdown.paragraphBeginningSpace,sanitize:U.markdown.sanitize,toc:U.markdown.toc});return Ee!=null&&Ee.renderers&&j.SetJSRenderers({renderers:{Md2HTML:Ee.renderers}}),j.SetHeadingID(!0),j.Md2HTML(K)})},xe=function(K,Ee,U){return we(void 0,void 0,void 0,function(){var j,ie,se;return De(this,function(oe){switch(oe.label){case 0:return j=_e(U),[4,$e(Ee,j)];case 1:if(ie=oe.sent(),j.transform&&(ie=j.transform(ie)),K.innerHTML=ie,K.classList.add("vditor-reset"),j.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(j.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return se="vditorI18nScript"+j.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(ve){ve.id!==se&&document.head.removeChild(ve)}),[4,(0,D.G)(j.cdn+"/dist/js/i18n/"+j.lang+".js",se)];case 3:oe.sent(),oe.label=4;case 4:return[3,6];case 5:window.VditorI18n=j.i18n,oe.label=6;case 6:return j.icon?[4,(0,D.G)(j.cdn+"/dist/js/icons/"+j.icon+".js","vditorIconScript")]:[3,8];case 7:oe.sent(),oe.label=8;case 8:return(0,q.Z)(j.theme.current,j.theme.path),j.anchor===1&&K.classList.add("vditor-reset--anchor"),(0,w.O)(K,j.hljs),(0,f.s)(j.hljs,K,j.cdn),(0,L.H)(K,{cdn:j.cdn,math:j.math}),(0,C.i)(K,j.cdn,j.mode),(0,y.K)(K,j.cdn,j.mode),(0,l.P)(K,j.cdn),(0,u.v)(K,j.cdn),(0,s.p)(K,j.cdn,j.mode),(0,k.P)(K,j.cdn,j.mode),(0,_.B)(K,j.cdn),(0,d.Q)(K,j.cdn),j.render.media.enable&&(0,S.Y)(K),j.speech.enable&&ue(K),j.anchor!==0&&(Ie=j.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(ve){Ie===1&&ve.classList.add("vditor-anchor--left"),ve.onclick=function(){var he=ve.getAttribute("href").substr(1),Y=document.getElementById("vditorAnchor-"+he).offsetTop;document.querySelector("html").scrollTop=Y}}),window.onhashchange=function(){var ve=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));ve&&(document.querySelector("html").scrollTop=ve.offsetTop)}),j.after&&j.after(),j.lazyLoadImage&&E(K),K.addEventListener("click",function(ve){var he=(0,Z.lG)(ve.target,"SPAN");if(he&&(0,Z.fb)(he,"vditor-toc")){var Y=K.querySelector("#"+he.getAttribute("data-target-id"));Y&&window.scrollTo(window.scrollX,Y.offsetTop)}}),[2]}var Ie})})},x=b(863),Fe=b(312);const Lt=function(){function K(){}return K.adapterRender=m,K.previewImage=x.E,K.codeRender=w.O,K.graphvizRender=u.v,K.highlightRender=f.s,K.mathRender=L.H,K.mermaidRender=C.i,K.markmapRender=y.K,K.flowchartRender=l.P,K.chartRender=s.p,K.abcRender=d.Q,K.mindmapRender=k.P,K.plantumlRender=_.B,K.outlineRender=p.k,K.mediaRender=S.Y,K.speechRender=ue,K.lazyLoadImageRender=E,K.md2html=$e,K.preview=xe,K.setCodeTheme=Fe.Y,K.setContentTheme=q.Z,K}()},54:(J,M,b)=>{b.d(M,{H:()=>d,g:()=>m});var d="3.10.4",m=function(){function s(){}return s.ZWSP="​",s.DROP_EDITOR="application/editor",s.MOBILE_WIDTH=520,s.CLASS_MENU_DISABLED="vditor-menu--disabled",s.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"],s.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"],s.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","markmap","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],s.CDN="https://unpkg.com/vditor@3.10.4",s.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},s.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},s.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},s.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:s.CDN+"/dist/css/content-theme"},s}()},478:(J,M,b)=>{b.d(M,{Q:()=>w});var d=b(54),m=b(526),s=b(156),w=function(l,u){l===void 0&&(l=document),u===void 0&&(u=d.g.CDN);var f=s.abcRenderAdapter.getElements(l);f.length>0&&(0,m.G)(u+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then(function(){f.forEach(function(E){E.parentElement.classList.contains("vditor-wysiwyg__pre")||E.parentElement.classList.contains("vditor-ir__marker--pre")||E.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(E,s.abcRenderAdapter.getCode(E).trim()),E.style.overflowX="auto",E.setAttribute("data-processed","true"))})})}},156:(J,M,b)=>{b.r(M),b.d(M,{abcRenderAdapter:()=>u,chartRenderAdapter:()=>l,flowchartRenderAdapter:()=>E,graphvizRenderAdapter:()=>f,markmapRenderAdapter:()=>s,mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>m,mindmapRenderAdapter:()=>w,plantumlRenderAdapter:()=>L});var d={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-math")}},m={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-mermaid")}},s={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-markmap")}},w={getCode:function(S){return S.getAttribute("data-code")},getElements:function(S){return S.querySelectorAll(".language-mindmap")}},l={getCode:function(S){return S.innerText},getElements:function(S){return S.querySelectorAll(".language-echarts")}},u={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-abc")}},f={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-graphviz")}},E={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-flowchart")}},L={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-plantuml")}}},314:(J,M,b)=>{b.d(M,{p:()=>w});var d=b(54),m=b(526),s=b(156),w=function(l,u,f){l===void 0&&(l=document),u===void 0&&(u=d.g.CDN);var E=s.chartRenderAdapter.getElements(l);E.length>0&&(0,m.G)(u+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){E.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var S=s.chartRenderAdapter.getCode(L).trim();if(S)try{if(L.getAttribute("data-processed")==="true")return;var C=JSON.parse(S);echarts.init(L,f==="dark"?"dark":void 0).setOption(C),L.setAttribute("data-processed","true")}catch(y){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+y}}})})}},730:(J,M,b)=>{b.d(M,{O:()=>s});var d=b(51),m=b(54),s=function(w,l){Array.from(w.querySelectorAll("pre > code")).filter(function(u,f){return!u.parentElement.classList.contains("vditor-wysiwyg__pre")&&!u.parentElement.classList.contains("vditor-ir__marker--pre")&&!(u.classList.contains("language-mermaid")||u.classList.contains("language-flowchart")||u.classList.contains("language-echarts")||u.classList.contains("language-mindmap")||u.classList.contains("language-plantuml")||u.classList.contains("language-markmap")||u.classList.contains("language-abc")||u.classList.contains("language-graphviz")||u.classList.contains("language-math"))&&!(u.style.maxHeight.indexOf("px")>-1)&&!(w.classList.contains("vditor-preview")&&f>5)}).forEach(function(u){var f,E,L,S=u.innerText;if(u.classList.contains("highlight-chroma")){var C=u.cloneNode(!0);C.querySelectorAll(".highlight-ln").forEach(function(_){_.remove()}),S=C.innerText}else S.endsWith(`
41
+ `)&&(S=S.substr(0,S.length-1));var y='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(y='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var k=document.createElement("div");k.className="vditor-copy",k.innerHTML='<span aria-label="'+(((f=window.VditorI18n)===null||f===void 0?void 0:f.copy)||"复制")+`"
42
+ onmouseover="this.setAttribute('aria-label', '`+(((E=window.VditorI18n)===null||E===void 0?void 0:E.copy)||"复制")+`')"
43
+ class="vditor-tooltipped vditor-tooltipped__w"
44
+ onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"已复制")+`');this.previousElementSibling.blur()">`+y+"</span>";var p=document.createElement("textarea");p.value=(0,d.X)(S),k.insertAdjacentElement("afterbegin",p),l&&l.renderMenu&&l.renderMenu(u,k),u.before(k),u.style.maxHeight=window.outerHeight-40+"px",u.insertAdjacentHTML("afterend",'<span style="position: absolute">'+m.g.ZWSP+"</span>")})}},66:(J,M,b)=>{b.d(M,{P:()=>w});var d=b(54),m=b(526),s=b(156),w=function(l,u){u===void 0&&(u=d.g.CDN);var f=s.flowchartRenderAdapter.getElements(l);f.length!==0&&(0,m.G)(u+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then(function(){f.forEach(function(E){if(E.getAttribute("data-processed")!=="true"){var L=flowchart.parse(s.flowchartRenderAdapter.getCode(E));E.innerHTML="",L.drawSVG(E),E.setAttribute("data-processed","true")}})})}},218:(J,M,b)=>{b.d(M,{v:()=>w});var d=b(54),m=b(526),s=b(156),w=function(l,u){u===void 0&&(u=d.g.CDN);var f=s.graphvizRenderAdapter.getElements(l);f.length!==0&&(0,m.G)(u+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){f.forEach(function(E){var L=s.graphvizRenderAdapter.getCode(E);if(!E.parentElement.classList.contains("vditor-wysiwyg__pre")&&!E.parentElement.classList.contains("vditor-ir__marker--pre")&&E.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var S=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),C=(window.URL||window.webkitURL).createObjectURL(S),y=new Worker(C);new Viz({worker:y}).renderSVGElement(L).then(function(k){E.innerHTML=k.outerHTML}).catch(function(k){E.innerHTML="graphviz render error: <br>"+k,E.className="vditor-reset--error"})}catch(k){console.error("graphviz error",k)}E.setAttribute("data-processed","true")}})})}},702:(J,M,b)=>{b.d(M,{s:()=>w});var d=b(54),m=b(526),s=b(578),w=function(l,u,f){u===void 0&&(u=document),f===void 0&&(f=d.g.CDN);var E=l.style;d.g.CODE_THEME.includes(E)||(E="github");var L=document.getElementById("vditorHljsStyle"),S=f+"/dist/js/highlight.js/styles/"+E+".css";L&&L.getAttribute("href")!==S&&L.remove(),(0,s.c)(f+"/dist/js/highlight.js/styles/"+E+".css","vditorHljsStyle"),l.enable!==!1&&u.querySelectorAll("pre > code").length!==0&&(0,m.G)(f+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,m.G)(f+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,m.G)(f+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then(function(){u.querySelectorAll("pre > code").forEach(function(C){if(!C.parentElement.classList.contains("vditor-ir__marker--pre")&&!C.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(C.classList.contains("language-mermaid")||C.classList.contains("language-flowchart")||C.classList.contains("language-echarts")||C.classList.contains("language-mindmap")||C.classList.contains("language-plantuml")||C.classList.contains("language-abc")||C.classList.contains("language-graphviz")||C.classList.contains("language-math"))&&(l.defaultLang!==""&&C.className.indexOf("language-")===-1&&C.classList.add("language-"+l.defaultLang),hljs.highlightElement(C),l.lineNumber)){C.classList.add("vditor-linenumber");var y=C.querySelector(".vditor-linenumber__temp");y||((y=document.createElement("div")).className="vditor-linenumber__temp",C.insertAdjacentElement("beforeend",y));var k=getComputedStyle(C).whiteSpace,p=!1;k!=="pre-wrap"&&k!=="pre-line"||(p=!0);var _="",N=C.textContent.split(/\r\n|\r|\n/g);N.pop(),N.map(function(q){var D="";p&&(y.textContent=q||`
45
+ `,D=' style="height:'+y.getBoundingClientRect().height+'px"'),_+="<span"+D+"></span>"}),y.style.display="none",_='<span class="vditor-linenumber__rows">'+_+"</span>",C.insertAdjacentHTML("beforeend",_)}})})})})}},563:(J,M,b)=>{b.d(M,{K:()=>u});var d=b(54),m=b(526),s=b(156),w={},l=function(f,E){var L=window.markmap,S=L.Transformer,C=L.Markmap,y=L.deriveOptions,k=(L.globalCSS,new S);f.innerHTML='<svg style="width:100%"></svg>';var p=f.firstChild,_=C.create(p,null),N=function(te,ge){var fe=te.transform(ge),ue=Object.keys(fe.features).filter(function(xe){return!w[xe]});ue.forEach(function(xe){w[xe]=!0});var we=te.getAssets(ue),De=we.styles,_e=we.scripts,$e=window.markmap;return De&&$e.loadCSS(De),_e&&$e.loadJS(_e),fe}(k,E),q=N.root,D=N.frontmatter,Z=y(D==null?void 0:D.markmap);_.setData(q,Z),_.fit()},u=function(f,E,L){E===void 0&&(E=d.g.CDN);var S=s.markmapRenderAdapter.getElements(f);S.length!==0&&(0,m.G)(E+"/dist/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){S.forEach(function(C){var y=s.markmapRenderAdapter.getCode(C);if(C.getAttribute("data-processed")!=="true"&&y.trim()!==""){var k=document.createElement("div");k.className="language-markmap",C.parentNode.appendChild(k),l(k,y),C.parentNode.childNodes[0].nodeName=="CODE"&&C.parentNode.removeChild(C.parentNode.childNodes[0])}})})}},466:(J,M,b)=>{b.d(M,{H:()=>u});var d=b(54),m=b(526),s=b(578),w=b(51),l=b(156),u=function(f,E){var L=l.mathRenderAdapter.getElements(f);if(L.length!==0){var S={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(E&&E.math&&(E.math=Object.assign({},S.math,E.math)),(E=Object.assign({},S,E)).math.engine==="KaTeX")(0,s.c)(E.cdn+"/dist/js/katex/katex.min.css?v=0.16.9","vditorKatexStyle"),(0,m.G)(E.cdn+"/dist/js/katex/katex.min.js?v=0.16.9","vditorKatexScript").then(function(){(0,m.G)(E.cdn+"/dist/js/katex/mhchem.min.js?v=0.16.9","vditorKatexChemScript").then(function(){L.forEach(function(y){if(!y.parentElement.classList.contains("vditor-wysiwyg__pre")&&!y.parentElement.classList.contains("vditor-ir__marker--pre")&&!y.getAttribute("data-math")){var k=(0,w.X)(l.mathRenderAdapter.getCode(y));y.setAttribute("data-math",k);try{y.innerHTML=katex.renderToString(k,{displayMode:y.tagName==="DIV",output:"html",macros:E.math.macros})}catch(p){y.innerHTML=p.message,y.className="language-math vditor-reset--error"}y.addEventListener("copy",function(p){p.stopPropagation(),p.preventDefault();var _=p.currentTarget.closest(".language-math");p.clipboardData.setData("text/html",_.innerHTML),p.clipboardData.setData("text/plain",_.getAttribute("data-math"))})}})})});else if(E.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:E.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:E.math.macros}},Object.assign(window.MathJax,E.math.mathJaxOptions)),(0,m.J)(E.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var C=function(y,k){var p=(0,w.X)(y.textContent).trim(),_=window.MathJax.getMetricsFor(y);_.display=y.tagName==="DIV",window.MathJax.tex2svgPromise(p,_).then(function(N){y.innerHTML="",y.setAttribute("data-math",p),y.append(N),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var q=N.querySelector('[data-mml-node="merror"]');q&&q.textContent.trim()!==""&&(y.innerHTML=q.textContent.trim(),y.className="vditor-reset--error"),k&&k()})};window.MathJax.startup.promise.then(function(){for(var y=[],k=function(_){var N=L[_];N.parentElement.classList.contains("vditor-wysiwyg__pre")||N.parentElement.classList.contains("vditor-ir__marker--pre")||N.getAttribute("data-math")||!(0,w.X)(N.textContent).trim()||y.push(function(q){_===L.length-1?C(N):C(N,q)})},p=0;p<L.length;p++)k(p);(function(_){if(_.length!==0){var N=0,q=_[_.length-1],D=function(){var Z=_[N++];Z===q?Z():Z(D)};D()}})(y)})}}}},554:(J,M,b)=>{b.d(M,{Y:()=>m});var d=b(835),m=function(s){s&&s.querySelectorAll("a").forEach(function(w){var l=w.getAttribute("href");l&&(l.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(u,f){u.insertAdjacentHTML("afterend",'<video controls="controls" src="'+f+'"></video>'),u.remove()}(w,l):l.match(/^.+.(mp3|wav|flac)$/)?function(u,f){u.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+f+'"></audio>'),u.remove()}(w,l):function(u,f){var E=f.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),L=f.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),S=f.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),C=f.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),y=f.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),k=f.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),p=f.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),_=f.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(E&&E[1].length===11)u.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+E[1]+(E[2]?"?start="+E[2]:"")+'"></iframe>'),u.remove();else if(L&&L[1])u.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+L[1]+'"></iframe>'),u.remove();else if(S&&S[1])u.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+S[1]+'"></iframe>'),u.remove();else if(C&&C[1])u.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
46
+ src="//coub.com/embed/`+C[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),u.remove();else if(y&&y[0])u.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
47
+ src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(y[0])+'"></iframe>'),u.remove();else if(k&&k[2])u.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
48
+ src="https://www.dailymotion.com/embed/video/`+k[2]+'"></iframe>'),u.remove();else if(f.indexOf("bilibili.com")>-1&&(f.indexOf("bvid=")>-1||p&&p[1])){var N={bvid:(0,d.o)("bvid",f)||p&&p[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(f.startsWith("http")?f:"https:"+f).search.split("&").forEach(function(Z,te){if(Z){te===0&&(Z=Z.substr(1));var ge=Z.split("=");N[ge[0]]=ge[1]}});var q="https://player.bilibili.com/player.html?",D=Object.keys(N);D.forEach(function(Z,te){q+=Z+"="+N[Z],te<D.length-1&&(q+="&")}),u.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'+q+'"></iframe>'),u.remove()}else _&&_[1]&&(u.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+_[1]+'"></iframe>'),u.remove())}(w,l))})}},40:(J,M,b)=>{b.d(M,{i:()=>f});var d=b(54),m=b(526),s=b(156),w=b(835),l=function(E,L,S,C){return new(S||(S=Promise))(function(y,k){function p(q){try{N(C.next(q))}catch(D){k(D)}}function _(q){try{N(C.throw(q))}catch(D){k(D)}}function N(q){var D;q.done?y(q.value):(D=q.value,D instanceof S?D:new S(function(Z){Z(D)})).then(p,_)}N((C=C.apply(E,[])).next())})},u=function(E,L){var S,C,y,k,p={label:0,sent:function(){if(1&y[0])throw y[1];return y[1]},trys:[],ops:[]};return k={next:_(0),throw:_(1),return:_(2)},typeof Symbol=="function"&&(k[Symbol.iterator]=function(){return this}),k;function _(N){return function(q){return function(D){if(S)throw new TypeError("Generator is already executing.");for(;p;)try{if(S=1,C&&(y=2&D[0]?C.return:D[0]?C.throw||((y=C.return)&&y.call(C),0):C.next)&&!(y=y.call(C,D[1])).done)return y;switch(C=0,y&&(D=[2&D[0],y.value]),D[0]){case 0:case 1:y=D;break;case 4:return p.label++,{value:D[1],done:!1};case 5:p.label++,C=D[1],D=[0];continue;case 7:D=p.ops.pop(),p.trys.pop();continue;default:if(y=p.trys,!((y=y.length>0&&y[y.length-1])||D[0]!==6&&D[0]!==2)){p=0;continue}if(D[0]===3&&(!y||D[1]>y[0]&&D[1]<y[3])){p.label=D[1];break}if(D[0]===6&&p.label<y[1]){p.label=y[1],y=D;break}if(y&&p.label<y[2]){p.label=y[2],p.ops.push(D);break}y[2]&&p.ops.pop(),p.trys.pop();continue}D=L.call(E,p)}catch(Z){D=[6,Z],C=0}finally{S=y=0}if(5&D[0])throw D[1];return{value:D[0]?D[1]:void 0,done:!0}}([N,q])}}},f=function(E,L,S){L===void 0&&(L=d.g.CDN);var C=s.mermaidRenderAdapter.getElements(E);C.length!==0&&(0,m.G)(L+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var y={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};S==="dark"&&(y.theme="dark"),mermaid.initialize(y),C.forEach(function(k){return l(void 0,void 0,void 0,function(){var p,_,N,q,D;return u(this,function(Z){switch(Z.label){case 0:if(p=s.mermaidRenderAdapter.getCode(k),k.getAttribute("data-processed")==="true"||p.trim()==="")return[2];_="mermaid"+(0,w.W)(),Z.label=1;case 1:return Z.trys.push([1,3,,4]),[4,mermaid.render(_,k.textContent)];case 2:return N=Z.sent(),k.innerHTML=N.svg,[3,4];case 3:return q=Z.sent(),D=document.querySelector("#"+_),k.innerHTML=D.outerHTML+`<br>
49
+ <div style="text-align: left"><small>`+q.message.replace(/\n/,"<br>")+"</small></div>",D.parentElement.remove(),[3,4];case 4:return k.setAttribute("data-processed","true"),[2]}})})})})}},749:(J,M,b)=>{b.d(M,{P:()=>w});var d=b(54),m=b(526),s=b(156),w=function(l,u,f){l===void 0&&(l=document),u===void 0&&(u=d.g.CDN);var E=s.mindmapRenderAdapter.getElements(l);E.length>0&&(0,m.G)(u+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){E.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var S=s.mindmapRenderAdapter.getCode(L);if(S)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,f==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(S))],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(C,y){var k;return!((k=y==null?void 0:y.data)===null||k===void 0)&&k.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(C){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+C}}})})}},818:(J,M,b)=>{b.d(M,{k:()=>s});var d=b(64),m=b(466),s=function(w,l,u){var f="",E=[];if(Array.from(w.children).forEach(function(y,k){if((0,d.W)(y)){if(u){var p=y.id.lastIndexOf("_");y.id=y.id.substring(0,p===-1?void 0:p)+"_"+k}E.push(y.id),f+=y.outerHTML.replace("<wbr>","")}}),f==="")return l.innerHTML="","";var L=document.createElement("div");if(u)u.lute.SetToC(!0),u.currentMode!=="wysiwyg"||u.preview.element.contains(w)?u.currentMode!=="ir"||u.preview.element.contains(w)?L.innerHTML=u.lute.HTML2VditorDOM("<p>[ToC]</p>"+f):L.innerHTML=u.lute.SpinVditorIRDOM("<p>[ToC]</p>"+f):L.innerHTML=u.lute.SpinVditorDOM("<p>[ToC]</p>"+f),u.lute.SetToC(u.options.preview.markdown.toc);else{l.classList.add("vditor-outline");var S=Lute.New();S.SetToC(!0),L.innerHTML=S.HTML2VditorDOM("<p>[ToC]</p>"+f)}var C=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return C.forEach(function(y,k){if(y.nextElementSibling&&y.nextElementSibling.tagName==="UL"){var p="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(p='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),y.innerHTML=p+"<span>"+y.innerHTML+"</span>"}else y.innerHTML="<svg></svg><span>"+y.innerHTML+"</span>";y.setAttribute("data-target-id",E[k])}),f=L.firstElementChild.innerHTML,C.length===0?(l.innerHTML="",f):(l.innerHTML=f,u&&(0,m.H)(l,{cdn:u.options.cdn,math:u.options.preview.math}),l.firstElementChild.addEventListener("click",function(y){for(var k=y.target;k&&!k.isEqualNode(l);){if(k.classList.contains("vditor-outline__action")){k.classList.contains("vditor-outline__action--close")?(k.classList.remove("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:block")):(k.classList.add("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:none")),y.preventDefault(),y.stopPropagation();break}if(k.getAttribute("data-target-id")){y.preventDefault(),y.stopPropagation();var p=document.getElementById(k.getAttribute("data-target-id"));if(!p)return;if(u)if(u.options.height==="auto"){var _=p.offsetTop+u.element.offsetTop;u.options.toolbarConfig.pin||(_+=u.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,_)}else u.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,u.element.offsetTop),u.preview.element.contains(w)?w.parentElement.scrollTop=p.offsetTop:w.scrollTop=p.offsetTop;else window.scrollTo(window.scrollX,p.offsetTop);break}k=k.parentElement}}),f)}},408:(J,M,b)=>{b.d(M,{B:()=>w});var d=b(54),m=b(526),s=b(156),w=function(l,u){l===void 0&&(l=document),u===void 0&&(u=d.g.CDN);var f=s.plantumlRenderAdapter.getElements(l);f.length!==0&&(0,m.G)(u+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then(function(){f.forEach(function(E){if(!E.parentElement.classList.contains("vditor-wysiwyg__pre")&&!E.parentElement.classList.contains("vditor-ir__marker--pre")){var L=s.plantumlRenderAdapter.getCode(E).trim();if(L)try{E.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'"/>'}catch(S){E.className="vditor-reset--error",E.innerHTML="plantuml render error: <br>"+S}}})})}},895:(J,M,b)=>{b.d(M,{X:()=>d});var d=function(m){var s=Lute.New();return s.PutEmojis(m.emojis),s.SetEmojiSite(m.emojiSite),s.SetHeadingAnchor(m.headingAnchor),s.SetInlineMathAllowDigitAfterOpenMarker(m.inlineMathDigit),s.SetAutoSpace(m.autoSpace),s.SetToC(m.toc),s.SetFootnotes(m.footnotes),s.SetFixTermTypo(m.fixTermTypo),s.SetVditorCodeBlockPreview(m.codeBlockPreview),s.SetVditorMathBlockPreview(m.mathBlockPreview),s.SetSanitize(m.sanitize),s.SetChineseParagraphBeginningSpace(m.paragraphBeginningSpace),s.SetRenderListStyle(m.listStyle),s.SetLinkBase(m.linkBase),s.SetLinkPrefix(m.linkPrefix),s.SetMark(m.mark),s.SetGFMAutoLink(m.gfmAutoLink),m.lazyLoadImage&&s.SetImageLazyLoading(m.lazyLoadImage),s}},863:(J,M,b)=>{b.d(M,{E:()=>d});var d=function(m,s,w){w===void 0&&(w="classic");var l=m.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(w==="dark"?" vditor--dark":"")+`">
50
+ <div class="vditor-img__bar">
51
+ <span class="vditor-img__btn" data-deg="0">
52
+ <svg><use xlink:href="#vditor-icon-redo"></use></svg>
53
+ `+window.VditorI18n.spin+`
54
+ </span>
55
+ <span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
56
+ X &nbsp;`+window.VditorI18n.close+`
57
+ </span>
58
+ </div>
59
+ <div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
60
+ <img style="width: `+m.width+"px;height:"+m.height+"px;transform: translate3d("+l.left+"px, "+(l.top-36)+'px, 0)" src="'+m.getAttribute("src")+`">
61
+ </div>
62
+ </div>`),document.body.style.overflow="hidden";var u=document.querySelector(".vditor-img img"),f="translate3d("+Math.max(0,window.innerWidth-m.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-m.naturalHeight)/2+"px, 0)";setTimeout(function(){u.setAttribute("style","transition: transform .3s ease-in-out;transform: "+f),setTimeout(function(){u.parentElement.scrollTo((u.parentElement.scrollWidth-u.parentElement.clientWidth)/2,(u.parentElement.scrollHeight-u.parentElement.clientHeight)/2)},400)});var E=document.querySelector(".vditor-img__btn");E.addEventListener("click",function(){var L=parseInt(E.getAttribute("data-deg"),10)+90;L/90%2==1&&m.naturalWidth>u.parentElement.clientHeight?u.style.transform="translate3d("+Math.max(0,window.innerWidth-m.naturalWidth)/2+"px, "+(m.naturalWidth/2-m.naturalHeight/2)+"px, 0) rotateZ("+L+"deg)":u.style.transform=f+" rotateZ("+L+"deg)",E.setAttribute("data-deg",L.toString()),setTimeout(function(){u.parentElement.scrollTo((u.parentElement.scrollWidth-u.parentElement.clientWidth)/2,(u.parentElement.scrollHeight-u.parentElement.clientHeight)/2)},400)})}},312:(J,M,b)=>{b.d(M,{Y:()=>s});var d=b(54),m=b(578),s=function(w,l){l===void 0&&(l=d.g.CDN),d.g.CODE_THEME.includes(w)||(w="github");var u=document.getElementById("vditorHljsStyle"),f=l+"/dist/js/highlight.js/styles/"+w+".css";u?u.getAttribute("href")!==f&&(u.remove(),(0,m.c)(f,"vditorHljsStyle")):(0,m.c)(f,"vditorHljsStyle")}},227:(J,M,b)=>{b.d(M,{Z:()=>m});var d=b(578),m=function(s,w){if(s&&w){var l=document.getElementById("vditorContentTheme"),u=w+"/"+s+".css";l?l.getAttribute("href")!==u&&(l.remove(),(0,d.c)(u,"vditorContentTheme")):(0,d.c)(u,"vditorContentTheme")}}},526:(J,M,b)=>{b.d(M,{G:()=>m,J:()=>d});var d=function(s,w){if(document.getElementById(w))return!1;var l=new XMLHttpRequest;l.open("GET",s,!1),l.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),l.send("");var u=document.createElement("script");u.type="text/javascript",u.text=l.responseText,u.id=w,document.head.appendChild(u)},m=function(s,w){return new Promise(function(l,u){if(document.getElementById(w))return l(),!1;var f=document.createElement("script");f.src=s,f.async=!0,document.head.appendChild(f),f.onerror=function(E){u(E)},f.onload=function(){if(document.getElementById(w))return f.remove(),l(),!1;f.id=w,l()}})}},578:(J,M,b)=>{b.d(M,{c:()=>d});var d=function(m,s){if(!document.getElementById(s)){var w=document.createElement("link");w.id=s,w.rel="stylesheet",w.type="text/css",w.href=m,document.getElementsByTagName("head")[0].appendChild(w)}}},51:(J,M,b)=>{b.d(M,{X:()=>d});var d=function(m){return m.replace(/\u00a0/g," ")}},794:(J,M,b)=>{b.d(M,{G6:()=>d,Le:()=>w,i7:()=>f,ns:()=>u,pK:()=>s,vU:()=>m,yl:()=>l});var d=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},m=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},s=function(){try{return typeof localStorage!="undefined"}catch(E){return!1}},w=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},l=function(E){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!E.metaKey||E.ctrlKey):!(E.metaKey||!E.ctrlKey)},u=function(E){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?E.indexOf("⇧")>-1&&m()&&(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},f=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},835:(J,M,b)=>{b.d(M,{W:()=>d,o:()=>m});var d=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(s){return(parseInt(s,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(s,10)/4).toString(16)})},m=function(s,w){w===void 0&&(w=window.location.search);var l=w.substring(w.indexOf("?")),u=l.indexOf("#");return new URLSearchParams(l.substring(0,u>=0?u:void 0)).get(s)}},827:(J,M,b)=>{b.d(M,{DX:()=>L,E2:()=>s,F9:()=>u,JQ:()=>m,O9:()=>w,a1:()=>l,fb:()=>E,lG:()=>f});var d=b(64),m=function(S,C){for(var y=E(S,C),k=!1,p=!1;y&&!y.classList.contains("vditor-reset")&&!p;)(k=E(y.parentElement,C))?y=k:p=!0;return y||!1},s=function(S,C){for(var y=(0,d.S)(S,C),k=!1,p=!1;y&&!y.classList.contains("vditor-reset")&&!p;)(k=(0,d.S)(y.parentElement,C))?y=k:p=!0;return y||!1},w=function(S){var C=s(S,"UL"),y=s(S,"OL"),k=C;return y&&(!C||C&&y.contains(C))&&(k=y),k},l=function(S,C,y){if(!S)return!1;S.nodeType===3&&(S=S.parentElement);for(var k=S,p=!1;k&&!p&&!k.classList.contains("vditor-reset");)k.getAttribute(C)===y?p=!0:k=k.parentElement;return p&&k},u=function(S){if(!S)return!1;S.nodeType===3&&(S=S.parentElement);var C=S,y=!1,k=l(S,"data-block","0");if(k)return k;for(;C&&!y&&!C.classList.contains("vditor-reset");)C.tagName==="H1"||C.tagName==="H2"||C.tagName==="H3"||C.tagName==="H4"||C.tagName==="H5"||C.tagName==="H6"||C.tagName==="P"||C.tagName==="BLOCKQUOTE"||C.tagName==="OL"||C.tagName==="UL"?y=!0:C=C.parentElement;return y&&C},f=function(S,C){if(!S)return!1;S.nodeType===3&&(S=S.parentElement);for(var y=S,k=!1;y&&!k&&!y.classList.contains("vditor-reset");)y.nodeName===C?k=!0:y=y.parentElement;return k&&y},E=function(S,C){if(!S)return!1;S.nodeType===3&&(S=S.parentElement);for(var y=S,k=!1;y&&!k&&!y.classList.contains("vditor-reset");)y.classList.contains(C)?k=!0:y=y.parentElement;return k&&y},L=function(S){for(;S&&S.lastChild;)S=S.lastChild;return S}},64:(J,M,b)=>{b.d(M,{S:()=>d,W:()=>m});var d=function(s,w){if(!s)return!1;s.nodeType===3&&(s=s.parentElement);for(var l=s,u=!1;l&&!u&&!l.classList.contains("vditor-reset");)l.nodeName.indexOf(w)===0?u=!0:l=l.parentElement;return u&&l},m=function(s){var w=d(s,"H");return!(!w||w.tagName.length!==2||w.tagName==="HR")&&w}},640:(J,M,b)=>{b.d(M,{T:()=>d});var d=function(){for(var m=[],s=0;s<arguments.length;s++)m[s]=arguments[s];for(var w={},l=function(f){for(var E in f)f.hasOwnProperty(E)&&(Object.prototype.toString.call(f[E])==="[object Object]"?w[E]=d(w[E],f[E]):w[E]=f[E])},u=0;u<m.length;u++)l(m[u]);return w}},393:(J,M,b)=>{b.d(M,{$j:()=>L,Gb:()=>u,Hc:()=>f,Ny:()=>l,ib:()=>S,im:()=>E,oC:()=>C,zh:()=>w});var d=b(54),m=b(794),s=b(827),w=function(y){var k,p=y[y.currentMode].element;return getSelection().rangeCount>0&&(k=getSelection().getRangeAt(0),p.isEqualNode(k.startContainer)||p.contains(k.startContainer))?k:y[y.currentMode].range?y[y.currentMode].range:(p.focus(),(k=p.ownerDocument.createRange()).setStart(p,0),k.collapse(!0),k)},l=function(y){var k=window.getSelection().getRangeAt(0);if(!y.contains(k.startContainer)&&!(0,s.fb)(k.startContainer,"vditor-panel--none"))return{left:0,top:0};var p,_=y.parentElement.getBoundingClientRect();if(k.getClientRects().length===0)if(k.startContainer.nodeType===3){var N=k.startContainer.parentElement;if(!(N&&N.getClientRects().length>0))return{left:0,top:0};p=N.getClientRects()[0]}else{var q=k.startContainer.children;if(q[k.startOffset]&&q[k.startOffset].getClientRects().length>0)p=q[k.startOffset].getClientRects()[0];else if(k.startContainer.childNodes.length>0){var D=k.cloneRange();k.selectNode(k.startContainer.childNodes[Math.max(0,k.startOffset-1)]),p=k.getClientRects()[0],k.setEnd(D.endContainer,D.endOffset),k.setStart(D.startContainer,D.startOffset)}else p=k.startContainer.getClientRects()[0];if(!p){for(var Z=k.startContainer.childNodes[k.startOffset];!Z.getClientRects||Z.getClientRects&&Z.getClientRects().length===0;)Z=Z.parentElement;p=Z.getClientRects()[0]}}else p=k.getClientRects()[0];return{left:p.left-_.left,top:p.top-_.top}},u=function(y,k){if(!k){if(getSelection().rangeCount===0)return!1;k=getSelection().getRangeAt(0)}var p=k.commonAncestorContainer;return y.isEqualNode(p)||y.contains(p)},f=function(y){var k=window.getSelection();k.removeAllRanges(),k.addRange(y)},E=function(y,k,p){var _={end:0,start:0};if(!p){if(getSelection().rangeCount===0)return _;p=window.getSelection().getRangeAt(0)}if(u(k,p)){var N=p.cloneRange();y.childNodes[0]&&y.childNodes[0].childNodes[0]?N.setStart(y.childNodes[0].childNodes[0],0):N.selectNodeContents(y),N.setEnd(p.startContainer,p.startOffset),_.start=N.toString().length,_.end=_.start+p.toString().length}return _},L=function(y,k,p){var _=0,N=0,q=p.childNodes[N],D=!1,Z=!1;y=Math.max(0,y),k=Math.max(0,k);var te=p.ownerDocument.createRange();for(te.setStart(q||p,0),te.collapse(!0);!Z&&q;){var ge=_+q.textContent.length;if(!D&&y>=_&&y<=ge&&(y===0?te.setStart(q,0):q.childNodes[0].nodeType===3?te.setStart(q.childNodes[0],y-_):q.nextSibling?te.setStartBefore(q.nextSibling):te.setStartAfter(q),D=!0,y===k)){Z=!0;break}D&&k>=_&&k<=ge&&(k===0?te.setEnd(q,0):q.childNodes[0].nodeType===3?te.setEnd(q.childNodes[0],k-_):q.nextSibling?te.setEndBefore(q.nextSibling):te.setEndAfter(q),Z=!0),_=ge,q=p.childNodes[++N]}return!Z&&p.childNodes[N-1]&&te.setStartBefore(p.childNodes[N-1]),f(te),te},S=function(y,k){var p=y.querySelector("wbr");if(p){if(p.previousElementSibling)if(p.previousElementSibling.isSameNode(p.previousSibling)){if(p.previousElementSibling.lastChild)return k.setStartBefore(p),k.collapse(!0),f(k),!(0,m.i7)()||p.previousElementSibling.tagName!=="EM"&&p.previousElementSibling.tagName!=="STRONG"&&p.previousElementSibling.tagName!=="S"||(k.insertNode(document.createTextNode(d.g.ZWSP)),k.collapse(!1)),void p.remove();k.setStartAfter(p.previousElementSibling)}else k.setStart(p.previousSibling,p.previousSibling.textContent.length);else p.previousSibling?k.setStart(p.previousSibling,p.previousSibling.textContent.length):p.nextSibling?p.nextSibling.nodeType===3?k.setStart(p.nextSibling,0):k.setStartBefore(p.nextSibling):k.setStart(p.parentElement,0);k.collapse(!0),p.remove(),f(k)}},C=function(y,k){var p=document.createElement("div");p.innerHTML=y;var _=p.querySelectorAll("p");_.length===1&&!_[0].previousSibling&&!_[0].nextSibling&&k[k.currentMode].element.children.length>0&&p.firstElementChild.tagName==="P"&&(y=_[0].innerHTML.trim());var N=document.createElement("div");N.innerHTML=y;var q=w(k);if(q.toString()!==""&&(k[k.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),N.firstElementChild&&N.firstElementChild.getAttribute("data-block")==="0"){N.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var D=(0,s.F9)(q.startContainer);D?D.insertAdjacentHTML("afterend",N.innerHTML):k[k.currentMode].element.insertAdjacentHTML("beforeend",N.innerHTML),S(k[k.currentMode].element,q)}else{var Z=document.createElement("template");Z.innerHTML=y,q.insertNode(Z.content.cloneNode(!0)),q.collapse(!1),f(q)}}}},ce={};function ne(J){var M=ce[J];if(M!==void 0)return M.exports;var b=ce[J]={exports:{}};return pe[J](b,b.exports,ne),b.exports}ne.d=(J,M)=>{for(var b in M)ne.o(M,b)&&!ne.o(J,b)&&Object.defineProperty(J,b,{enumerable:!0,get:M[b]})},ne.o=(J,M)=>Object.prototype.hasOwnProperty.call(J,M),ne.r=J=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(J,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(J,"__esModule",{value:!0})};var je={};return(()=>{ne.d(je,{default:()=>Ni});var J,M=ne(872),b=ne(54),d=ne(51),m=function(e){return e.currentMode==="sv"?(0,d.X)((e.sv.element.textContent+`
63
+ `).replace(/\n\n$/,`
64
+ `)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},s=ne(526),w=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return e.prototype.renderEchart=function(t){var n=this;t.devtools.element.style.display==="block"&&(0,s.G)(t.options.cdn+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){n.ASTChart||(n.ASTChart=echarts.init(t.devtools.element.lastElementChild));try{n.element.lastElementChild.style.display="block",n.element.firstElementChild.innerHTML="",n.ASTChart.setOption({series:[{data:JSON.parse(t.lute.RenderEChartsJSON(m(t))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),n.ASTChart.resize()}catch(i){n.element.lastElementChild.style.display="none",n.element.firstElementChild.innerHTML=i}})},e}(),l=ne(794),u=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&i.classList.contains("vditor-menu--current")&&i.classList.remove("vditor-menu--current")}})},f=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&!i.classList.contains("vditor-menu--current")&&i.classList.add("vditor-menu--current")}})},E=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&i.classList.contains(b.g.CLASS_MENU_DISABLED)&&i.classList.remove(b.g.CLASS_MENU_DISABLED)}})},L=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&!i.classList.contains(b.g.CLASS_MENU_DISABLED)&&i.classList.add(b.g.CLASS_MENU_DISABLED)}})},S=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="none")})},C=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="block")})},y=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(i){n&&i.isEqualNode(n)||(i.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},k=function(e,t,n,i){n.addEventListener((0,l.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(b.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(o){o.classList.remove("vditor-hint--current")}),t.style.display==="block"?t.style.display="none":(y(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},p=ne(827),_=ne(64),N=function(e,t,n,i){i&&console.log(e+" - "+n+": "+t)},q=ne(478),D=ne(314),Z=ne(730),te=ne(66),ge=ne(218),fe=ne(702),ue=ne(466),we=ne(40),De=ne(563),_e=ne(749),$e=ne(408),xe=function(e,t){if(e)if(e.parentElement.getAttribute("data-type")!=="html-block"){var n=e.firstElementChild.className.replace("language-","");n==="abc"?(0,q.Q)(e,t.options.cdn):n==="mermaid"?(0,we.i)(e,t.options.cdn,t.options.theme):n==="markmap"?(0,De.K)(e,t.options.cdn,t.options.theme):n==="flowchart"?(0,te.P)(e,t.options.cdn):n==="echarts"?(0,D.p)(e,t.options.cdn,t.options.theme):n==="mindmap"?(0,_e.P)(e,t.options.cdn,t.options.theme):n==="plantuml"?(0,$e.B)(e,t.options.cdn):n==="graphviz"?(0,ge.v)(e,t.options.cdn):n==="math"?(0,ue.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find(function(i){if(i.language===n)return i.render(e,t),!0})||((0,fe.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,Z.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")},x=ne(393),Fe=function(e){if(e.currentMode!=="sv"){var t=e[e.currentMode].element,n=e.outline.render(e);n===""&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(i){i.innerHTML=n,(0,ue.H)(i,{cdn:e.options.cdn,math:e.options.preview.math})})}},Lt=function(e,t){var n=(0,p.lG)(e.target,"SPAN");if(n&&(0,p.fb)(n,"vditor-toc")){var i=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(i)if(t.options.height==="auto"){var r=i.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(r+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,r)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=i.offsetTop}},K=function(e,t,n,i){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if(n.key==="Backspace"&&(0,x.im)(e,t[t.currentMode].element,i).start===0)return e.previousElementSibling.remove(),le(t),!0;if(dt(t,n,i,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if(n.key==="Delete"&&(0,x.im)(e,t[t.currentMode].element,i).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),le(t),!0;if(bt(t,n,i,e,e.nextElementSibling))return!0}if(n.key==="Backspace"||n.key==="Delete"){var r=(0,p.fb)(i.startContainer,"vditor-toc");if(r)return r.remove(),le(t),!0}},Ee=function(e,t,n,i){n===void 0&&(n=!1);var r=(0,p.F9)(t.startContainer);if(r&&!n&&r.getAttribute("data-type")!=="code-block"){if(Xt(r.innerHTML)&&r.previousElementSibling||Yt(r.innerHTML))return;for(var o=(0,x.im)(r,e.ir.element,t).start,a=!0,c=o-1;c>r.textContent.substr(0,o).lastIndexOf(`
65
+ `);c--)if(r.textContent.charAt(c)!==" "&&r.textContent.charAt(c)!==" "){a=!1;break}o===0&&(a=!1);var v=!0;for(c=o-1;c<r.textContent.length;c++)if(r.textContent.charAt(c)!==" "&&r.textContent.charAt(c)!==`
66
+ `){v=!1;break}if(a)return void(typeof e.options.input=="function"&&e.options.input(m(e)));if(v&&!(0,p.fb)(t.startContainer,"vditor-ir__marker")){var g=t.startContainer.previousSibling;return g&&g.nodeType!==3&&g.classList.contains("vditor-ir__node--expand")&&g.classList.remove("vditor-ir__node--expand"),void(typeof e.options.input=="function"&&e.options.input(m(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(F){F.classList.remove("vditor-ir__node--expand")}),r||(r=e.ir.element),!r.querySelector("wbr")){var h=(0,p.fb)(t.startContainer,"vditor-ir__preview");h?h.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}r.querySelectorAll("[style]").forEach(function(F){F.removeAttribute("style")}),r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.ir.element);var A,I=r.isEqualNode(e.ir.element),W=(0,p.a1)(r,"data-type","footnotes-block"),T="";if(I)T=r.innerHTML;else{var R=(0,_.S)(t.startContainer,"BLOCKQUOTE"),B=(0,p.O9)(t.startContainer);if(B&&(r=B),R&&(!B||B&&!R.contains(B))&&(r=R),W&&(r=W),T=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var O=r.previousElementSibling,V=r.nextElementSibling;!O||O.tagName!=="UL"&&O.tagName!=="OL"||(T=O.outerHTML+T,O.remove()),!V||V.tagName!=="UL"&&V.tagName!=="OL"||(T+=V.outerHTML,V.remove()),T=T.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else r.previousElementSibling&&r.previousElementSibling.textContent.replace(b.g.ZWSP,"")!==""&&i&&i.inputType==="insertParagraph"&&(T=r.previousElementSibling.outerHTML+T,r.previousElementSibling.remove());r.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(F){F&&!r.isEqualNode(F)&&(T+=F.outerHTML,F.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(F){F&&!r.isEqualNode(F)&&(T+=F.outerHTML,F.remove())}))}if(N("SpinVditorIRDOM",T,"argument",e.options.debugger),T=e.lute.SpinVditorIRDOM(T),N("SpinVditorIRDOM",T,"result",e.options.debugger),I)r.innerHTML=T;else if(r.outerHTML=T,W){var P=(0,p.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(P){var H=P.textContent,G=H.substring(1,H.indexOf("]:")),ee=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+G+'"]');ee&&ee.setAttribute("aria-label",H.substr(G.length+3).trim().substr(0,24))}}var X,$=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");$.forEach(function(F,re){re===0?A=F:(A.insertAdjacentHTML("beforeend",F.innerHTML),F.remove())}),$.length>0&&e.ir.element.insertAdjacentElement("beforeend",$[0]);var Q=e.ir.element.querySelectorAll("[data-type='footnotes-block']");Q.forEach(function(F,re){re===0?X=F:(X.insertAdjacentHTML("beforeend",F.innerHTML),F.remove())}),Q.length>0&&e.ir.element.insertAdjacentElement("beforeend",Q[0]),(0,x.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(F){xe(F,e)}),Fe(e),Xe(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},U=function(e,t){if(e==="")return!1;if(e.indexOf("⇧")===-1&&e.indexOf("⌘")===-1&&e.indexOf("⌥")===-1)return!((0,l.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if(e==="⇧Tab")return!((0,l.yl)(t)||t.altKey||!t.shiftKey||t.code!=="Tab");var n=e.split("");if(e.startsWith("⌥")){var i=n.length===3?n[2]:n[1];return!((n.length===3?!(0,l.yl)(t):(0,l.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(i)?"Digit":"Key")+i)}e==="⌘Enter"&&(n=["⌘","Enter"]);var r=n.length>2&&n[0]==="⇧",o=r?n[2]:n[1];return!r||!(0,l.vU)()&&/Mac/.test(navigator.platform)||(o==="-"?o="_":o==="="&&(o="+")),!(!(0,l.yl)(t)||t.key.toLowerCase()!==o.toLowerCase()||t.altKey||!(!r&&!t.shiftKey||r&&t.shiftKey))},j=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(a){a.classList.remove("vditor-ir__node--expand")});var n=(0,p.JQ)(e.startContainer,"vditor-ir__node"),i=!e.collapsed&&(0,p.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===i){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,x.Hc)(e));var r=function(a){var c=a.startContainer;if(c.nodeType===3&&c.nodeValue.length!==a.startOffset)return!1;for(var v=c.nextSibling;v&&v.textContent==="";)v=v.nextSibling;if(!v){var g=(0,p.fb)(c,"vditor-ir__marker");if(g&&!g.nextSibling){var h=c.parentElement.parentElement.nextSibling;if(h&&h.nodeType!==3&&h.classList.contains("vditor-ir__node"))return h}return!1}return!(!v||v.nodeType===3||!v.classList.contains("vditor-ir__node")||v.getAttribute("data-block"))&&v}(e);if(r)return r.classList.add("vditor-ir__node--expand"),void r.classList.remove("vditor-ir__node--hidden");var o=function(a){var c=a.startContainer,v=c.previousSibling;return!(c.nodeType!==3||a.startOffset!==0||!v||v.nodeType===3||!v.classList.contains("vditor-ir__node")||v.getAttribute("data-block"))&&v}(e);return o?(o.classList.add("vditor-ir__node--expand"),void o.classList.remove("vditor-ir__node--hidden")):void 0}},ie=ne(863),se=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(n){for(var i=n.parentElement,r=i.nextSibling;r&&r.textContent.startsWith(" ");){var o=r;o.childNodes.forEach(function(a){i.append(a.cloneNode(!0))}),r=r.nextSibling,o.remove()}t&&t(i)})},oe=function(e,t){var n,i=getSelection().getRangeAt(0).cloneRange(),r=i.startContainer;i.startContainer.nodeType!==3&&i.startContainer.tagName==="DIV"&&(r=i.startContainer.childNodes[i.startOffset-1]);var o=(0,p.a1)(r,"data-block","0");if(o&&t&&(t.inputType==="deleteContentBackward"||t.data===" ")){for(var a=(0,x.im)(o,e.sv.element,i).start,c=!0,v=a-1;v>o.textContent.substr(0,a).lastIndexOf(`
67
+ `);v--)if(o.textContent.charAt(v)!==" "&&o.textContent.charAt(v)!==" "){c=!1;break}if(a===0&&(c=!1),c)return void Oe(e);if(t.inputType==="deleteContentBackward"){var g=(0,p.a1)(r,"data-type","code-block-open-marker")||(0,p.a1)(r,"data-type","code-block-close-marker");if(g){var h;if(g.getAttribute("data-type")==="code-block-close-marker"&&(h=Ct(r,"code-block-open-marker"))||g.getAttribute("data-type")==="code-block-open-marker"&&(h=Ct(r,"code-block-close-marker",!1)))return h.textContent=g.textContent,void Oe(e)}var A=(0,p.a1)(r,"data-type","math-block-open-marker");if(A){var I=A.nextElementSibling.nextElementSibling;return void(I&&I.getAttribute("data-type")==="math-block-close-marker"&&(I.remove(),Oe(e)))}o.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(O){O.textContent.length===1&&O.remove()}),o.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(O){O.textContent.length===1&&O.remove()});var W=(0,p.a1)(r,"data-type","heading-marker");if(W&&W.textContent.indexOf("#")===-1)return void Oe(e)}if((t.data===" "||t.inputType==="deleteContentBackward")&&((0,p.a1)(r,"data-type","padding")||(0,p.a1)(r,"data-type","li-marker")||(0,p.a1)(r,"data-type","task-marker")||(0,p.a1)(r,"data-type","blockquote-marker")))return void Oe(e)}if(o&&o.textContent.trimRight()==="$$")Oe(e);else{o||(o=e.sv.element),((n=o.firstElementChild)===null||n===void 0?void 0:n.getAttribute("data-type"))==="link-ref-defs-block"&&(o=e.sv.element),(0,p.a1)(r,"data-type","footnotes-link")&&(o=e.sv.element),o.textContent.indexOf(Lute.Caret)===-1&&i.insertNode(document.createTextNode(Lute.Caret)),o.querySelectorAll("[style]").forEach(function(O){O.removeAttribute("style")}),o.querySelectorAll("font").forEach(function(O){O.outerHTML=O.innerHTML});var T=o.textContent,R=o.isEqualNode(e.sv.element);if(R)T=o.textContent;else{o.previousElementSibling&&(T=o.previousElementSibling.textContent+T,o.previousElementSibling.remove()),o.previousElementSibling&&T.indexOf(`---
68
+ `)===0&&(T=o.previousElementSibling.textContent+T,o.previousElementSibling.remove());var B="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(O,V){O&&!o.isEqualNode(O.parentElement)&&(B+=O.parentElement.textContent+`
69
+ `,O.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(O,V){O&&!o.isEqualNode(O.parentElement)&&(B+=O.parentElement.textContent+`
70
+ `,O.parentElement.remove())}),T=B+T}T=vn(T,e),R?o.innerHTML=T:o.outerHTML=T,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(O){e.sv.element.insertAdjacentElement("beforeend",O.parentElement)}),se(e.sv.element,function(O){e.sv.element.insertAdjacentElement("beforeend",O)}),(0,x.ib)(e.sv.element,i),He(e),Oe(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},Ie=ne(227),ve=function(e){e.options.theme==="dark"?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},he=function(e){var t=window.innerWidth<=b.g.MOBILE_WIDTH?10:35;if(e.wysiwyg.element.parentElement.style.display!=="none"){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px "+Math.max(t,n)+"px"}e.ir.element.parentElement.style.display!=="none"&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px "+Math.max(t,n)+"px"),e.preview.element.style.display!=="block"?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+(e.options.outline.position==="left"?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+(e.options.outline.position==="left"?e.outline.element.offsetWidth:0)+"px"},Y=function(e){if(e.options.typewriterMode){var t=window.innerHeight;typeof e.options.height=="number"?(t=e.options.height,typeof e.options.minHeight=="number"&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}};function Je(){window.removeEventListener("resize",J)}var tt,sn,sr=function(e){Y(e),Je(),window.addEventListener("resize",J=function(){he(e),Y(e)});var t=(0,l.pK)()&&localStorage.getItem(e.options.cache.id);return e.options.cache.enable&&t||(e.options.value?t=e.options.value:e.originalInnerHTML?t=e.lute.HTML2Md(e.originalInnerHTML):e.options.cache.enable||(t="")),t||""},ht=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if(e[e.currentMode].element.getAttribute("contenteditable")!=="false"&&(0,x.Gb)(e[e.currentMode].element)){u(e.toolbar.elements,b.g.EDIT_TOOLBARS),E(e.toolbar.elements,b.g.EDIT_TOOLBARS);var t=(0,x.zh)(e),n=t.startContainer;t.startContainer.nodeType===3&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),(e.currentMode==="sv"?(0,p.a1)(n,"data-type","heading"):(0,_.W)(n))&&f(e.toolbar.elements,["headings"]),(e.currentMode==="sv"?(0,p.a1)(n,"data-type","blockquote"):(0,p.lG)(n,"BLOCKQUOTE"))&&f(e.toolbar.elements,["quote"]),(0,p.a1)(n,"data-type","strong")&&f(e.toolbar.elements,["bold"]),(0,p.a1)(n,"data-type","em")&&f(e.toolbar.elements,["italic"]),(0,p.a1)(n,"data-type","s")&&f(e.toolbar.elements,["strike"]),(0,p.a1)(n,"data-type","a")&&f(e.toolbar.elements,["link"]);var i=(0,p.lG)(n,"LI");i?(i.classList.contains("vditor-task")?f(e.toolbar.elements,["check"]):i.parentElement.tagName==="OL"?f(e.toolbar.elements,["ordered-list"]):i.parentElement.tagName==="UL"&&f(e.toolbar.elements,["list"]),E(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,p.a1)(n,"data-type","code-block")&&(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),f(e.toolbar.elements,["code"])),(0,p.a1)(n,"data-type","code")&&(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),f(e.toolbar.elements,["inline-code"])),(0,p.a1)(n,"data-type","table")&&L(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},Se=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=m(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,l.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},dn=function(e){for(var t="",n=e.nextSibling;n;)n.nodeType===3?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},cn=function(e){for(var t="",n=e.previousSibling;n;)t=n.nodeType===3?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},un=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(n.nodeType===3){var i=document.createElement("p");i.setAttribute("data-block","0"),i.textContent=n.textContent;var r=t.startContainer.nodeType===3?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(i,n),n.remove(),t.setStart(i.firstChild,Math.min(i.firstChild.textContent.length,r)),t.collapse(!0),(0,x.Hc)(t),!0}if(!n.getAttribute("data-block"))return n.tagName==="P"?n.remove():(n.tagName==="DIV"?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>"):n.tagName==="BR"?n.outerHTML='<p data-block="0">'+n.outerHTML+"<wbr></p>":(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.outerHTML+"</p>"),(0,x.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},Tt=function(e,t){var n=(0,x.zh)(e),i=(0,p.F9)(n.startContainer);i||(i=n.startContainer.childNodes[n.startOffset]),i||e.wysiwyg.element.children.length!==0||(i=e.wysiwyg.element),i&&!i.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),i.innerHTML.trim()==="<wbr>"&&(i.innerHTML="<wbr><br>"),i.tagName==="BLOCKQUOTE"||i.classList.contains("vditor-reset")?i.innerHTML="<"+t+' data-block="0">'+i.innerHTML.trim()+"</"+t+">":i.outerHTML="<"+t+' data-block="0">'+i.innerHTML.trim()+"</"+t+">",(0,x.ib)(e.wysiwyg.element,n),Fe(e))},qt=function(e){var t=getSelection().getRangeAt(0),n=(0,p.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>",(0,x.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},vt=function(e,t,n){n===void 0&&(n=!0);var i=e.previousElementSibling,r=i.ownerDocument.createRange();i.tagName==="CODE"?(i.style.display="inline-block",n?r.setStart(i.firstChild,1):r.selectNodeContents(i)):(i.style.display="block",i.firstChild.firstChild||i.firstChild.appendChild(document.createTextNode("")),r.selectNodeContents(i.firstChild)),n?r.collapse(!0):r.collapse(!1),(0,x.Hc)(r),e.firstElementChild.classList.contains("language-mindmap")||He(t)},Re=function(e,t){if(U("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},nt=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(e.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,x.Gb)(e.wysiwyg.element)){u(e.toolbar.elements,b.g.EDIT_TOOLBARS),E(e.toolbar.elements,b.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=t.startContainer.nodeType===3?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var i=(0,p.a1)(n,"data-type","footnotes-block");if(i)return e.wysiwyg.popover.innerHTML="",Ve(i,e),void Be(e,i);var r=(0,p.lG)(n,"LI");r?(r.classList.contains("vditor-task")?f(e.toolbar.elements,["check"]):r.parentElement.tagName==="OL"?f(e.toolbar.elements,["ordered-list"]):r.parentElement.tagName==="UL"&&f(e.toolbar.elements,["list"]),E(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,p.lG)(n,"BLOCKQUOTE")&&f(e.toolbar.elements,["quote"]),((0,p.lG)(n,"B")||(0,p.lG)(n,"STRONG"))&&f(e.toolbar.elements,["bold"]),((0,p.lG)(n,"I")||(0,p.lG)(n,"EM"))&&f(e.toolbar.elements,["italic"]),((0,p.lG)(n,"STRIKE")||(0,p.lG)(n,"S"))&&f(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(z){z.classList.remove("vditor-comment--focus")});var o=(0,p.fb)(n,"vditor-comment");if(o){var a=o.getAttribute("data-cmtids").split(" ");if(a.length>1&&o.nextSibling.isSameNode(o.nextElementSibling)){var c=o.nextElementSibling.getAttribute("data-cmtids").split(" ");a.find(function(z){if(c.includes(z))return a=[z],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(z){z.getAttribute("data-cmtids").indexOf(a[0])>-1&&z.classList.add("vditor-comment--focus")})}var v=(0,p.lG)(n,"A");v&&f(e.toolbar.elements,["link"]);var g=(0,p.lG)(n,"TABLE"),h=(0,_.W)(n);(0,p.lG)(n,"CODE")?(0,p.lG)(n,"PRE")?(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),f(e.toolbar.elements,["code"])):(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),f(e.toolbar.elements,["inline-code"])):h?(L(e.toolbar.elements,["bold"]),f(e.toolbar.elements,["headings"])):g&&L(e.toolbar.elements,["table"]);var A=(0,p.fb)(n,"vditor-toc");if(A)return e.wysiwyg.popover.innerHTML="",Ve(A,e),void Be(e,A);var I=(0,_.S)(n,"BLOCKQUOTE");if(I&&(e.wysiwyg.popover.innerHTML="",at(t,I,e),lt(t,I,e),Ve(I,e),Be(e,I)),r&&(e.wysiwyg.popover.innerHTML="",at(t,r,e),lt(t,r,e),Ve(r,e),Be(e,r)),g){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var W=function(){var z=g.rows.length,Le=g.rows[0].cells.length,it=parseInt(re.value,10)||z,Qe=parseInt(Ce.value,10)||Le;if(it!==z||Le!==Qe){if(Le!==Qe)for(var Kn=Qe-Le,pt=0;pt<g.rows.length;pt++)if(Kn>0)for(var Fn=0;Fn<Kn;Fn++)pt===0?g.rows[pt].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):g.rows[pt].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var en=Le-1;en>=Qe;en--)g.rows[pt].cells[en].remove();if(z!==it){var Gn=it-z;if(Gn>0){for(var tn="<tr>",mt=0;mt<Qe;mt++)tn+="<td> </td>";for(var Zn=0;Zn<Gn;Zn++)g.querySelector("tbody")?g.querySelector("tbody").insertAdjacentHTML("beforeend",tn):g.querySelector("thead").insertAdjacentHTML("afterend",tn+"</tr>")}else for(mt=z-1;mt>=it;mt--)g.rows[mt].remove(),g.rows.length===1&&g.querySelector("tbody").remove()}typeof e.options.input=="function"&&e.options.input(m(e))}},T=function(z){_t(g,z),z==="right"?(V.classList.remove("vditor-icon--current"),P.classList.remove("vditor-icon--current"),H.classList.add("vditor-icon--current")):z==="center"?(V.classList.remove("vditor-icon--current"),H.classList.remove("vditor-icon--current"),P.classList.add("vditor-icon--current")):(P.classList.remove("vditor-icon--current"),H.classList.remove("vditor-icon--current"),V.classList.add("vditor-icon--current")),(0,x.Hc)(t),Se(e)},R=(0,p.lG)(n,"TD"),B=(0,p.lG)(n,"TH"),O="left";R?O=R.getAttribute("align")||"left":B&&(O=B.getAttribute("align")||"center");var V=document.createElement("button");V.setAttribute("type","button"),V.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,l.ns)("⇧⌘L")+">"),V.setAttribute("data-type","left"),V.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',V.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(O==="left"?" vditor-icon--current":""),V.onclick=function(){T("left")};var P=document.createElement("button");P.setAttribute("type","button"),P.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,l.ns)("⇧⌘C")+">"),P.setAttribute("data-type","center"),P.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',P.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(O==="center"?" vditor-icon--current":""),P.onclick=function(){T("center")};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,l.ns)("⇧⌘R")+">"),H.setAttribute("data-type","right"),H.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(O==="right"?" vditor-icon--current":""),H.onclick=function(){T("right")};var G=document.createElement("button");G.setAttribute("type","button"),G.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,l.ns)("⌘=")+">"),G.setAttribute("data-type","insertRow"),G.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',G.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",G.onclick=function(){var z=getSelection().getRangeAt(0).startContainer,Le=(0,p.lG)(z,"TD")||(0,p.lG)(z,"TH");Le&&Mn(e,t,Le)};var ee=document.createElement("button");ee.setAttribute("type","button"),ee.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,l.ns)("⇧⌘F")+">"),ee.setAttribute("data-type","insertRow"),ee.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',ee.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",ee.onclick=function(){var z=getSelection().getRangeAt(0).startContainer,Le=(0,p.lG)(z,"TD")||(0,p.lG)(z,"TH");Le&&xn(e,t,Le)};var X=document.createElement("button");X.setAttribute("type","button"),X.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,l.ns)("⇧⌘=")+">"),X.setAttribute("data-type","insertColumn"),X.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',X.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",X.onclick=function(){var z=getSelection().getRangeAt(0).startContainer,Le=(0,p.lG)(z,"TD")||(0,p.lG)(z,"TH");Le&&Ht(e,g,Le)};var $=document.createElement("button");$.setAttribute("type","button"),$.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,l.ns)("⇧⌘G")+">"),$.setAttribute("data-type","insertColumn"),$.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',$.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",$.onclick=function(){var z=getSelection().getRangeAt(0).startContainer,Le=(0,p.lG)(z,"TD")||(0,p.lG)(z,"TH");Le&&Ht(e,g,Le,"beforebegin")};var Q=document.createElement("button");Q.setAttribute("type","button"),Q.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,l.ns)("⌘-")+">"),Q.setAttribute("data-type","deleteRow"),Q.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',Q.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Q.onclick=function(){var z=getSelection().getRangeAt(0).startContainer,Le=(0,p.lG)(z,"TD")||(0,p.lG)(z,"TH");Le&&An(e,t,Le)};var F=document.createElement("button");F.setAttribute("type","button"),F.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,l.ns)("⇧⌘-")+">"),F.setAttribute("data-type","deleteColumn"),F.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',F.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",F.onclick=function(){var z=getSelection().getRangeAt(0).startContainer,Le=(0,p.lG)(z,"TD")||(0,p.lG)(z,"TH");Le&&_n(e,t,g,Le)},(Ue=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),Ue.className="vditor-tooltipped vditor-tooltipped__n";var re=document.createElement("input");Ue.appendChild(re),re.type="number",re.min="1",re.className="vditor-input",re.style.width="42px",re.style.textAlign="center",re.setAttribute("placeholder",window.VditorI18n.row),re.value=g.rows.length.toString(),re.oninput=function(){W()},re.onkeydown=function(z){if(!z.isComposing)return z.key==="Tab"?(Ce.focus(),Ce.select(),void z.preventDefault()):void(Re(e,z)||Ge(z,t))};var ke=document.createElement("span");ke.setAttribute("aria-label",window.VditorI18n.column),ke.className="vditor-tooltipped vditor-tooltipped__n";var Ce=document.createElement("input");ke.appendChild(Ce),Ce.type="number",Ce.min="1",Ce.className="vditor-input",Ce.style.width="42px",Ce.style.textAlign="center",Ce.setAttribute("placeholder",window.VditorI18n.column),Ce.value=g.rows[0].cells.length.toString(),Ce.oninput=function(){W()},Ce.onkeydown=function(z){if(!z.isComposing)return z.key==="Tab"?(re.focus(),re.select(),void z.preventDefault()):void(Re(e,z)||Ge(z,t))},at(t,g,e),lt(t,g,e),Ve(g,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",V),e.wysiwyg.popover.insertAdjacentElement("beforeend",P),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",ee),e.wysiwyg.popover.insertAdjacentElement("beforeend",G),e.wysiwyg.popover.insertAdjacentElement("beforeend",$),e.wysiwyg.popover.insertAdjacentElement("beforeend",X),e.wysiwyg.popover.insertAdjacentElement("beforeend",Q),e.wysiwyg.popover.insertAdjacentElement("beforeend",F),e.wysiwyg.popover.insertAdjacentElement("beforeend",Ue),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",ke),Be(e,g)}var Ye=(0,p.a1)(n,"data-type","link-ref");Ye&&pn(e,Ye,t);var Pe=(0,p.a1)(n,"data-type","footnotes-ref");if(Pe){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(Ue=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,l.ns)("⌥Enter")+">"),Ue.className="vditor-tooltipped vditor-tooltipped__n";var qe=document.createElement("input");Ue.appendChild(qe),qe.className="vditor-input",qe.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,l.ns)("⌥Enter")+">"),qe.style.width="120px",qe.value=Pe.getAttribute("data-footnotes-label"),qe.oninput=function(){qe.value.trim()!==""&&Pe.setAttribute("data-footnotes-label",qe.value),typeof e.options.input=="function"&&e.options.input(m(e))},qe.onkeydown=function(z){z.isComposing||Re(e,z)||Ge(z,t)},Ve(Pe,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Ue),Be(e,Pe)}var Ne=(0,p.fb)(n,"vditor-wysiwyg__block"),ct=!!Ne&&Ne.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(z){(!Ne||Ne&&ct&&!Ne.contains(z))&&(z.previousElementSibling.style.display="none")}),Ne&&ct){if(e.wysiwyg.popover.innerHTML="",at(t,Ne,e),lt(t,Ne,e),Ve(Ne,e),Ne.getAttribute("data-type")==="code-block"){var Ot=document.createElement("span");Ot.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,l.ns)("⌥Enter")+">"),Ot.className="vditor-tooltipped vditor-tooltipped__n";var ze=document.createElement("input");Ot.appendChild(ze);var Et=Ne.firstElementChild.firstElementChild;ze.className="vditor-input",ze.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,l.ns)("⌥Enter")+">"),ze.value=Et.className.indexOf("language-")>-1?Et.className.split("-")[1].split(" ")[0]:"",ze.oninput=function(z){ze.value.trim()!==""?Et.className="language-"+ze.value:(Et.className="",e.hint.recentLanguage=""),Ne.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(Ne.lastElementChild.innerHTML=Ne.firstElementChild.innerHTML,xe(Ne.lastElementChild,e)),Se(e),z.detail===1&&(t.setStart(Et.firstChild,0),t.collapse(!0),(0,x.Hc)(t))},ze.onkeydown=function(z){if(!z.isComposing&&!Re(e,z)){if(z.key==="Escape"&&e.hint.element.style.display==="block")return e.hint.element.style.display="none",void z.preventDefault();e.hint.select(z,e),Ge(z,t)}},ze.onkeyup=function(z){if(!z.isComposing&&z.key!=="Enter"&&z.key!=="ArrowUp"&&z.key!=="Escape"&&z.key!=="ArrowDown"){var Le=[],it=ze.value.substring(0,ze.selectionStart);(e.options.preview.hljs.langs||b.g.CODE_LANGUAGES).forEach(function(Qe){Qe.indexOf(it.toLowerCase())>-1&&Le.push({html:Qe,value:Qe})}),e.hint.genHTML(Le,it,e),z.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",Ot)}Be(e,Ne)}else Ne=void 0;if(h){var Ue;e.wysiwyg.popover.innerHTML="",(Ue=document.createElement("span")).setAttribute("aria-label","ID<"+(0,l.ns)("⌥Enter")+">"),Ue.className="vditor-tooltipped vditor-tooltipped__n";var et=document.createElement("input");Ue.appendChild(et),et.className="vditor-input",et.setAttribute("placeholder","ID<"+(0,l.ns)("⌥Enter")+">"),et.style.width="120px",et.value=h.getAttribute("data-id")||"",et.oninput=function(){h.setAttribute("data-id",et.value),typeof e.options.input=="function"&&e.options.input(m(e))},et.onkeydown=function(z){z.isComposing||Re(e,z)||Ge(z,t)},at(t,h,e),lt(t,h,e),Ve(h,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Ue),Be(e,h)}if(v&&Bt(e,v,t),!(I||r||g||Ne||v||Ye||Pe||h||A)){var ut=(0,p.a1)(n,"data-block","0");ut&&ut.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",at(t,ut,e),lt(t,ut,e),Ve(ut,e),Be(e,ut)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(z){z.style.display="none"});var zn=(0,p.a1)(t.startContainer,"data-type","backslash");zn&&(zn.querySelector("span").style.display="inline")}},200)},Be=function(e,t){var n=t,i=(0,p.lG)(t,"TABLE");i&&(n=i),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},pn=function(e,t,n){n===void 0&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.tagName==="IMG"?t.setAttribute("alt",o.value):t.textContent=o.value),c.value.trim()!==""&&t.setAttribute("data-link-label",c.value),typeof e.options.input=="function"&&e.options.input(m(e))},r=document.createElement("span");r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");r.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.getAttribute("alt")||t.textContent,o.oninput=function(){i()},o.onkeydown=function(v){Re(e,v)||Ge(v,n)||gt(e,t,v,c)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.linkRef),a.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");a.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.linkRef),c.value=t.getAttribute("data-link-label"),c.oninput=function(){i()},c.onkeydown=function(v){Re(e,v)||Ge(v,n)||gt(e,t,v,o)},Ve(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),Be(e,t)},at=function(e,t,n){var i=t.previousElementSibling;if(i&&(t.parentElement.isEqualNode(n.wysiwyg.element)||t.tagName==="LI")){var r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("data-type","up"),r.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,l.ns)("⇧⌘U")+">"),r.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',r.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",r.onclick=function(){e.insertNode(document.createElement("wbr")),i.insertAdjacentElement("beforebegin",t),(0,x.ib)(n.wysiwyg.element,e),Se(n),nt(n),He(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},lt=function(e,t,n){var i=t.nextElementSibling;if(i&&(t.parentElement.isEqualNode(n.wysiwyg.element)||t.tagName==="LI")){var r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("data-type","down"),r.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,l.ns)("⇧⌘D")+">"),r.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',r.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",r.onclick=function(){e.insertNode(document.createElement("wbr")),i.insertAdjacentElement("afterend",t),(0,x.ib)(n.wysiwyg.element,e),Se(n),nt(n),He(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},Ve=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,l.ns)("⇧⌘X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var i=(0,x.zh)(t);i.setStartAfter(e),(0,x.Hc)(i),e.remove(),Se(t),nt(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&Fe(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},gt=function(e,t,n,i){if(!n.isComposing){if(n.key==="Tab")return i.focus(),i.select(),void n.preventDefault();if(!(0,l.yl)(n)&&!n.shiftKey&&n.altKey&&n.key==="Enter"){var r=(0,x.zh)(e);t.insertAdjacentHTML("afterend",b.g.ZWSP),r.setStartAfter(t.nextSibling),r.collapse(!0),(0,x.Hc)(r),n.preventDefault()}}},Bt=function(e,t,n){e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.innerHTML=o.value),t.setAttribute("href",c.value),t.setAttribute("title",g.value),Se(e)};t.querySelectorAll("[data-marker]").forEach(function(h){h.removeAttribute("data-marker")});var r=document.createElement("span");r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");r.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.innerHTML||"",o.oninput=function(){i()},o.onkeydown=function(h){Re(e,h)||Ge(h,n)||gt(e,t,h,c)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.link),a.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");a.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.link),c.value=t.getAttribute("href")||"",c.oninput=function(){i()},c.onkeydown=function(h){Re(e,h)||Ge(h,n)||gt(e,t,h,g)};var v=document.createElement("span");v.setAttribute("aria-label",window.VditorI18n.tooltipText),v.className="vditor-tooltipped vditor-tooltipped__n";var g=document.createElement("input");v.appendChild(g),g.className="vditor-input",g.setAttribute("placeholder",window.VditorI18n.tooltipText),g.style.width="60px",g.value=t.getAttribute("title")||"",g.oninput=function(){i()},g.onkeydown=function(h){Re(e,h)||Ge(h,n)||gt(e,t,h,o)},Ve(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),e.wysiwyg.popover.insertAdjacentElement("beforeend",v),Be(e,t)},Ge=function(e,t){if(!(0,l.yl)(e)&&!e.shiftKey&&e.key==="Enter"||e.key==="Escape")return t&&(0,x.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},st=function(e){e.currentMode==="wysiwyg"?nt(e):e.currentMode==="ir"&&ht(e)},mn=function(e,t,n){n===void 0&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var i=e.wysiwyg.element;i.innerHTML=e.lute.Md2VditorDOM(t),i.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(r){xe(r,e),r.previousElementSibling.setAttribute("style","display:none")}),Se(e,n)},dr=function(e,t,n){for(var i=e.startContainer.parentElement,r=!1,o="",a="",c=function(T){var R=cn(T.startContainer),B=dn(T.startContainer),O=T.startContainer.textContent,V=T.startOffset,P="",H="";return(O.substr(0,V)!==""&&O.substr(0,V)!==b.g.ZWSP||R)&&(P=""+R+O.substr(0,V)),(O.substr(V)!==""&&O.substr(V)!==b.g.ZWSP||B)&&(H=""+O.substr(V)+B),{afterHTML:H,beforeHTML:P}}(e),v=c.beforeHTML,g=c.afterHTML;i&&!r;){var h=i.tagName;if(h==="STRIKE"&&(h="S"),h==="I"&&(h="EM"),h==="B"&&(h="STRONG"),h==="S"||h==="STRONG"||h==="EM"){var A="",I="",W="";i.parentElement.getAttribute("data-block")!=="0"&&(I=cn(i),W=dn(i)),(v||I)&&(v=A=I+"<"+h+">"+v+"</"+h+">"),(n==="bold"&&h==="STRONG"||n==="italic"&&h==="EM"||n==="strikeThrough"&&h==="S")&&(A+=""+o+b.g.ZWSP+"<wbr>"+a,r=!0),(g||W)&&(A+=g="<"+h+">"+g+"</"+h+">"+W),i.parentElement.getAttribute("data-block")!=="0"?(i=i.parentElement).innerHTML=A:(i.outerHTML=A,i=i.parentElement),o="<"+h+">"+o,a="</"+h+">"+a}else r=!0}(0,x.ib)(t.wysiwyg.element,e)},Te=function(e,t){var n,i=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var r=t.hotkey?" <"+(0,l.ns)(t.hotkey)+">":"";t.level===2&&(r=t.hotkey?" &lt;"+(0,l.ns)(t.hotkey)+"&gt;":"");var o=t.tip?t.tip+r:""+window.VditorI18n[t.name]+r,a=t.name==="upload"?"div":"button";if(t.level===2)this.element.innerHTML="<"+a+' data-type="'+t.name+'">'+o+"</"+a+">";else{this.element.classList.add("vditor-toolbar__item");var c=document.createElement(a);c.setAttribute("data-type",t.name),c.className="vditor-tooltipped vditor-tooltipped__"+t.tipPosition,c.setAttribute("aria-label",o),c.innerHTML=t.icon,this.element.appendChild(c)}t.prefix&&this.element.children[0].addEventListener((0,l.Le)(),function(v){v.preventDefault(),i.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)||(e.currentMode==="wysiwyg"?function(g,h,A){if(!(g.wysiwyg.composingLock&&A instanceof CustomEvent)){var I=!0,W=!0;g.wysiwyg.element.querySelector("wbr")&&g.wysiwyg.element.querySelector("wbr").remove();var T=(0,x.zh)(g),R=h.getAttribute("data-type");if(h.classList.contains("vditor-menu--current"))if(R==="strike"&&(R="strikeThrough"),R==="quote"){var B=(0,p.lG)(T.startContainer,"BLOCKQUOTE");B||(B=T.startContainer.childNodes[T.startOffset]),B&&(I=!1,h.classList.remove("vditor-menu--current"),T.insertNode(document.createElement("wbr")),B.outerHTML=B.innerHTML.trim()===""?'<p data-block="0">'+B.innerHTML+"</p>":B.innerHTML,(0,x.ib)(g.wysiwyg.element,T))}else if(R==="inline-code"){var O=(0,p.lG)(T.startContainer,"CODE");O||(O=T.startContainer.childNodes[T.startOffset]),O&&(O.outerHTML=O.innerHTML.replace(b.g.ZWSP,"")+"<wbr>",(0,x.ib)(g.wysiwyg.element,T))}else R==="link"?(T.collapsed&&T.selectNode(T.startContainer.parentElement),document.execCommand("unlink",!1,"")):R==="check"||R==="list"||R==="ordered-list"?(At(g,T,R),(0,x.ib)(g.wysiwyg.element,T),I=!1,h.classList.remove("vditor-menu--current")):(I=!1,h.classList.remove("vditor-menu--current"),T.toString()===""?dr(T,g,R):document.execCommand(R,!1,""));else{g.wysiwyg.element.childNodes.length===0&&(g.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,x.ib)(g.wysiwyg.element,T));var V=(0,p.F9)(T.startContainer);if(R==="quote"){if(V||(V=T.startContainer.childNodes[T.startOffset]),V){I=!1,h.classList.add("vditor-menu--current"),T.insertNode(document.createElement("wbr"));var P=(0,p.lG)(T.startContainer,"LI");P&&V.contains(P)?P.innerHTML='<blockquote data-block="0">'+P.innerHTML+"</blockquote>":V.outerHTML='<blockquote data-block="0">'+V.outerHTML+"</blockquote>",(0,x.ib)(g.wysiwyg.element,T)}}else if(R==="check"||R==="list"||R==="ordered-list")At(g,T,R,!1),(0,x.ib)(g.wysiwyg.element,T),I=!1,u(g.toolbar.elements,["check","list","ordered-list"]),h.classList.add("vditor-menu--current");else if(R==="inline-code"){if(T.toString()==="")(H=document.createElement("code")).textContent=b.g.ZWSP,T.insertNode(H),T.setStart(H.firstChild,1),T.collapse(!0),(0,x.Hc)(T);else if(T.startContainer.nodeType===3){var H=document.createElement("code");T.surroundContents(H),T.insertNode(H),(0,x.Hc)(T)}h.classList.add("vditor-menu--current")}else if(R==="code")(H=document.createElement("div")).className="vditor-wysiwyg__block",H.setAttribute("data-type","code-block"),H.setAttribute("data-block","0"),H.setAttribute("data-marker","```"),T.toString()===""?H.innerHTML=`<pre><code><wbr>
71
+ </code></pre>`:(H.innerHTML="<pre><code>"+T.toString()+"<wbr></code></pre>",T.deleteContents()),T.insertNode(H),V&&(V.outerHTML=g.lute.SpinVditorDOM(V.outerHTML)),(0,x.ib)(g.wysiwyg.element,T),g.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(Ce){xe(Ce,g)}),h.classList.add("vditor-menu--disabled");else if(R==="link"){if(T.toString()===""){var G=document.createElement("a");G.innerText=b.g.ZWSP,T.insertNode(G),T.setStart(G.firstChild,1),T.collapse(!0),Bt(g,G,T);var ee=g.wysiwyg.popover.querySelector("input");ee.value="",ee.focus(),W=!1}else{(H=document.createElement("a")).setAttribute("href",""),H.innerHTML=T.toString(),T.surroundContents(H),T.insertNode(H),(0,x.Hc)(T),Bt(g,H,T);var X=g.wysiwyg.popover.querySelectorAll("input");X[0].value=H.innerText,X[1].focus()}I=!1,h.classList.add("vditor-menu--current")}else if(R==="table"){var $='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(T.toString().trim()==="")V&&V.innerHTML.trim().replace(b.g.ZWSP,"")===""?V.outerHTML=$:document.execCommand("insertHTML",!1,$),T.selectNode(g.wysiwyg.element.querySelector("wbr").previousSibling),g.wysiwyg.element.querySelector("wbr").remove(),(0,x.Hc)(T);else{$='<table data-block="0"><thead><tr>';var Q=T.toString().split(`
72
+ `),F=Q[0].split(",").length>Q[0].split(" ").length?",":" ";Q.forEach(function(Ce,Ye){Ye===0?(Ce.split(F).forEach(function(Pe,qe){$+=qe===0?"<th>"+Pe+"<wbr></th>":"<th>"+Pe+"</th>"}),$+="</tr></thead>"):($+=Ye===1?"<tbody><tr>":"<tr>",Ce.split(F).forEach(function(Pe){$+="<td>"+Pe+"</td>"}),$+="</tr>")}),$+="</tbody></table>",document.execCommand("insertHTML",!1,$),(0,x.ib)(g.wysiwyg.element,T)}I=!1,h.classList.add("vditor-menu--disabled")}else if(R==="line"){if(V){var re=`<hr data-block="0"><p data-block="0"><wbr>
73
+ </p>`;V.innerHTML.trim()===""?V.outerHTML=re:V.insertAdjacentHTML("afterend",re),(0,x.ib)(g.wysiwyg.element,T)}}else if(I=!1,h.classList.add("vditor-menu--current"),R==="strike"&&(R="strikeThrough"),T.toString()!==""||R!=="bold"&&R!=="italic"&&R!=="strikeThrough")document.execCommand(R,!1,"");else{var ke="strong";R==="italic"?ke="em":R==="strikeThrough"&&(ke="s"),(H=document.createElement(ke)).textContent=b.g.ZWSP,T.insertNode(H),H.previousSibling&&H.previousSibling.textContent===b.g.ZWSP&&(H.previousSibling.textContent=""),T.setStart(H.firstChild,1),T.collapse(!0),(0,x.Hc)(T)}}I&&nt(g),W&&Se(g)}}(e,i.element.children[0],v):e.currentMode==="ir"?kr(e,i.element.children[0],t.prefix||"",t.suffix||""):mr(e,i.element.children[0],t.prefix||"",t.suffix||""))})},cr=(tt=function(e,t){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},tt(e,t)},function(e,t){function n(){this.constructor=e}tt(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),rt=function(e,t,n){var i;if(typeof n!="string"?(y(e,["subToolbar","hint"]),n.preventDefault(),i=m(e)):i=n,e.currentMode!==t||typeof n=="string"){if(e.devtools&&e.devtools.renderEchart(e),e.options.preview.mode==="both"&&t==="sv"?e.preview.element.style.display="block":e.preview.element.style.display="none",E(e.toolbar.elements,b.g.EDIT_TOOLBARS),u(e.toolbar.elements,b.g.EDIT_TOOLBARS),L(e.toolbar.elements,["outdent","indent"]),t==="ir")S(e.toolbar.elements,["both"]),C(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(i),Xe(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),he(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o){xe(o,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(o){(0,ue.H)(o,{cdn:e.options.cdn,math:e.options.preview.math})});else if(t==="wysiwyg")S(e.toolbar.elements,["both"]),C(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",he(e),mn(e,i,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(o){(0,ue.H)(o,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if(t==="sv"){C(e.toolbar.elements,["both"]),S(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",(e.options.preview.mode==="both"||e.options.preview.mode==="editor")&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var r=vn(i,e);r==="<div data-block='0'></div>"&&(r=""),e.sv.element.innerHTML=r,se(e.sv.element),Oe(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),he(e)}e.undo.resetIcon(e),typeof n!="string"&&(e[e.currentMode].element.focus(),st(e)),Fe(e),Y(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(o){o.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'+e.currentMode+'"]').classList.add("vditor-menu--current")),e.outline.toggle(e,e.currentMode!=="sv"&&e.options.outline.enable,typeof n!="string")}},ur=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");return o.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'+window.VditorI18n.wysiwyg+" &lt;"+(0,l.ns)("⌥⌘7")+`></button>
74
+ <button data-mode="ir">`+window.VditorI18n.instantRendering+" &lt;"+(0,l.ns)("⌥⌘8")+`></button>
75
+ <button data-mode="sv">`+window.VditorI18n.splitView+" &lt;"+(0,l.ns)("⌥⌘9")+"></button>",r.element.appendChild(o),r._bindEvent(n,o,i),r}return cr(t,e),t.prototype._bindEvent=function(n,i,r){var o=this.element.children[0];k(n,i,o,r.level),i.children.item(0).addEventListener((0,l.Le)(),function(a){rt(n,"wysiwyg",a),a.preventDefault(),a.stopPropagation()}),i.children.item(1).addEventListener((0,l.Le)(),function(a){rt(n,"ir",a),a.preventDefault(),a.stopPropagation()}),i.children.item(2).addEventListener((0,l.Le)(),function(a){rt(n,"sv",a),a.preventDefault(),a.stopPropagation()})},t}(Te),yt=function(e,t){return(0,x.Gb)(e,t)?getSelection().toString():""},Vt=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(m(e)),y(e,["subToolbar","hint"])})},fn=function(e,t){t.addEventListener("dblclick",function(n){n.target.tagName==="IMG"&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,ie.E)(n.target,e.options.lang,e.options.theme))})},Ut=function(e,t){t.addEventListener("blur",function(n){if(e.currentMode==="ir"){var i=e.ir.element.querySelector(".vditor-ir__node--expand");i&&i.classList.remove("vditor-ir__node--expand")}else e.currentMode!=="wysiwyg"||e.wysiwyg.selectPopover.contains(n.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,x.zh)(e),e.options.blur&&e.options.blur(m(e))})},Wt=function(e,t){t.addEventListener("dragstart",function(n){n.dataTransfer.setData(b.g.DROP_EDITOR,b.g.DROP_EDITOR)}),t.addEventListener("drop",function(n){n.dataTransfer.getData(b.g.DROP_EDITOR)?le(e):(n.dataTransfer.types.includes("Files")||n.dataTransfer.types.includes("text/html"))&&Nt(e,n,{pasteCode:function(i){document.execCommand("insertHTML",!1,i)}})})},zt=function(e,t,n){t.addEventListener("copy",function(i){return n(i,e)})},Kt=function(e,t,n){t.addEventListener("cut",function(i){n(i,e),e.options.comment.enable&&e.currentMode==="wysiwyg"&&e.wysiwyg.getComments(e),document.execCommand("delete")})},He=function(e){if(e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,x.Ny)(t).top;e.options.height!=="auto"||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),(e.options.height!=="auto"||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},Ft=function(e,t){t.addEventListener("keydown",function(n){if(!n.isComposing&&e.options.keydown&&e.options.keydown(n),!(e.options.hint.extend.length>1||e.toolbar.elements.emoji)||!e.hint.select(n,e)){if(e.options.comment.enable&&e.currentMode==="wysiwyg"&&(n.key==="Backspace"||U("⌘X",n))&&e.wysiwyg.getComments(e),e.currentMode==="sv"){if(function(r,o){var a,c,v,g,h;if(r.sv.composingLock=o.isComposing,o.isComposing||(o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,l.yl)(o)&&o.key!=="Escape"))return!1;var A=(0,x.zh)(r),I=A.startContainer;A.startContainer.nodeType!==3&&A.startContainer.tagName==="DIV"&&(I=A.startContainer.childNodes[A.startOffset-1]);var W=(0,p.a1)(I,"data-type","text"),T=(0,p.a1)(I,"data-type","blockquote-marker");if(!T&&A.startOffset===0&&W&&W.previousElementSibling&&W.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(T=W.previousElementSibling),T&&o.key==="Enter"&&!(0,l.yl)(o)&&!o.altKey&&T.nextElementSibling.textContent.trim()===""&&(0,x.im)(T,r.sv.element,A).start===T.textContent.length)return((a=T.previousElementSibling)===null||a===void 0?void 0:a.getAttribute("data-type"))==="padding"&&T.previousElementSibling.setAttribute("data-action","enter-remove"),T.remove(),Oe(r),o.preventDefault(),!0;var R=(0,p.a1)(I,"data-type","li-marker"),B=(0,p.a1)(I,"data-type","task-marker"),O=R;if(O||B&&B.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(O=B),O||A.startOffset!==0||!W||!W.previousElementSibling||W.previousElementSibling.getAttribute("data-type")!=="li-marker"&&W.previousElementSibling.getAttribute("data-type")!=="task-marker"||(O=W.previousElementSibling),O){var V=(0,x.im)(O,r.sv.element,A).start,P=O.getAttribute("data-type")==="task-marker",H=O;if(P&&(H=O.previousElementSibling.previousElementSibling.previousElementSibling),V===O.textContent.length){if(o.key==="Enter"&&!(0,l.yl)(o)&&!o.altKey&&!o.shiftKey&&O.nextElementSibling.textContent.trim()==="")return((c=H.previousElementSibling)===null||c===void 0?void 0:c.getAttribute("data-type"))==="padding"?(H.previousElementSibling.remove(),oe(r)):(P&&(H.remove(),O.previousElementSibling.previousElementSibling.remove(),O.previousElementSibling.remove()),O.nextElementSibling.remove(),O.remove(),Oe(r)),o.preventDefault(),!0;if(o.key==="Tab")return H.insertAdjacentHTML("beforebegin",'<span data-type="padding">'+H.textContent.replace(/\S/g," ")+"</span>"),/^\d/.test(H.textContent)&&(H.textContent=H.textContent.replace(/^\d{1,}/,"1"),A.selectNodeContents(O.firstChild),A.collapse(!1)),oe(r),o.preventDefault(),!0}}if(Qt(r,A,o))return!0;var G=(0,p.a1)(I,"data-block","0"),ee=(0,_.S)(I,"SPAN");if(o.key==="Enter"&&!(0,l.yl)(o)&&!o.altKey&&!o.shiftKey&&G){var X=!1,$=G.textContent.match(/^\n+/);(0,x.im)(G,r.sv.element).start<=($?$[0].length:0)&&(X=!0);var Q=`
76
+ `;if(ee){if(((v=ee.previousElementSibling)===null||v===void 0?void 0:v.getAttribute("data-action"))==="enter-remove")return ee.previousElementSibling.remove(),Oe(r),o.preventDefault(),!0;Q+=pr(ee)}return A.insertNode(document.createTextNode(Q)),A.collapse(!1),G&&G.textContent.trim()!==""&&!X?oe(r):Oe(r),o.preventDefault(),!0}if(o.key==="Backspace"&&!(0,l.yl)(o)&&!o.altKey&&!o.shiftKey){if(ee&&((g=ee.previousElementSibling)===null||g===void 0?void 0:g.getAttribute("data-type"))==="newline"&&(0,x.im)(ee,r.sv.element,A).start===1&&ee.getAttribute("data-type").indexOf("code-block-")===-1)return A.setStart(ee,0),A.extractContents(),ee.textContent.trim()!==""?oe(r):Oe(r),o.preventDefault(),!0;if(G&&(0,x.im)(G,r.sv.element,A).start===0&&G.previousElementSibling){A.extractContents();var F=G.previousElementSibling.lastElementChild;return F.getAttribute("data-type")==="newline"&&(F.remove(),F=G.previousElementSibling.lastElementChild),F.getAttribute("data-type")!=="newline"&&(F.insertAdjacentHTML("afterend",G.innerHTML),G.remove()),G.textContent.trim()===""||!((h=G.previousElementSibling)===null||h===void 0)&&h.querySelector('[data-type="code-block-open-marker"]')?(F.getAttribute("data-type")!=="newline"&&(A.selectNodeContents(F.lastChild),A.collapse(!1)),Oe(r)):oe(r),o.preventDefault(),!0}}return!1}(e,n))return}else if(e.currentMode==="wysiwyg"){if(function(r,o){if(r.wysiwyg.composingLock=o.isComposing,o.isComposing)return!1;o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o);var a=(0,x.zh)(r),c=a.startContainer;if(!wn(o,r,c)||(En(a,r,o),jn(a),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,l.yl)(o)&&o.key!=="Escape"&&o.key!=="Delete"))return!1;var v=(0,p.F9)(c),g=(0,p.lG)(c,"P");if(Cn(o,r,g,a)||Tn(a,r,g,o)||Hn(r,o,a))return!0;var h=(0,p.fb)(c,"vditor-wysiwyg__block");if(h){if(o.key==="Escape"&&h.children.length===2)return r.wysiwyg.popover.style.display="none",h.firstElementChild.style.display="none",r.wysiwyg.element.blur(),o.preventDefault(),!0;if(!(0,l.yl)(o)&&!o.shiftKey&&o.altKey&&o.key==="Enter"&&h.getAttribute("data-type")==="code-block"){var A=r.wysiwyg.popover.querySelector(".vditor-input");return A.focus(),A.select(),o.preventDefault(),!0}if(h.getAttribute("data-block")==="0"&&(Nn(r,o,h.firstElementChild,a)||bt(r,o,a,h.firstElementChild,h)||h.getAttribute("data-type")!=="yaml-front-matter"&&dt(r,o,a,h.firstElementChild,h)))return!0}if(Dn(r,a,o,g))return!0;var I=(0,p.E2)(c,"BLOCKQUOTE");if(I&&!o.shiftKey&&o.altKey&&o.key==="Enter"){(0,l.yl)(o)?a.setStartBefore(I):a.setStartAfter(I),(0,x.Hc)(a);var W=document.createElement("p");return W.setAttribute("data-block","0"),W.innerHTML=`
77
+ `,a.insertNode(W),a.collapse(!0),(0,x.Hc)(a),Se(r),He(r),o.preventDefault(),!0}var T,R=(0,_.W)(c);if(R){if(R.tagName==="H6"&&c.textContent.length===a.startOffset&&!(0,l.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"){var B=document.createElement("p");return B.textContent=`
78
+ `,B.setAttribute("data-block","0"),c.parentElement.insertAdjacentElement("afterend",B),a.setStart(B,0),(0,x.Hc)(a),Se(r),He(r),o.preventDefault(),!0}var O;if(U("⌘=",o))return(O=parseInt(R.tagName.substr(1),10)-1)>0&&(Tt(r,"h"+O),Se(r)),o.preventDefault(),!0;if(U("⌘-",o))return(O=parseInt(R.tagName.substr(1),10)+1)<7&&(Tt(r,"h"+O),Se(r)),o.preventDefault(),!0;o.key!=="Backspace"||(0,l.yl)(o)||o.shiftKey||o.altKey||R.textContent.length!==1||qt(r)}if(On(r,a,o))return!0;if(o.altKey&&o.key==="Enter"&&!(0,l.yl)(o)&&!o.shiftKey){var V=(0,p.lG)(c,"A"),P=(0,p.a1)(c,"data-type","link-ref"),H=(0,p.a1)(c,"data-type","footnotes-ref");if(V||P||H||R&&R.tagName.length===2){var G=r.wysiwyg.popover.querySelector("input");G.focus(),G.select()}}if(Re(r,o))return!0;if(U("⇧⌘U",o)&&(T=r.wysiwyg.popover.querySelector('[data-type="up"]'))||U("⇧⌘D",o)&&(T=r.wysiwyg.popover.querySelector('[data-type="down"]')))return T.click(),o.preventDefault(),!0;if(Qt(r,a,o))return!0;if(!(0,l.yl)(o)&&o.shiftKey&&!o.altKey&&o.key==="Enter"&&c.parentElement.tagName!=="LI"&&c.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(c.parentElement.tagName)?a.insertNode(document.createTextNode(`
79
+ `+b.g.ZWSP)):a.insertNode(document.createTextNode(`
80
+ `)),a.collapse(!1),(0,x.Hc)(a),Se(r),He(r),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,l.yl)(o)&&!o.shiftKey&&!o.altKey&&a.toString()===""){if(In(r,a,o,g))return!0;if(v){if(v.previousElementSibling&&v.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&v.previousElementSibling.getAttribute("data-block")==="0"&&v.tagName!=="UL"&&v.tagName!=="OL"){var ee=(0,x.im)(v,r.wysiwyg.element,a).start;if(ee===0&&a.startOffset===0||ee===1&&v.innerText.startsWith(b.g.ZWSP))return vt(v.previousElementSibling.lastElementChild,r,!1),v.innerHTML.trim().replace(b.g.ZWSP,"")===""&&(v.remove(),Se(r)),o.preventDefault(),!0}var X=a.startOffset;if(a.toString()===""&&c.nodeType===3&&c.textContent.charAt(X-2)===`
81
+ `&&c.textContent.charAt(X-1)!==b.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(c.parentElement.tagName))return c.textContent=c.textContent.substring(0,X-1)+b.g.ZWSP,a.setStart(c,X),a.collapse(!0),Se(r),o.preventDefault(),!0;c.textContent===b.g.ZWSP&&a.startOffset===1&&!c.previousSibling&&function(Q){for(var F=Q.startContainer.nextSibling;F&&F.textContent==="";)F=F.nextSibling;return!(!F||F.nodeType===3||F.tagName!=="CODE"&&F.getAttribute("data-type")!=="math-inline"&&F.getAttribute("data-type")!=="html-entity"&&F.getAttribute("data-type")!=="html-inline")}(a)&&(c.textContent=""),v.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(Q){Q.firstElementChild.style.display="inline",Q.lastElementChild.style.display="none"}),v.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(Q){Q.firstElementChild.style.display="inline",Q.lastElementChild.style.display="none"})}}if((0,l.vU)()&&a.startOffset===1&&c.textContent.indexOf(b.g.ZWSP)>-1&&c.previousSibling&&c.previousSibling.nodeType!==3&&c.previousSibling.tagName==="CODE"&&(o.key==="Backspace"||o.key==="ArrowLeft"))return a.selectNodeContents(c.previousSibling),a.collapse(!1),o.preventDefault(),!0;if(Rn(o,v,a))return o.preventDefault(),!0;if(kn(a,o.key),o.key==="ArrowDown"){var $=c.nextSibling;$&&$.nodeType!==3&&$.getAttribute("data-type")==="math-inline"&&a.setStartAfter($)}return!(!v||!K(v,r,o,a)||(o.preventDefault(),0))}(e,n))return}else if(e.currentMode==="ir"&&function(r,o){if(r.ir.composingLock=o.isComposing,o.isComposing)return!1;o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o);var a=(0,x.zh)(r),c=a.startContainer;if(!wn(o,r,c)||(En(a,r,o),jn(a),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,l.yl)(o)&&o.key!=="Escape"&&o.key!=="Delete"))return!1;var v=(0,p.a1)(c,"data-newline","1");if(!(0,l.yl)(o)&&!o.altKey&&!o.shiftKey&&o.key==="Enter"&&v&&a.startOffset<v.textContent.length){var g=v.previousElementSibling;g&&(a.insertNode(document.createTextNode(g.textContent)),a.collapse(!1));var h=v.nextSibling;h&&(a.insertNode(document.createTextNode(h.textContent)),a.collapse(!0))}var A=(0,p.lG)(c,"P");if(Cn(o,r,A,a)||Tn(a,r,A,o)||Dn(r,a,o,A))return!0;var I=(0,p.fb)(c,"vditor-ir__marker--pre");if(I&&I.tagName==="PRE"){var W=I.firstChild;if(Nn(r,o,I,a)||(W.getAttribute("data-type")==="math-block"||W.getAttribute("data-type")==="html-block")&&dt(r,o,a,W,I.parentElement)||bt(r,o,a,W,I.parentElement))return!0}var T=(0,p.a1)(c,"data-type","code-block-info");if(T){if(o.key==="Enter"||o.key==="Tab")return a.selectNodeContents(T.nextElementSibling.firstChild),a.collapse(!0),o.preventDefault(),y(r,["hint"]),!0;if(o.key==="Backspace"){var R=(0,x.im)(T,r.ir.element).start;R===1&&a.setStart(c,0),R===2&&(r.hint.recentLanguage="")}if(dt(r,o,a,T,T.parentElement))return y(r,["hint"]),!0}var B=(0,p.lG)(c,"TD")||(0,p.lG)(c,"TH");if(o.key.indexOf("Arrow")>-1&&B){var O=wr(B);if(O&&dt(r,o,a,B,O))return!0;var V=Er(B);if(V&&bt(r,o,a,B,V))return!0}if(Hn(r,o,a)||On(r,a,o)||Qt(r,a,o))return!0;var P=(0,_.W)(c);if(P){var H;if(U("⌘=",o))return(H=P.querySelector(".vditor-ir__marker--heading"))&&H.textContent.trim().length>1&&wt(r,H.textContent.substr(1)),o.preventDefault(),!0;if(U("⌘-",o))return(H=P.querySelector(".vditor-ir__marker--heading"))&&H.textContent.trim().length<6&&wt(r,H.textContent.trim()+"# "),o.preventDefault(),!0}var G=(0,p.F9)(c);if(o.key==="Backspace"&&!(0,l.yl)(o)&&!o.shiftKey&&!o.altKey&&a.toString()===""){if(In(r,a,o,A))return!0;if(G&&G.previousElementSibling&&G.tagName!=="UL"&&G.tagName!=="OL"&&(G.previousElementSibling.getAttribute("data-type")==="code-block"||G.previousElementSibling.getAttribute("data-type")==="math-block")){var ee=(0,x.im)(G,r.ir.element,a).start;if(ee===0||ee===1&&G.innerText.startsWith(b.g.ZWSP))return a.selectNodeContents(G.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),a.collapse(!1),j(a,r),G.textContent.trim().replace(b.g.ZWSP,"")===""&&(G.remove(),Xe(r)),o.preventDefault(),!0}if(P){var X=P.firstElementChild.textContent.length;(0,x.im)(P,r.ir.element).start===X&&(a.setStart(P.firstElementChild.firstChild,X-1),a.collapse(!0),(0,x.Hc)(a))}}return!((o.key!=="ArrowUp"&&o.key!=="ArrowDown"||!G||(G.querySelectorAll(".vditor-ir__node").forEach(function($){$.contains(c)||$.classList.add("vditor-ir__node--hidden")}),!Rn(o,G,a)))&&(kn(a,o.key),!G||!K(G,r,o,a)||(o.preventDefault(),0)))}(e,n))return;if(e.options.ctrlEnter&&U("⌘Enter",n))return e.options.ctrlEnter(m(e)),void n.preventDefault();if(U("⌘Z",n)&&!e.toolbar.elements.undo)return e.undo.undo(e),void n.preventDefault();if(U("⌘Y",n)&&!e.toolbar.elements.redo)return e.undo.redo(e),void n.preventDefault();if(n.key==="Escape")return e.hint.element.style.display==="block"?e.hint.element.style.display="none":e.options.esc&&!n.isComposing&&e.options.esc(m(e)),void n.preventDefault();if((0,l.yl)(n)&&n.altKey&&!n.shiftKey&&/^Digit[1-6]$/.test(n.code)){if(e.currentMode==="wysiwyg"){var i=n.code.replace("Digit","H");(0,p.lG)(getSelection().getRangeAt(0).startContainer,i)?qt(e):Tt(e,i),Se(e)}else e.currentMode==="sv"?gn(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" "):e.currentMode==="ir"&&wt(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" ");return n.preventDefault(),!0}if((0,l.yl)(n)&&n.altKey&&!n.shiftKey&&/^Digit[7-9]$/.test(n.code))return n.code==="Digit7"?rt(e,"wysiwyg",n):n.code==="Digit8"?rt(e,"ir",n):n.code==="Digit9"&&rt(e,"sv",n),!0;e.options.toolbar.find(function(r){return!r.hotkey||r.toolbar?!!r.toolbar&&!!r.toolbar.find(function(o){return!!o.hotkey&&(U(o.hotkey,n)?(e.toolbar.elements[o.name].children[0].dispatchEvent(new CustomEvent((0,l.Le)())),n.preventDefault(),!0):void 0)}):U(r.hotkey,n)?(e.toolbar.elements[r.name].children[0].dispatchEvent(new CustomEvent((0,l.Le)())),n.preventDefault(),!0):void 0})}})},Gt=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var i=yt(e[e.currentMode].element);i.trim()?(e.currentMode==="wysiwyg"&&e.options.comment.enable&&((0,p.a1)(n.target,"data-type","footnotes-block")||(0,p.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(i)):e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.wysiwyg.hideComment()})}})},hn=function(e,t){var n=(0,x.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var i=(0,p.a1)(n.startContainer,"data-block","0");i||(i=e.sv.element);var r=e.lute.SpinVditorSVDOM(i.textContent);r="<div data-block='0'>"+r.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
82
+ </span></span><span data-type="newline"><br /><span style="display: none">
83
+ </span></span></div><div data-block="0"><`)+"</div>",i.isEqualNode(e.sv.element)?i.innerHTML=r:i.outerHTML=r,se(e.sv.element),(0,x.ib)(e.sv.element,n),He(e)},Ct=function(e,t,n){n===void 0&&(n=!0);var i=e;for(i.nodeType===3&&(i=i.parentElement);i;){if(i.getAttribute("data-type")===t)return i;i=n?i.previousElementSibling:i.nextElementSibling}return!1},vn=function(e,t){return N("SpinVditorSVDOM",e,"argument",t.options.debugger),e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
84
+ </span></span><span data-type="newline"><br /><span style="display: none">
85
+ </span></span></div><div data-block="0"><`)+"</div>",N("SpinVditorSVDOM",e,"result",t.options.debugger),e},pr=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,i=t&&t!=="text"&&t!=="table"&&t!=="heading-marker"&&t!=="newline"&&t!=="yaml-front-matter-open-marker"&&t!=="yaml-front-matter-close-marker"&&t!=="code-block-info"&&t!=="code-block-close-marker"&&t!=="code-block-open-marker"?e.textContent:"",r=!1;for(t==="newline"&&(r=!0);n&&!r;){var o=n.getAttribute("data-type");if(o==="li-marker"||o==="blockquote-marker"||o==="task-marker"||o==="padding"){var a=n.textContent;if(o!=="li-marker"||t!=="code-block-open-marker"&&t!=="code-block-info")if(t==="code-block-close-marker"&&n.nextElementSibling.isSameNode(e)){var c=Ct(e,"code-block-open-marker");c&&c.previousElementSibling&&(n=c.previousElementSibling,i=a+i)}else i=a+i;else i=a.replace(/\S/g," ")+i}else o==="newline"&&(r=!0);n=n.previousElementSibling}return i},Oe=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=m(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,l.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},gn=function(e,t){var n=(0,x.zh)(e),i=(0,_.S)(n.startContainer,"SPAN");i&&i.textContent.trim()!==""&&(t=`
86
+ `+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},mr=function(e,t,n,i){var r=(0,x.zh)(e),o=t.getAttribute("data-type");e.sv.element.childNodes.length===0&&(e.sv.element.innerHTML=`<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">
87
+ </span></span>`,(0,x.ib)(e.sv.element,r));var a=(0,p.F9)(r.startContainer),c=(0,_.S)(r.startContainer,"SPAN");if(a){if(o==="link"){var v=void 0;return v=r.toString()===""?""+n+Lute.Caret+i:""+n+r.toString()+i.replace(")",Lute.Caret+")"),void document.execCommand("insertHTML",!1,v)}if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"||o==="line")return v=void 0,v=r.toString()===""?""+n+Lute.Caret+(o==="code"?"":i):""+n+r.toString()+Lute.Caret+(o==="code"?"":i),o==="table"||o==="code"&&c&&c.textContent!==""?v=`
88
+
89
+ `+v:o==="line"&&(v=`
90
+
91
+ `+n+`
92
+ `+Lute.Caret),void document.execCommand("insertHTML",!1,v);if((o==="check"||o==="list"||o==="ordered-list"||o==="quote")&&c){var g="* ";o==="check"?g="* [ ] ":o==="ordered-list"?g="1. ":o==="quote"&&(g="> ");var h=Ct(c,"newline");return h?h.insertAdjacentText("afterend",g):a.insertAdjacentText("afterbegin",g),void oe(e)}(0,x.ib)(e.sv.element,r),Oe(e)}},yn=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},bn=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},fr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(g){try{v(i.next(g))}catch(h){o(h)}}function c(g){try{v(i.throw(g))}catch(h){o(h)}}function v(g){var h;g.done?r(g.value):(h=g.value,h instanceof n?h:new n(function(A){A(h)})).then(a,c)}v((i=i.apply(e,[])).next())})},hr=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(v){return function(g){return function(h){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&h[0]?i.return:h[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,h[1])).done)return r;switch(i=0,r&&(h=[2&h[0],r.value]),h[0]){case 0:case 1:r=h;break;case 4:return a.label++,{value:h[1],done:!1};case 5:a.label++,i=h[1],h=[0];continue;case 7:h=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||h[0]!==6&&h[0]!==2)){a=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){a.label=h[1];break}if(h[0]===6&&a.label<r[1]){a.label=r[1],r=h;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(h);break}r[2]&&a.ops.pop(),a.trys.pop();continue}h=t.call(e,a)}catch(A){h=[6,A],i=0}finally{n=r=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([v,g])}}},vr=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},Zt=function(e,t,n){return fr(void 0,void 0,void 0,function(){var i,r,o,a,c,v,g,h,A,I,W,T,R,B;return hr(this,function(O){switch(O.label){case 0:for(i=[],r=e.options.upload.multiple===!0?t.length:1,T=0;T<r;T++)(o=t[T])instanceof DataTransferItem&&(o=o.getAsFile()),i.push(o);return e.options.upload.handler?[4,e.options.upload.handler(i)]:[3,2];case 1:return a=O.sent(),n&&(n.value=""),typeof a=="string"?(e.tip.show(a),[2]):[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(i)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:i=O.sent(),O.label=4;case 4:if(e.options.upload.validate&&typeof(a=e.options.upload.validate(i))=="string")return e.tip.show(a),[2];if(c=yn(e),e.upload.range=(0,x.zh)(e),v=function(V,P){V.tip.hide();for(var H=[],G="",ee="",X=(V.options.lang,V.options,function(F,re){var ke=P[re],Ce=!0;ke.name||(G+="<li>"+window.VditorI18n.nameEmpty+"</li>",Ce=!1),ke.size>V.options.upload.max&&(G+="<li>"+ke.name+" "+window.VditorI18n.over+" "+V.options.upload.max/1024/1024+"M</li>",Ce=!1);var Ye=ke.name.lastIndexOf("."),Pe=ke.name.substr(Ye),qe=V.options.upload.filename(ke.name.substr(0,Ye))+Pe;V.options.upload.accept&&(V.options.upload.accept.split(",").some(function(Ne){var ct=Ne.trim();if(ct.indexOf(".")===0){if(Pe.toLowerCase()===ct.toLowerCase())return!0}else if(ke.type.split("/")[0]===ct.split("/")[0])return!0;return!1})||(G+="<li>"+ke.name+" "+window.VditorI18n.fileTypeError+"</li>",Ce=!1)),Ce&&(H.push(ke),ee+="<li>"+qe+" "+window.VditorI18n.uploading+"</li>")}),$=P.length,Q=0;Q<$;Q++)X(0,Q);return V.tip.show("<ul>"+G+ee+"</ul>"),H}(e,i),v.length===0)return n&&(n.value=""),[2];for(g=new FormData,h=e.options.upload.extraData,A=0,I=Object.keys(h);A<I.length;A++)W=I[A],g.append(W,h[W]);for(T=0,R=v.length;T<R;T++)g.append(e.options.upload.fieldName,v[T]);return(B=new XMLHttpRequest).open("POST",e.options.upload.url),e.options.upload.token&&B.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(B.withCredentials=!0),bn(e,B),e.upload.isUploading=!0,c.setAttribute("contenteditable","false"),B.onreadystatechange=function(){if(B.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,c.setAttribute("contenteditable","true"),B.status>=200&&B.status<300)if(e.options.upload.success)e.options.upload.success(c,B.responseText);else{var V=B.responseText;e.options.upload.format&&(V=e.options.upload.format(t,B.responseText)),function(P,H){yn(H).focus();var G=JSON.parse(P),ee="";G.code===1&&(ee=""+G.msg),G.data.errFiles&&G.data.errFiles.length>0&&(ee="<ul><li>"+ee+"</li>",G.data.errFiles.forEach(function($){var Q=$.lastIndexOf("."),F=H.options.upload.filename($.substr(0,Q))+$.substr(Q);ee+="<li>"+F+" "+window.VditorI18n.uploadError+"</li>"}),ee+="</ul>"),ee?H.tip.show(ee):H.tip.hide();var X="";Object.keys(G.data.succMap).forEach(function($){var Q=G.data.succMap[$],F=$.lastIndexOf("."),re=$.substr(F),ke=H.options.upload.filename($.substr(0,F))+re;(re=re.toLowerCase()).indexOf(".wav")===0||re.indexOf(".mp3")===0||re.indexOf(".ogg")===0?H.currentMode==="wysiwyg"?X+=`<div class="vditor-wysiwyg__block" data-type="html-block"
93
+ data-block="0"><pre><code>&lt;audio controls="controls" src="`+Q+'"&gt;&lt;/audio&gt;</code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="'+Q+`"></audio></pre></div>
94
+ `:H.currentMode==="ir"?X+='<audio controls="controls" src="'+Q+`"></audio>
95
+ `:X+="["+ke+"]("+Q+`)
96
+ `:re.indexOf(".apng")===0||re.indexOf(".bmp")===0||re.indexOf(".gif")===0||re.indexOf(".ico")===0||re.indexOf(".cur")===0||re.indexOf(".jpg")===0||re.indexOf(".jpeg")===0||re.indexOf(".jfif")===0||re.indexOf(".pjp")===0||re.indexOf(".pjpeg")===0||re.indexOf(".png")===0||re.indexOf(".svg")===0||re.indexOf(".webp")===0?H.currentMode==="wysiwyg"?X+='<img alt="'+ke+'" src="'+Q+`">
97
+ `:X+="!["+ke+"]("+Q+`)
98
+ `:H.currentMode==="wysiwyg"?X+='<a href="'+Q+'">'+ke+`</a>
99
+ `:X+="["+ke+"]("+Q+`)
100
+ `}),(0,x.Hc)(H.upload.range),document.execCommand("insertHTML",!1,X),H.upload.range=getSelection().getRangeAt(0).cloneRange()}(V,e)}else e.options.upload.error?e.options.upload.error(B.responseText):e.tip.show(B.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},B.upload.onprogress=function(V){if(V.lengthComputable){var P=V.loaded/V.total*100;e.upload.element.style.display="block",e.upload.element.style.width=P+"%"}},B.send(g),[2]}})})},Mt=function(e,t,n){var i,r=(0,p.F9)(t.startContainer);if(r||(r=e.wysiwyg.element),n&&n.inputType!=="formatItalic"&&n.inputType!=="deleteByDrag"&&n.inputType!=="insertFromDrop"&&n.inputType!=="formatBold"&&n.inputType!=="formatRemove"&&n.inputType!=="formatStrikeThrough"&&n.inputType!=="insertUnorderedList"&&n.inputType!=="insertOrderedList"&&n.inputType!=="formatOutdent"&&n.inputType!=="formatIndent"&&n.inputType!==""||!n){var o=function(P){for(var H=P.previousSibling;H;){if(H.nodeType!==3&&H.tagName==="A"&&!H.previousSibling&&H.innerHTML.replace(b.g.ZWSP,"")===""&&H.nextSibling)return H;H=H.previousSibling}return!1}(t.startContainer);o&&o.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(P){P.remove()}),t.insertNode(document.createElement("wbr")),r.querySelectorAll("[style]").forEach(function(P){P.removeAttribute("style")}),r.querySelectorAll(".vditor-comment").forEach(function(P){P.textContent.trim()===""&&(P.classList.remove("vditor-comment","vditor-comment--focus"),P.removeAttribute("data-cmtids"))}),(i=r.previousElementSibling)===null||i===void 0||i.querySelectorAll(".vditor-comment").forEach(function(P){P.textContent.trim()===""&&(P.classList.remove("vditor-comment","vditor-comment--focus"),P.removeAttribute("data-cmtids"))});var a="";r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.wysiwyg.element);var c,v=r.isEqualNode(e.wysiwyg.element),g=(0,p.a1)(r,"data-type","footnotes-block");if(v)a=r.innerHTML;else{var h=(0,p.O9)(t.startContainer);if(h&&!g){var A=(0,_.S)(t.startContainer,"BLOCKQUOTE");r=A?(0,p.F9)(t.startContainer)||r:h}if(g&&(r=g),a=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var I=r.previousElementSibling,W=r.nextElementSibling;!I||I.tagName!=="UL"&&I.tagName!=="OL"||(a=I.outerHTML+a,I.remove()),!W||W.tagName!=="UL"&&W.tagName!=="OL"||(a+=W.outerHTML,W.remove()),a=a.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}r.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(P){P&&!r.isEqualNode(P)&&(a+=P.outerHTML,P.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(P){P&&!r.isEqualNode(P)&&(a+=P.outerHTML,P.remove())}))}if((a=a.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""))==='<p data-block="0">```<wbr></p>'&&e.hint.recentLanguage&&(a='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),N("SpinVditorDOM",a,"argument",e.options.debugger),a=e.lute.SpinVditorDOM(a),N("SpinVditorDOM",a,"result",e.options.debugger),v)r.innerHTML=a;else if(r.outerHTML=a,g){var T=(0,p.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(T){var R=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+T.getAttribute("data-marker")+'"]');R&&R.setAttribute("aria-label",T.textContent.trim().substr(0,24))}}var B,O=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");O.forEach(function(P,H){H===0?c=P:(c.insertAdjacentHTML("beforeend",P.innerHTML),P.remove())}),O.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",O[0]);var V=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");V.forEach(function(P,H){H===0?B=P:(B.insertAdjacentHTML("beforeend",P.innerHTML),P.remove())}),V.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",V[0]),(0,x.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(P){xe(P,e)}),n&&(n.inputType==="deleteContentBackward"||n.inputType==="deleteContentForward")&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}Fe(e),Se(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},gr=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},yr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(g){try{v(i.next(g))}catch(h){o(h)}}function c(g){try{v(i.throw(g))}catch(h){o(h)}}function v(g){var h;g.done?r(g.value):(h=g.value,h instanceof n?h:new n(function(A){A(h)})).then(a,c)}v((i=i.apply(e,[])).next())})},br=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(v){return function(g){return function(h){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&h[0]?i.return:h[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,h[1])).done)return r;switch(i=0,r&&(h=[2&h[0],r.value]),h[0]){case 0:case 1:r=h;break;case 4:return a.label++,{value:h[1],done:!1};case 5:a.label++,i=h[1],h=[0];continue;case 7:h=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||h[0]!==6&&h[0]!==2)){a=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){a.label=h[1];break}if(h[0]===6&&a.label<r[1]){a.label=r[1],r=h;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(h);break}r[2]&&a.ops.pop(),a.trys.pop();continue}h=t.call(e,a)}catch(A){h=[6,A],i=0}finally{n=r=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([v,g])}}},wn=function(e,t,n){if(e.keyCode===229&&e.code===""&&e.key==="Unidentified"&&t.currentMode!=="sv"){var i=(0,p.F9)(n);if(i&&i.textContent.trim()==="")return t[t.currentMode].composingLock=!0,!1}return!0},En=function(e,t,n){if(!(n.key==="Enter"||n.key==="Tab"||n.key==="Backspace"||n.key.indexOf("Arrow")>-1||(0,l.yl)(n)||n.key==="Escape"||n.shiftKey||n.altKey)){var i=(0,p.lG)(e.startContainer,"P")||(0,p.lG)(e.startContainer,"LI");if(i&&(0,x.im)(i,t[t.currentMode].element,e).start===0){i.nodeValue&&(i.nodeValue=i.nodeValue.replace(/\u2006/g,""));var r=document.createTextNode(b.g.ZWSP);e.insertNode(r),e.setStartAfter(r)}}},kn=function(e,t){if(t==="ArrowDown"||t==="ArrowUp"){var n=(0,p.a1)(e.startContainer,"data-type","math-inline")||(0,p.a1)(e.startContainer,"data-type","html-entity")||(0,p.a1)(e.startContainer,"data-type","html-inline");n&&(t==="ArrowDown"&&e.setStartAfter(n.parentElement),t==="ArrowUp"&&e.setStartBefore(n.parentElement))}},xt=function(e,t){var n=(0,x.zh)(e),i=(0,p.F9)(n.startContainer);i&&(i.insertAdjacentHTML(t,'<p data-block="0">'+b.g.ZWSP+`<wbr>
101
+ </p>`),(0,x.ib)(e[e.currentMode].element,n),st(e),le(e))},wr=function(e){var t=(0,p.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},Er=function(e){var t=(0,p.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},Sn=function(e,t,n){n===void 0&&(n=!0);var i=e.previousElementSibling;return i||(i=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:e.parentElement.parentElement.tagName==="TBODY"&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),i&&(t.selectNodeContents(i),n||t.collapse(!1),(0,x.Hc)(t)),i},bt=function(e,t,n,i,r){var o=(0,x.im)(i,e[e.currentMode].element,n);if(t.key==="ArrowDown"&&i.textContent.trimRight().substr(o.start).indexOf(`
102
+ `)===-1||t.key==="ArrowRight"&&o.start>=i.textContent.trimRight().length){var a=r.nextElementSibling;return!a||a&&(a.tagName==="TABLE"||a.getAttribute("data-type"))?(r.insertAdjacentHTML("afterend",'<p data-block="0">'+b.g.ZWSP+"<wbr></p>"),(0,x.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!0),(0,x.Hc)(n)),t.preventDefault(),!0}return!1},dt=function(e,t,n,i,r){var o=(0,x.im)(i,e[e.currentMode].element,n);if(t.key==="ArrowUp"&&i.textContent.substr(0,o.start).indexOf(`
103
+ `)===-1||(t.key==="ArrowLeft"||t.key==="Backspace"&&n.toString()==="")&&o.start===0){var a=r.previousElementSibling;return!a||a&&(a.tagName==="TABLE"||a.getAttribute("data-type"))?(r.insertAdjacentHTML("beforebegin",'<p data-block="0">'+b.g.ZWSP+"<wbr></p>"),(0,x.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!1),(0,x.Hc)(n)),t.preventDefault(),!0}return!1},At=function(e,t,n,i){i===void 0&&(i=!0);var r=(0,p.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(h){h.remove()}),t.insertNode(document.createElement("wbr")),i&&r){for(var o="",a=0;a<r.parentElement.childElementCount;a++){var c=r.parentElement.children[a].querySelector("input");c&&c.remove(),o+='<p data-block="0">'+r.parentElement.children[a].innerHTML.trimLeft()+"</p>"}r.parentElement.insertAdjacentHTML("beforebegin",o),r.parentElement.remove()}else if(r)if(n==="check")r.parentElement.querySelectorAll("li").forEach(function(h){h.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'+(h.textContent.indexOf(" ")===0?"":" ")),h.classList.add("vditor-task")});else{r.querySelector("input")&&r.parentElement.querySelectorAll("li").forEach(function(h){h.querySelector("input").remove(),h.classList.remove("vditor-task")});var v=void 0;n==="list"?(v=document.createElement("ul")).setAttribute("data-marker","*"):(v=document.createElement("ol")).setAttribute("data-marker","1."),v.setAttribute("data-block","0"),v.setAttribute("data-tight",r.parentElement.getAttribute("data-tight")),v.innerHTML=r.parentElement.innerHTML,r.parentElement.parentNode.replaceChild(v,r.parentElement)}else{var g=(0,p.a1)(t.startContainer,"data-block","0");g||(e[e.currentMode].element.querySelector("wbr").remove(),(g=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),n==="check"?(g.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '+g.innerHTML+"</li></ul>"),g.remove()):n==="list"?(g.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'+g.innerHTML+"</li></ul>"),g.remove()):n==="ordered-list"&&(g.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'+g.innerHTML+"</li></ol>"),g.remove())}},Ln=function(e,t,n){var i=t.previousElementSibling;if(t&&i){var r=[t];Array.from(n.cloneContents().children).forEach(function(v,g){v.nodeType!==3&&t&&v.textContent.trim()!==""&&t.getAttribute("data-node-id")===v.getAttribute("data-node-id")&&(g!==0&&r.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(v){v.remove()}),n.insertNode(document.createElement("wbr"));var o=i.parentElement,a="";r.forEach(function(v){var g=v.getAttribute("data-marker");g.length!==1&&(g="1"+g.slice(-1)),a+='<li data-node-id="'+v.getAttribute("data-node-id")+'" data-marker="'+g+'">'+v.innerHTML+"</li>",v.remove()}),i.insertAdjacentHTML("beforeend","<"+o.tagName+' data-block="0">'+a+"</"+o.tagName+">"),e.currentMode==="wysiwyg"?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):o.outerHTML=e.lute.SpinVditorIRDOM(o.outerHTML),(0,x.ib)(e[e.currentMode].element,n);var c=(0,p.O9)(n.startContainer);c&&c.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(v){xe(v,e),e.currentMode==="wysiwyg"&&v.previousElementSibling.setAttribute("style","display:none")}),le(e),st(e)}else e[e.currentMode].element.focus()},Jt=function(e,t,n,i){var r=(0,p.lG)(t.parentElement,"LI");if(r){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(A){A.remove()}),n.insertNode(document.createElement("wbr"));var o=t.parentElement,a=o.cloneNode(),c=[t];Array.from(n.cloneContents().children).forEach(function(A,I){A.nodeType!==3&&t&&A.textContent.trim()!==""&&t.getAttribute("data-node-id")===A.getAttribute("data-node-id")&&(I!==0&&c.push(t),t=t.nextElementSibling)});var v=!1,g="";o.querySelectorAll("li").forEach(function(A){v&&(g+=A.outerHTML,A.nextElementSibling||A.previousElementSibling?A.remove():A.parentElement.remove()),A.isSameNode(c[c.length-1])&&(v=!0)}),c.reverse().forEach(function(A){r.insertAdjacentElement("afterend",A)}),g&&(a.innerHTML=g,c[0].insertAdjacentElement("beforeend",a)),e.currentMode==="wysiwyg"?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,x.ib)(e[e.currentMode].element,n);var h=(0,p.O9)(n.startContainer);h&&h.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(A){xe(A,e),e.currentMode==="wysiwyg"&&A.previousElementSibling.setAttribute("style","display:none")}),le(e),st(e)}else e[e.currentMode].element.focus()},_t=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,i=e.rows[0].cells.length,r=e.rows.length,o=0,a=0;a<r;a++)for(var c=0;c<i;c++)if(e.rows[a].cells[c].isSameNode(n)){o=c;break}for(var v=0;v<r;v++)e.rows[v].cells[o].setAttribute("align",t)},Xt=function(e){var t=e.trimRight().split(`
104
+ `).pop();return t!==""&&(t.replace(/ |-/g,"")===""||t.replace(/ |_/g,"")===""||t.replace(/ |\*/g,"")==="")&&t.replace(/ /g,"").length>2&&!(t.indexOf("-")>-1&&t.trimLeft().indexOf(" ")===-1&&e.trimRight().split(`
105
+ `).length>1)&&t.indexOf(" ")!==0&&t.indexOf(" ")!==0},Yt=function(e){var t=e.trimRight().split(`
106
+ `);return(e=t.pop()).indexOf(" ")!==0&&e.indexOf(" ")!==0&&(e=e.trimLeft())!==""&&t.length!==0&&(e.replace(/-/g,"")===""||e.replace(/=/g,"")==="")},le=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),e.currentMode==="wysiwyg"?Se(e,t):e.currentMode==="ir"?Xe(e,t):e.currentMode==="sv"&&Oe(e,t)},Tn=function(e,t,n,i){var r,o=e.startContainer,a=(0,p.lG)(o,"LI");if(a){if(!(0,l.yl)(i)&&!i.altKey&&i.key==="Enter"&&!i.shiftKey&&n&&a.contains(n)&&n.nextElementSibling)return a&&!a.textContent.endsWith(`
107
+ `)&&a.insertAdjacentText("beforeend",`
108
+ `),e.insertNode(document.createTextNode(`
109
+
110
+ `)),e.collapse(!1),le(t),i.preventDefault(),!0;if(!((0,l.yl)(i)||i.shiftKey||i.altKey||i.key!=="Backspace"||a.previousElementSibling||e.toString()!==""||(0,x.im)(a,t[t.currentMode].element,e).start!==0))return a.nextElementSibling?(a.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+a.innerHTML+"</p>"),a.remove()):a.parentElement.outerHTML='<p data-block="0"><wbr>'+a.innerHTML+"</p>",(0,x.ib)(t[t.currentMode].element,e),le(t),i.preventDefault(),!0;if(!(0,l.yl)(i)&&!i.shiftKey&&!i.altKey&&i.key==="Backspace"&&a.textContent.trim().replace(b.g.ZWSP,"")===""&&e.toString()===""&&((r=a.previousElementSibling)===null||r===void 0?void 0:r.tagName)==="LI")return a.previousElementSibling.insertAdjacentText("beforeend",`
111
+
112
+ `),e.selectNodeContents(a.previousElementSibling),e.collapse(!1),a.remove(),(0,x.ib)(t[t.currentMode].element,e),le(t),i.preventDefault(),!0;if(!(0,l.yl)(i)&&!i.altKey&&i.key==="Tab"){var c=!1;if((e.startOffset===0&&(o.nodeType===3&&!o.previousSibling||o.nodeType!==3&&o.nodeName==="LI")||a.classList.contains("vditor-task")&&e.startOffset===1&&o.previousSibling.nodeType!==3&&o.previousSibling.tagName==="INPUT")&&(c=!0),c||e.toString()!=="")return i.shiftKey?Jt(t,a,e,a.parentElement):Ln(t,a,e),i.preventDefault(),!0}}return!1},Qt=function(e,t,n){if(e.options.tab&&n.key==="Tab")return n.shiftKey||(t.toString()===""?(t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)):(t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1))),(0,x.Hc)(t),le(e),n.preventDefault(),!0},Cn=function(e,t,n,i){if(n){if(!(0,l.yl)(e)&&!e.altKey&&e.key==="Enter"){var r=String.raw(sn||(sn=gr(["",""],["",""])),n.textContent).replace(/\\\|/g,"").trim(),o=r.split("|");if(r.startsWith("|")&&r.endsWith("|")&&o.length>3){var a=o.map(function(){return"---"}).join("|");return a=n.textContent+`
113
+ `+a.substring(3,a.length-3)+`
114
+ |<wbr>`,n.outerHTML=t.lute.SpinVditorDOM(a),(0,x.ib)(t[t.currentMode].element,i),le(t),He(t),e.preventDefault(),!0}if(Xt(n.innerHTML)&&n.previousElementSibling){var c="",v=n.innerHTML.trimRight().split(`
115
+ `);return v.length>1&&(v.pop(),c='<p data-block="0">'+v.join(`
116
+ `)+"</p>"),n.insertAdjacentHTML("afterend",c+`<hr data-block="0"><p data-block="0"><wbr>
117
+ </p>`),n.remove(),(0,x.ib)(t[t.currentMode].element,i),le(t),He(t),e.preventDefault(),!0}if(Yt(n.innerHTML))return t.currentMode==="wysiwyg"?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+`<p data-block="0"><wbr>
118
+ </p>`):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+`<p data-block="0"><wbr>
119
+ </p>`),(0,x.ib)(t[t.currentMode].element,i),le(t),He(t),e.preventDefault(),!0}if(i.collapsed&&n.previousElementSibling&&e.key==="Backspace"&&!(0,l.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split(`
120
+ `).length>1&&(0,x.im)(n,t[t.currentMode].element,i).start===0){var g=(0,p.DX)(n.previousElementSibling);return g.textContent.endsWith(`
121
+ `)||(g.textContent=g.textContent+`
122
+ `),g.parentElement.insertAdjacentHTML("beforeend","<wbr>"+n.innerHTML),n.remove(),(0,x.ib)(t[t.currentMode].element,i),!1}return!1}},Mn=function(e,t,n){for(var i="",r=0;r<n.parentElement.childElementCount;r++)i+='<td align="'+n.parentElement.children[r].getAttribute("align")+'"> </td>';n.tagName==="TH"?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>"+i+"</tr></tbody>"):n.parentElement.insertAdjacentHTML("afterend","<tr>"+i+"</tr>"),le(e)},xn=function(e,t,n){for(var i="",r=0;r<n.parentElement.childElementCount;r++)n.tagName==="TH"?i+='<th align="'+n.parentElement.children[r].getAttribute("align")+'"> </th>':i+='<td align="'+n.parentElement.children[r].getAttribute("align")+'"> </td>';if(n.tagName==="TH"){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>"+i+"</tr></thead>"),t.insertNode(document.createElement("wbr"));var o=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",o),n.parentElement.parentElement.remove(),(0,x.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>"+i+"</tr>");le(e)},Ht=function(e,t,n,i){i===void 0&&(i="afterend");for(var r=0,o=n.previousElementSibling;o;)r++,o=o.previousElementSibling;for(var a=0;a<t.rows.length;a++)a===0?t.rows[a].cells[r].insertAdjacentHTML(i,"<th> </th>"):t.rows[a].cells[r].insertAdjacentHTML(i,"<td> </td>");le(e)},An=function(e,t,n){if(n.tagName==="TD"){var i=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(i.previousElementSibling.lastElementChild.lastElementChild),i.childElementCount===1?i.remove():n.parentElement.remove(),t.collapse(!1),(0,x.Hc)(t),le(e)}},_n=function(e,t,n,i){for(var r=0,o=i.previousElementSibling;o;)r++,o=o.previousElementSibling;(i.previousElementSibling||i.nextElementSibling)&&(t.selectNodeContents(i.previousElementSibling||i.nextElementSibling),t.collapse(!0));for(var a=0;a<n.rows.length;a++){var c=n.rows[a].cells;if(c.length===1){n.remove(),st(e);break}c[r].remove()}(0,x.Hc)(t),le(e)},Hn=function(e,t,n){var i=n.startContainer,r=(0,p.lG)(i,"TD")||(0,p.lG)(i,"TH");if(r){if(!(0,l.yl)(t)&&!t.altKey&&t.key==="Enter"){r.lastElementChild&&(!r.lastElementChild||r.lastElementChild.isSameNode(r.lastChild)&&r.lastElementChild.tagName==="BR")||r.insertAdjacentHTML("beforeend","<br>");var o=document.createElement("br");return n.insertNode(o),n.setStartAfter(o),le(e),He(e),t.preventDefault(),!0}if(t.key==="Tab")return t.shiftKey?(Sn(r,n),t.preventDefault(),!0):((h=r.nextElementSibling)||(h=r.parentElement.nextElementSibling?r.parentElement.nextElementSibling.firstElementChild:r.parentElement.parentElement.tagName==="THEAD"&&r.parentElement.parentElement.nextElementSibling?r.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),h&&(n.selectNodeContents(h),(0,x.Hc)(n)),t.preventDefault(),!0);var a=r.parentElement.parentElement.parentElement;if(t.key==="ArrowUp"){if(t.preventDefault(),r.tagName==="TH")return a.previousElementSibling?(n.selectNodeContents(a.previousElementSibling),n.collapse(!1),(0,x.Hc)(n)):xt(e,"beforebegin"),!0;for(var c=0,v=r.parentElement;c<v.cells.length&&!v.cells[c].isSameNode(r);c++);var g=v.previousElementSibling;return g||(g=v.parentElement.previousElementSibling.firstChild),n.selectNodeContents(g.cells[c]),n.collapse(!1),(0,x.Hc)(n),!0}if(t.key==="ArrowDown"){var h;if(t.preventDefault(),!(v=r.parentElement).nextElementSibling&&r.tagName==="TD")return a.nextElementSibling?(n.selectNodeContents(a.nextElementSibling),n.collapse(!0),(0,x.Hc)(n)):xt(e,"afterend"),!0;for(c=0;c<v.cells.length&&!v.cells[c].isSameNode(r);c++);return(h=v.nextElementSibling)||(h=v.parentElement.nextElementSibling.firstChild),n.selectNodeContents(h.cells[c]),n.collapse(!0),(0,x.Hc)(n),!0}if(e.currentMode==="wysiwyg"&&!(0,l.yl)(t)&&t.key==="Enter"&&!t.shiftKey&&t.altKey){var A=e.wysiwyg.popover.querySelector(".vditor-input");return A.focus(),A.select(),t.preventDefault(),!0}if(!(0,l.yl)(t)&&!t.shiftKey&&!t.altKey&&t.key==="Backspace"&&n.startOffset===0&&n.toString()==="")return!Sn(r,n,!1)&&a&&(a.textContent.trim()===""?(a.outerHTML=`<p data-block="0"><wbr>
123
+ </p>`,(0,x.ib)(e[e.currentMode].element,n)):(n.setStartBefore(a),n.collapse(!0)),le(e)),t.preventDefault(),!0;if(U("⇧⌘F",t))return xn(e,n,r),t.preventDefault(),!0;if(U("⌘=",t))return Mn(e,n,r),t.preventDefault(),!0;if(U("⇧⌘G",t))return Ht(e,a,r,"beforebegin"),t.preventDefault(),!0;if(U("⇧⌘=",t))return Ht(e,a,r),t.preventDefault(),!0;if(U("⌘-",t))return An(e,n,r),t.preventDefault(),!0;if(U("⇧⌘-",t))return _n(e,n,a,r),t.preventDefault(),!0;if(U("⇧⌘L",t)){if(e.currentMode==="ir")return _t(a,"left"),le(e),t.preventDefault(),!0;if(I=e.wysiwyg.popover.querySelector('[data-type="left"]'))return I.click(),t.preventDefault(),!0}if(U("⇧⌘C",t)){if(e.currentMode==="ir")return _t(a,"center"),le(e),t.preventDefault(),!0;if(I=e.wysiwyg.popover.querySelector('[data-type="center"]'))return I.click(),t.preventDefault(),!0}if(U("⇧⌘R",t)){if(e.currentMode==="ir")return _t(a,"right"),le(e),t.preventDefault(),!0;var I;if(I=e.wysiwyg.popover.querySelector('[data-type="right"]'))return I.click(),t.preventDefault(),!0}}return!1},Nn=function(e,t,n,i){if(n.tagName==="PRE"&&U("⌘A",t))return i.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&t.key==="Tab"&&!t.shiftKey&&i.toString()==="")return i.insertNode(document.createTextNode(e.options.tab)),i.collapse(!1),le(e),t.preventDefault(),!0;if(t.key==="Backspace"&&!(0,l.yl)(t)&&!t.shiftKey&&!t.altKey){var r=(0,x.im)(n,e[e.currentMode].element,i);if((r.start===0||r.start===1&&n.innerText===`
124
+ `)&&i.toString()==="")return n.parentElement.outerHTML='<p data-block="0"><wbr>'+n.firstElementChild.innerHTML+"</p>",(0,x.ib)(e[e.currentMode].element,i),le(e),t.preventDefault(),!0}return!(0,l.yl)(t)&&!t.altKey&&t.key==="Enter"&&(n.firstElementChild.textContent.endsWith(`
125
+ `)||n.firstElementChild.insertAdjacentText("beforeend",`
126
+ `),i.extractContents(),i.insertNode(document.createTextNode(`
127
+ `)),i.collapse(!1),(0,x.Hc)(i),(0,l.vU)()||(e.currentMode==="wysiwyg"?Mt(e,i):Ee(e,i)),He(e),t.preventDefault(),!0)},Dn=function(e,t,n,i){var r=t.startContainer,o=(0,p.lG)(r,"BLOCKQUOTE");if(o&&t.toString()===""){if(n.key==="Backspace"&&!(0,l.yl)(n)&&!n.shiftKey&&!n.altKey&&(0,x.im)(o,e[e.currentMode].element,t).start===0)return t.insertNode(document.createElement("wbr")),o.outerHTML=o.innerHTML,(0,x.ib)(e[e.currentMode].element,t),le(e),n.preventDefault(),!0;if(i&&n.key==="Enter"&&!(0,l.yl)(n)&&!n.shiftKey&&!n.altKey&&i.parentElement.tagName==="BLOCKQUOTE"){var a=!1;if(i.innerHTML.replace(b.g.ZWSP,"")===`
128
+ `||i.innerHTML.replace(b.g.ZWSP,"")===""?(a=!0,i.remove()):i.innerHTML.endsWith(`
129
+
130
+ `)&&(0,x.im)(i,e[e.currentMode].element,t).start===i.textContent.length-1&&(i.innerHTML=i.innerHTML.substr(0,i.innerHTML.length-2),a=!0),a)return o.insertAdjacentHTML("afterend",'<p data-block="0">'+b.g.ZWSP+`<wbr>
131
+ </p>`),(0,x.ib)(e[e.currentMode].element,t),le(e),n.preventDefault(),!0}var c=(0,p.F9)(r);if(e.currentMode==="wysiwyg"&&c&&U("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),c.outerHTML='<blockquote data-block="0">'+c.outerHTML+"</blockquote>",(0,x.ib)(e.wysiwyg.element,t),Se(e),n.preventDefault(),!0;if(bt(e,n,t,o,o)||dt(e,n,t,o,o))return!0}return!1},On=function(e,t,n){var i=t.startContainer,r=(0,p.fb)(i,"vditor-task");if(r){if(U("⇧⌘J",n)){var o=r.firstElementChild;return o.checked?o.removeAttribute("checked"):o.setAttribute("checked","checked"),le(e),n.preventDefault(),!0}if(n.key==="Backspace"&&!(0,l.yl)(n)&&!n.shiftKey&&!n.altKey&&t.toString()===""&&t.startOffset===1&&(i.nodeType===3&&i.previousSibling&&i.previousSibling.tagName==="INPUT"||i.nodeType!==3)){var a=r.previousElementSibling;return r.querySelector("input").remove(),a?((0,p.DX)(a).parentElement.insertAdjacentHTML("beforeend","<wbr>"+r.innerHTML.trim()),r.remove()):(r.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+(r.innerHTML.trim()||`
132
+ `)+"</p>"),r.nextElementSibling?r.remove():r.parentElement.remove()),(0,x.ib)(e[e.currentMode].element,t),le(e),n.preventDefault(),!0}if(n.key==="Enter"&&!(0,l.yl)(n)&&!n.shiftKey&&!n.altKey){if(r.textContent.trim()==="")if((0,p.fb)(r.parentElement,"vditor-task")){var c=(0,p.O9)(i);c&&Jt(e,r,t,c)}else if(r.nextElementSibling){var v="",g="",h=!1;Array.from(r.parentElement.children).forEach(function(T){r.isSameNode(T)?h=!0:h?v+=T.outerHTML:g+=T.outerHTML});var A=r.parentElement.tagName,I=r.parentElement.tagName==="OL"?"":' data-marker="'+r.parentElement.getAttribute("data-marker")+'"',W="";g&&(W=r.parentElement.tagName==="UL"?"":' start="1"',g="<"+A+' data-tight="true"'+I+' data-block="0">'+g+"</"+A+">"),r.parentElement.outerHTML=g+`<p data-block="0"><wbr>
133
+ </p><`+A+`
134
+ data-tight="true"`+I+' data-block="0"'+W+">"+v+"</"+A+">"}else r.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
135
+ </p>`),r.parentElement.querySelectorAll("li").length===1?r.parentElement.remove():r.remove();else i.nodeType!==3&&t.startOffset===0&&i.firstChild.tagName==="INPUT"?t.setStart(i.childNodes[1],1):(t.setEndAfter(r.lastChild),r.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'+r.getAttribute("data-marker")+'"><input type="checkbox"> <wbr></li>'),document.querySelector("wbr").after(t.extractContents()));return(0,x.ib)(e[e.currentMode].element,t),le(e),He(e),n.preventDefault(),!0}}return!1},In=function(e,t,n,i){if(t.startContainer.nodeType!==3){var r=t.startContainer.children[t.startOffset];if(r&&r.tagName==="HR")return t.selectNodeContents(r.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(i){var o=i.previousElementSibling;if(o&&(0,x.im)(i,e[e.currentMode].element,t).start===0&&((0,l.vU)()&&o.tagName==="HR"||o.tagName==="TABLE")){if(o.tagName==="TABLE"){var a=o.lastElementChild.lastElementChild.lastElementChild;a.innerHTML=a.innerHTML.trimLeft()+"<wbr>"+i.textContent.trim(),i.remove()}else o.remove();return(0,x.ib)(e[e.currentMode].element,t),le(e),n.preventDefault(),!0}}return!1},jn=function(e){(0,l.vU)()&&e.startContainer.nodeType!==3&&e.startContainer.tagName==="HR"&&e.setStartBefore(e.startContainer)},Rn=function(e,t,n){var i,r;if(!(0,l.vU)())return!1;if(e.key==="ArrowUp"&&t&&((i=t.previousElementSibling)===null||i===void 0?void 0:i.tagName)==="TABLE"){var o=t.previousElementSibling;return n.selectNodeContents(o.rows[o.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!(e.key!=="ArrowDown"||!t||((r=t.nextElementSibling)===null||r===void 0?void 0:r.tagName)!=="TABLE")&&(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0)},Nt=function(e,t,n){return yr(void 0,void 0,void 0,function(){var i,r,o,a,c,v,g,h,A,I,W,T,R,B,O,V;return br(this,function(P){switch(P.label){case 0:return e[e.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(i=t.clipboardData.getData("text/html"),r=t.clipboardData.getData("text/plain"),o=t.clipboardData.files):(i=t.dataTransfer.getData("text/html"),r=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items)),a={},c=function(H,G){if(!G)return["",Lute.WalkContinue];var ee=H.TokensStr();if(H.__internal_object__.Parent.Type===34&&ee&&ee.indexOf("file://")===-1&&e.options.upload.linkToImgUrl){var X=new XMLHttpRequest;X.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&X.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(X.withCredentials=!0),bn(e,X),X.setRequestHeader("Content-Type","application/json; charset=utf-8"),X.onreadystatechange=function(){if(X.readyState===XMLHttpRequest.DONE){if(X.status===200){var $=X.responseText;e.options.upload.linkToImgFormat&&($=e.options.upload.linkToImgFormat(X.responseText));var Q=JSON.parse($);if(Q.code!==0)return void e.tip.show(Q.msg);var F=Q.data.originalURL;if(e.currentMode==="sv")e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(ke){ke.textContent===F&&(ke.textContent=Q.data.url)});else{var re=e[e.currentMode].element.querySelector('img[src="'+F+'"]');re.src=Q.data.url,e.currentMode==="ir"&&(re.previousElementSibling.previousElementSibling.innerHTML=Q.data.url)}le(e)}else e.tip.show(X.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(X.responseText)}},X.send(JSON.stringify({url:ee}))}return e.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'+Lute.EscapeHTMLStr(ee)+"</span>",Lute.WalkContinue]:e.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'+Lute.EscapeHTMLStr(ee)+"</span>",Lute.WalkContinue]},i.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'+r+'">'+r+"</a>"&&i.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<!--StartFragment--><a href="'+r+'">'+r+"</a><!--EndFragment-->"||(i=""),(v=new DOMParser().parseFromString(i,"text/html")).body&&(i=v.body.innerHTML),i=Lute.Sanitize(i),e.wysiwyg.getComments(e),g=e[e.currentMode].element.scrollHeight,h=function(H,G,ee){ee===void 0&&(ee="sv");var X=document.createElement("div");X.innerHTML=H;var $=!1;X.childElementCount===1&&X.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&($=!0);var Q=X.querySelectorAll("pre");if(X.childElementCount===1&&Q.length===1&&Q[0].className!=="vditor-wysiwyg"&&Q[0].className!=="vditor-sv"&&($=!0),H.indexOf(`
136
+ <p class="p1">`)===0&&($=!0),X.childElementCount===1&&X.firstElementChild.tagName==="TABLE"&&X.querySelector(".line-number")&&X.querySelector(".line-content")&&($=!0),$){var F=G||H;return/\n/.test(F)||Q.length===1?ee==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'+F.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"<wbr></code></pre></div>":"\n```\n"+F.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"\n```":ee==="wysiwyg"?"<code>"+F.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</code><wbr>":"`"+F+"`"}return!1}(i,r,e.currentMode),(A=e.currentMode==="sv"?(0,p.a1)(t.target,"data-type","code-block"):(0,p.lG)(t.target,"CODE"))?(e.currentMode==="sv"?document.execCommand("insertHTML",!1,r.replace(/&/g,"&amp;").replace(/</g,"&lt;")):(I=(0,x.im)(t.target,e[e.currentMode].element),A.parentElement.tagName!=="PRE"&&(r+=b.g.ZWSP),A.textContent=A.textContent.substring(0,I.start)+r+A.textContent.substring(I.end),(0,x.$j)(I.start+r.length,I.start+r.length,A.parentElement),!((V=A.parentElement)===null||V===void 0)&&V.nextElementSibling.classList.contains("vditor-"+e.currentMode+"__preview")&&(A.parentElement.nextElementSibling.innerHTML=A.outerHTML,xe(A.parentElement.nextElementSibling,e))),[3,8]):[3,1]);case 1:return h?(n.pasteCode(h),[3,8]):[3,2];case 2:return i.trim()===""?[3,3]:((W=document.createElement("div")).innerHTML=i,W.querySelectorAll("[style]").forEach(function(H){H.removeAttribute("style")}),W.querySelectorAll(".vditor-copy").forEach(function(H){H.remove()}),e.currentMode==="ir"?(a.HTML2VditorIRDOM={renderLinkDest:c},e.lute.SetJSRenderers({renderers:a}),(0,x.oC)(e.lute.HTML2VditorIRDOM(W.innerHTML),e)):e.currentMode==="wysiwyg"?(a.HTML2VditorDOM={renderLinkDest:c},e.lute.SetJSRenderers({renderers:a}),(0,x.oC)(e.lute.HTML2VditorDOM(W.innerHTML),e)):(a.Md2VditorSVDOM={renderLinkDest:c},e.lute.SetJSRenderers({renderers:a}),hn(e,e.lute.HTML2Md(W.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return o.length>0?e.options.upload.url||e.options.upload.handler?[4,Zt(e,o)]:[3,5]:[3,7];case 4:return P.sent(),[3,6];case 5:T=new FileReader,"clipboardData"in t?(o=t.clipboardData.files,R=o[0]):t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items,R=o[0].getAsFile()),R&&R.type.startsWith("image")&&(T.readAsDataURL(R),T.onload=function(){var H="";e.currentMode==="wysiwyg"?H+='<img alt="'+R.name+'" src="'+T.result.toString()+`">
137
+ `:H+="!["+R.name+"]("+T.result.toString()+`)
138
+ `,document.execCommand("insertHTML",!1,H)}),P.label=6;case 6:return[3,8];case 7:r.trim()!==""&&o.length===0&&((O=(0,x.zh)(e)).toString()!==""&&e.lute.IsValidLinkDest(r)&&(r="["+O.toString()+"]("+r+")"),e.currentMode==="ir"?(a.Md2VditorIRDOM={renderLinkDest:c},e.lute.SetJSRenderers({renderers:a}),(0,x.oC)(e.lute.Md2VditorIRDOM(r),e)):e.currentMode==="wysiwyg"?(a.Md2VditorDOM={renderLinkDest:c},e.lute.SetJSRenderers({renderers:a}),(0,x.oC)(e.lute.Md2VditorDOM(r),e)):(a.Md2VditorSVDOM={renderLinkDest:c},e.lute.SetJSRenderers({renderers:a}),hn(e,r)),e.outline.render(e)),P.label=8;case 8:return e.currentMode!=="sv"&&((B=(0,p.F9)((0,x.zh)(e).startContainer))&&(O=(0,x.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(H){H.remove()}),O.insertNode(document.createElement("wbr")),e.currentMode==="wysiwyg"?B.outerHTML=e.lute.SpinVditorDOM(B.outerHTML):B.outerHTML=e.lute.SpinVditorIRDOM(B.outerHTML),(0,x.ib)(e[e.currentMode].element,O)),e[e.currentMode].element.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(H){xe(H,e)})),e.wysiwyg.triggerRemoveComment(e),le(e),e[e.currentMode].element.scrollHeight-g>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&He(e),[2]}})})},Pn=function(e){e.hint.render(e);var t=(0,x.zh)(e).startContainer,n=(0,p.a1)(t,"data-type","code-block-info");if(n)if(n.textContent.replace(b.g.ZWSP,"")===""&&e.hint.recentLanguage)n.textContent=b.g.ZWSP+e.hint.recentLanguage,(0,x.zh)(e).selectNodeContents(n);else{var i=[],r=n.textContent.substring(0,(0,x.im)(n,e.ir.element).start).replace(b.g.ZWSP,"");(e.options.preview.hljs.langs||b.g.CODE_LANGUAGES).forEach(function(o){o.indexOf(r.toLowerCase())>-1&&i.push({html:o,value:o})}),e.hint.genHTML(i,r,e)}},Xe=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&Pn(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=m(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,l.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},wt=function(e,t){var n=(0,x.zh)(e),i=(0,p.F9)(n.startContainer)||n.startContainer;if(i){var r=i.querySelector(".vditor-ir__marker--heading");r?r.innerHTML=t:(i.insertAdjacentText("afterbegin",t),n.selectNodeContents(i),n.collapse(!1)),Ee(e,n.cloneRange()),ht(e)}},Dt=function(e,t,n){var i=(0,p.a1)(e.startContainer,"data-type",n);if(i){i.firstElementChild.remove(),i.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var r=document.createElement("div");r.innerHTML=t.lute.SpinVditorIRDOM(i.outerHTML),i.outerHTML=r.firstElementChild.innerHTML.trim()}},kr=function(e,t,n,i){var r=(0,x.zh)(e),o=t.getAttribute("data-type"),a=r.startContainer;a.nodeType===3&&(a=a.parentElement);var c=!0;if(t.classList.contains("vditor-menu--current"))if(o==="quote"){var v=(0,p.lG)(a,"BLOCKQUOTE");v&&(r.insertNode(document.createElement("wbr")),v.outerHTML=v.innerHTML.trim()===""?'<p data-block="0">'+v.innerHTML+"</p>":v.innerHTML)}else if(o==="link"){var g=(0,p.a1)(r.startContainer,"data-type","a");if(g){var h=(0,p.fb)(r.startContainer,"vditor-ir__link");h?(r.insertNode(document.createElement("wbr")),g.outerHTML=h.innerHTML):g.outerHTML=g.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else o==="italic"?Dt(r,e,"em"):o==="bold"?Dt(r,e,"strong"):o==="strike"?Dt(r,e,"s"):o==="inline-code"?Dt(r,e,"code"):o!=="check"&&o!=="list"&&o!=="ordered-list"||(At(e,r,o),c=!1,t.classList.remove("vditor-menu--current"));else{e.ir.element.childNodes.length===0&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,x.ib)(e.ir.element,r));var A=(0,p.F9)(r.startContainer);if(o==="line"){if(A){var I=`<hr data-block="0"><p data-block="0"><wbr>
139
+ </p>`;A.innerHTML.trim()===""?A.outerHTML=I:A.insertAdjacentHTML("afterend",I)}}else if(o==="quote")A&&(r.insertNode(document.createElement("wbr")),A.outerHTML='<blockquote data-block="0">'+A.outerHTML+"</blockquote>",c=!1,t.classList.add("vditor-menu--current"));else if(o==="link"){var W=void 0;W=r.toString()===""?n+"<wbr>"+i:""+n+r.toString()+i.replace(")","<wbr>)"),document.execCommand("insertHTML",!1,W),c=!1,t.classList.add("vditor-menu--current")}else if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"){W=void 0,r.toString()===""?W=n+"<wbr>"+i:(W=o==="code"?n+`
140
+ `+r.toString()+"<wbr>"+i:o==="table"?""+n+r.toString()+"<wbr>"+i:""+n+r.toString()+i+"<wbr>",r.deleteContents()),o!=="table"&&o!=="code"||(W=`
141
+ `+W+`
142
+
143
+ `);var T=document.createElement("span");T.innerHTML=W,r.insertNode(T),Ee(e,r),o==="table"&&(r.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,x.Hc)(r))}else o!=="check"&&o!=="list"&&o!=="ordered-list"||(At(e,r,o,!1),c=!1,u(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,x.ib)(e.ir.element,r),Xe(e),c&&ht(e)},Sr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(g){try{v(i.next(g))}catch(h){o(h)}}function c(g){try{v(i.throw(g))}catch(h){o(h)}}function v(g){var h;g.done?r(g.value):(h=g.value,h instanceof n?h:new n(function(A){A(h)})).then(a,c)}v((i=i.apply(e,[])).next())})},Lr=function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(v){return function(g){return function(h){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&h[0]?i.return:h[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,h[1])).done)return r;switch(i=0,r&&(h=[2&h[0],r.value]),h[0]){case 0:case 1:r=h;break;case 4:return a.label++,{value:h[1],done:!1};case 5:a.label++,i=h[1],h=[0];continue;case 7:h=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||h[0]!==6&&h[0]!==2)){a=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){a.label=h[1];break}if(h[0]===6&&a.label<r[1]){a.label=r[1],r=h;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(h);break}r[2]&&a.ops.pop(),a.trys.pop();continue}h=t.call(e,a)}catch(A){h=[6,A],i=0}finally{n=r=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([v,g])}}},Tr=function(){function e(t){var n=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(i,r){n.element.style.display="none";var o=decodeURIComponent(i.getAttribute("data-value")),a=window.getSelection().getRangeAt(0);if(r.currentMode==="ir"){var c=(0,p.a1)(a.startContainer,"data-type","code-block-info");if(c)return c.textContent=b.g.ZWSP+o.trimRight(),a.selectNodeContents(c),a.collapse(!1),Xe(r),c.parentElement.querySelectorAll("code").forEach(function(A){A.className="language-"+o.trimRight()}),xe(c.parentElement.querySelector(".vditor-ir__preview"),r),void(n.recentLanguage=o.trimRight())}if(r.currentMode==="wysiwyg"&&a.startContainer.nodeType!==3){var v=a.startContainer,g=void 0;if((g=v.classList.contains("vditor-input")?v:v.firstElementChild)&&g.classList.contains("vditor-input"))return g.value=o.trimRight(),a.selectNodeContents(g),a.collapse(!1),g.dispatchEvent(new CustomEvent("input",{detail:1})),void(n.recentLanguage=o.trimRight())}if(a.setStart(a.startContainer,n.lastIndex),a.deleteContents(),r.options.hint.parse?r.currentMode==="sv"?(0,x.oC)(r.lute.SpinVditorSVDOM(o),r):r.currentMode==="wysiwyg"?(0,x.oC)(r.lute.SpinVditorDOM(o),r):(0,x.oC)(r.lute.SpinVditorIRDOM(o),r):(0,x.oC)(o,r),n.splitChar===":"&&o.indexOf(":")>-1&&r.currentMode!=="sv"&&a.insertNode(document.createTextNode(" ")),a.collapse(!1),(0,x.Hc)(a),r.currentMode==="wysiwyg")(h=(0,p.fb)(a.startContainer,"vditor-wysiwyg__block"))&&h.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(h.lastElementChild.innerHTML=h.firstElementChild.innerHTML,xe(h.lastElementChild,r));else if(r.currentMode==="ir"){var h;(h=(0,p.fb)(a.startContainer,"vditor-ir__marker--pre"))&&h.nextElementSibling.classList.contains("vditor-ir__preview")&&(h.nextElementSibling.innerHTML=h.innerHTML,xe(h.nextElementSibling,r))}le(r)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",t.push({key:":"})}return e.prototype.render=function(t){var n=this;if(window.getSelection().focusNode){var i,r=getSelection().getRangeAt(0);i=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(i,t.options.hint.extend);if(o===void 0)this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var a=o===""?t.options.hint.emoji:t.lute.GetEmojis(),c=[];Object.keys(a).forEach(function(v){v.indexOf(o.toLowerCase())===0&&(a[v].indexOf(".")>-1?c.push({html:'<img src="'+a[v]+'" title=":'+v+':"/> :'+v+":",value:":"+v+":"}):c.push({html:'<span class="vditor-hint__emoji">'+a[v]+"</span>"+v,value:a[v]}))}),this.genHTML(c,o,t)}else t.options.hint.extend.forEach(function(v){v.key===n.splitChar&&(clearTimeout(n.timeId),n.timeId=window.setTimeout(function(){return Sr(n,void 0,void 0,function(){var g;return Lr(this,function(h){switch(h.label){case 0:return g=this.genHTML,[4,v.hint(o)];case 1:return g.apply(this,[h.sent(),o,t]),[2]}})})},t.options.hint.delay))})}},e.prototype.genHTML=function(t,n,i){var r=this;if(t.length!==0){var o=i[i.currentMode].element,a=(0,x.Ny)(o),c=a.left+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0),v=a.top,g="";t.forEach(function(A,I){if(!(I>7)){var W=A.html;if(n!==""){var T=W.lastIndexOf(">")+1,R=W.substr(T),B=R.toLowerCase().indexOf(n.toLowerCase());B>-1&&(R=R.substring(0,B)+"<b>"+R.substring(B,B+n.length)+"</b>"+R.substring(B+n.length),W=W.substr(0,T)+R)}g+='<button type="button" data-value="'+encodeURIComponent(A.value)+` "
144
+ `+(I===0?"class='vditor-hint--current'":"")+"> "+W+"</button>"}}),this.element.innerHTML=g;var h=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top=v+(h||22)+"px",this.element.style.left=c+"px",this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(A){A.addEventListener("click",function(I){r.fillEmoji(A,i),I.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top=v-this.element.offsetHeight+"px"),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")}else this.element.style.display="none"},e.prototype.select=function(t,n){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var i=this.element.querySelector(".vditor-hint--current");if(t.key==="ArrowDown")return t.preventDefault(),t.stopPropagation(),i.removeAttribute("class"),i.nextElementSibling?i.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(t.key==="ArrowUp"){if(t.preventDefault(),t.stopPropagation(),i.removeAttribute("class"),i.previousElementSibling)i.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!((0,l.yl)(t)||t.shiftKey||t.altKey||t.key!=="Enter"||t.isComposing)&&(t.preventDefault(),t.stopPropagation(),this.fillEmoji(i,n),!0)},e.prototype.getKey=function(t,n){var i,r=this;if(this.lastIndex=-1,this.splitChar="",n.forEach(function(v){var g=t.lastIndexOf(v.key);r.lastIndex<g&&(r.splitChar=v.key,r.lastIndex=g)}),this.lastIndex===-1)return i;var o=t.split(this.splitChar),a=o[o.length-1];if(o.length>1&&a.trim()===a)if(o.length===2&&o[0]===""&&o[1].length<32)i=o[1];else{var c=o[o.length-2].slice(-1);(0,d.X)(c)===" "&&a.length<32&&(i=a)}return i},e}(),Cr=function(){function e(t){this.composingLock=!1;var n=document.createElement("div");n.className="vditor-ir",n.innerHTML='<pre class="vditor-reset" placeholder="'+t.options.placeholder+`"
145
+ contenteditable="true" spellcheck="false"></pre>`,this.element=n.firstElementChild,this.bindEvent(t),Vt(t,this.element),fn(t,this.element),Ut(t,this.element),Ft(t,this.element),Gt(t,this.element),Wt(t,this.element),zt(t,this.element,this.copy),Kt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){var i=getSelection().getRangeAt(0);if(i.toString()!==""){t.stopPropagation(),t.preventDefault();var r=document.createElement("div");r.appendChild(i.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorIRDOM2Md(r.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){Nt(t,i,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})}),this.element.addEventListener("scroll",function(){y(t,["hint"])}),this.element.addEventListener("compositionstart",function(i){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){(0,l.vU)()||Ee(t,getSelection().getRangeAt(0).cloneRange()),n.composingLock=!1}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop")return n.preventInput?(n.preventInput=!1,void Xe(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(n.composingLock||i.data==="‘"||i.data==="“"||i.data==="《"||Ee(t,getSelection().getRangeAt(0).cloneRange(),!1,i))}),this.element.addEventListener("click",function(i){if(i.target.tagName==="INPUT")return i.target.checked?i.target.setAttribute("checked","checked"):i.target.removeAttribute("checked"),n.preventInput=!0,void Xe(t);var r=(0,x.zh)(t),o=(0,p.fb)(i.target,"vditor-ir__preview");if(o||(o=(0,p.fb)(r.startContainer,"vditor-ir__preview")),o&&(o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!0),(0,x.Hc)(r),He(t)),i.target.tagName==="IMG"){var a=i.target.parentElement.querySelector(".vditor-ir__marker--link");a&&(r.selectNode(a),(0,x.Hc)(r))}var c=(0,p.a1)(i.target,"data-type","a");if(!c||c.classList.contains("vditor-ir__node--expand")){if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&r.collapsed){var v=n.element.lastElementChild.getBoundingClientRect();i.y>v.top+v.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(b.g.ZWSP,"")===""?(r.selectNodeContents(n.element.lastElementChild),r.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+b.g.ZWSP+"<wbr></p>"),(0,x.ib)(n.element,r)))}r.toString()===""?j(r,t):setTimeout(function(){j((0,x.zh)(t),t)}),Lt(i,t),ht(t)}else t.options.link.click?t.options.link.click(c.querySelector(":scope > .vditor-ir__marker--link")):t.options.link.isOpen&&window.open(c.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,l.yl)(i))if(i.key==="Enter"&&He(t),ht(t),i.key!=="Backspace"&&i.key!=="Delete"||t.ir.element.innerHTML===""||t.ir.element.childNodes.length!==1||!t.ir.element.firstElementChild||t.ir.element.firstElementChild.tagName!=="P"||t.ir.element.firstElementChild.childElementCount!==0||t.ir.element.textContent!==""&&t.ir.element.textContent!==`
146
+ `){var r=(0,x.zh)(t);i.key==="Backspace"?((0,l.vU)()&&r.startContainer.textContent===`
147
+ `&&r.startOffset===1&&(r.startContainer.textContent="",j(r,t)),n.element.querySelectorAll(".language-math").forEach(function(a){var c=a.querySelector("br");c&&c.remove()})):i.key.indexOf("Arrow")>-1?(i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||Pn(t),j(r,t)):i.keyCode===229&&i.code===""&&i.key==="Unidentified"&&j(r,t);var o=(0,p.fb)(r.startContainer,"vditor-ir__preview");if(o){if(i.key==="ArrowUp"||i.key==="ArrowLeft")return o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!1),i.preventDefault(),!0;if(o.tagName==="SPAN"&&(i.key==="ArrowDown"||i.key==="ArrowRight"))return o.parentElement.getAttribute("data-type")==="html-entity"?(o.parentElement.insertAdjacentText("afterend",b.g.ZWSP),r.setStart(o.parentElement.nextSibling,1)):r.selectNodeContents(o.parentElement.lastElementChild),r.collapse(!1),i.preventDefault(),!0}}else t.ir.element.innerHTML=""})},e}(),qn=function(e){return e.currentMode==="sv"?e.lute.Md2HTML(m(e)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},Mr=ne(895),Bn=ne(818),xr=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'+t+`</div>
148
+ <div class="vditor-outline__content"></div>`}return e.prototype.render=function(t){return t.preview.element.style.display==="block"?(0,Bn.k)(t.preview.previewElement,this.element.lastElementChild,t):(0,Bn.k)(t[t.currentMode].element,this.element.lastElementChild,t)},e.prototype.toggle=function(t,n,i){var r;n===void 0&&(n=!0),i===void 0&&(i=!0);var o=(r=t.toolbar.elements.outline)===null||r===void 0?void 0:r.firstElementChild;if(n&&window.innerWidth>=b.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(t),o==null||o.classList.add("vditor-menu--current")):(this.element.style.display="none",o==null||o.classList.remove("vditor-menu--current")),i&&getSelection().rangeCount>0){var a=getSelection().getRangeAt(0);t[t.currentMode].element.contains(a.startContainer)&&(0,x.Hc)(a)}he(t)},e}(),Ar=ne(554),_r=function(){function e(t){var n=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",t.options.classes.preview&&this.previewElement.classList.add(t.options.classes.preview),this.previewElement.style.maxWidth=t.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(v){if(v.target.tagName!=="TEXTAREA"){var g=document.createElement("div");g.className="vditor-reset",g.appendChild(getSelection().getRangeAt(0).cloneContents()),n.copyToX(t,g,"default"),v.preventDefault()}}),this.previewElement.addEventListener("click",function(v){var g=(0,p.lG)(v.target,"SPAN");if(g&&(0,p.fb)(g,"vditor-toc")){var h=n.previewElement.querySelector("#"+g.getAttribute("data-target-id"));h&&(n.element.scrollTop=h.offsetTop)}else{if(v.target.tagName==="A")return t.options.link.click?t.options.link.click(v.target):t.options.link.isOpen&&window.open(v.target.getAttribute("href")),void v.preventDefault();v.target.tagName==="IMG"&&(t.options.image.preview?t.options.image.preview(v.target):t.options.image.isPreview&&(0,ie.E)(v.target,t.options.lang,t.options.theme))}}),this.element.appendChild(this.previewElement);var i=t.options.preview.actions;if(i.length!==0){var r=document.createElement("div");r.className="vditor-preview__action";for(var o=[],a=0;a<i.length;a++){var c=i[a];if(typeof c!="object")switch(c){case"desktop":o.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":o.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":o.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":o.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":o.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}else o.push('<button type="button" data-type="'+c.key+'" class="'+c.className+'"'+(c.tooltip?' aria-label="'+c.tooltip+'"':"")+'">'+c.text+"</button>")}r.innerHTML=o.join(""),r.addEventListener((0,l.Le)(),function(v){var g=(0,_.S)(v.target,"BUTTON");if(g){var h=g.getAttribute("data-type"),A=i.find(function(I){return(I==null?void 0:I.key)===h});A?A.click(h):h!=="mp-wechat"&&h!=="zhihu"?(n.previewElement.style.width=h==="desktop"?"auto":h==="tablet"?"780px":"360px",n.previewElement.scrollWidth>n.previewElement.parentElement.clientWidth&&(n.previewElement.style.width="auto"),n.render(t),r.querySelectorAll("button").forEach(function(I){I.classList.remove("vditor-preview__action--current")}),g.classList.add("vditor-preview__action--current")):n.copyToX(t,n.previewElement.cloneNode(!0),h)}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(t,n){var i=this;if(clearTimeout(this.mdTimeoutId),this.element.style.display!=="none")if(n)this.previewElement.innerHTML=n;else if(m(t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")!==""){var r=new Date().getTime(),o=m(t);this.mdTimeoutId=window.setTimeout(function(){if(t.options.preview.url){var a=new XMLHttpRequest;a.open("POST",t.options.preview.url),a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),a.onreadystatechange=function(){if(a.readyState===XMLHttpRequest.DONE)if(a.status===200){var v=JSON.parse(a.responseText);if(v.code!==0)return void t.tip.show(v.msg);t.options.preview.transform&&(v.data=t.options.preview.transform(v.data)),i.previewElement.innerHTML=v.data,i.afterRender(t,r)}else{var g=t.lute.Md2HTML(o);t.options.preview.transform&&(g=t.options.preview.transform(g)),i.previewElement.innerHTML=g,i.afterRender(t,r)}},a.send(JSON.stringify({markdownText:o}))}else{var c=t.lute.Md2HTML(o);t.options.preview.transform&&(c=t.options.preview.transform(c)),i.previewElement.innerHTML=c,i.afterRender(t,r)}},t.options.preview.delay)}else this.previewElement.innerHTML="";else this.element.getAttribute("data-type")==="renderPerformance"&&t.tip.hide()},e.prototype.afterRender=function(t,n){t.options.preview.parse&&t.options.preview.parse(this.element);var i=new Date().getTime()-n;new Date().getTime()-n>2600?(t.tip.show(window.VditorI18n.performanceTip.replace("${x}",i.toString())),t.preview.element.setAttribute("data-type","renderPerformance")):t.preview.element.getAttribute("data-type")==="renderPerformance"&&(t.tip.hide(),t.preview.element.removeAttribute("data-type"));var r=t.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,Z.O)(t.preview.previewElement,t.options.preview.hljs),(0,fe.s)(t.options.preview.hljs,t.preview.previewElement,t.options.cdn),(0,we.i)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,De.K)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,te.P)(t.preview.previewElement,t.options.cdn),(0,ge.v)(t.preview.previewElement,t.options.cdn),(0,D.p)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,_e.P)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,$e.B)(t.preview.previewElement,t.options.cdn),(0,q.Q)(t.preview.previewElement,t.options.cdn),t.options.preview.render.media.enable&&(0,Ar.Y)(t.preview.previewElement),t.options.customRenders.forEach(function(c){c.render(t.preview.previewElement,t)});var o=t.preview.element,a=t.outline.render(t);a===""&&(a="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(c){c.innerHTML=a,(0,ue.H)(c,{cdn:t.options.cdn,math:t.options.preview.math})}),(0,ue.H)(t.preview.previewElement,{cdn:t.options.cdn,math:t.options.preview.math})},e.prototype.copyToX=function(t,n,i){i===void 0&&(i="mp-wechat"),i!=="zhihu"?n.querySelectorAll(".katex-html .base").forEach(function(o){o.style.display="initial"}):n.querySelectorAll(".language-math").forEach(function(o){o.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'+o.getAttribute("data-math")+'\\" style="display: block; margin: 0 auto; max-width: 100%;">'}),n.style.backgroundColor="#fff",n.querySelectorAll("code").forEach(function(o){o.style.backgroundImage="none"}),this.element.append(n);var r=n.ownerDocument.createRange();r.selectNode(n),(0,x.Hc)(r),document.execCommand("copy"),n.remove(),t.tip.show(["zhihu","mp-wechat"].includes(i)?"已复制,可到"+(i==="zhihu"?"知乎":"微信公众号平台")+"进行粘贴":"已复制到剪切板")},e}(),Hr=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--"+t.options.resize.position,this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(t)}return e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("mousedown",function(i){var r=document,o=i.clientY,a=t.element.offsetHeight,c=63+t.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),n.element.classList.add("vditor-resize--selected"),r.onmousemove=function(v){t.options.resize.position==="top"?t.element.style.height=Math.max(c,a+(o-v.clientY))+"px":t.element.style.height=Math.max(c,a+(v.clientY-o))+"px",t.options.typewriterMode&&(t.sv.element.style.paddingBottom=t.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){t.options.resize.after&&t.options.resize.after(t.element.offsetHeight-a),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,n.element.classList.remove("vditor-resize--selected")}})},e}(),Nr=function(){function e(t){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",t.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(t),Vt(t,this.element),Ut(t,this.element),Ft(t,this.element),Gt(t,this.element),Wt(t,this.element),zt(t,this.element,this.copy),Kt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){t.stopPropagation(),t.preventDefault(),t.clipboardData.setData("text/plain",yt(n[n.currentMode].element))},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){Nt(t,i,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})}),this.element.addEventListener("scroll",function(){if(t.preview.element.style.display==="block"){var i=n.element.scrollTop,r=n.element.clientHeight,o=n.element.scrollHeight-parseFloat(n.element.style.paddingBottom||"0"),a=t.preview.element;a.scrollTop=i/r>.5?(i+r)*a.scrollHeight/o-r:i*a.scrollHeight/o}}),this.element.addEventListener("compositionstart",function(i){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){(0,l.vU)()||oe(t,i),n.composingLock=!1}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop"&&!n.composingLock&&i.data!=="‘"&&i.data!=="“"&&i.data!=="《")return n.preventInput?(n.preventInput=!1,void Oe(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void oe(t,i)}),this.element.addEventListener("keyup",function(i){i.isComposing||(0,l.yl)(i)||(i.key!=="Backspace"&&i.key!=="Delete"||t.sv.element.innerHTML===""||t.sv.element.childNodes.length!==1||!t.sv.element.firstElementChild||t.sv.element.firstElementChild.tagName!=="DIV"||t.sv.element.firstElementChild.childElementCount!==2||t.sv.element.firstElementChild.textContent!==""&&t.sv.element.textContent!==`
149
+ `?i.key==="Enter"&&He(t):t.sv.element.innerHTML="")})},e}(),Vn=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(t,n){var i=this;n===void 0&&(n=6e3),this.element.className="vditor-tip vditor-tip--show",n===0?(this.element.innerHTML='<div class="vditor-tip__content">'+t+`
150
+ <div class="vditor-tip__close">X</div></div>`,this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){i.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'+t+"</div>",setTimeout(function(){i.hide()},n)),this.element.removeAttribute("style"),setTimeout(function(){i.element.getBoundingClientRect().top<46&&(i.element.style.position="fixed",i.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),$t=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),f(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",u(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},Dr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Or=function(e){function t(n,i){var r=e.call(this,n,i)||this;return n.options.preview.mode==="both"&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,l.Le)(),function(o){r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)||(o.preventDefault(),n.currentMode==="sv"&&(n.options.preview.mode==="both"?$t("editor",n):$t("both",n)))}),r}return Dr(t,e),t}(Te),Ir=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},Un=ne(312),jr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],a=document.createElement("div");a.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow");var c="";return b.g.CODE_THEME.forEach(function(v){c+="<button>"+v+"</button>"}),a.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+c+"</div>",a.addEventListener((0,l.Le)(),function(v){v.target.tagName==="BUTTON"&&(y(n,["subToolbar"]),n.options.preview.hljs.style=v.target.textContent,(0,Un.Y)(v.target.textContent,n.options.cdn),v.preventDefault(),v.stopPropagation())}),r.element.appendChild(a),k(n,a,o,i.level),r}return jr(t,e),t}(Te),Pr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),qr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],a=document.createElement("div");a.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow");var c="";return Object.keys(n.options.preview.theme.list).forEach(function(v){c+='<button data-type="'+v+'">'+n.options.preview.theme.list[v]+"</button>"}),a.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+c+"</div>",a.addEventListener((0,l.Le)(),function(v){v.target.tagName==="BUTTON"&&(y(n,["subToolbar"]),n.options.preview.theme.current=v.target.getAttribute("data-type"),(0,Ie.Z)(n.options.preview.theme.current,n.options.preview.theme.path),v.preventDefault(),v.stopPropagation())}),r.element.appendChild(a),k(n,a,o,i.level),r}return Pr(t,e),t}(Te),Br=function(){function e(t){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(t,"")}return e.prototype.render=function(t,n){var i=n.endsWith(`
151
+ `)?n.length-1:n.length;if(t.options.counter.type==="text"&&t[t.currentMode]){var r=t[t.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(o){o.remove()}),i=r.textContent.length}typeof t.options.counter.max=="number"?(i>t.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML=i+"/"+t.options.counter.max):this.element.innerHTML=""+i,this.element.setAttribute("aria-label",t.options.counter.type),t.options.counter.after&&t.options.counter.after(i,{enable:t.options.counter.enable,max:t.options.counter.max,type:t.options.counter.type})},e}(),Vr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ur=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].innerHTML=i.icon,r.element.children[0].addEventListener((0,l.Le)(),function(o){o.preventDefault(),o.currentTarget.classList.contains(b.g.CLASS_MENU_DISABLED)||i.click(o,n)}),r}return Vr(t,e),t}(Te),Wr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),zr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.firstElementChild.addEventListener((0,l.Le)(),function(o){var a=r.element.firstElementChild;a.classList.contains(b.g.CLASS_MENU_DISABLED)||(o.preventDefault(),a.classList.contains("vditor-menu--current")?(a.classList.remove("vditor-menu--current"),n.devtools.element.style.display="none",he(n)):(a.classList.add("vditor-menu--current"),n.devtools.element.style.display="block",he(n),n.devtools.renderEchart(n)))}),r}return Wr(t,e),t}(Te),Kr=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},Fr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Gr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var a="";return Object.keys(n.options.hint.emoji).forEach(function(c){var v=n.options.hint.emoji[c];v.indexOf(".")>-1?a+='<button data-value=":'+c+': " data-key=":'+c+`:"><img
152
+ data-value=":`+c+': " data-key=":'+c+':" class="vditor-emojis__icon" src="'+v+'"/></button>':a+='<button data-value="'+v+` "
153
+ data-key="`+c+'"><span class="vditor-emojis__icon">'+v+"</span></button>"}),o.innerHTML='<div class="vditor-emojis" style="max-height: '+(n.options.height==="auto"?"auto":n.options.height-80)+'px">'+a+`</div><div class="vditor-emojis__tail">
154
+ <span class="vditor-emojis__tip"></span><span>`+(n.options.hint.emojiTail||"")+`</span>
155
+ </div>`,r.element.appendChild(o),k(n,o,r.element.firstElementChild,i.level),r.bindEvent(n),r}return Fr(t,e),t.prototype.bindEvent=function(n){var i=this;this.element.lastElementChild.addEventListener((0,l.Le)(),function(r){var o=(0,_.S)(r.target,"BUTTON");if(o){r.preventDefault();var a=o.getAttribute("data-value"),c=(0,x.zh)(n),v=a;if(n.currentMode==="wysiwyg"?v=n.lute.SpinVditorDOM(a):n.currentMode==="ir"&&(v=n.lute.SpinVditorIRDOM(a)),a.indexOf(":")>-1&&n.currentMode!=="sv"){var g=document.createElement("div");g.innerHTML=v,v=g.firstElementChild.firstElementChild.outerHTML+" ",(0,x.oC)(v,n)}else c.extractContents(),c.insertNode(document.createTextNode(a));c.collapse(!1),(0,x.Hc)(c),i.element.lastElementChild.style.display="none",le(n)}}),this.element.lastElementChild.addEventListener("mouseover",function(r){var o=(0,_.S)(r.target,"BUTTON");o&&(i.element.querySelector(".vditor-emojis__tip").innerHTML=o.getAttribute("data-key"))})},t}(Te),Wn=function(e,t,n){var i=document.createElement("a");"download"in i?(i.download=n,i.style.display="none",i.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(i),i.click(),i.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},Zr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],a=document.createElement("div");return a.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow"),a.innerHTML=`<button data-type="markdown">Markdown</button>
156
+ <button data-type="pdf">PDF</button>
157
+ <button data-type="html">HTML</button>`,a.addEventListener((0,l.Le)(),function(c){var v=c.target;if(v.tagName==="BUTTON"){switch(v.getAttribute("data-type")){case"markdown":(function(g){var h=m(g);Wn(g,h,h.substr(0,10)+".md")})(n);break;case"pdf":(function(g){g.tip.show(window.VditorI18n.generate,3800);var h=document.querySelector("#vditorExportIframe");h.contentDocument.open(),h.contentDocument.write('<link rel="stylesheet" href="'+g.options.cdn+`/dist/index.css"/>
158
+ <script src="`+g.options.cdn+`/dist/method.min.js"><\/script>
159
+ <div id="preview" style="width: 800px"></div>
160
+ <script>
161
+ window.addEventListener("message", (e) => {
162
+ if(!e.data) {
163
+ return;
164
+ }
165
+ Vditor.preview(document.getElementById('preview'), e.data, {
166
+ cdn: "`+g.options.cdn+`",
167
+ markdown: {
168
+ theme: `+JSON.stringify(g.options.preview.theme)+`
169
+ },
170
+ hljs: {
171
+ style: "`+g.options.preview.hljs.style+`"
172
+ }
173
+ });
174
+ setTimeout(() => {
175
+ window.print();
176
+ }, 3600);
177
+ }, false);
178
+ <\/script>`),h.contentDocument.close(),setTimeout(function(){h.contentWindow.postMessage(m(g),"*")},200)})(n);break;case"html":(function(g){var h=qn(g),A='<html><head><link rel="stylesheet" type="text/css" href="'+g.options.cdn+`/dist/index.css"/>
179
+ <script src="`+g.options.cdn+"/dist/js/i18n/"+g.options.lang+`.js"><\/script>
180
+ <script src="`+g.options.cdn+`/dist/method.min.js"><\/script></head>
181
+ <body><div class="vditor-reset" id="preview">`+h+`</div>
182
+ <script>
183
+ const previewElement = document.getElementById('preview')
184
+ Vditor.setContentTheme('`+g.options.preview.theme.current+"', '"+g.options.preview.theme.path+`');
185
+ Vditor.codeRender(previewElement);
186
+ Vditor.highlightRender(`+JSON.stringify(g.options.preview.hljs)+", previewElement, '"+g.options.cdn+`');
187
+ Vditor.mathRender(previewElement, {
188
+ cdn: '`+g.options.cdn+`',
189
+ math: `+JSON.stringify(g.options.preview.math)+`,
190
+ });
191
+ Vditor.mermaidRender(previewElement, '`+g.options.cdn+"', '"+g.options.theme+`');
192
+ Vditor.markmapRender(previewElement, '`+g.options.cdn+"', '"+g.options.theme+`');
193
+ Vditor.flowchartRender(previewElement, '`+g.options.cdn+`');
194
+ Vditor.graphvizRender(previewElement, '`+g.options.cdn+`');
195
+ Vditor.chartRender(previewElement, '`+g.options.cdn+"', '"+g.options.theme+`');
196
+ Vditor.mindmapRender(previewElement, '`+g.options.cdn+"', '"+g.options.theme+`');
197
+ Vditor.abcRender(previewElement, '`+g.options.cdn+`');
198
+ `+(g.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"")+`
199
+ Vditor.speechRender(previewElement);
200
+ <\/script>
201
+ <script src="`+g.options.cdn+"/dist/js/icons/"+g.options.icon+'.js"><\/script></body></html>';Wn(g,A,h.substr(0,10)+".html")})(n)}y(n,["subToolbar"]),c.preventDefault(),c.stopPropagation()}}),r.element.appendChild(a),k(n,a,o,i.level),r}return Zr(t,e),t}(Te),Xr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Yr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n,i),r}return Xr(t,e),t.prototype._bindEvent=function(n,i){this.element.children[0].addEventListener((0,l.Le)(),function(r){r.preventDefault(),n.element.className.includes("vditor--fullscreen")?(i.level||(this.innerHTML=i.icon),n.element.style.zIndex="",document.body.style.overflow="",n.element.classList.remove("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(o){var a=n.toolbar.elements[o].firstChild;a&&(a.className=a.className.replace("__s","__n"),n.options.toolbar.forEach(function(c){typeof c!="string"&&c.tipPosition&&c.name===a.dataset.type&&(a.className="vditor-tooltipped vditor-tooltipped__"+c.tipPosition)}))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__s","__n"))):(i.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),n.element.style.zIndex=n.options.fullscreen.index.toString(),document.body.style.overflow="hidden",n.element.classList.add("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(o){var a=n.toolbar.elements[o].firstChild;a&&(a.className=a.className.replace("__n","__s"))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__n","__s"))),n.devtools&&n.devtools.renderEchart(n),i.click&&i.click(r,n),he(n),Y(n)})},t}(Te),Qr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),$r=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");return o.className="vditor-hint vditor-panel--arrow",o.innerHTML='<button data-tag="h1" data-value="# ">'+window.VditorI18n.heading1+" "+(0,l.ns)("&lt;⌥⌘1>")+`</button>
202
+ <button data-tag="h2" data-value="## ">`+window.VditorI18n.heading2+" &lt;"+(0,l.ns)("⌥⌘2")+`></button>
203
+ <button data-tag="h3" data-value="### ">`+window.VditorI18n.heading3+" &lt;"+(0,l.ns)("⌥⌘3")+`></button>
204
+ <button data-tag="h4" data-value="#### ">`+window.VditorI18n.heading4+" &lt;"+(0,l.ns)("⌥⌘4")+`></button>
205
+ <button data-tag="h5" data-value="##### ">`+window.VditorI18n.heading5+" &lt;"+(0,l.ns)("⌥⌘5")+`></button>
206
+ <button data-tag="h6" data-value="###### ">`+window.VditorI18n.heading6+" &lt;"+(0,l.ns)("⌥⌘6")+"></button>",r.element.appendChild(o),r._bindEvent(n,o),r}return Qr(t,e),t.prototype._bindEvent=function(n,i){var r=this.element.children[0];r.addEventListener((0,l.Le)(),function(a){a.preventDefault(),clearTimeout(n.wysiwyg.afterRenderTimeoutId),clearTimeout(n.ir.processTimeoutId),clearTimeout(n.sv.processTimeoutId),r.classList.contains(b.g.CLASS_MENU_DISABLED)||(r.blur(),r.classList.contains("vditor-menu--current")?(n.currentMode==="wysiwyg"?(qt(n),Se(n)):n.currentMode==="ir"&&wt(n,""),r.classList.remove("vditor-menu--current")):(y(n,["subToolbar"]),i.style.display="block"))});for(var o=0;o<6;o++)i.children.item(o).addEventListener((0,l.Le)(),function(a){a.preventDefault(),n.currentMode==="wysiwyg"?(Tt(n,a.target.getAttribute("data-tag")),Se(n),r.classList.add("vditor-menu--current")):n.currentMode==="ir"?(wt(n,a.target.getAttribute("data-value")),r.classList.add("vditor-menu--current")):gn(n,a.target.getAttribute("data-value")),i.style.display="none"})},t}(Te),ei=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ti=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,l.Le)(),function(o){o.preventDefault(),n.tip.show(`<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">
207
+ <div style="margin-top: 14px;flex: 1">
208
+ <div>Markdown 使用指南</div>
209
+ <ul style="list-style: none">
210
+ <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>
211
+ <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>
212
+ <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>
213
+ <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>
214
+ </ul>
215
+ </div>
216
+ <div style="margin-top: 14px;flex: 1">
217
+ <div>Vditor 支持</div>
218
+ <ul style="list-style: none">
219
+ <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>
220
+ <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>
221
+ <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>
222
+ <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>
223
+ </ul>
224
+ </div></div>`,0)}),r}return ei(t,e),t}(Te),ni=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ri=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,l.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var a=(0,x.zh)(n),c=(0,p.lG)(a.startContainer,"LI");c&&Ln(n,c,a)}}),r}return ni(t,e),t}(Te),ii=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),oi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,l.Le)(),function(o){o.preventDefault(),n.tip.show(`<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">
225
+ <p style="text-align: center;margin: 14px 0">
226
+ <em>下一代的 Markdown 编辑器,为未来而构建</em>
227
+ </p>
228
+ <div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">
229
+ <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>
230
+ <div>&nbsp;&nbsp;</div>
231
+ <div style="flex: 1;min-width: 250px">
232
+ Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。
233
+ 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。
234
+ </div>
235
+ </div>
236
+ <div style="display: flex;flex-wrap: wrap;">
237
+ <ul style="list-style: none;flex: 1;min-width:148px">
238
+ <li>
239
+ 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>
240
+ </li>
241
+ <li>
242
+ 开源协议:MIT
243
+ </li>
244
+ </ul>
245
+ <ul style="list-style: none;margin-right: 18px">
246
+ <li>
247
+ 组件版本:Vditor v`+b.H+" / Lute v"+Lute.Version+`
248
+ </li>
249
+ <li>
250
+ 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
251
+ </li>
252
+ </ul>
253
+ </div>
254
+ </div>`,0)}),r}return ii(t,e),t}(Te),ai=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),li=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,l.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)||n.currentMode==="sv"||xt(n,"afterend")}),r}return ai(t,e),t}(Te),si=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),di=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,l.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)||n.currentMode==="sv"||xt(n,"beforebegin")}),r}return si(t,e),t}(Te),ci=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ui=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,l.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var a=(0,x.zh)(n),c=(0,p.lG)(a.startContainer,"LI");c&&Jt(n,c,a,c.parentElement)}}),r}return ci(t,e),t}(Te),pi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),mi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return n.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,l.Le)(),function(o){o.preventDefault(),n.toolbar.elements.outline.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)||(n.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),n.outline.toggle(n,n.options.outline.enable))}),r}return pi(t,e),t}(Te),fi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),hi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return fi(t,e),t.prototype._bindEvent=function(n){var i=this;this.element.children[0].addEventListener((0,l.Le)(),function(r){r.preventDefault();var o=i.element.firstElementChild;if(!o.classList.contains(b.g.CLASS_MENU_DISABLED)){var a=b.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);o.classList.contains("vditor-menu--current")?(o.classList.remove("vditor-menu--current"),n.currentMode==="sv"?(n.sv.element.style.display="block",n.options.preview.mode==="both"?n.preview.element.style.display="block":n.preview.element.style.display="none"):(n[n.currentMode].element.parentElement.style.display="block",n.preview.element.style.display="none"),E(n.toolbar.elements,a),n.outline.render(n)):(L(n.toolbar.elements,a),n.preview.element.style.display="block",n.currentMode==="sv"?n.sv.element.style.display="none":n[n.currentMode].element.parentElement.style.display="none",n.preview.render(n),o.classList.add("vditor-menu--current"),y(n,["subToolbar","hint","popover"]),setTimeout(function(){n.outline.render(n)},n.options.preview.delay+10)),he(n)}})},t}(Te),vi=function(){function e(t){var n;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,typeof AudioContext!="undefined")n=new AudioContext;else{if(!webkitAudioContext)return;n=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=n.sampleRate;var i=n.createGain();n.createMediaStreamSource(t).connect(i),this.recorder=n.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,i.connect(this.recorder),this.recorder.connect(n.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(t,n){this.leftChannel.push(new Float32Array(t)),this.rightChannel.push(new Float32Array(n)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var t=this.mergeBuffers(this.leftChannel),n=this.mergeBuffers(this.rightChannel),i=new Float32Array(t.length),r=0;r<t.length;++r)i[r]=.5*(t[r]+n[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(i=this.downSampleBuffer(i,this.SAMPLE_RATE));var o=44+2*i.length,a=new ArrayBuffer(o),c=new DataView(a);this.writeUTFBytes(c,0,"RIFF"),c.setUint32(4,o,!0),this.writeUTFBytes(c,8,"WAVE"),this.writeUTFBytes(c,12,"fmt "),c.setUint32(16,16,!0),c.setUint16(20,1,!0),c.setUint16(22,1,!0),c.setUint32(24,this.SAMPLE_RATE,!0),c.setUint32(28,2*this.SAMPLE_RATE,!0),c.setUint16(32,2,!0),c.setUint16(34,16,!0);var v=2*i.length;this.writeUTFBytes(c,36,"data"),c.setUint32(40,v,!0);for(var g=i.length,h=44,A=0;A<g;A++)c.setInt16(h,32767*i[A],!0),h+=2;return new Blob([c],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(t,n){if(n===this.DEFAULT_SAMPLE_RATE||n>this.DEFAULT_SAMPLE_RATE)return t;for(var i=this.DEFAULT_SAMPLE_RATE/n,r=Math.round(t.length/i),o=new Float32Array(r),a=0,c=0;a<o.length;){for(var v=Math.round((a+1)*i),g=0,h=0,A=c;A<v&&A<t.length;A++)g+=t[A],h++;o[a]=g/h,a++,c=v}return o},e.prototype.mergeBuffers=function(t){for(var n=new Float32Array(this.recordingLength),i=0,r=t.length,o=0;o<r;++o){var a=t[o];n.set(a,i),i+=a.length}return n},e.prototype.writeUTFBytes=function(t,n,i){for(var r=i.length,o=0;o<r;o++)t.setUint8(n+o,i.charCodeAt(o))},e}(),gi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),yi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return gi(t,e),t.prototype._bindEvent=function(n){var i,r=this;this.element.children[0].addEventListener((0,l.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)){var a=n[n.currentMode].element;if(i)if(i.isRecording){i.stopRecording(),n.tip.hide();var c=new File([i.buildWavFileBlob()],"record"+new Date().getTime()+".wav",{type:"video/webm"});Zt(n,[c]),r.element.children[0].classList.remove("vditor-menu--current")}else n.tip.show(window.VditorI18n.recording),a.setAttribute("contenteditable","false"),i.startRecordingNewWavFile(),r.element.children[0].classList.add("vditor-menu--current");else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(v){(i=new vi(v)).recorder.onaudioprocess=function(g){if(i.isRecording){var h=g.inputBuffer.getChannelData(0),A=g.inputBuffer.getChannelData(1);i.cloneChannelData(h,A)}},i.startRecordingNewWavFile(),n.tip.show(window.VditorI18n.recording),a.setAttribute("contenteditable","false"),r.element.children[0].classList.add("vditor-menu--current")}).catch(function(){n.tip.show(window.VditorI18n["record-tip"])})}})},t}(Te),bi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),wi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return L({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,l.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)||n.undo.redo(n)}),r}return bi(t,e),t}(Te),Ei=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ki=function(e){function t(n,i){var r=e.call(this,n,i)||this;return L({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,l.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED)||n.undo.undo(n)}),r}return Ei(t,e),t}(Te),Si=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Li=function(e){function t(n,i){var r=e.call(this,n,i)||this,o='<input type="file"';return n.options.upload.multiple&&(o+=' multiple="multiple"'),n.options.upload.accept&&(o+=' accept="'+n.options.upload.accept+'"'),r.element.children[0].innerHTML=""+(i.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>')+o+">",r._bindEvent(n),r}return Si(t,e),t.prototype._bindEvent=function(n){var i=this;this.element.children[0].addEventListener((0,l.Le)(),function(r){if(i.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED))return r.stopPropagation(),void r.preventDefault()}),this.element.querySelector("input").addEventListener("change",function(r){if(i.element.firstElementChild.classList.contains(b.g.CLASS_MENU_DISABLED))return r.stopPropagation(),void r.preventDefault();r.target.files.length!==0&&Zt(n,r.target.files,r.target)})},t}(Te),Ti=function(){function e(t){var n=this,i=t.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",i.toolbar.forEach(function(r,o){var a=n.genItem(t,r,o);if(n.element.appendChild(a),r.toolbar){var c=document.createElement("div");c.className="vditor-hint vditor-panel--arrow",c.addEventListener((0,l.Le)(),function(v){c.style.display="none"}),r.toolbar.forEach(function(v,g){v.level=2,c.appendChild(n.genItem(t,v,o+g))}),a.appendChild(c),k(t,c,a.children[0])}}),t.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),t.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),t.options.counter.enable&&(t.counter=new Br(t),this.element.appendChild(t.counter.element))}return e.prototype.genItem=function(t,n,i){var r;switch(n.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":r=new Te(t,n);break;case"emoji":r=new Gr(t,n);break;case"headings":r=new $r(t,n);break;case"|":r=new Kr;break;case"br":r=new Ir;break;case"undo":r=new ki(t,n);break;case"redo":r=new wi(t,n);break;case"help":r=new ti(t,n);break;case"both":r=new Or(t,n);break;case"preview":r=new hi(t,n);break;case"fullscreen":r=new Yr(t,n);break;case"upload":r=new Li(t,n);break;case"record":r=new yi(t,n);break;case"info":r=new oi(t,n);break;case"edit-mode":r=new ur(t,n);break;case"devtools":r=new zr(t,n);break;case"outdent":r=new ui(t,n);break;case"indent":r=new ri(t,n);break;case"outline":r=new mi(t,n);break;case"insert-after":r=new li(t,n);break;case"insert-before":r=new di(t,n);break;case"code-theme":r=new Rr(t,n);break;case"content-theme":r=new qr(t,n);break;case"export":r=new Jr(t,n);break;default:r=new Ur(t,n)}if(r){var o=n.name;return o!=="br"&&o!=="|"||(o+=i),this.elements[o]=r.element,r.element}},e}(),Ci=ne(471),Mi=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new Ci}return e.prototype.clearStack=function(t){this.resetStack(),this.resetIcon(t)},e.prototype.resetIcon=function(t){t.toolbar&&(this[t.currentMode].undoStack.length>1?E(t.toolbar.elements,["undo"]):L(t.toolbar.elements,["undo"]),this[t.currentMode].redoStack.length!==0?E(t.toolbar.elements,["redo"]):L(t.toolbar.elements,["redo"]))},e.prototype.undo=function(t){if(t[t.currentMode].element.getAttribute("contenteditable")!=="false"&&!(this[t.currentMode].undoStack.length<2)){var n=this[t.currentMode].undoStack.pop();n&&(this[t.currentMode].redoStack.push(n),this.renderDiff(n,t),this[t.currentMode].hasUndo=!0,y(t,["hint"]))}},e.prototype.redo=function(t){if(t[t.currentMode].element.getAttribute("contenteditable")!=="false"){var n=this[t.currentMode].redoStack.pop();n&&(this[t.currentMode].undoStack.push(n),this.renderDiff(n,t,!0))}},e.prototype.recordFirstPosition=function(t,n){if(getSelection().rangeCount!==0&&!(this[t.currentMode].undoStack.length!==1||this[t.currentMode].undoStack[0].length===0||this[t.currentMode].redoStack.length>0||(0,l.vU)()&&n.key==="Backspace"||(0,l.G6)())){var i=this.addCaret(t);i.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[t.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[t.currentMode].undoStack[0][0].diffs[0][1]=i,this[t.currentMode].lastText=i)}},e.prototype.addToUndoStack=function(t){var n=this.addCaret(t,!0),i=this.dmp.diff_main(n,this[t.currentMode].lastText,!0),r=this.dmp.patch_make(n,this[t.currentMode].lastText,i);r.length===0&&this[t.currentMode].undoStack.length>0||(this[t.currentMode].lastText=n,this[t.currentMode].undoStack.push(r),this[t.currentMode].undoStack.length>this.stackSize&&this[t.currentMode].undoStack.shift(),this[t.currentMode].hasUndo&&(this[t.currentMode].redoStack=[],this[t.currentMode].hasUndo=!1,L(t.toolbar.elements,["redo"])),this[t.currentMode].undoStack.length>1&&E(t.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(t,n,i){var r;if(i===void 0&&(i=!1),i){var o=this.dmp.patch_deepCopy(t).reverse();o.forEach(function(c){c.diffs.forEach(function(v){v[0]=-v[0]})}),r=this.dmp.patch_apply(o,this[n.currentMode].lastText)[0]}else r=this.dmp.patch_apply(t,this[n.currentMode].lastText)[0];if(this[n.currentMode].lastText=r,n[n.currentMode].element.innerHTML=r,n.currentMode!=="sv"&&n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(c){xe(c,n)}),n[n.currentMode].element.querySelector("wbr"))(0,x.ib)(n[n.currentMode].element,n[n.currentMode].element.ownerDocument.createRange()),He(n);else{var a=getSelection().getRangeAt(0);a.setEndBefore(n[n.currentMode].element),a.collapse(!1)}Fe(n),le(n,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),st(n),n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(c){xe(c,n)}),this[n.currentMode].undoStack.length>1?E(n.toolbar.elements,["undo"]):L(n.toolbar.elements,["undo"]),this[n.currentMode].redoStack.length!==0?E(n.toolbar.elements,["redo"]):L(n.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(t,n){var i;if(n===void 0&&(n=!1),getSelection().rangeCount!==0&&!t[t.currentMode].element.querySelector("wbr")){var r=getSelection().getRangeAt(0);if(t[t.currentMode].element.contains(r.startContainer)){i=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}t.ir.element.cloneNode(!0).querySelectorAll(".vditor-"+t.currentMode+"__preview[data-render='1']").forEach(function(c){c.firstElementChild&&(c.firstElementChild.classList.contains("language-echarts")||c.firstElementChild.classList.contains("language-plantuml")||c.firstElementChild.classList.contains("language-mindmap")?(c.firstElementChild.removeAttribute("_echarts_instance_"),c.firstElementChild.removeAttribute("data-processed"),c.firstElementChild.innerHTML=c.previousElementSibling.firstElementChild.innerHTML,c.setAttribute("data-render","2")):c.firstElementChild.classList.contains("language-math")&&(c.setAttribute("data-render","2"),c.firstElementChild.textContent=c.firstElementChild.getAttribute("data-math"),c.firstElementChild.removeAttribute("data-math")))});var a=t[t.currentMode].element.innerHTML;return t[t.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(c){c.remove()}),n&&i&&(0,x.Hc)(i),a.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),xi=ne(640),Ai=function(){function e(t){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:b.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",confused:"😕",eyes:"👀️",heart:"❤️",rocket:"🚀️",smile:"😄",tada:"🎉️"},emojiPath:b.g.CDN+"/dist/images/emoji",extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:b.g.HLJS_OPTIONS,markdown:b.g.MARKDOWN_OPTIONS,math:b.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:b.g.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(n){return n.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=t}return e.prototype.merge=function(){var t,n,i,r,o,a,c,v,g;this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),!((n=(t=this.options.preview)===null||t===void 0?void 0:t.theme)===null||n===void 0)&&n.list&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),!((o=(r=(i=this.options.preview)===null||i===void 0?void 0:i.render)===null||r===void 0?void 0:r.media)===null||o===void 0)&&o.enable&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),!((a=this.options.hint)===null||a===void 0)&&a.emoji&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&(!((v=(c=this.options.preview)===null||c===void 0?void 0:c.theme)===null||v===void 0)&&v.path||(this.defaultOptions.preview.theme.path=this.options.cdn+"/dist/css/content-theme"),!((g=this.options.hint)===null||g===void 0)&&g.emojiPath||(this.defaultOptions.hint.emojiPath=this.options.cdn+"/dist/images/emoji")));var h=(0,xi.T)(this.defaultOptions,this.options);if(h.cache.enable&&!h.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return h},e.prototype.mergeToolbar=function(t){var n=this,i=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"⌘E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"⌘H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"⌘B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"⌘K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"⌘L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"⇧⌘I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"⇧⌘O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"⌘;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"⇧⌘H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"⌘U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"⇧⌘B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"⇧⌘E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"⌘M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:` | col2 | col3 |
255
+ | --- | --- | --- |
256
+ | | | |
257
+ | | | |`,tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],r=[];return t.forEach(function(o){var a=o;i.forEach(function(c){typeof o=="string"&&c.name===o&&(a=c),typeof o=="object"&&c.name===o.name&&(a=Object.assign({},c,o))}),o.toolbar&&(a.toolbar=n.mergeToolbar(o.toolbar)),r.push(a)}),r},e}(),_i=function(){function e(t){var n=this;this.composingLock=!1,this.commentIds=[];var i=document.createElement("div");i.className="vditor-wysiwyg",i.innerHTML='<pre class="vditor-reset" placeholder="'+t.options.placeholder+`"
258
+ contenteditable="true" spellcheck="false"></pre>
259
+ <div class="vditor-panel vditor-panel--none"></div>
260
+ <div class="vditor-panel vditor-panel--none">
261
+ <button type="button" aria-label="`+window.VditorI18n.comment+`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
262
+ <svg><use xlink:href="#vditor-icon-comment"></use></svg>
263
+ </button>
264
+ </div>`,this.element=i.firstElementChild,this.popover=i.firstElementChild.nextElementSibling,this.selectPopover=i.lastElementChild,this.bindEvent(t),Vt(t,this.element),fn(t,this.element),Ut(t,this.element),Ft(t,this.element),Gt(t,this.element),Wt(t,this.element),zt(t,this.element,this.copy),Kt(t,this.element,this.copy),t.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var r,o,a=Lute.NewNodeID(),c=getSelection().getRangeAt(0),v=c.cloneRange(),g=c.extractContents(),h=!1,A=!1;g.childNodes.forEach(function(T,R){var B=!1;if(T.nodeType===3?B=!0:T.classList.contains("vditor-comment")?T.classList.contains("vditor-comment")&&T.setAttribute("data-cmtids",T.getAttribute("data-cmtids")+" "+a):B=!0,B)if(T.nodeType!==3&&T.getAttribute("data-block")==="0"&&R===0&&v.startOffset>0)T.innerHTML='<span class="vditor-comment" data-cmtids="'+a+'">'+T.innerHTML+"</span>",r=T;else if(T.nodeType!==3&&T.getAttribute("data-block")==="0"&&R===g.childNodes.length-1&&v.endOffset<v.endContainer.textContent.length)T.innerHTML='<span class="vditor-comment" data-cmtids="'+a+'">'+T.innerHTML+"</span>",o=T;else if(T.nodeType!==3&&T.getAttribute("data-block")==="0")R===0?h=!0:R===g.childNodes.length-1&&(A=!0),T.innerHTML='<span class="vditor-comment" data-cmtids="'+a+'">'+T.innerHTML+"</span>";else{var O=document.createElement("span");O.classList.add("vditor-comment"),O.setAttribute("data-cmtids",a),T.parentNode.insertBefore(O,T),O.appendChild(T)}});var I=(0,p.F9)(v.startContainer);I&&(r?(I.insertAdjacentHTML("beforeend",r.innerHTML),r.remove()):I.textContent.trim().replace(b.g.ZWSP,"")===""&&h&&I.remove());var W=(0,p.F9)(v.endContainer);W&&(o?(W.insertAdjacentHTML("afterbegin",o.innerHTML),o.remove()):W.textContent.trim().replace(b.g.ZWSP,"")===""&&A&&W.remove()),c.insertNode(g),t.options.comment.add(a,c.toString(),n.getComments(t,!0)),Se(t,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),n.hideComment()})}return e.prototype.getComments=function(t,n){var i=this;if(n===void 0&&(n=!1),t.currentMode!=="wysiwyg"||!t.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(o){i.commentIds=i.commentIds.concat(o.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return n?(this.commentIds.forEach(function(o){r.push({id:o,top:i.element.querySelector('.vditor-comment[data-cmtids="'+o+'"]').offsetTop})}),r):void 0},e.prototype.triggerRemoveComment=function(t){var n,i,r;if(t.currentMode==="wysiwyg"&&t.options.comment.enable&&t.wysiwyg.commentIds.length>0){var o=JSON.parse(JSON.stringify(this.commentIds));this.getComments(t);var a=(n=o,i=this.commentIds,r=new Set(i),n.filter(function(c){return!r.has(c)}));a.length>0&&t.options.comment.remove(a)}},e.prototype.showComment=function(){var t=(0,x.Ny)(this.element);this.selectPopover.setAttribute("style","left:"+t.left+"px;display:block;top:"+Math.max(-8,t.top-21)+"px")},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(t,n){var i=getSelection().getRangeAt(0);if(i.toString()!==""){t.stopPropagation(),t.preventDefault();var r=(0,p.lG)(i.startContainer,"CODE"),o=(0,p.lG)(i.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var a="";return a=r.parentElement.tagName==="PRE"?i.toString():"`"+i.toString()+"`",t.clipboardData.setData("text/plain",a),void t.clipboardData.setData("text/html","")}var c=(0,p.lG)(i.startContainer,"A"),v=(0,p.lG)(i.endContainer,"A");if(c&&v&&v.isSameNode(c)){var g=c.getAttribute("title")||"";return g&&(g=' "'+g+'"'),t.clipboardData.setData("text/plain","["+i.toString()+"]("+c.getAttribute("href")+g+")"),void t.clipboardData.setData("text/html","")}var h=document.createElement("div");h.appendChild(i.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorDOM2Md(h.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(y(t,["hint"]),n.popover.style.display==="block"&&n.selectPopover.style.display==="block"){var i=parseInt(n.popover.getAttribute("data-top"),10);if(t.options.height==="auto"){if(t.options.toolbarConfig.pin){var r=Math.max(i,window.scrollY-t.element.offsetTop-8)+"px";n.popover.style.display==="block"&&(n.popover.style.top=r),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=r)}}else if(t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0){var o=Math.max(window.scrollY-t.element.offsetTop-8,Math.min(i-t.wysiwyg.element.scrollTop,n.element.clientHeight-21))+"px";n.popover.style.display==="block"&&(n.popover.style.top=o),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",function(){if(y(t,["hint"]),t.options.comment&&t.options.comment.enable&&t.options.comment.scroll&&t.options.comment.scroll(t.wysiwyg.element.scrollTop),n.popover.style.display==="block"){var i=parseInt(n.popover.getAttribute("data-top"),10)-t.wysiwyg.element.scrollTop,r=-8;t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0&&(r=window.scrollY-t.element.offsetTop+r);var o=Math.max(r,Math.min(i,n.element.clientHeight-21))+"px";n.popover.style.top=o,n.selectPopover.style.top=o}}),this.element.addEventListener("paste",function(i){Nt(t,i,{pasteCode:function(r){var o=(0,x.zh)(t),a=document.createElement("template");a.innerHTML=r,o.insertNode(a.content.cloneNode(!0));var c=(0,p.a1)(o.startContainer,"data-block","0");c?c.outerHTML=t.lute.SpinVditorDOM(c.outerHTML):t.wysiwyg.element.innerHTML=t.lute.SpinVditorDOM(t.wysiwyg.element.innerHTML),(0,x.ib)(t.wysiwyg.element,o)}})}),this.element.addEventListener("compositionstart",function(){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){var r=(0,_.W)(getSelection().getRangeAt(0).startContainer);r&&r.textContent===""?Fe(t):((0,l.vU)()||Mt(t,getSelection().getRangeAt(0).cloneRange(),i),n.composingLock=!1)}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop"){if(n.preventInput)return n.preventInput=!1,void Se(t);if(n.composingLock||i.data==="‘"||i.data==="“"||i.data==="《")Se(t);else{var r=getSelection().getRangeAt(0),o=(0,p.F9)(r.startContainer);if(o||(un(t,r),o=(0,p.F9)(r.startContainer)),o){for(var a=(0,x.im)(o,t.wysiwyg.element,r).start,c=!0,v=a-1;v>o.textContent.substr(0,a).lastIndexOf(`
265
+ `);v--)if(o.textContent.charAt(v)!==" "&&o.textContent.charAt(v)!==" "){c=!1;break}a===0&&(c=!1);var g=!0;for(v=a-1;v<o.textContent.length;v++)if(o.textContent.charAt(v)!==" "&&o.textContent.charAt(v)!==`
266
+ `){g=!1;break}var h=(0,_.W)(getSelection().getRangeAt(0).startContainer);h&&h.textContent===""&&(Fe(t),h.remove()),c&&o.getAttribute("data-type")!=="code-block"||g||Yt(o.innerHTML)||Xt(o.innerHTML)&&o.previousElementSibling?typeof t.options.input=="function"&&t.options.input(m(t)):(i.inputType==="insertParagraph"&&n.element.innerHTML==="<p><br></p><p><br></p>"&&o.previousElementSibling.remove(),Mt(t,r,i))}}}}),this.element.addEventListener("click",function(i){if(i.target.tagName==="INPUT"){var r=i.target;return r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),n.preventInput=!0,void Se(t)}if(i.target.tagName!=="IMG"||i.target.parentElement.classList.contains("vditor-wysiwyg__preview")){var o=(0,p.lG)(i.target,"A");if(o)return t.options.link.click?t.options.link.click(o):t.options.link.isOpen&&window.open(o.getAttribute("href")),void i.preventDefault();var a=(0,x.zh)(t);if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&a.collapsed){var c=n.element.lastElementChild.getBoundingClientRect();i.y>c.top+c.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(b.g.ZWSP,"")===""?(a.selectNodeContents(n.element.lastElementChild),a.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+b.g.ZWSP+"<wbr></p>"),(0,x.ib)(n.element,a)))}nt(t);var v=(0,p.fb)(i.target,"vditor-wysiwyg__preview");v||(v=(0,p.fb)((0,x.zh)(t).startContainer,"vditor-wysiwyg__preview")),v&&vt(v,t),Lt(i,t)}else i.target.getAttribute("data-type")==="link-ref"?pn(t,i.target):function(g,h){var A=g.target;h.wysiwyg.popover.innerHTML="";var I=function(){A.setAttribute("src",T.value),A.setAttribute("alt",B.value),A.setAttribute("title",V.value),typeof h.options.input=="function"&&h.options.input(m(h))},W=document.createElement("span");W.setAttribute("aria-label",window.VditorI18n.imageURL),W.className="vditor-tooltipped vditor-tooltipped__n";var T=document.createElement("input");W.appendChild(T),T.className="vditor-input",T.setAttribute("placeholder",window.VditorI18n.imageURL),T.value=A.getAttribute("src")||"",T.oninput=function(){I()},T.onkeydown=function(P){Re(h,P)};var R=document.createElement("span");R.setAttribute("aria-label",window.VditorI18n.alternateText),R.className="vditor-tooltipped vditor-tooltipped__n";var B=document.createElement("input");R.appendChild(B),B.className="vditor-input",B.setAttribute("placeholder",window.VditorI18n.alternateText),B.style.width="52px",B.value=A.getAttribute("alt")||"",B.oninput=function(){I()},B.onkeydown=function(P){Re(h,P)};var O=document.createElement("span");O.setAttribute("aria-label",window.VditorI18n.title),O.className="vditor-tooltipped vditor-tooltipped__n";var V=document.createElement("input");O.appendChild(V),V.className="vditor-input",V.setAttribute("placeholder",window.VditorI18n.title),V.value=A.getAttribute("title")||"",V.oninput=function(){I()},V.onkeydown=function(P){Re(h,P)},Ve(A,h),h.wysiwyg.popover.insertAdjacentElement("beforeend",W),h.wysiwyg.popover.insertAdjacentElement("beforeend",R),h.wysiwyg.popover.insertAdjacentElement("beforeend",O),Be(h,A)}(i,t)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,l.yl)(i)){i.key==="Enter"&&He(t),i.key!=="Backspace"&&i.key!=="Delete"||t.wysiwyg.element.innerHTML===""||t.wysiwyg.element.childNodes.length!==1||!t.wysiwyg.element.firstElementChild||t.wysiwyg.element.firstElementChild.tagName!=="P"||t.wysiwyg.element.firstElementChild.childElementCount!==0||t.wysiwyg.element.textContent!==""&&t.wysiwyg.element.textContent!==`
267
+ `||(t.wysiwyg.element.innerHTML="");var r=(0,x.zh)(t);if(i.key==="Backspace"&&(0,l.vU)()&&r.startContainer.textContent===`
268
+ `&&r.startOffset===1&&(r.startContainer.textContent=""),un(t,r),nt(t),i.key==="ArrowDown"||i.key==="ArrowRight"||i.key==="Backspace"||i.key==="ArrowLeft"||i.key==="ArrowUp"){i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||t.hint.render(t);var o=(0,p.fb)(r.startContainer,"vditor-wysiwyg__preview");if(!o&&r.startContainer.nodeType!==3&&r.startOffset>0&&(c=r.startContainer).classList.contains("vditor-wysiwyg__block")&&(o=c.lastElementChild),o)if(o.previousElementSibling.style.display!=="none"){var a=o.previousElementSibling;if(a.tagName==="PRE"&&(a=a.firstElementChild),i.key==="ArrowDown"||i.key==="ArrowRight"){var c,v=function(h){for(var A=h;A&&!A.nextSibling;)A=A.parentElement;return A.nextSibling}(c=o.parentElement);if(v&&v.nodeType!==3){var g=v.querySelector(".vditor-wysiwyg__preview");if(g)return void vt(g,t)}if(v.nodeType===3){for(;v.textContent.length===0&&v.nextSibling;)v=v.nextSibling;r.setStart(v,1)}else r.setStart(v.firstChild,0)}else r.selectNodeContents(a),r.collapse(!1)}else i.key==="ArrowDown"||i.key==="ArrowRight"?vt(o,t):vt(o,t,!1)}}})},e}(),Hi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();const Ni=function(e){function t(n,i){var r=e.call(this)||this;if(r.version=b.H,typeof n=="string"){if(i?i.cache?i.cache.id||(i.cache.id="vditor"+n):i.cache={id:"vditor"+n}:i={cache:{id:"vditor"+n}},!document.getElementById(n))return r.showErrorTip("Failed to get element by id: "+n),r;n=document.getElementById(n)}var o=new Ai(i).merge();if(o.i18n)window.VditorI18n=o.i18n,r.init(n,o);else{if(!["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(o.lang))throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");var a="vditorI18nScript",c=a+o.lang;document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(v){v.id!==c&&document.head.removeChild(v)}),(0,s.G)(o.cdn+"/dist/js/i18n/"+o.lang+".js",c).then(function(){r.init(n,o)}).catch(function(v){r.showErrorTip("GET "+o.cdn+"/dist/js/i18n/"+o.lang+".js net::ERR_ABORTED 404 (Not Found)")})}return r}return Hi(t,e),t.prototype.showErrorTip=function(n){var i=new Vn;document.body.appendChild(i.element),i.show(n,0)},t.prototype.setTheme=function(n,i,r,o){this.vditor.options.theme=n,ve(this.vditor),i&&(this.vditor.options.preview.theme.current=i,(0,Ie.Z)(i,o||this.vditor.options.preview.theme.path)),r&&(this.vditor.options.preview.hljs.style=r,(0,Un.Y)(r,this.vditor.options.cdn))},t.prototype.getValue=function(){return m(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.focus():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.focus():this.vditor.currentMode==="ir"&&this.vditor.ir.element.focus()},t.prototype.blur=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.blur():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.blur():this.vditor.currentMode==="ir"&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){y(this.vditor,["subToolbar","hint","popover"]),L(this.vditor.toolbar.elements,b.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){E(this.vditor.toolbar.elements,b.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){return this.vditor.currentMode==="wysiwyg"?yt(this.vditor.wysiwyg.element):this.vditor.currentMode==="sv"?yt(this.vditor.sv.element):this.vditor.currentMode==="ir"?yt(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(n){this.vditor.preview.render(this.vditor,n)},t.prototype.getCursorPosition=function(){return(0,x.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(n){return this.vditor.lute.HTML2Md(n)},t.prototype.exportJSON=function(n){return this.vditor.lute.RenderJSON(n)},t.prototype.getHTML=function(){return qn(this.vditor)},t.prototype.tip=function(n,i){this.vditor.tip.show(n,i)},t.prototype.setPreviewMode=function(n){$t(n,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(n){document.execCommand("insertHTML",!1,n)},t.prototype.insertValue=function(n,i){i===void 0&&(i=!0);var r=(0,x.zh)(this.vditor);r.collapse(!0);var o=document.createElement("template");o.innerHTML=n,r.insertNode(o.content.cloneNode(!0)),r.collapse(!1),this.vditor.currentMode==="sv"?(this.vditor.sv.preventInput=!0,i&&oe(this.vditor)):this.vditor.currentMode==="wysiwyg"?i&&Mt(this.vditor,getSelection().getRangeAt(0)):this.vditor.currentMode==="ir"&&(this.vditor.ir.preventInput=!0,i&&Ee(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.setValue=function(n,i){var r=this;i===void 0&&(i=!1),this.vditor.currentMode==="sv"?(this.vditor.sv.element.innerHTML="<div data-block='0'>"+this.vditor.lute.SpinVditorSVDOM(n)+"</div>",Oe(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):this.vditor.currentMode==="wysiwyg"?mn(this.vditor,n,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(n),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o){xe(o,r.vditor)}),Xe(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),n||(y(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),i&&this.clearStack()},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var n=document.getElementById("vditorIconScript");n&&n.remove(),this.clearCache(),Je(),this.vditor.wysiwyg.unbindListener()},t.prototype.getCommentIds=function(){return this.vditor.currentMode!=="wysiwyg"?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var i=function(r){r.classList.remove("vditor-comment--hover"),n.forEach(function(o){r.getAttribute("data-cmtids").indexOf(o)>-1&&r.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)})}},t.prototype.unHlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var i=function(r){n.forEach(function(o){r.getAttribute("data-cmtids").indexOf(o)>-1&&r.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)})}},t.prototype.removeCommentIds=function(n){var i=this;if(this.vditor.currentMode==="wysiwyg"){var r=function(o,a){var c=o.getAttribute("data-cmtids").split(" ");c.find(function(v,g){if(v===a)return c.splice(g,1),!0}),c.length===0?(o.outerHTML=o.innerHTML,(0,x.zh)(i.vditor).collapse(!0)):o.setAttribute("data-cmtids",c.join(" "))};n.forEach(function(o){i.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(a){r(a,o)}),i.vditor.preview.element.style.display!=="none"&&i.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(a){r(a,o)})}),Se(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(n,i){var r=this;this.vditor={currentMode:i.mode,element:n,hint:new Tr(i.hint.extend),lute:void 0,options:i,originalInnerHTML:n.innerHTML,outline:new xr(window.VditorI18n.outline),tip:new Vn},this.vditor.sv=new Nr(this.vditor),this.vditor.undo=new Mi,this.vditor.wysiwyg=new _i(this.vditor),this.vditor.ir=new Cr(this.vditor),this.vditor.toolbar=new Ti(this.vditor),i.resize.enable&&(this.vditor.resize=new Hr(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new w),(i.upload.url||i.upload.handler)&&(this.vditor.upload=new vr),(0,s.G)(i._lutePath||i.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){r.vditor.lute=(0,Mr.X)({autoSpace:r.vditor.options.preview.markdown.autoSpace,gfmAutoLink:r.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:r.vditor.options.preview.markdown.codeBlockPreview,emojiSite:r.vditor.options.hint.emojiPath,emojis:r.vditor.options.hint.emoji,fixTermTypo:r.vditor.options.preview.markdown.fixTermTypo,footnotes:r.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:r.vditor.options.preview.math.inlineDigit,linkBase:r.vditor.options.preview.markdown.linkBase,linkPrefix:r.vditor.options.preview.markdown.linkPrefix,listStyle:r.vditor.options.preview.markdown.listStyle,mark:r.vditor.options.preview.markdown.mark,mathBlockPreview:r.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:r.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:r.vditor.options.preview.markdown.sanitize,toc:r.vditor.options.preview.markdown.toc}),r.vditor.preview=new _r(r.vditor),function(o){o.element.innerHTML="",o.element.classList.add("vditor"),o.options.rtl&&o.element.setAttribute("dir","rtl"),ve(o),(0,Ie.Z)(o.options.preview.theme.current,o.options.preview.theme.path),typeof o.options.height=="number"?o.element.style.height=o.options.height+"px":o.element.style.height=o.options.height,typeof o.options.minHeight=="number"&&(o.element.style.minHeight=o.options.minHeight+"px"),typeof o.options.width=="number"?o.element.style.width=o.options.width+"px":o.element.style.width=o.options.width,o.element.appendChild(o.toolbar.element);var a=document.createElement("div");if(a.className="vditor-content",o.options.outline.position==="left"&&a.appendChild(o.outline.element),a.appendChild(o.wysiwyg.element.parentElement),a.appendChild(o.sv.element),a.appendChild(o.ir.element.parentElement),a.appendChild(o.preview.element),o.toolbar.elements.devtools&&a.appendChild(o.devtools.element),o.options.outline.position==="right"&&(o.outline.element.classList.add("vditor-outline--right"),a.appendChild(o.outline.element)),o.upload&&a.appendChild(o.upload.element),o.options.resize.enable&&a.appendChild(o.resize.element),a.appendChild(o.hint.element),a.appendChild(o.tip.element),o.element.appendChild(a),a.addEventListener("click",function(){y(o,["subToolbar"])}),o.toolbar.elements.export&&o.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),rt(o,o.options.mode,sr(o)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&window.visualViewport!==void 0){var c=!1,v=function(g){c||(c=!0,requestAnimationFrame(function(){c=!1;var h=o.toolbar.element;h.style.transform="none",h.getBoundingClientRect().top<0&&(h.style.transform="translate(0, "+-h.getBoundingClientRect().top+"px)")}))};window.visualViewport.addEventListener("scroll",v),window.visualViewport.addEventListener("resize",v)}}(r.vditor),i.after&&i.after(),i.icon&&(0,s.J)(i.cdn+"/dist/js/icons/"+i.icon+".js","vditorIconScript")})},t}(M.default)})(),je=je.default})())})(ot);var Yn=ot.exports;const St=Ze(Yn),Rt=()=>de.usePlugin(Pt).getCDN(),on=de.genStyleHook("nb-field-markdown-vditor",ae=>{const{componentCls:ye}=ae;return{[ye]:{".vditor-reset":{fontSize:`${ae.fontSize}px !important`},".vditor":{borderRadius:8},".vditor .vditor-content":{borderRadius:"0 0 8px 8px",overflow:"hidden"},".vditor .vditor-toolbar":{paddingLeft:" 16px !important",borderRadius:"8px 8px 0 0"},".vditor .vditor-content .vditor-ir .vditor-reset":{paddingLeft:" 16px !important"}}}});function Qn(ae){const ye=ae;let pe=document.createElement("div");pe.innerHTML=ye;const ce=pe.innerText;return pe=null,(ce==null?void 0:ce.replace(/[\n\r]/g,""))||""}const $n=ae=>{if(ae){const ye=document.createRange();return ye.selectNodeContents(ae),ye.getBoundingClientRect().width}};function an(ae){var J;const ye=Ae.useRef(null),{wrapSSR:pe,componentCls:ce,hashId:ne}=on(),je=Rt();return Ae.useEffect(()=>{var M;St.preview(ye.current,(M=ae.value)!=null?M:"",{mode:"light",cdn:je})},[ae.value]),pe(Ke.jsx("div",{className:`${ne} ${ce}`,children:Ke.jsx("div",{ref:ye,style:rn({border:"none"},(J=ae==null?void 0:ae.style)!=null?J:{})})}))}const er=de.withDynamicSchemaProps(ae=>{var l;const ye=Me.useField(),pe=(l=ae.value)!=null?l:ye.value,ce=Rt(),ne=Ae.useRef(),[je,J]=Ae.useState(!1),[M,b]=Ae.useState(!1),[d,m]=Ae.useState(""),s=Ae.useRef();Ae.useEffect(()=>{var u;!ae.value||!ye.value||(ae.ellipsis?St.md2html(ae.value,{mode:"light",cdn:ce}).then(f=>{m(Qn(f))}).catch(()=>m("")):St.preview(ne.current,(u=ae.value)!=null?u:ye.value,{mode:"light",cdn:ce}))},[ae.value,ae.ellipsis,ye.value]);const w=Ae.useCallback(()=>{var E;if(!s.current)return!1;const u=$n(s.current),f=(E=s.current)==null?void 0:E.offsetWidth;return u>f},[s]);return ae.ellipsis?Ke.jsx(kt.Popover,{open:je,onOpenChange:u=>{J(M&&u)},content:Ke.jsx(an,{value:pe,style:{maxWidth:500,maxHeight:400,overflowY:"auto"}}),children:Ke.jsx("div",{ref:s,style:{overflow:"hidden",overflowWrap:"break-word",textOverflow:"ellipsis",whiteSpace:"nowrap",wordBreak:"break-all"},onMouseEnter:u=>{const f=u.target;w()&&b(f.scrollWidth>=f.clientWidth)},children:d})}):Ke.jsx(an,{value:pe})}),tr="field-markdown-vditor";function me(ae){return jt.tval(ae,{ns:tr})}const{defaultProps:nr,operators:rr}=de.interfacesProperties,ln=["headings","bold","italic","strike","link","list","ordered-list","check","quote","line","code","inline-code","upload","fullscreen"];class ir extends de.CollectionFieldInterface{constructor(){super(...arguments);We(this,"name","vditor");We(this,"type","object");We(this,"group","media");We(this,"order",1);We(this,"title",me("Vditor"));We(this,"sortable",!0);We(this,"default",{type:"text",length:"long",uiSchema:{type:"string","x-component":"MarkdownVditor"}});We(this,"availableTypes",["text","json","string"]);We(this,"properties",Xn(rn({},nr),{"uiSchema.x-component-props.fileCollection":{type:"string",title:me("File collection"),"x-component":"CollectionSelect","x-component-props":{filter:pe=>{var ce;return((ce=pe==null?void 0:pe.options)==null?void 0:ce.template)==="file"}},"x-decorator":"FormItem",default:"","x-reactions":{fulfill:{schema:{description:me("Used to store files uploaded in the Markdown editor")}}}},"uiSchema.x-component-props.toolbar":{type:"array",title:me("Toolbar"),"x-component":"Select","x-component-props":{mode:"multiple"},"x-decorator":"FormItem",default:ln,enum:[{value:"emoji",label:me("Emoji")},{value:"headings",label:me("Headings")},{value:"bold",label:me("Bold")},{value:"italic",label:me("Italic")},{value:"strike",label:me("Strike")},{value:"line",label:me("Line")},{value:"quote",label:me("Quote")},{value:"list",label:me("List")},{value:"ordered-list",label:me("OrderedList")},{value:"check",label:me("Check")},{value:"outdent",label:me("Outdent")},{value:"indent",label:me("Indent")},{value:"code",label:me("Code")},{value:"inline-code",label:me("InlineCode")},{value:"insert-after",label:me("InsertAfter")},{value:"insert-before",label:me("InsertBefore")},{value:"undo",label:me("Undo")},{value:"redo",label:me("Redo")},{value:"upload",label:me("Upload")},{value:"link",label:me("Link")},{value:"record",label:me("Record")},{value:"table",label:me("Table")},{value:"edit-mode",label:me("EditMode")},{value:"both",label:me("Both")},{value:"preview",label:me("Preview")},{value:"fullscreen",label:me("Fullscreen")},{value:"outline",label:me("Outline")}]}}));We(this,"filterable",{operators:rr.bigField});We(this,"titleUsable",!0)}schemaInitialize(pe,{block:ce}){["Table","Kanban"].includes(ce)&&(pe["x-component-props"]=pe["x-component-props"]||{},pe["x-component-props"].ellipsis=!0)}}const or=["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"],ar=de.withDynamicSchemaProps(ae=>{const{disabled:ye,onChange:pe,value:ce,fileCollection:ne,toolbar:je}=ae,[J,M]=Ae.useState(!1),b=Ae.useRef(),d=Ae.useRef(!1),m=Ae.useRef(null),s=Ae.useRef(null),w=de.useApp(),l=de.useAPIClient(),u=Rt(),{wrapSSR:f,hashId:E,componentCls:L}=on(),S=l.auth.locale,C=Ae.useMemo(()=>{const y=S.replace(/-/g,"_");return or.includes(y)?y:"en_US"},[S]);return Ae.useEffect(()=>{if(!m.current)return;const y=ne||"attachments",k=je!=null?je:ln,p=new St(m.current,{value:ce!=null?ce:"",lang:C,cache:{enable:!1},undoDelay:0,preview:{math:{engine:"KaTeX"}},toolbar:k,fullscreen:{index:1200},cdn:u,minHeight:200,after:()=>{b.current=p,M(!0),p.setValue(ce!=null?ce:""),ye?p.disabled():p.enable()},input(_){pe(_)},upload:{url:w.getApiUrl(`${y}:create`),headers:l.getHeaders(),multiple:!1,fieldName:"file",max:1024*1024*1024,format(_,N){const q=JSON.parse(N),D={msg:"",code:0,data:{errFiles:[],succMap:{[q.data.filename]:q.data.url}}};return JSON.stringify(D)}}});return()=>{var _;(_=b.current)==null||_.destroy(),b.current=void 0}},[ne,je==null?void 0:je.join(",")]),Ae.useEffect(()=>{var y;if(J&&b.current){const k=b.current;if(ce!==k.getValue()){k.setValue(ce!=null?ce:"");const p=(y=m.current)==null?void 0:y.querySelector("div.vditor-content > div.vditor-ir > pre");if(p){const _=document.createRange(),N=window.getSelection();N&&(_.selectNodeContents(p),_.collapse(!1),N.removeAllRanges(),N.addRange(_))}}}},[ce,J]),Ae.useEffect(()=>{J&&b.current&&(ye?b.current.disabled():b.current.enable())},[ye,J]),Ae.useLayoutEffect(()=>{if(!m.current)return;const y=new ResizeObserver(k=>{var p;for(const _ of k){const N=_.target;N.className.includes("vditor--fullscreen")?(document.body.appendChild(N),d.current=!0):d.current&&((p=s.current)==null||p.appendChild(N),d.current=!1)}});return y.observe(m.current),()=>{y.unobserve(m.current)}},[]),f(Ke.jsx("div",{ref:s,className:`${E} ${L}`,children:Ke.jsx("div",{id:E,ref:m})}))}),lr=de.withDynamicSchemaProps(Me.connect(ar,Me.mapReadPretty(er)));class Pt extends de.Plugin{afterAdd(){return It(this,null,function*(){})}beforeLoad(){return It(this,null,function*(){})}load(){return It(this,null,function*(){this.app.addComponents({MarkdownVditor:lr}),this.initVditorDependency(),this.app.dataSourceManager.addFieldInterfaces([ir])})}getCDN(){return this.app.getPublicPath()+"static/plugins/@nocobase/plugin-field-markdown-vditor/dist/client/vditor"}initVditorDependency(){const ye=this.getCDN();try{const pe="plugin-field-markdown-vditor-dep",ce={[`${pe}.katex`]:`${ye}/dist/js/katex/katex.min.js?v=0.16.9`,[`${pe}.ABCJS`]:`${ye}/dist/js/abcjs/abcjs_basic.min`,[`${pe}.plantumlEncoder`]:`${ye}/dist/js/plantuml/plantuml-encoder.min`,[`${pe}.echarts`]:`${ye}/dist/js/echarts/echarts.min`,[`${pe}.flowchart`]:`${ye}/dist/js/flowchart.js/flowchart.min`,[`${pe}.Viz`]:`${ye}/dist/js/graphviz/viz`,[`${pe}.mermaid`]:`${ye}/dist/js/mermaid/mermaid.min`};this.app.requirejs.require.config({waitSeconds:120,paths:ce}),Object.keys(ce).forEach(ne=>{this.app.requirejs.require([ne],je=>{window[ne.split(".")[1]]=je})})}catch(pe){console.log("initVditorDependency failed",pe)}}}be.PluginFieldMarkdownVditorClient=Pt,be.default=Pt,Object.defineProperties(be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});