1 line
308 KiB
JavaScript
Vendored
1 line
308 KiB
JavaScript
Vendored
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[710],{53419:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(1519),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".mdeditor-transfer{background-color:#fff}.mdeditor-transfer .ivu-modal-header{display:none}.mdeditor-transfer .ivu-modal-close{top:7px}.mdeditor-transfer .mdeditor-transfer-body{height:100%;left:0;margin:0;padding:0;position:absolute;top:0;width:100%}",""]);const o=i},10979:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(1519),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,".mdeditor-box[data-v-44cfcde5]{position:relative}.upload-control[data-v-44cfcde5]{display:none;height:0;overflow:hidden;width:0}",""]);const o=i},25712:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(1519),i=r.n(n),o=r(18789),a=i()((function(e){return e[1]}));a.i(o.Z),a.push([e.id,'[data-v-c274aad4] .markdown-theme-light pre{word-wrap:break-word;background:#f7f8fb!important;border:0!important;border-radius:0!important;border-radius:4px!important;font-size:14px!important;line-height:1.6!important;margin:10px 0!important;overflow-x:auto!important;overflow-y:hidden!important;padding:20px 10px!important;word-break:break-all}[data-v-c274aad4] .markdown-theme-light pre code{color:#444;font-family:Consolas!important;font-size:13px;line-height:22px!important}[data-v-c274aad4] .markdown-theme-light .hljs{-webkit-text-size-adjust:none;color:#525252;display:block;overflow-x:auto;padding:15px}[data-v-c274aad4] .markdown-theme-light .hljs-doctype{color:#999}[data-v-c274aad4] .markdown-theme-light .hljs-tag{color:#3e76f6}[data-v-c274aad4] .markdown-theme-light .hljs-attribute{color:#e96900}[data-v-c274aad4] .markdown-theme-light .hljs-value{color:#42b983}[data-v-c274aad4] .markdown-theme-light .hljs-keyword{color:#e96900}[data-v-c274aad4] .markdown-theme-light .hljs-string{color:#42b983}[data-v-c274aad4] .markdown-theme-light .hljs-comment{color:#b3b3b3}[data-v-c274aad4] .markdown-theme-light .hljs-operator .hljs-comment{color:#525252}[data-v-c274aad4] .markdown-theme-light .hljs-regexp{color:#af7dff}[data-v-c274aad4] .markdown-theme-light .hljs-built_in{color:#2db7f5}[data-v-c274aad4] .markdown-theme-light .css .hljs-class{color:#e96900}[data-v-c274aad4] .markdown-theme-light .css .hljs-number,[data-v-c274aad4] .markdown-theme-light .javascript .hljs-number{color:#fc1e70}[data-v-c274aad4] .markdown-theme-light .css .hljs-attribute{color:#af7dff}[data-v-c274aad4] .markdown-theme-light .css .hljs-important{color:red}[data-v-c274aad4] .markdown-theme-light .actionscript .hljs-literal,[data-v-c274aad4] .markdown-theme-light .javascript .hljs-literal{color:#fc1e70}[data-v-c274aad4] .markdown-theme-light pre{background:#f7f7f7!important;margin:0;padding:0}[data-v-c274aad4] .markdown-theme-light code{background:#f7f7f7;border:1px solid #eee;border-radius:3px;color:#666;display:inline-block;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;margin:0 3px;padding:1px 5px}[data-v-c274aad4] .markdown-theme-light pre code{background:transparent;border:none;display:inline;margin:0;padding:0}[data-v-c274aad4] .markdown-theme-light pre.bg code{background:#f7f7f7}[data-v-c274aad4] .markdown-theme-dark pre{background:#1e1e1e;border-radius:4px;color:#dcdcdc;display:block;margin:20px 0!important;overflow-x:auto!important;overflow-y:hidden!important;padding:20px 10px!important}[data-v-c274aad4] .markdown-theme-dark pre,[data-v-c274aad4] .markdown-theme-dark pre *{font-family:Menlo,Consolas,Courier New,Courier,FreeMono,monospace!important}[data-v-c274aad4] .markdown-theme-dark pre *{font-size:14px;line-height:1.6!important}[data-v-c274aad4] .markdown-theme-dark code{margin:0!important;padding:0!important}[data-v-c274aad4] .markdown-theme-dark .hljs-literal,[data-v-c274aad4] .markdown-theme-dark .hljs-name,[data-v-c274aad4] .markdown-theme-dark .hljs-symbol{color:#659bd1}[data-v-c274aad4] .markdown-theme-dark .hljs-keyword{color:#bc89bd}[data-v-c274aad4] .markdown-theme-dark .hljs-link{color:#569cd6;text-decoration:underline}[data-v-c274aad4] .markdown-theme-dark .hljs-built_in,[data-v-c274aad4] .markdown-theme-dark .hljs-type{color:#4ec9b0}[data-v-c274aad4] .markdown-theme-dark .hljs-class,[data-v-c274aad4] .markdown-theme-dark .hljs-number{color:#b8d7a3}[data-v-c274aad4] .markdown-theme-dark .hljs-meta-string,[data-v-c274aad4] .markdown-theme-dark .hljs-string{color:#d69d85}[data-v-c274aad4] .markdown-theme-dark .hljs-regexp,[data-v-c274aad4] .markdown-theme-dark .hljs-template-tag{color:#9a5334}[data-v-c274aad4] .markdown-theme-dark .hljs-formula,[data-v-c274aad4] .markdown-theme-dark .hljs-function,[data-v-c274aad4] .markdown-theme-dark .hljs-params,[data-v-c274aad4] .markdown-theme-dark .hljs-subst,[data-v-c274aad4] .markdown-theme-dark .hljs-title{color:#dcdcdc}[data-v-c274aad4] .markdown-theme-dark .hljs-comment,[data-v-c274aad4] .markdown-theme-dark .hljs-quote{color:#57a64a;font-style:italic}[data-v-c274aad4] .markdown-theme-dark .hljs-doctag{color:#608b4e}[data-v-c274aad4] .markdown-theme-dark .hljs-meta,[data-v-c274aad4] .markdown-theme-dark .hljs-meta-keyword,[data-v-c274aad4] .markdown-theme-dark .hljs-tag{color:#9b9b9b}[data-v-c274aad4] .markdown-theme-dark .hljs-template-variable,[data-v-c274aad4] .markdown-theme-dark .hljs-variable{color:#bd63c5}[data-v-c274aad4] .markdown-theme-dark .hljs-attr,[data-v-c274aad4] .markdown-theme-dark .hljs-attribute,[data-v-c274aad4] .markdown-theme-dark .hljs-builtin-name{color:#9cdcfe}[data-v-c274aad4] .markdown-theme-dark .hljs-section{color:gold}[data-v-c274aad4] .markdown-theme-dark .hljs-emphasis{font-style:italic}[data-v-c274aad4] .markdown-theme-dark .hljs-strong{font-weight:700}[data-v-c274aad4] .markdown-theme-dark .hljs-bullet,[data-v-c274aad4] .markdown-theme-dark .hljs-selector-attr,[data-v-c274aad4] .markdown-theme-dark .hljs-selector-class,[data-v-c274aad4] .markdown-theme-dark .hljs-selector-id,[data-v-c274aad4] .markdown-theme-dark .hljs-selector-pseudo,[data-v-c274aad4] .markdown-theme-dark .hljs-selector-tag{color:#d7ba7d}[data-v-c274aad4] .markdown-theme-dark .hljs-addition{background-color:#144212;display:inline-block;width:100%}[data-v-c274aad4] .markdown-theme-dark .hljs-deletion{background-color:#600;display:inline-block;width:100%}[data-v-c274aad4] .markdown-theme-dark .hljs-comment{font-style:normal}[data-v-c274aad4] .markdown-theme-oneDark pre{background:#292c34;border-radius:4px;color:#abb2bf;display:block;font-family:Menlo,Consolas,Courier New,Courier,FreeMono,monospace;margin:10px 0!important;overflow-x:auto!important;overflow-y:hidden!important;padding:20px 10px!important}[data-v-c274aad4] .markdown-theme-oneDark pre *{font-family:Menlo,Consolas,Courier New,Courier,FreeMono,monospace;font-size:14px;line-height:1.6!important}[data-v-c274aad4] .markdown-theme-oneDark .hljs-comment,[data-v-c274aad4] .markdown-theme-oneDark .hljs-quote{color:#5c6370;font-style:italic}[data-v-c274aad4] .markdown-theme-oneDark .hljs-doctag,[data-v-c274aad4] .markdown-theme-oneDark .hljs-formula,[data-v-c274aad4] .markdown-theme-oneDark .hljs-keyword{color:#c678dd}[data-v-c274aad4] .markdown-theme-oneDark .hljs-deletion,[data-v-c274aad4] .markdown-theme-oneDark .hljs-name,[data-v-c274aad4] .markdown-theme-oneDark .hljs-section,[data-v-c274aad4] .markdown-theme-oneDark .hljs-selector-tag,[data-v-c274aad4] .markdown-theme-oneDark .hljs-subst{color:#e06c75}[data-v-c274aad4] .markdown-theme-oneDark .hljs-literal{color:#56b6c2}[data-v-c274aad4] .markdown-theme-oneDark .hljs-addition,[data-v-c274aad4] .markdown-theme-oneDark .hljs-attribute,[data-v-c274aad4] .markdown-theme-oneDark .hljs-meta-string,[data-v-c274aad4] .markdown-theme-oneDark .hljs-regexp,[data-v-c274aad4] .markdown-theme-oneDark .hljs-string{color:#98c379}[data-v-c274aad4] .markdown-theme-oneDark .hljs-built_in,[data-v-c274aad4] .markdown-theme-oneDark .hljs-class .hljs-title{color:#e6c07b}[data-v-c274aad4] .markdown-theme-oneDark .hljs-attr,[data-v-c274aad4] .markdown-theme-oneDark .hljs-number,[data-v-c274aad4] .markdown-theme-oneDark .hljs-selector-attr,[data-v-c274aad4] .markdown-theme-oneDark .hljs-selector-class,[data-v-c274aad4] .markdown-theme-oneDark .hljs-selector-pseudo,[data-v-c274aad4] .markdown-theme-oneDark .hljs-template-variable,[data-v-c274aad4] .markdown-theme-oneDark .hljs-type,[data-v-c274aad4] .markdown-theme-oneDark .hljs-variable{color:#d19a66}[data-v-c274aad4] .markdown-theme-oneDark .hljs-bullet,[data-v-c274aad4] .markdown-theme-oneDark .hljs-link,[data-v-c274aad4] .markdown-theme-oneDark .hljs-meta,[data-v-c274aad4] .markdown-theme-oneDark .hljs-selector-id,[data-v-c274aad4] .markdown-theme-oneDark .hljs-symbol,[data-v-c274aad4] .markdown-theme-oneDark .hljs-title{color:#61aeee}[data-v-c274aad4] .markdown-theme-oneDark .hljs-emphasis{font-style:italic}[data-v-c274aad4] .markdown-theme-oneDark .hljs-strong{font-weight:700}[data-v-c274aad4] .markdown-theme-oneDark .hljs-link{text-decoration:underline}[data-v-c274aad4] .markdown-theme-gitHub pre{background:#f7f8fa!important;border-radius:4px;color:#333;display:block;font-size:13px;line-height:20px;margin:10px 0!important;overflow-x:auto;overflow-x:auto!important;padding:20px 10px!important}[data-v-c274aad4] .markdown-theme-gitHub pre *{font-family:Consolas!important}[data-v-c274aad4] .markdown-theme-gitHub .hljs-comment,[data-v-c274aad4] .markdown-theme-gitHub .hljs-quote{color:#998;font-style:italic}[data-v-c274aad4] .markdown-theme-gitHub .hljs-selector-tag,[data-v-c274aad4] .markdown-theme-gitHub .hljs-subst{color:#333;font-weight:700}[data-v-c274aad4] .markdown-theme-gitHub .hljs-keyword{color:#d73a49}[data-v-c274aad4] .markdown-theme-gitHub .hljs-literal,[data-v-c274aad4] .markdown-theme-gitHub .hljs-number,[data-v-c274aad4] .markdown-theme-gitHub .hljs-tag .hljs-attr,[data-v-c274aad4] .markdown-theme-gitHub .hljs-template-variable,[data-v-c274aad4] .markdown-theme-gitHub .hljs-variable{color:teal}[data-v-c274aad4] .markdown-theme-gitHub .hljs-doctag,[data-v-c274aad4] .markdown-theme-gitHub .hljs-string{color:#d73a49}[data-v-c274aad4] .markdown-theme-gitHub .hljs-section,[data-v-c274aad4] .markdown-theme-gitHub .hljs-selector-id,[data-v-c274aad4] .markdown-theme-gitHub .hljs-title{color:#900;font-weight:700}[data-v-c274aad4] .markdown-theme-gitHub .hljs-subst{font-weight:400}[data-v-c274aad4] .markdown-theme-gitHub .hljs-class .hljs-title,[data-v-c274aad4] .markdown-theme-gitHub .hljs-type{color:#458;font-weight:700}[data-v-c274aad4] .markdown-theme-gitHub .hljs-attribute,[data-v-c274aad4] .markdown-theme-gitHub .hljs-name,[data-v-c274aad4] .markdown-theme-gitHub .hljs-tag{color:navy;font-weight:400}[data-v-c274aad4] .markdown-theme-gitHub .hljs-link,[data-v-c274aad4] .markdown-theme-gitHub .hljs-regexp{color:#009926}[data-v-c274aad4] .markdown-theme-gitHub .hljs-bullet,[data-v-c274aad4] .markdown-theme-gitHub .hljs-symbol{color:#990073}[data-v-c274aad4] .markdown-theme-gitHub .hljs-built_in,[data-v-c274aad4] .markdown-theme-gitHub .hljs-builtin-name{color:#0086b3}[data-v-c274aad4] .markdown-theme-gitHub .hljs-meta{color:#999;font-weight:700}[data-v-c274aad4] .markdown-theme-gitHub .hljs-deletion{background:#fdd}[data-v-c274aad4] .markdown-theme-gitHub .hljs-addition{background:#dfd}[data-v-c274aad4] .markdown-theme-gitHub .hljs-emphasis{font-style:italic}[data-v-c274aad4] .markdown-theme-gitHub .hljs-strong{font-weight:700}.markdown[data-v-c274aad4]{align-items:center;background:#f7f7f7;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;margin:0;overflow:hidden;padding:0;position:relative}.markdown.border[data-v-c274aad4]{border:1px solid #d9d9d9}.markdown *[data-v-c274aad4]{box-sizing:border-box;margin:0;padding:0}.markdown.fullscreen[data-v-c274aad4]{border:none;bottom:0;height:100%!important;left:0;position:fixed;right:0;top:0;width:100%;z-index:999999}.markdown.fullscreen .markdown-content[data-v-c274aad4]{padding:10px 0 0}.markdown .markdown-toolbars[data-v-c274aad4]{align-items:center;background:#fff;border-bottom:1px solid #d9d9d9;color:#6a6f7b;cursor:pointer;display:flex;height:40px;list-style:none;padding-left:4px;width:100%}.markdown .markdown-toolbars>li[data-v-c274aad4]{cursor:pointer;line-height:normal;margin:0;min-height:auto;position:relative}.markdown .markdown-toolbars>li[data-v-c274aad4]:after{background:#000;border-radius:2px;color:#fff;content:attr(name);display:block;font-size:12px;left:20px;line-height:28px;opacity:0;padding:0 6px;position:absolute;top:32px;transform:scale(0);transform-origin:top;transition:all .3s .1s;white-space:nowrap;z-index:999999999999}.markdown .markdown-toolbars>li[data-v-c274aad4]:hover:after{opacity:1;transform:scale(1)}.markdown .markdown-toolbars>li[data-v-c274aad4]:last-child:after{left:auto;right:20%}.markdown .markdown-toolbars>li .title[data-v-c274aad4]{font-size:16px!important}.markdown .markdown-toolbars>li .icon-svg[data-v-c274aad4]{align-items:center;display:flex;justify-content:center}.markdown .markdown-toolbars .empty[data-v-c274aad4]{flex:1;width:12px}.markdown .markdown-toolbars span[data-v-c274aad4]{border-radius:3px;color:#999;cursor:pointer;display:block;font-size:18px;height:30px;line-height:30px;text-align:center;width:30px}.markdown .markdown-toolbars span[data-v-c274aad4]:hover{background:#f7f7f7;color:#1890ff}.markdown .markdown-toolbars .title[data-v-c274aad4]{padding-left:4px;padding-right:10px}.markdown .markdown-toolbars li:last-child span[data-v-c274aad4]{font-size:20px!important;margin-right:4px}.markdown .markdown-toolbars .export-file[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme[data-v-c274aad4]{align-items:center;display:flex;height:46px;justify-content:center;position:relative}.markdown .markdown-toolbars .export-file span[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme span[data-v-c274aad4]{display:inline-block;font-size:18px;line-height:32px;padding:0 8px;transition:all .3s}.markdown .markdown-toolbars .export-file span[data-v-c274aad4]:hover,.markdown .markdown-toolbars .shift-theme span[data-v-c274aad4]:hover{background:#f7f7f7;border-radius:3px;color:#0084ff}.markdown .markdown-toolbars .export-file ul[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme ul[data-v-c274aad4]{background:#fff;border:1px solid #d9d9d9;border-radius:4px;box-shadow:0 2px 8px 0 rgba(0,0,0,.1);box-sizing:border-box;left:-50%;list-style:none;margin:0;padding:6px 0;position:absolute;top:40px;transform:scale(0);transform-origin:top center;transition:all .3s;width:160px;z-index:9999999}.markdown .markdown-toolbars .export-file ul.active[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme ul.active[data-v-c274aad4]{opacity:1;transform:scaleY(1)}.markdown .markdown-toolbars .export-file ul li[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme ul li[data-v-c274aad4]{align-items:center;color:#262626;cursor:pointer;display:flex;font-size:13px;line-height:30px;padding:0 12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown .markdown-toolbars .export-file ul li .iconfont[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme ul li .iconfont[data-v-c274aad4]{display:block;font-size:14px;height:30px;line-height:30px;overflow:hidden;width:30px}.markdown .markdown-toolbars .export-file ul li .iconfont[data-v-c274aad4]:hover,.markdown .markdown-toolbars .shift-theme ul li .iconfont[data-v-c274aad4]:hover{color:#262626}.markdown .markdown-toolbars .export-file ul li i[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme ul li i[data-v-c274aad4]{display:block;flex:1;font-size:13px;font-style:normal;white-space:normal}.markdown .markdown-toolbars .export-file ul li[data-v-c274aad4]:last-child,.markdown .markdown-toolbars .shift-theme ul li[data-v-c274aad4]:last-child{border-bottom:0}.markdown .markdown-toolbars .export-file ul li:last-child .iconfont[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme ul li:last-child .iconfont[data-v-c274aad4]{font-size:14px!important;margin:0!important}.markdown .markdown-toolbars .export-file ul li[data-v-c274aad4]:hover,.markdown .markdown-toolbars .shift-theme ul li[data-v-c274aad4]:hover{background:#f7f7f7}.markdown .markdown-toolbars .export-file ul li.disabled[data-v-c274aad4],.markdown .markdown-toolbars .shift-theme ul li.disabled[data-v-c274aad4]{color:#bbbec4;cursor:not-allowed}.markdown .markdown-toolbars .export-file ul li.disabled[data-v-c274aad4]:hover,.markdown .markdown-toolbars .shift-theme ul li.disabled[data-v-c274aad4]:hover{background:transparent}.markdown .markdown-toolbars .import-file[data-v-c274aad4]{position:relative}.markdown .markdown-toolbars .import-file input[data-v-c274aad4]{cursor:pointer;display:block;font-size:0;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:9999}.markdown .markdown-toolbars .import-file:hover span[data-v-c274aad4]{background:#f7f7f7;color:#1890ff}.markdown .markdown-toolbars .import-file[data-v-c274aad4]:hover:after{opacity:1;transform:scale(1)}.markdown .close-preview[data-v-c274aad4]{align-items:center;color:#262626;cursor:pointer;display:flex;height:40px;justify-content:center;position:absolute;right:0;top:0;width:40px;z-index:999}.markdown .close-preview span[data-v-c274aad4]{font-size:22px}.markdown .close-preview span[data-v-c274aad4]:hover{color:#262626}.markdown .markdown-content[data-v-c274aad4]{padding-bottom:0;width:100%}.markdown .markdown-content[data-v-c274aad4],.markdown .markdown-content .markdown-editor[data-v-c274aad4]{display:flex;flex:1;justify-content:space-between;overflow:hidden;position:relative}.markdown .markdown-content .markdown-editor[data-v-c274aad4]{background:#2d2d2d;height:100%;margin:0!important;overflow-y:scroll}.markdown .markdown-content .markdown-editor[data-v-c274aad4]::-webkit-scrollbar{display:none}.markdown .markdown-content .markdown-editor .index[data-v-c274aad4]{background:#272727;line-height:22px;min-height:100%;padding:12px 0;width:36px}.markdown .markdown-content .markdown-editor .index li[data-v-c274aad4]{background:#272727;color:#ccc;font-family:Consolas;font-size:14px;text-align:center}.markdown .markdown-content .markdown-editor textarea[data-v-c274aad4]{background:#2d2d2d;border:0;caret-color:#ccc;color:#669acc;font-family:Consolas;font-size:14px;line-height:22px;min-height:100%;outline:none;overflow:hidden;overflow-x:auto;padding:12px 8px;resize:none;white-space:nowrap;width:100%}.markdown .markdown-content .markdown-editor textarea[data-v-c274aad4]::-moz-selection{background:#999;color:#0084ff}.markdown .markdown-content .markdown-editor textarea[data-v-c274aad4]::selection{background:#999;color:#0084ff}.markdown .markdown-content .codemirror[data-v-c274aad4]{flex:1;height:100%;overflow:auto;width:0}.markdown .markdown-content .markdown-preview[data-v-c274aad4]{flex:1;height:100%;width:0}.markdown ul.toc-anchor[data-v-c274aad4]{background-color:#f6f8fa;border-left:2px solid #dcdfe6;max-width:260px;min-width:150px;overflow:auto}.markdown ul.toc-anchor li.toc-anchor-item[data-v-c274aad4]{cursor:pointer;font-size:12px;line-height:1;overflow:hidden;padding:6px 16px;text-overflow:ellipsis;white-space:nowrap}.markdown ul.toc-anchor li.toc-anchor-item span[data-v-c274aad4]{color:#333;opacity:.8}.markdown ul.toc-anchor li.toc-anchor-item span.toc-link-2[data-v-c274aad4]{padding-left:16px}.markdown ul.toc-anchor li.toc-anchor-item span.toc-link-3[data-v-c274aad4]{padding-left:32px}.markdown ul.toc-anchor li.toc-anchor-item span.toc-link-4[data-v-c274aad4]{padding-left:48px}.markdown ul.toc-anchor li.toc-anchor-item span.toc-link-5[data-v-c274aad4]{padding-left:64px}.markdown ul.toc-anchor li.toc-anchor-item span.toc-link-action[data-v-c274aad4]{color:#2b85e4;opacity:1}.markdown ul.toc-anchor li.toc-anchor-item[data-v-c274aad4]:first-child{padding-top:16px}.markdown ul.toc-anchor li.toc-anchor-item:hover span[data-v-c274aad4]{opacity:1}.insert-img-model[data-v-c274aad4]{background:rgba(0,0,0,.3);bottom:0;display:none;left:0;opacity:0;padding-top:12%;position:fixed;right:0;top:0;transition:all .3s;z-index:99999}.insert-img-model .model-container[data-v-c274aad4]{background:#fff;border-radius:4px;margin:0 auto;transform:scale(0);transform-origin:center;transition:all .3s;width:480px}.insert-img-model .model-container .model-head[data-v-c274aad4]{background:#f7f7f7;border-radius:4px 4px 0 0;box-shadow:0 1px 2px #d9d9d9;display:flex;justify-content:space-between;line-height:32px;padding:0 12px}.insert-img-model .model-container .model-head span[data-v-c274aad4]:nth-of-type(2){cursor:pointer;font-size:14px;padding-left:12px}.insert-img-model .model-container .model-head span[data-v-c274aad4]:nth-of-type(2):hover{color:#ed3f14}.insert-img-model .model-container .model-content[data-v-c274aad4]{min-height:180px;padding:0 12px 20px}.insert-img-model .model-container .model-content .insert-url[data-v-c274aad4]{align-items:center;display:flex;justify-content:space-between;padding:42px 0}.insert-img-model .model-container .model-content .insert-url input[data-v-c274aad4]{text-rendering:auto;background:#fff;border:1px solid #ccc;border-radius:4px;color:#333;display:block;flex:1;font-size:14px;line-height:24px;padding:4px 8px;transition:box-shadow 2s;-ms-writing-mode:lr-tb;writing-mode:horizontal-tb}.insert-img-model .model-container .model-content .insert-url input[data-v-c274aad4]:focus{border-color:#1890ff}.insert-img-model .model-container .model-content .insert-url input[data-v-c274aad4]::-moz-placeholder{color:#c1c1c1}.insert-img-model .model-container .model-content .insert-url input[data-v-c274aad4]:-ms-input-placeholder{color:#c1c1c1}.insert-img-model .model-container .model-content .insert-url input[data-v-c274aad4]::placeholder{color:#c1c1c1}.insert-img-model .model-container .model-content .insert-url a[data-v-c274aad4]{background:#1890ff;border:1px solid #d9d9d9;border-radius:3px;color:#fff;display:block;font-size:13px;height:32px;line-height:32px;margin-left:20px;padding:0 12px;transition:all .3s}.insert-img-model .model-container .model-content .insert-url a[data-v-c274aad4]:hover{background:#0169af}.insert-img-model .model-container .model-content .insert-local[data-v-c274aad4]{align-items:center;border:1px dashed #d9d9d9;border-radius:4px;cursor:pointer;display:flex;flex-direction:column;height:120px;justify-content:center;position:relative;transition:all .3s}.insert-img-model .model-container .model-content .insert-local span[data-v-c274aad4]{color:#d9d9d9;font-size:40px;line-height:50px;transition:all .3s}.insert-img-model .model-container .model-content .insert-local p[data-v-c274aad4]{color:#262626;font-size:14px;transition:all .3s}.insert-img-model .model-container .model-content .insert-local[data-v-c274aad4]:hover{border-color:#1890ff}.insert-img-model .model-container .model-content .insert-local:hover p[data-v-c274aad4],.insert-img-model .model-container .model-content .insert-local:hover span[data-v-c274aad4]{color:#1890ff}.insert-img-model .model-container .model-content .insert-local input[data-v-c274aad4]{display:block;height:100%;opacity:0;position:absolute;width:100%}.insert-img-model .model-container .model-foot[data-v-c274aad4]{align-items:center;display:flex;display:none;justify-content:flex-end;padding:10px 12px}.insert-img-model .model-container .model-foot a[data-v-c274aad4]{background:#f7f7f7;border:1px solid #d9d9d9;border-radius:3px;color:#262626;display:block;font-size:13px;height:26px;line-height:26px;margin-left:12px;padding:0 12px;transition:all .3s}.insert-img-model .model-container .model-foot a[data-v-c274aad4]:hover{background:#d9d9d9}.insert-img-model .model-container .model-foot a.ok[data-v-c274aad4]{background:#1890ff;border-color:#1890ff;color:#fff}.insert-img-model .model-container .model-foot a.ok[data-v-c274aad4]:hover{background:#0169af}.insert-img-model.active[data-v-c274aad4]{display:block;opacity:1}.insert-img-model.active .model-container[data-v-c274aad4]{transform:scale(1)}ul.shift[data-v-c274aad4]{align-items:center;display:flex;padding:6px 12px}ul.shift span[data-v-c274aad4]{cursor:pointer;font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ul.shift span.iconfont[data-v-c274aad4]{font-size:14px}ul.shift label[data-v-c274aad4]{cursor:pointer;font-size:12px;padding-right:10px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ul.shift input[type=radio][data-v-c274aad4],ul.shift label[data-v-c274aad4]{box-sizing:border-box;transition:all .6s ease}ul.shift input[type=radio]+label[data-v-c274aad4]:before{border:1px solid #292d35;border-radius:50%;content:"\\a0";display:inline-block;height:8px;margin-right:4px;padding:2px;vertical-align:middle;width:8px}ul.shift input[type=radio]:checked+label[data-v-c274aad4]:before{background-clip:content-box;background-color:#292d35;padding:2px}ul.shift input[type=radio][data-v-c274aad4]{clip:rect(0,0,0,0);position:absolute}ul.shift input[type=radio]:checked+label[data-v-c274aad4]{color:#292d35}[data-v-c274aad4] .markdown-preview{background:#fff;flex:1;font-family:Tahoma For Number,Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;overflow:hidden;overflow-y:scroll;padding:20px 12px!important}[data-v-c274aad4] .markdown-preview *{box-sizing:border-box;margin:0;padding:0}[data-v-c274aad4] .markdown-preview>div{background:#fff;padding:10px 12px!important}[data-v-c274aad4] .markdown-preview::-webkit-scrollbar,[data-v-c274aad4] .markdown-preview>div::-webkit-scrollbar{display:none}[data-v-c274aad4] .markdown-preview em{font-style:oblique}[data-v-c274aad4] .markdown-preview ul{list-style:none;padding:0 20px}[data-v-c274aad4] .markdown-preview ul li{position:relative}[data-v-c274aad4] .markdown-preview ul li:after{background:#262626;border-radius:50%;content:"";display:block;height:8px;left:-16px;position:absolute;top:12px;width:8px;z-index:99}[data-v-c274aad4] .markdown-preview ol,[data-v-c274aad4] .markdown-preview ul{margin:10px 0}[data-v-c274aad4] .markdown-preview ol li,[data-v-c274aad4] .markdown-preview ul li{color:#262626;font-size:14px!important;line-height:22px!important;min-height:28px;padding:4px 0 4px 6px}[data-v-c274aad4] .markdown-preview ol li input[type=checkbox],[data-v-c274aad4] .markdown-preview ul li input[type=checkbox]{cursor:pointer;left:-14px;overflow:visible;position:relative;position:absolute;top:5px}[data-v-c274aad4] .markdown-preview ol li input[type=checkbox]:before,[data-v-c274aad4] .markdown-preview ul li input[type=checkbox]:before{background-position:50%;background:#fff;color:#999;content:"\\E684";display:block;font-family:iconfont!important;font-size:18px;height:18px;left:-4px;line-height:18px;position:absolute;text-align:center;top:0;width:18px;z-index:999999}[data-v-c274aad4] .markdown-preview ol li input[type=checkbox]:checked:before,[data-v-c274aad4] .markdown-preview ul li input[type=checkbox]:checked:before{content:"\\E683"}[data-v-c274aad4] .markdown-preview ol.toc-anchor,[data-v-c274aad4] .markdown-preview ul.toc-anchor{margin:0;padding:0}[data-v-c274aad4] .markdown-preview ol.toc-anchor li.toc-anchor-item,[data-v-c274aad4] .markdown-preview ul.toc-anchor li.toc-anchor-item{cursor:pointer;font-size:13px!important;line-height:16px!important;min-height:auto;overflow:hidden;padding:4px 0;text-overflow:ellipsis;white-space:nowrap}[data-v-c274aad4] .markdown-preview ol.toc-anchor li.toc-anchor-item span,[data-v-c274aad4] .markdown-preview ul.toc-anchor li.toc-anchor-item span{color:#2b85e4;opacity:.9}[data-v-c274aad4] .markdown-preview ol.toc-anchor li.toc-anchor-item span.toc-link-2,[data-v-c274aad4] .markdown-preview ul.toc-anchor li.toc-anchor-item span.toc-link-2{padding-left:16px}[data-v-c274aad4] .markdown-preview ol.toc-anchor li.toc-anchor-item span.toc-link-3,[data-v-c274aad4] .markdown-preview ul.toc-anchor li.toc-anchor-item span.toc-link-3{padding-left:32px}[data-v-c274aad4] .markdown-preview ol.toc-anchor li.toc-anchor-item span.toc-link-4,[data-v-c274aad4] .markdown-preview ul.toc-anchor li.toc-anchor-item span.toc-link-4{padding-left:48px}[data-v-c274aad4] .markdown-preview ol.toc-anchor li.toc-anchor-item span.toc-link-5,[data-v-c274aad4] .markdown-preview ul.toc-anchor li.toc-anchor-item span.toc-link-5{padding-left:64px}[data-v-c274aad4] .markdown-preview ol.toc-anchor li.toc-anchor-item:last-child,[data-v-c274aad4] .markdown-preview ul.toc-anchor li.toc-anchor-item:last-child{padding-bottom:6px}[data-v-c274aad4] .markdown-preview ol.toc-anchor li.toc-anchor-item:hover span,[data-v-c274aad4] .markdown-preview ul.toc-anchor li.toc-anchor-item:hover span{opacity:1}[data-v-c274aad4] .markdown-preview ol{list-style-type:decimal;padding-left:20px}[data-v-c274aad4] .markdown-preview ol li{list-style:decimal}[data-v-c274aad4] .markdown-preview hr{border:0;border-top:1px solid #d9d9d9;color:#d9d9d9;height:1px;margin:20px 0;padding:0}[data-v-c274aad4] .markdown-preview del,[data-v-c274aad4] .markdown-preview em,[data-v-c274aad4] .markdown-preview strong{display:inline-block}[data-v-c274aad4] .markdown-preview blockquote{background:#f7f7f7;border-left:5px solid #d9d9d9;border-radius:2px;margin:8px 0;padding:6px 12px;position:relative}[data-v-c274aad4] .markdown-preview h1,[data-v-c274aad4] .markdown-preview h2,[data-v-c274aad4] .markdown-preview h3,[data-v-c274aad4] .markdown-preview h4,[data-v-c274aad4] .markdown-preview h5,[data-v-c274aad4] .markdown-preview h6{color:#262626}[data-v-c274aad4] .markdown-preview h1{border-bottom:1px solid #d9d9d9;font-size:28px}[data-v-c274aad4] .markdown-preview h2{font-size:24px}[data-v-c274aad4] .markdown-preview h3{font-size:18px}[data-v-c274aad4] .markdown-preview h4{font-size:16px}[data-v-c274aad4] .markdown-preview h5{font-size:14px}[data-v-c274aad4] .markdown-preview h6{font-size:12px}[data-v-c274aad4] .markdown-preview h1,[data-v-c274aad4] .markdown-preview h2,[data-v-c274aad4] .markdown-preview h3,[data-v-c274aad4] .markdown-preview h4,[data-v-c274aad4] .markdown-preview h5,[data-v-c274aad4] .markdown-preview h6{font-weight:600;padding:8px 0}[data-v-c274aad4] .markdown-preview p{color:#262626;font-size:14px!important;line-height:22px;margin-bottom:8px}[data-v-c274aad4] .markdown-preview img{cursor:pointer;display:block;margin:20px 0;max-width:100%}[data-v-c274aad4] .markdown-preview table{background:#fff;border:1px solid #d9d9d9;border-bottom:0;border-collapse:collapse;border-spacing:0;margin:20px 0;width:100%}[data-v-c274aad4] .markdown-preview table tr{transition:background .1s}[data-v-c274aad4] .markdown-preview table tr td,[data-v-c274aad4] .markdown-preview table tr th{border-bottom:1px solid #d9d9d9;color:#333;cursor:pointer;font-size:14px;line-height:24px;padding:4px 8px}[data-v-c274aad4] .markdown-preview table th{background:#f8f8f9;font-weight:700;text-align:left}[data-v-c274aad4] .markdown-preview table tr:nth-of-type(2n) td{background:#fafafa}[data-v-c274aad4] .markdown-preview table tr:hover td{background:#f5f5f5}[data-v-c274aad4] .markdown-preview table td,[data-v-c274aad4] .markdown-preview table th{border:1px solid #d9d9d9;word-break:break-all}[data-v-c274aad4] .markdown-preview input[type=checkbox]{border-radius:0;display:inline-block;margin-right:8px}[data-v-c274aad4] .markdown-preview a{color:#1890ff;font-size:14px;line-height:22px;text-decoration:none}[data-v-c274aad4] .markdown-preview .code-block{padding:0!important;position:relative}[data-v-c274aad4] .markdown-preview .code-block .copy-code{color:#d9d9d9;cursor:pointer;font-size:12px;line-height:20px;opacity:0;position:absolute;right:10px;top:5px;transition:all .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:999}[data-v-c274aad4] .markdown-preview .code-block .copy-code:hover{color:#1890ff}[data-v-c274aad4] .markdown-preview .code-block:hover .copy-code{opacity:1}.preview-img[data-v-c274aad4]{align-items:center;background:rgba(0,0,0,.5);display:none;height:100vh;justify-content:center;left:0;opacity:0;position:fixed;top:0;transition:opacity .3s .1s;width:100vw;z-index:99999999}.preview-img .close[data-v-c274aad4]{color:#fff;cursor:pointer;font-size:20px;padding:10px;position:absolute;right:0;top:0}.preview-img img[data-v-c274aad4]{display:block}.preview-img img.vertical[data-v-c274aad4]{height:80%;width:auto}.preview-img img.horizontal[data-v-c274aad4]{height:auto;width:80%}.preview-img.active[data-v-c274aad4]{display:flex;opacity:1}',""]);const l=a},74402:(e,t,r)=>{r.d(t,{Z:()=>o});var n=r(1519),i=r.n(n)()((function(e){return e[1]}));i.push([e.id,'.CodeMirror{color:#000;direction:ltr;height:100%}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px 0 8px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{background-color:#f7f7f7;border-right:1px solid #ddd;white-space:nowrap}.CodeMirror-linenumber{color:#999;min-width:20px;padding:0 5px!important;text-align:right;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{background:#7e7;border:0!important;width:auto}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20,255,20,.5)}.cm-animate-fat-cursor,.cm-fat-cursor-mark{-webkit-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{background-color:#7e7;border:0;width:auto}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:-50px}.CodeMirror-ruler{border-left:1px solid #ccc;bottom:0;position:absolute;top:0}.CodeMirror{background:#fff;overflow:hidden;position:relative}.CodeMirror-scroll{height:100%;margin-bottom:-30px;margin-right:-30px;outline:none;overflow:scroll!important;padding-bottom:30px;position:relative}.CodeMirror-sizer{border-right:30px solid transparent;position:relative}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{display:none;position:absolute;z-index:6}.CodeMirror-vscrollbar{overflow-x:hidden;overflow-y:scroll;right:0;top:0}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-x:scroll;overflow-y:hidden}.CodeMirror-scrollbar-filler{bottom:0;right:0}.CodeMirror-gutter-filler{bottom:0;left:0}.CodeMirror-gutters{left:0;min-height:100%;position:absolute;top:0;z-index:3}.CodeMirror-gutter{display:inline-block;height:100%;margin-bottom:-30px;vertical-align:top;white-space:normal}.CodeMirror-gutter-wrapper{background:none!important;border:none!important;position:absolute;z-index:4}.CodeMirror-gutter-background{bottom:0;position:absolute;top:0;z-index:4}.CodeMirror-gutter-elt{cursor:default;position:absolute;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{word-wrap:normal;-webkit-tap-highlight-color:transparent;background:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-variant-ligatures:contextual;line-height:inherit;margin:0;overflow:visible;position:relative;white-space:pre;z-index:2}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{bottom:0;left:0;position:absolute;right:0;top:0;z-index:0}.CodeMirror-linewidget{padding:.1px;position:relative;z-index:2}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{box-sizing:content-box}.CodeMirror-measure{height:0;overflow:hidden;position:absolute;visibility:hidden;width:100%}.CodeMirror-cursor{pointer-events:none;position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{position:relative;visibility:hidden;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-strikethrough{text-decoration:line-through}.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.cm-s-default.CodeMirror,.cm-s-default .CodeMirror-gutters{background-color:#282a36!important;border:none;color:#f8f8f2!important}.cm-s-default *,.cm-s-default.CodeMirror,.cm-s-default .CodeMirror-gutters{font-family:Menlo,Consolas,Courier New,Courier,FreeMono,monospace!important}.cm-s-default *{color:#ccc;font-size:14px;line-height:1.6!important}.cm-s-default .CodeMirror-gutters{color:#282a36}.cm-s-default .CodeMirror-cursor{border-left:thin solid #f8f8f0}.cm-s-default .CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-default .CodeMirror-line::selection,.cm-s-default .CodeMirror-line>span::selection,.cm-s-default .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-default .CodeMirror-line::-moz-selection,.cm-s-default .CodeMirror-line>span::-moz-selection,.cm-s-default .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-default span.cm-comment{color:#999}.cm-s-default span.cm-string,.cm-s-default span.cm-string-2{color:#ce9178}.cm-s-default span.cm-number{color:#bd93f9}.cm-s-default span.cm-variable,.cm-s-default span.cm-variable-2{color:#61afef}.cm-s-default span.cm-def,.cm-s-default span.cm-operator{color:#e0e2e4}.cm-s-default span.cm-keyword{color:#c678dd}.cm-s-default span.cm-atom{color:#bd93f9}.cm-s-default span.cm-meta{color:#f8f8f2}.cm-s-default span.cm-tag{color:#569cd6}.cm-s-default span.cm-attribute,.cm-s-default span.cm-qualifier{color:#9cdcfe}.cm-s-default span.cm-property{color:#dcdcaa}.cm-s-default span.cm-builtin{color:#50fa7b}.cm-s-default span.cm-type,.cm-s-default span.cm-variable-3{color:#ffb86c}.cm-s-default .CodeMirror-activeline-background{background:hsla(0,0%,100%,.1)}.cm-s-default .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}.cm-s-default .cm-header{color:#fff}.cm-s-default .CodeMirror-gutter{background:#22252b;padding-right:2px}.cm-link{color:#569cd6;text-decoration:underline}.cm-url{color:#9cdcfe!important}',""]);const o=i},55305:(e,t,r)=>{r.d(t,{Z:()=>c});var n=r(20629);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s={name:"ImgUpload",props:{value:{},num:{},width:{},height:{},type:{},http:{type:Boolean,default:!1},otherParams:{type:Object,default:function(){return{}}},uploadIng:{type:Number,default:0}},data:function(){return{actionUrl:$A.apiUrl("system/imgupload"),params:{width:this.width,height:this.height},multiple:this.num>1,visible:!1,browseVisible:!1,isLoading:!1,browseList:[],browseListNext:[],imgVisible:"",defaultList:this.initItems(this.value),uploadList:[],maxNum:Math.min(Math.max($A.runNum(this.num),1),99),httpValue:"",httpType:"",maxSize:2048}},mounted:function(){var e=this;this.uploadList=this.$refs.upload.fileList,this.$emit("input",this.uploadList);var t=$A(this.$refs.browselistbox);t.scroll((function(){var r=t[0].scrollHeight;if(t[0].scrollTop+t.height()>=r&&e.browseListNext.length>0){var n=e.browseListNext;e.browseListNext=[],e.browsePictureFor(n)}}))},watch:{value:function(e){"string"!=typeof e?e!==this.$refs.upload.fileList&&(this.$refs.upload.fileList=this.initItems(e),this.uploadList=this.$refs.upload.fileList):this.$emit("input",this.initItems(e))},browseVisible:function(){this.httpType="",this.httpValue=""}},computed:a(a({},(0,n.rn)(["userToken"])),{},{uploadHeaders:function(){return{fd:$A.getStorageString("userWsFd"),token:this.userToken}},uploadParams:function(){return Object.keys(this.otherParams).length>0?Object.assign(this.params,this.otherParams):this.params}}),methods:{handleCallback:function(e){"callback"===this.type&&(!0===e?(this.$emit("on-callback",this.uploadList),this.$refs.upload.fileList=[],this.uploadList=this.$refs.upload.fileList):"object"===i(e)&&this.$emit("on-callback",[e])),this.browseVisible=!1},initItems:function(e){"string"==typeof e&&(e=[{url:e}]);var t=[];return $A.each(e,(function(e,r){"string"==typeof r&&(r={url:r}),r.url&&(r.active=!0,r.status="finished",void 0===r.path&&(r.path=r.url),void 0===r.thumb&&(r.thumb=r.url),t.push(r))})),t},handleView:function(e){this.visible=!0,this.imgVisible=e.url},handleRemove:function(e){var t=this.$refs.upload.fileList;this.$refs.upload.fileList.splice(t.indexOf(e),1),this.$emit("input",this.$refs.upload.fileList)},handleProgress:function(){this.$emit("update:uploadIng",this.uploadIng+1)},handleSuccess:function(e,t){this.$emit("update:uploadIng",this.uploadIng-1),1===e.ret?(t.url=e.data.url,t.path=e.data.path,t.thumb=e.data.thumb,this.handleCallback(t)):($A.noticeWarning({title:this.$L("上传失败"),desc:this.$L("文件 "+t.name+" 上传失败 "+e.msg)}),this.$refs.upload.fileList.pop()),this.$emit("input",this.$refs.upload.fileList)},handleError:function(){this.$emit("update:uploadIng",this.uploadIng-1)},handleFormatError:function(e){$A.noticeWarning({title:this.$L("文件格式不正确"),desc:this.$L("文件 "+e.name+" 格式不正确,请上传 jpg、jpeg、gif、png 格式的图片。")})},handleMaxSize:function(e){$A.noticeWarning({title:this.$L("超出文件大小限制"),desc:this.$L("文件 "+e.name+" 太大,不能超过:"+$A.bytesToSize(1024*this.maxSize))})},handleBeforeUpload:function(){var e=this.uploadList.length<this.maxNum;return e||1!=this.uploadList.length||(this.handleRemove(this.uploadList[0]),e=this.uploadList.length<this.maxNum),e||$A.noticeWarning(this.$L("最多只能上传 "+this.maxNum+" 张图片。")),this.params={width:this.width,height:this.height},e},handleClick:function(){this.handleBeforeUpload()&&this.$refs.upload.handleClick()},handleManual:function(e){this.handleBeforeUpload()&&this.$refs.upload.upload(e)},browsePicture:function(e){var t=this;this.browseVisible=!0,this.browseList=[],this.browseListNext=[],this.isLoading=!0,this.$store.dispatch("call",{url:"system/imgview",data:{path:e||""}}).then((function(e){var r=e.data;t.isLoading=!1;for(var n=r.dirs,i=0;i<n.length;i++)t.browseList.push(n[i]);t.browsePictureFor(r.files)})).catch((function(e){var r=e.msg;t.isLoading=!1,t.browseVisible=!1,$A.noticeWarning(r)}))},browsePictureFor:function(e){for(var t=0;t<e.length;t++){for(var r=0;r<this.uploadList.length;r++)if(this.uploadList[r].url===e[t].url||this.uploadList[r].url===e[t].path){e[t].active=!0;break}t<100?this.browseList.push(e[t]):this.browseListNext.push(e[t])}},browseItem:function(e){if("dir"===e.type)this.browsePicture(e.path);else if("file"===e.type){if(e.active){var t=this.$refs.upload.fileList;this.$refs.upload.fileList.splice(t.indexOf(e),1),e.active=!1}else{if(1===this.maxNum){for(var r=0;r<this.browseList.length;r++)this.browseList[r].active=!1;this.$refs.upload.fileList=[],this.uploadList=this.$refs.upload.fileList}if(!(this.uploadList.length<this.maxNum))return void $A.noticeWarning(this.$L("最多只能选择 "+this.maxNum+" 张图片。"));e.active=!0,e.status="finished",this.$refs.upload.fileList.push(e),this.uploadList=this.$refs.upload.fileList}this.$emit("input",this.$refs.upload.fileList)}},__thumb:function(e){return $A.strExists(e,"?",!1)?e+"&__thumb=true":e+"?__thumb=true"},httpEnter:function(){this.$emit("input",this.initItems(this.httpValue)),this.browseVisible=!1}}};const c=(0,r(51900).Z)(s,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"common-img-update"},[e._l(e.uploadList,(function(t){return"callback"!==e.type?r("div",{staticClass:"imgcomp-upload-list"},["finished"===t.status?[r("div",{staticClass:"imgcomp-upload-img",style:{"background-image":"url("+e.__thumb(t.thumb)+")"}}),e._v(" "),r("div",{staticClass:"imgcomp-upload-list-cover"},[r("Icon",{attrs:{type:"ios-eye-outline"},nativeOn:{click:function(r){return e.handleView(t)}}}),e._v(" "),r("Icon",{attrs:{type:"ios-trash-outline"},nativeOn:{click:function(r){return e.handleRemove(t)}}})],1)]:[t.showProgress?r("Progress",{attrs:{percent:t.percentage,"hide-info":""}}):e._e()]],2):e._e()})),e._v(" "),r("div",{staticClass:"add-box",class:{"callback-add-box":"callback"===e.type}},[r("div",{staticClass:"add-box-icon"},[r("Icon",{attrs:{type:"md-add",size:"32"}})],1),e._v(" "),r("div",{staticClass:"add-box-upload"},[r("div",{staticClass:"add-box-item",on:{click:e.browsePicture}},[r("span",[e._v(e._s(e.$L("浏览"))),"callback"===e.type?r("em",[e._v(e._s(e.$L("图片")))]):e._e()])]),e._v(" "),r("div",{staticClass:"add-box-item"},[r("Upload",{ref:"upload",attrs:{name:"image",accept:"image/*",action:e.actionUrl,headers:e.uploadHeaders,data:e.uploadParams,"show-upload-list":!1,"max-size":e.maxSize,format:["jpg","jpeg","gif","png"],"default-file-list":e.defaultList,"on-progress":e.handleProgress,"on-success":e.handleSuccess,"on-error":e.handleError,"on-format-error":e.handleFormatError,"on-exceeded-size":e.handleMaxSize,"before-upload":e.handleBeforeUpload,multiple:e.multiple}},[r("span",[e._v(e._s(e.$L("上传"))),"callback"===e.type?r("em",[e._v(e._s(e.$L("图片")))]):e._e()])])],1)])]),e._v(" "),r("Modal",{staticClass:"img-upload-modal",attrs:{title:e.$L("浏览图片空间的图片"),width:"710"},model:{value:e.browseVisible,callback:function(t){e.browseVisible=t},expression:"browseVisible"}},[e.isLoading?r("div",{staticClass:"browse-load"},[e._v(e._s(e.$L("加载中...")))]):e._e(),e._v(" "),r("div",{ref:"browselistbox",staticClass:"browse-list",class:"input"===e.httpType?"browse-list-disabled":""},e._l(e.browseList,(function(t){return r("div",{staticClass:"browse-item",on:{click:function(r){return e.browseItem(t)}}},[t.active?r("Icon",{staticClass:"browse-icon",attrs:{type:"ios-checkmark-circle"}}):e._e(),e._v(" "),r("div",{staticClass:"browse-img",style:{"background-image":"url("+t.thumb+")"}}),e._v(" "),r("div",{staticClass:"browse-title"},[e._v(e._s(t.title))])],1)})),0),e._v(" "),r("div",{staticClass:"img-upload-foot",attrs:{slot:"footer"},slot:"footer"},["callback"!==e.type&&e.http&&""===e.httpType?r("div",{staticClass:"img-upload-foot-input",on:{click:function(t){e.httpType="input"}}},[r("Icon",{attrs:{type:"ios-image",size:"22"}}),e._v(" "),r("div",{staticClass:"img-upload-foot-httptitle"},[e._v(e._s(e.$L("自定义图片地址")))])],1):e._e(),e._v(" "),"callback"!==e.type&&e.http&&"input"===e.httpType?r("div",{staticClass:"img-upload-foot-input"},[r("Input",{attrs:{placeholder:e.$L("以 http:// 或 https:// 开头"),search:"","enter-button":e.$L("确定")},on:{"on-search":e.httpEnter},model:{value:e.httpValue,callback:function(t){e.httpValue=t},expression:"httpValue"}},[r("span",{staticStyle:{cursor:"pointer"},attrs:{slot:"prepend"},on:{click:function(t){e.httpType=""}},slot:"prepend"},[e._v(e._s(e.$L("自定义地址"))+": ")])])],1):e._e(),e._v(" "),""===e.httpType?r("Button",{on:{click:function(t){e.browseVisible=!1}}},[e._v(e._s(e.$L("关闭")))]):e._e(),e._v(" "),""===e.httpType?r("Button",{attrs:{type:"primary"},on:{click:function(t){return e.handleCallback(!0)}}},[e._v(e._s(e.$L("完成")))]):e._e()],1)]),e._v(" "),r("Modal",{staticClass:"img-upload-modal",attrs:{title:e.$L("查看图片"),draggable:""},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[r("div",{staticStyle:{"max-height":"480px",overflow:"auto"}},[r("a",{attrs:{href:e.imgVisible,target:"_blank"}},[e.visible?r("img",{staticStyle:{"max-width":"100%","max-height":"900px",display:"block",margin:"0 auto"},attrs:{src:e.imgVisible}}):e._e()])])])],2)}),[],!1,null,null,null).exports},51710:(e,t,r)=>{r.r(t),r.d(t,{default:()=>is});function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=navigator.userAgent,o=navigator.platform,a=/gecko\/\d/i.test(i),l=/MSIE \d/.test(i),s=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(i),c=/Edge\/(\d+)/.exec(i),d=l||s||c,u=d&&(l?document.documentMode||6:+(c||s)[1]),h=!c&&/WebKit\//.test(i),f=h&&/Qt\/\d+\.\d+/.test(i),p=!c&&/Chrome\//.test(i),m=/Opera\//.test(i),g=/Apple Computer/.test(navigator.vendor),v=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(i),b=/PhantomJS/.test(i),w=!c&&/AppleWebKit/.test(i)&&/Mobile\/\w+/.test(i),y=/Android/.test(i),k=w||y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(i),x=w||/Mac/.test(o),C=/\bCrOS\b/.test(i),S=/win/i.test(o),L=m&&i.match(/Version\/(\d*\.\d*)/);L&&(L=Number(L[1])),L&&L>=15&&(m=!1,h=!0);var M=x&&(f||m&&(null==L||L<12.11)),T=a||d&&u>=9;function D(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var A,z=function(e,t){var r=e.className,n=D(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function F(e,t){return O(e).appendChild(t)}function N(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function E(e,t,r,n){var i=N(e,t,r,n);return i.setAttribute("role","presentation"),i}function j(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function P(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function I(e,t){var r=e.className;D(t).test(r)||(e.className+=(r?" ":"")+t)}function H(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!D(r[n]).test(t)&&(t+=" "+r[n]);return t}A=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var _=function(e){e.select()};function W(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function $(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function B(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}w?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:d&&(_=function(e){try{e.select()}catch(e){}});var R=function(){this.id=null,this.f=null,this.time=0,this.handler=W(this.onTimeout,this)};function V(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}R.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},R.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var U={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},K={origin:"*mouse"},G={origin:"+move"};function Z(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var X=[""];function Y(e){for(;X.length<=e;)X.push(Q(X)+" ");return X[e]}function Q(e){return e[e.length-1]}function J(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function ee(){}function te(e,t){var r;return Object.create?r=Object.create(e):(ee.prototype=e,r=new ee),t&&$(t,r),r}var re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ne(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||re.test(e))}function ie(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ne(e))||t.test(e):ne(e)}function oe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ae=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function le(e){return e.charCodeAt(0)>=768&&ae.test(e)}function se(e,t,r){for(;(r<0?t>0:t<e.length)&&le(e.charAt(t));)t+=r;return t}function ce(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}var de=null;function ue(e,t,r){var n;de=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:de=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:de=i)}return null!=n?n:de}var he=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,r=/[LRr]/,n=/[Lb1n]/,i=/[1n]/;function o(e,t,r){this.level=e,this.from=t,this.to=r}return function(a,l){var s="ltr"==l?"L":"R";if(0==a.length||"ltr"==l&&!e.test(a))return!1;for(var c,d=a.length,u=[],h=0;h<d;++h)u.push((c=a.charCodeAt(h))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var f=0,p=s;f<d;++f){var m=u[f];"m"==m?u[f]=p:p=m}for(var g=0,v=s;g<d;++g){var b=u[g];"1"==b&&"r"==v?u[g]="n":r.test(b)&&(v=b,"r"==b&&(u[g]="R"))}for(var w=1,y=u[0];w<d-1;++w){var k=u[w];"+"==k&&"1"==y&&"1"==u[w+1]?u[w]="1":","!=k||y!=u[w+1]||"1"!=y&&"n"!=y||(u[w]=y),y=k}for(var x=0;x<d;++x){var C=u[x];if(","==C)u[x]="N";else if("%"==C){var S=void 0;for(S=x+1;S<d&&"%"==u[S];++S);for(var L=x&&"!"==u[x-1]||S<d&&"1"==u[S]?"1":"N",M=x;M<S;++M)u[M]=L;x=S-1}}for(var T=0,D=s;T<d;++T){var A=u[T];"L"==D&&"1"==A?u[T]="L":r.test(A)&&(D=A)}for(var z=0;z<d;++z)if(t.test(u[z])){var O=void 0;for(O=z+1;O<d&&t.test(u[O]);++O);for(var F="L"==(z?u[z-1]:s),N=F==("L"==(O<d?u[O]:s))?F?"L":"R":s,E=z;E<O;++E)u[E]=N;z=O-1}for(var j,P=[],I=0;I<d;)if(n.test(u[I])){var H=I;for(++I;I<d&&n.test(u[I]);++I);P.push(new o(0,H,I))}else{var _=I,W=P.length;for(++I;I<d&&"L"!=u[I];++I);for(var $=_;$<I;)if(i.test(u[$])){_<$&&P.splice(W,0,new o(1,_,$));var B=$;for(++$;$<I&&i.test(u[$]);++$);P.splice(W,0,new o(2,B,$)),_=$}else++$;_<I&&P.splice(W,0,new o(1,_,I))}return"ltr"==l&&(1==P[0].level&&(j=a.match(/^\s+/))&&(P[0].from=j[0].length,P.unshift(new o(0,0,j[0].length))),1==Q(P).level&&(j=a.match(/\s+$/))&&(Q(P).to-=j[0].length,P.push(new o(0,d-j[0].length,d)))),"rtl"==l?P.reverse():P}}();function fe(e,t){var r=e.order;return null==r&&(r=e.order=he(e.text,t)),r}var pe=[],me=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||pe).concat(r)}};function ge(e,t){return e._handlers&&e._handlers[t]||pe}function ve(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=V(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function be(e,t){var r=ge(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function we(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),be(e,r||t.type,e,t),Le(t)||t.codemirrorIgnore}function ye(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==V(r,t[n])&&r.push(t[n])}function ke(e,t){return ge(e,t).length>0}function xe(e){e.prototype.on=function(e,t){me(this,e,t)},e.prototype.off=function(e,t){ve(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Se(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Le(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Me(e){Ce(e),Se(e)}function Te(e){return e.target||e.srcElement}function De(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),x&&e.ctrlKey&&1==t&&(t=3),t}var Ae,ze,Oe=function(){if(d&&u<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function Fe(e){if(null==Ae){var t=N("span","");F(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ae=t.offsetWidth<=1&&t.offsetHeight>2&&!(d&&u<8))}var r=Ae?N("span",""):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function Ne(e){if(null!=ze)return ze;var t=F(e,document.createTextNode("AخA")),r=A(t,0,1).getBoundingClientRect(),n=A(t,1,2).getBoundingClientRect();return O(e),!(!r||r.left==r.right)&&(ze=n.right-r.right<3)}var Ee,je=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Pe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ie="oncopy"in(Ee=N("div"))||(Ee.setAttribute("oncopy","return;"),"function"==typeof Ee.oncopy),He=null;var _e={},We={};function $e(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_e[e]=t}function Be(e){if("string"==typeof e&&We.hasOwnProperty(e))e=We[e];else if(e&&"string"==typeof e.name&&We.hasOwnProperty(e.name)){var t=We[e.name];"string"==typeof t&&(t={name:t}),(e=te(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Re(e,t){t=Be(t);var r=_e[t.name];if(!r)return Re(e,"text/plain");var n=r(e,t);if(Ve.hasOwnProperty(t.name)){var i=Ve[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}var Ve={};function Ue(e,t){$(t,Ve.hasOwnProperty(e)?Ve[e]:Ve[e]={})}function qe(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ke(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ge(e,t,r){return!e.startState||e.startState(t,r)}var Ze=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Xe(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function Ye(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,(function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i})),n}function Qe(e,t,r){var n=[];return e.iter(t,r,(function(e){n.push(e.text)})),n}function Je(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function et(e){if(null==e.parent)return null;for(var t=e.parent,r=V(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function tt(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a].height;if(t<l)break;t-=l}return r+a}function rt(e,t){return t>=e.first&&t<e.first+e.size}function nt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function it(e,t,r){if(void 0===r&&(r=null),!(this instanceof it))return new it(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ot(e,t){return e.line-t.line||e.ch-t.ch}function at(e,t){return e.sticky==t.sticky&&0==ot(e,t)}function lt(e){return it(e.line,e.ch)}function st(e,t){return ot(e,t)<0?t:e}function ct(e,t){return ot(e,t)<0?e:t}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ut(e,t){if(t.line<e.first)return it(e.first,0);var r=e.first+e.size-1;return t.line>r?it(r,Xe(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?it(e.line,t):r<0?it(e.line,0):e}(t,Xe(e,t.line).text.length)}function ht(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ut(e,t[n]);return r}Ze.prototype.eol=function(){return this.pos>=this.string.length},Ze.prototype.sol=function(){return this.pos==this.lineStart},Ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ze.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ze.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Ze.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ze.prototype.skipToEnd=function(){this.pos=this.string.length},Ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ze.prototype.backUp=function(e){this.pos-=e},Ze.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=B(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},Ze.prototype.indentation=function(){return B(this.string,null,this.tabSize)-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},Ze.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ft=function(e,t){this.state=e,this.lookAhead=t},pt=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function mt(e,t,r,n){var i=[e.state.modeGen],o={};St(e,t.text,e.doc.mode,r,(function(e,t){return i.push(e,t)}),o,n);for(var a=r.state,l=function(n){r.baseTokens=i;var l=e.state.overlays[n],s=1,c=0;r.state=!0,St(e,t.text,l.mode,r,(function(e,t){for(var r=s;c<e;){var n=i[s];n>e&&i.splice(s,1,e,i[s+1],n),s+=2,c=Math.min(e,n)}if(t)if(l.opaque)i.splice(r,s-r,e,"overlay "+t),s=r+2;else for(;r<s;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}}),o),r.state=a,r.baseTokens=null,r.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function gt(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=vt(e,et(t)),i=t.text.length>e.options.maxHighlightLength&&qe(e.doc.mode,n.state),o=mt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function vt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new pt(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=Xe(o,l-1),c=s.stateAfter;if(c&&(!r||l+(c instanceof ft?c.lookAhead:0)<=o.modeFrontier))return l;var d=B(s.text,null,e.options.tabSize);(null==i||n>d)&&(i=l-1,n=d)}return i}(e,t,r),a=o>n.first&&Xe(n,o-1).stateAfter,l=a?pt.fromSaved(n,a,o):new pt(n,Ge(n.mode),o);return n.iter(o,t,(function(r){bt(e,r.text,l);var n=l.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?l.save():null,l.nextLine()})),r&&(n.modeFrontier=l.line),l}function bt(e,t,r,n){var i=e.doc.mode,o=new Ze(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&wt(i,r.state);!o.eol();)yt(i,o,r.state),o.start=o.pos}function wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ke(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function yt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ke(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}pt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},pt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pt.fromSaved=function(e,t,r){return t instanceof ft?new pt(e,qe(e.mode,t.state),r,t.lookAhead):new pt(e,qe(e.mode,t),r)},pt.prototype.save=function(e){var t=!1!==e?qe(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ft(t,this.maxLookAhead):t};var kt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function xt(e,t,r,n){var i,o,a=e.doc,l=a.mode,s=Xe(a,(t=ut(a,t)).line),c=vt(e,t.line,r),d=new Ze(s.text,e.options.tabSize,c);for(n&&(o=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,i=yt(l,d,c.state),n&&o.push(new kt(d,i,qe(a.mode,c.state)));return n?o:new kt(d,i,c.state)}function Ct(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function St(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,d=null,u=new Ze(t,e.options.tabSize,n),h=e.options.addModeClass&&[null];for(""==t&&Ct(wt(r,n.state),o);!u.eol();){if(u.pos>e.options.maxHighlightLength?(l=!1,a&&bt(e,t,n,u.pos),u.pos=t.length,s=null):s=Ct(yt(r,u,n.state,h),o),h){var f=h[0].name;f&&(s="m-"+(s?f+" "+s:f))}if(!l||d!=s){for(;c<u.start;)i(c=Math.min(u.start,c+5e3),d);d=s}u.start=u.pos}for(;c<u.pos;){var p=Math.min(u.pos,c+5e3);i(p,d),c=p}}var Lt=!1,Mt=!1;function Tt(e,t,r){this.marker=e,this.from=t,this.to=r}function Dt(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function At(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function zt(e,t){if(t.full)return null;var r=rt(e,t.from.line)&&Xe(e,t.from.line).markedSpans,n=rt(e,t.to.line)&&Xe(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==ot(t.from,t.to),l=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Tt(a,o.from,l?null:o.to))}}return n}(r,i,a),s=function(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker;if(null==o.to||(a.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Tt(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,a),c=1==t.text.length,d=Q(t.text).length+(c?i:0);if(l)for(var u=0;u<l.length;++u){var h=l[u];if(null==h.to){var f=Dt(s,h.marker);f?c&&(h.to=null==f.to?null:f.to+d):h.to=i}}if(s)for(var p=0;p<s.length;++p){var m=s[p];if(null!=m.to&&(m.to+=d),null==m.from)Dt(l,m.marker)||(m.from=d,c&&(l||(l=[])).push(m));else m.from+=d,c&&(l||(l=[])).push(m)}l&&(l=Ot(l)),s&&s!=l&&(s=Ot(s));var g=[l];if(!c){var v,b=t.text.length-2;if(b>0&&l)for(var w=0;w<l.length;++w)null==l[w].to&&(v||(v=[])).push(new Tt(l[w].marker,null,null));for(var y=0;y<b;++y)g.push(v);g.push(s)}return g}function Ot(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ft(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Nt(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Et(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function Pt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ot(n.from,i.from)||Et(e)-Et(t);if(o)return-o;var a=ot(n.to,i.to)||jt(e)-jt(t);return a||t.id-e.id}function It(e,t){var r,n=Mt&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Pt(r,i.marker)<0)&&(r=i.marker);return r}function Ht(e){return It(e,!0)}function _t(e){return It(e,!1)}function Wt(e,t){var r,n=Mt&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Pt(r,o.marker)<0)&&(r=o.marker)}return r}function $t(e,t,r,n,i){var o=Xe(e,t),a=Mt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),d=ot(c.from,r)||Et(s.marker)-Et(i),u=ot(c.to,n)||jt(s.marker)-jt(i);if(!(d>=0&&u<=0||d<=0&&u>=0)&&(d<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ot(c.to,r)>=0:ot(c.to,r)>0)||d>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ot(c.from,n)<=0:ot(c.from,n)<0)))return!0}}}function Bt(e){for(var t;t=Ht(e);)e=t.find(-1,!0).line;return e}function Rt(e,t){var r=Xe(e,t),n=Bt(r);return r==n?t:et(n)}function Vt(e,t){if(t>e.lastLine())return t;var r,n=Xe(e,t);if(!Ut(e,n))return t;for(;r=_t(n);)n=r.find(1,!0).line;return et(n)+1}function Ut(e,t){var r=Mt&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&qt(e,t,n))return!0}}function qt(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return qt(e,n.line,Dt(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&qt(e,t,i))return!0}function Kt(e){for(var t=0,r=(e=Bt(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function Gt(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Ht(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=_t(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function Zt(e){var t=e.display,r=e.doc;t.maxLine=Xe(r,r.first),t.maxLineLength=Gt(t.maxLine),t.maxLineChanged=!0,r.iter((function(e){var r=Gt(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)}))}var Xt=function(e,t,r){this.text=e,Nt(this,t),this.height=r?r(this):1};function Yt(e){e.parent=null,Ft(e)}Xt.prototype.lineNo=function(){return et(this)},xe(Xt);var Qt={},Jt={};function er(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Jt:Qt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function tr(e,t){var r=E("span",null,null,h?"padding-right: .1px":null),n={pre:E("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;n.pos=0,n.addToken=nr,Ne(e.display.measure)&&(a=fe(o,e.doc.direction))&&(n.addToken=ir(n.addToken,a)),n.map=[],ar(o,n,gt(e,o,t!=e.display.externalMeasured&&et(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=H(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=H(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Fe(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(h){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return be(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=H(n.pre.className,n.textClass||"")),n}function rr(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function nr(e,t,r,n,i,o,a){if(t){var l,s=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,c=e.cm.state.specialChars,h=!1;if(c.test(t)){l=document.createDocumentFragment();for(var f=0;;){c.lastIndex=f;var p=c.exec(t),m=p?p.index-f:t.length-f;if(m){var g=document.createTextNode(s.slice(f,f+m));d&&u<9?l.appendChild(N("span",[g])):l.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;f+=m+1;var v=void 0;if("\t"==p[0]){var b=e.cm.options.tabSize,w=b-e.col%b;(v=l.appendChild(N("span",Y(w),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=w}else"\r"==p[0]||"\n"==p[0]?((v=l.appendChild(N("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),d&&u<9?l.appendChild(N("span",[v])):l.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,l=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,l),d&&u<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==s.charCodeAt(t.length-1),r||n||i||h||o){var y=r||"";n&&(y+=n),i&&(y+=i);var k=N("span",[l],y,o);if(a)for(var x in a)a.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&k.setAttribute(x,a[x]);return e.content.appendChild(k)}e.content.appendChild(l)}}function ir(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,d=c+n.length;;){for(var u=void 0,h=0;h<t.length&&!((u=t[h]).to>c&&u.from<=c);h++);if(u.to>=d)return e(r,n,i,o,a,l,s);e(r,n.slice(0,u.to-c),i,o,null,l,s),o=null,n=n.slice(u.to-c),c=u.to}}}function or(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function ar(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,d,u,h,f=i.length,p=0,m=1,g="",v=0;;){if(v==p){s=c=d=l="",h=null,u=null,v=1/0;for(var b=[],w=void 0,y=0;y<n.length;++y){var k=n[y],x=k.marker;if("bookmark"==x.type&&k.from==p&&x.widgetNode)b.push(x);else if(k.from<=p&&(null==k.to||k.to>p||x.collapsed&&k.to==p&&k.from==p)){if(null!=k.to&&k.to!=p&&v>k.to&&(v=k.to,c=""),x.className&&(s+=" "+x.className),x.css&&(l=(l?l+";":"")+x.css),x.startStyle&&k.from==p&&(d+=" "+x.startStyle),x.endStyle&&k.to==v&&(w||(w=[])).push(x.endStyle,k.to),x.title&&((h||(h={})).title=x.title),x.attributes)for(var C in x.attributes)(h||(h={}))[C]=x.attributes[C];x.collapsed&&(!u||Pt(u.marker,x)<0)&&(u=k)}else k.from>p&&v>k.from&&(v=k.from)}if(w)for(var S=0;S<w.length;S+=2)w[S+1]==v&&(c+=" "+w[S]);if(!u||u.from==p)for(var L=0;L<b.length;++L)or(t,0,b[L]);if(u&&(u.from||0)==p){if(or(t,(null==u.to?f+1:u.to)-p,u.marker,null==u.from),null==u.to)return;u.to==p&&(u=!1)}}if(p>=f)break;for(var M=Math.min(f,v);;){if(g){var T=p+g.length;if(!u){var D=T>M?g.slice(0,M-p):g;t.addToken(t,D,a?a+s:s,d,p+D.length==v?c:"",l,h)}if(T>=M){g=g.slice(M-p),p=M;break}p=T,d=""}g=i.slice(o,o=r[m++]),a=er(r[m++],t.cm.options)}}else for(var A=1;A<r.length;A+=2)t.addToken(t,i.slice(o,o=r[A]),er(r[A+1],t.cm.options))}function lr(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=_t(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?et(Q(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function sr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new lr(e.doc,Xe(e.doc,o),o);n=o+a.size,i.push(a)}return i}var cr=null;var dr=null;function ur(e,t){var r=ge(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);cr?n=cr.delayedCallbacks:dr?n=dr:(n=dr=[],setTimeout(hr,0));for(var o=function(e){n.push((function(){return r[e].apply(null,i)}))},a=0;a<r.length;++a)o(a)}}function hr(){var e=dr;dr=null;for(var t=0;t<e.length;++t)e[t]()}function fr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?gr(e,t):"gutter"==o?br(e,t,r,n):"class"==o?vr(e,t):"widget"==o&&wr(e,t,n)}t.changes=null}function pr(e){return e.node==e.text&&(e.node=N("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),d&&u<8&&(e.node.style.zIndex=2)),e.node}function mr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):tr(e,t)}function gr(e,t){var r=t.text.className,n=mr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,vr(e,t)):r&&(t.text.className=r)}function vr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=pr(t);t.background=n.insertBefore(N("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?pr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function br(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=pr(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=pr(t),l=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(N("div",nt(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var c=e.display.gutterSpecs[s].className,d=o.hasOwnProperty(c)&&o[c];d&&l.appendChild(N("div",[d],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function wr(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);kr(e,t,r)}function yr(e,t,r,n){var i=mr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),vr(e,t),br(e,t,r,n),kr(e,t,n),t.node}function kr(e,t,r){if(xr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)xr(e,t.rest[n],t,r,!1)}function xr(e,t,r,n,i){if(t.widgets)for(var o=pr(r),a=0,l=t.widgets;a<l.length;++a){var s=l[a],c=N("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Cr(s,c,r,n),e.display.input.setUneditable(c),i&&s.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),ur(s,"redraw")}}function Cr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Sr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!j(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),F(t.display.measure,N("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Lr(e,t){for(var r=Te(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Mr(e){return e.lineSpace.offsetTop}function Tr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Dr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=F(e.measure,N("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Ar(e){return 30-e.display.nativeBarWidth}function zr(e){return e.display.scroller.clientWidth-Ar(e)-e.display.barWidth}function Or(e){return e.display.scroller.clientHeight-Ar(e)-e.display.barHeight}function Fr(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(et(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Nr(e,t,r,n){return Pr(e,jr(e,t),r,n)}function Er(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[pn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function jr(e,t){var r=et(t),n=Er(e,r);n&&!n.text?n=null:n&&n.changes&&(fr(e,n,r,cn(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=et(t=Bt(t)),n=e.display.externalMeasured=new lr(e.doc,t,r);n.lineN=r;var i=n.built=tr(e,n);return n.text=i.pre,F(e.display.lineMeasure,i.pre),n}(e,t));var i=Fr(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Pr(e,t,r,n,i){t.before&&(r=-1);var o,a=r+(n||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(!function(e,t,r){var n=e.options.lineWrapping,i=n&&zr(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],c=a[l+1];Math.abs(s.bottom-c.bottom)>2&&o.push((s.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),o=function(e,t,r,n){var i,o=_r(t.map,r,n),a=o.node,l=o.start,s=o.end,c=o.collapse;if(3==a.nodeType){for(var h=0;h<4;h++){for(;l&&le(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+s<o.coverEnd&&le(t.line.text.charAt(o.coverStart+s));)++s;if((i=d&&u<9&&0==l&&s==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Wr(A(a,l,s).getClientRects(),n)).left||i.right||0==l)break;s=l,l-=1,c="right"}d&&u<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=He)return He;var t=F(e,N("span","x")),r=t.getBoundingClientRect(),n=A(t,0,1).getBoundingClientRect();return He=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var f;l>0&&(c=n="right"),i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==n?f.length-1:0]:a.getBoundingClientRect()}if(d&&u<9&&!l&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+sn(e.display),top:p.top,bottom:p.bottom}:Hr}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,b=t.view.measure.heights,w=0;w<b.length-1&&!(v<b[w]);w++);var y=w?b[w-1]:0,k=b[w],x={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:y,bottom:k};i.left||i.right||(x.bogus=!0);e.options.singleCursorHeightPerLine||(x.rtop=m,x.rbottom=g);return x}(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Ir,Hr={left:0,right:0,top:0,bottom:0};function _r(e,t,r){for(var n,i,o,a,l,s,c=0;c<e.length;c+=3)if(l=e[c],s=e[c+1],t<l?(i=0,o=1,a="left"):t<s?o=(i=t-l)+1:(c==e.length-3||t==s&&e[c+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(n=e[c+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],a="left";if("right"==r&&i==s-l)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],a="right";break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Wr(e,t){var r=Hr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function $r(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Br(e){e.display.externalMeasure=null,O(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)$r(e.display.view[t])}function Rr(e){Br(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Vr(){return p&&y?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ur(){return p&&y?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function qr(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Sr(e.widgets[r]));return t}function Kr(e,t,r,n,i){if(!i){var o=qr(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var a=Kt(t);if("local"==n?a+=Mr(e.display):a-=e.display.viewOffset,"page"==n||"window"==n){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+("window"==n?0:Ur());var s=l.left+("window"==n?0:Vr());r.left+=s,r.right+=s}return r.top+=a,r.bottom+=a,r}function Gr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Vr(),i-=Ur();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:i-a.top}}function Zr(e,t,r,n,i){return n||(n=Xe(e.doc,t.line)),Kr(e,n,Nr(e,n,t.ch,i),r)}function Xr(e,t,r,n,i,o){function a(t,a){var l=Pr(e,i,t,a?"right":"left",o);return a?l.left=l.right:l.right=l.left,Kr(e,n,l,r)}n=n||Xe(e.doc,t.line),i||(i=jr(e,n));var l=fe(n,e.doc.direction),s=t.ch,c=t.sticky;if(s>=n.text.length?(s=n.text.length,c="before"):s<=0&&(s=0,c="after"),!l)return a("before"==c?s-1:s,"before"==c);function d(e,t,r){return a(r?e-1:e,1==l[t].level!=r)}var u=ue(l,s,c),h=de,f=d(s,u,"before"==c);return null!=h&&(f.other=d(s,h,"before"!=c)),f}function Yr(e,t){var r=0;t=ut(e.doc,t),e.options.lineWrapping||(r=sn(e.display)*t.ch);var n=Xe(e.doc,t.line),i=Kt(n)+Mr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Qr(e,t,r,n,i){var o=it(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function Jr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Qr(n.first,0,null,-1,-1);var i=tt(n,r),o=n.first+n.size-1;if(i>o)return Qr(n.first+n.size-1,Xe(n,o).text.length,null,1,1);t<0&&(t=0);for(var a=Xe(n,i);;){var l=nn(e,a,i,t,r),s=Wt(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var c=s.find(1);if(c.line==i)return c;a=Xe(n,i=c.line)}}function en(e,t,r,n){n-=qr(t);var i=t.text.length,o=ce((function(t){return Pr(e,r,t-1).bottom<=n}),i,0);return{begin:o,end:i=ce((function(t){return Pr(e,r,t).top>n}),o,i)}}function tn(e,t,r,n){return r||(r=jr(e,t)),en(e,t,r,Kr(e,t,Pr(e,r,n),"line").top)}function rn(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function nn(e,t,r,n,i){i-=Kt(t);var o=jr(e,t),a=qr(t),l=0,s=t.text.length,c=!0,d=fe(t,e.doc.direction);if(d){var u=(e.options.lineWrapping?an:on)(e,t,r,o,d,n,i);l=(c=1!=u.level)?u.from:u.to-1,s=c?u.to:u.from-1}var h,f,p=null,m=null,g=ce((function(t){var r=Pr(e,o,t);return r.top+=a,r.bottom+=a,!!rn(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,m=r),!0)}),l,s),v=!1;if(m){var b=n-m.left<m.right-n,w=b==c;g=p+(w?0:1),f=w?"after":"before",h=b?m.left:m.right}else{c||g!=s&&g!=l||g++,f=0==g?"after":g==t.text.length?"before":Pr(e,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var y=Xr(e,it(r,g,f),"line",t,o);h=y.left,v=i<y.top?-1:i>=y.bottom?1:0}return Qr(r,g=se(t.text,g,1),f,v,n-h)}function on(e,t,r,n,i,o,a){var l=ce((function(l){var s=i[l],c=1!=s.level;return rn(Xr(e,it(r,c?s.to:s.from,c?"before":"after"),"line",t,n),o,a,!0)}),0,i.length-1),s=i[l];if(l>0){var c=1!=s.level,d=Xr(e,it(r,c?s.from:s.to,c?"after":"before"),"line",t,n);rn(d,o,a,!0)&&d.top>a&&(s=i[l-1])}return s}function an(e,t,r,n,i,o,a){var l=en(e,t,n,a),s=l.begin,c=l.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var d=null,u=null,h=0;h<i.length;h++){var f=i[h];if(!(f.from>=c||f.to<=s)){var p=Pr(e,n,1!=f.level?Math.min(c,f.to)-1:Math.max(s,f.from)).right,m=p<o?o-p+1e9:p-o;(!d||u>m)&&(d=f,u=m)}}return d||(d=i[i.length-1]),d.from<s&&(d={from:s,to:d.to,level:d.level}),d.to>c&&(d={from:d.from,to:c,level:d.level}),d}function ln(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(N("br"));Ir.appendChild(document.createTextNode("x"))}F(e.measure,Ir);var r=Ir.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),O(e.measure),r||1}function sn(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),r=N("pre",[t],"CodeMirror-line-like");F(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function cn(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;r[l]=o.offsetLeft+o.clientLeft+i,n[l]=o.clientWidth}return{fixedPos:dn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function dn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function un(e){var t=ln(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/sn(e.display)-3);return function(i){if(Ut(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function hn(e){var t=e.doc,r=un(e);t.iter((function(e){var t=r(e);t!=e.height&&Je(e,t)}))}function fn(e,t,r,n){var i=e.display;if(!r&&"true"==Te(t).getAttribute("cm-not-content"))return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(t){return null}var s,c=Jr(e,o,a);if(n&&1==c.xRel&&(s=Xe(e.doc,c.line).text).length==c.ch){var d=B(s,s.length,e.options.tabSize)-s.length;c=it(c.line,Math.max(0,Math.round((o-Dr(e.display).left)/sn(e.display))-d))}return c}function pn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function mn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Mt&&Rt(e.doc,t)<i.viewTo&&vn(e);else if(r<=i.viewFrom)Mt&&Vt(e.doc,r+n)>i.viewFrom?vn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)vn(e);else if(t<=i.viewFrom){var o=bn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):vn(e)}else if(r>=i.viewTo){var a=bn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):vn(e)}else{var l=bn(e,t,t,-1),s=bn(e,r,r+n,1);l&&s?(i.view=i.view.slice(0,l.index).concat(sr(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):vn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.size&&(i.externalMeasured=null))}function gn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[pn(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==V(a,r)&&a.push(r)}}}function vn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function bn(e,t,r,n){var i,o=pn(e,t),a=e.display.view;if(!Mt||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var l=e.display.viewFrom,s=0;s<o;s++)l+=a[s].size;if(l!=t){if(n>0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,r+=i}for(;Rt(e.doc,r)!=r;){if(o==(n<0?0:a.length-1))return null;r+=n*a[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function wn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function yn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function kn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),a=0;a<r.sel.ranges.length;a++)if(t||a!=r.sel.primIndex){var l=r.sel.ranges[a];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var s=l.empty();(s||e.options.showCursorWhenSelecting)&&xn(e,l.head,i),s||Sn(e,l,o)}}return n}function xn(e,t,r){var n=Xr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(N("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Cn(e,t){return e.top-t.top||e.left-t.left}function Sn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),a=Dr(e.display),l=a.left,s=Math.max(n.sizerWidth,zr(e)-n.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function d(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?s-e:r)+"px;\n height: "+(n-t)+"px"))}function u(t,r,n){var o,a,u=Xe(i,t),h=u.text.length;function f(r,n){return Zr(e,it(t,r),"div",u,n)}function p(t,r,n){var i=tn(e,u,null,t),o="ltr"==r==("after"==n)?"left":"right";return f("after"==n?i.begin:i.end-(/\s/.test(u.text.charAt(i.end-1))?2:1),o)[o]}var m=fe(u,i.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(m,r||0,null==n?h:n,(function(e,t,i,u){var g="ltr"==i,v=f(e,g?"left":"right"),b=f(t-1,g?"right":"left"),w=null==r&&0==e,y=null==n&&t==h,k=0==u,x=!m||u==m.length-1;if(b.top-v.top<=3){var C=(c?y:w)&&x,S=(c?w:y)&&k?l:(g?v:b).left,L=C?s:(g?b:v).right;d(S,v.top,L-S,v.bottom)}else{var M,T,D,A;g?(M=c&&w&&k?l:v.left,T=c?s:p(e,i,"before"),D=c?l:p(t,i,"after"),A=c&&y&&x?s:b.right):(M=c?p(e,i,"before"):l,T=!c&&w&&k?s:v.right,D=!c&&y&&x?l:b.left,A=c?p(t,i,"after"):s),d(M,v.top,T-M,v.bottom),v.bottom<b.top&&d(l,v.bottom,null,b.top),d(D,b.top,A-D,b.bottom)}(!o||Cn(v,o)<0)&&(o=v),Cn(b,o)<0&&(o=b),(!a||Cn(v,a)<0)&&(a=v),Cn(b,a)<0&&(a=b)})),{start:o,end:a}}var h=t.from(),f=t.to();if(h.line==f.line)u(h.line,h.ch,f.ch);else{var p=Xe(i,h.line),m=Xe(i,f.line),g=Bt(p)==Bt(m),v=u(h.line,h.ch,g?p.text.length+1:null).end,b=u(f.line,g?0:null,f.ch).start;g&&(v.top<b.top-2?(d(v.right,v.top,null,v.bottom),d(l,b.top,b.left,b.bottom)):d(v.right,v.top,b.left-v.right,v.bottom)),v.bottom<b.top&&d(l,v.bottom,null,b.top)}r.appendChild(o)}function Ln(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Mn(e){e.state.focused||(e.display.input.focus(),Dn(e))}function Tn(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,An(e))}),100)}function Dn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(be(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),h&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Ln(e))}function An(e,t){e.state.delayingBlurEvent||(e.state.focused&&(be(e,"blur",e,t),e.state.focused=!1,z(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function zn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,a=void 0,l=0;if(!i.hidden){if(d&&u<8){var s=i.node.offsetTop+i.node.offsetHeight;a=s-r,r=s}else{var c=i.node.getBoundingClientRect();a=c.bottom-c.top,!o&&i.text.firstChild&&(l=i.text.firstChild.getBoundingClientRect().right-c.left-1)}var h=i.line.height-a;if((h>.005||h<-.005)&&(Je(i.line,a),On(i.line),i.rest))for(var f=0;f<i.rest.length;f++)On(i.rest[f]);if(l>e.display.sizerWidth){var p=Math.ceil(l/sn(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function On(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Fn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Mr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=tt(t,n),a=tt(t,i);if(r&&r.ensure){var l=r.ensure.from.line,s=r.ensure.to.line;l<o?(o=l,a=tt(t,Kt(Xe(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=tt(t,Kt(Xe(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function Nn(e,t){var r=e.display,n=ln(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Or(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Tr(r),s=t.top<n,c=t.bottom>l-n;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var d=Math.min(t.top,(c?l:t.bottom)-o);d!=i&&(a.scrollTop=d)}var u=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,h=zr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),f=t.right-t.left>h;return f&&(t.right=t.left+h),t.left<10?a.scrollLeft=0:t.left<u?a.scrollLeft=Math.max(0,t.left-(f?0:10)):t.right>h+u-3&&(a.scrollLeft=t.right+(f?0:10)-h),a}function En(e,t){null!=t&&(In(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function jn(e){In(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pn(e,t,r){null==t&&null==r||In(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function In(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Hn(e,Yr(e,t.from),Yr(e,t.to),t.margin))}function Hn(e,t,r,n){var i=Nn(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Pn(e,i.scrollLeft,i.scrollTop)}function _n(e,t){Math.abs(e.doc.scrollTop-t)<2||(a||hi(e,{top:t}),Wn(e,t,!0),a&&hi(e),li(e,100))}function Wn(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function $n(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,mi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Bn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Tr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Ar(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Rn=function(e,t,r){this.cm=r;var n=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),me(n,"scroll",(function(){n.clientHeight&&t(n.scrollTop,"vertical")})),me(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,d&&u<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Rn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Rn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Rn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Rn.prototype.zeroWidthHack=function(){var e=x&&!v?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new R,this.disableVert=new R},Rn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,(function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},Rn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Vn=function(){};function Un(e,t){t||(t=Bn(e));var r=e.display.barWidth,n=e.display.barHeight;qn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&zn(e),qn(e,Bn(e)),r=e.display.barWidth,n=e.display.barHeight}function qn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}Vn.prototype.update=function(){return{bottom:0,right:0}},Vn.prototype.setScrollLeft=function(){},Vn.prototype.setScrollTop=function(){},Vn.prototype.clear=function(){};var Kn={native:Rn,null:Vn};function Gn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Kn[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,r){"horizontal"==r?$n(e,t):_n(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var Zn=0;function Xn(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zn},t=e.curOp,cr?cr.ops.push(t):t.ownsGroup=cr={ops:[t],delayedCallbacks:[]}}function Yn(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{cr=null,t(r)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Qn(t[r]);for(var n=0;n<t.length;n++)Jn(t[n]);for(var i=0;i<t.length;i++)ei(t[i]);for(var o=0;o<t.length;o++)ti(t[o]);for(var a=0;a<t.length;a++)ri(t[a])}(e)}))}function Qn(e){var t=e.cm,r=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ar(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ar(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Zt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ci(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Jn(e){e.updatedDisplay=e.mustUpdate&&di(e.cm,e.update)}function ei(e){var t=e.cm,r=t.display;e.updatedDisplay&&zn(t),e.barMeasure=Bn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Nr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Ar(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-zr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function ti(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&$n(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==P();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Un(t,e.barMeasure),e.updatedDisplay&&pi(t,e.barMeasure),e.selectionChanged&&Ln(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Mn(e.cm)}function ri(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&ui(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Wn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&$n(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?it(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?it(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,l=Xr(e,t),s=r&&r!=t?Xr(e,r):l,c=Nn(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n}),d=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=c.scrollTop&&(_n(e,c.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(a=!0)),null!=c.scrollLeft&&($n(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return i}(t,ut(n,e.scrollToPos.from),ut(n,e.scrollToPos.to),e.scrollToPos.margin);!function(e,t){if(!we(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!b){var o=N("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Mr(e.display))+"px;\n height: "+(t.bottom-t.top+Ar(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||be(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&be(a[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ni(e,t){if(e.curOp)return t();Xn(e);try{return t()}finally{Yn(e)}}function ii(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xn(e);try{return t.apply(e,arguments)}finally{Yn(e)}}}function oi(e){return function(){if(this.curOp)return e.apply(this,arguments);Xn(this);try{return e.apply(this,arguments)}finally{Yn(this)}}}function ai(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Xn(t);try{return e.apply(this,arguments)}finally{Yn(t)}}}function li(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,W(si,e))}function si(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=vt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(n.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?qe(t.mode,n.state):null,s=mt(e,o,n,!0);l&&(n.state=l),o.styles=s.styles;var c=o.styleClasses,d=s.classes;d?o.styleClasses=d:c&&(o.styleClasses=null);for(var u=!a||a.length!=o.styles.length||c!=d&&(!c||!d||c.bgClass!=d.bgClass||c.textClass!=d.textClass),h=0;!u&&h<a.length;++h)u=a[h]!=o.styles[h];u&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&bt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return li(e,e.options.workDelay),!0})),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&ni(e,(function(){for(var t=0;t<i.length;t++)gn(e,i[t],"text")}))}}var ci=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Fn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=zr(e),this.force=r,this.dims=cn(e),this.events=[]};function di(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return vn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==wn(e))return!1;gi(e)&&(vn(e),t.dims=cn(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(i,r.viewTo)),Mt&&(o=Rt(e.doc,o),a=Vt(e.doc,a));var l=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=sr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=sr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(pn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(sr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,pn(e,r)))),n.viewTo=r}(e,o,a),r.viewOffset=Kt(Xe(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var s=wn(e);if(!l&&0==s&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=P();if(!t||!j(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&j(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return s>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,a=o.firstChild;function l(t){var r=t.nextSibling;return h&&x&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var s=n.view,c=n.viewFrom,d=0;d<s.length;d++){var u=s[d];if(u.hidden);else if(u.node&&u.node.parentNode==o){for(;a!=u.node;)a=l(a);var f=i&&null!=t&&t<=c&&u.lineNumber;u.changes&&(V(u.changes,"gutter")>-1&&(f=!1),fr(e,u,c,r)),f&&(O(u.lineNumber),u.lineNumber.appendChild(document.createTextNode(nt(e.options,c)))),a=u.node.nextSibling}else{var p=yr(e,u,c,r);o.insertBefore(p,a)}c+=u.size}for(;a;)a=l(a)}(e,r.updateLineNumbers,t.dims),s>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=P()&&(e.activeElt.focus(),e.anchorNode&&j(document.body,e.anchorNode)&&j(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),O(r.cursorDiv),O(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,l&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,li(e,400)),r.updateLineNumbers=null,!0}function ui(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=zr(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Tr(e.display)-Or(e),r.top)}),t.visible=Fn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&di(e,t);n=!1){zn(e);var i=Bn(e);yn(e),Un(e,i),pi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function hi(e,t){var r=new ci(e,t);if(di(e,r)){zn(e),ui(e,r);var n=Bn(e);yn(e),Un(e,n),pi(e,n),r.finish()}}function fi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function pi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ar(e)+"px"}function mi(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=dn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var l=r[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function gi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=nt(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(N("div",[N("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-a)+1,n.lineNumWidth=n.lineNumInnerWidth+a,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",fi(e.display),!0}return!1}function vi(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;n=!0}r.push({className:o,style:a})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function bi(e){var t=e.gutters,r=e.gutterSpecs;O(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,a=i.style,l=t.appendChild(N("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",fi(e)}function wi(e){bi(e.display),mn(e),mi(e)}function yi(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=E("div",null,"CodeMirror-code"),i.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=N("div",null,"CodeMirror-cursors"),i.measure=N("div",null,"CodeMirror-measure"),i.lineMeasure=N("div",null,"CodeMirror-measure"),i.lineSpace=E("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=E("div",[i.lineSpace],"CodeMirror-lines");i.mover=N("div",[o],null,"position: relative"),i.sizer=N("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=N("div",null,null,"position: absolute; height: 30px; width: 1px;"),i.gutters=N("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=N("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=N("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),d&&u<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),h||a&&k||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=vi(n.gutters,n.lineNumbers),bi(i),r.init(i)}ci.prototype.signal=function(e,t){ke(e,t)&&this.events.push(arguments)},ci.prototype.finish=function(){for(var e=0;e<this.events.length;e++)be.apply(null,this.events[e])};var ki=0,xi=null;function Ci(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function Si(e){var t=Ci(e);return t.x*=xi,t.y*=xi,t}function Li(e,t){var r=Ci(t),n=r.x,i=r.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,c=l.scrollHeight>l.clientHeight;if(n&&s||i&&c){if(i&&x&&h)e:for(var d=t.target,u=o.view;d!=l;d=d.parentNode)for(var f=0;f<u.length;f++)if(u[f].node==d){e.display.currentWheelTarget=d;break e}if(n&&!a&&!m&&null!=xi)return i&&c&&_n(e,Math.max(0,l.scrollTop+i*xi)),$n(e,Math.max(0,l.scrollLeft+n*xi)),(!i||i&&c)&&Ce(t),void(o.wheelStartX=null);if(i&&null!=xi){var p=i*xi,g=e.doc.scrollTop,v=g+o.wrapper.clientHeight;p<0?g=Math.max(0,g+p-50):v=Math.min(e.doc.height,v+p+50),hi(e,{top:g,bottom:v})}ki<20&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout((function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(xi=(xi*ki+r)/(ki+1),++ki)}}),200)):(o.wheelDX+=n,o.wheelDY+=i))}}d?xi=-.53:a?xi=15:p?xi=-.7:g&&(xi=-1/3);var Mi=function(e,t){this.ranges=e,this.primIndex=t};Mi.prototype.primary=function(){return this.ranges[this.primIndex]},Mi.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!at(r.anchor,n.anchor)||!at(r.head,n.head))return!1}return!0},Mi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ti(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new Mi(e,this.primIndex)},Mi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Mi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(ot(t,n.from())>=0&&ot(e,n.to())<=0)return r}return-1};var Ti=function(e,t){this.anchor=e,this.head=t};function Di(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort((function(e,t){return ot(e.from(),t.from())})),r=V(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ot(l.to(),a.from());if(n&&!a.empty()?s>0:s>=0){var c=ct(l.from(),a.from()),d=st(l.to(),a.to()),u=l.empty()?a.from()==a.head:l.from()==l.head;o<=r&&--r,t.splice(--o,2,new Ti(u?d:c,u?c:d))}}return new Mi(t,r)}function Ai(e,t){return new Mi([new Ti(e,t||e)],0)}function zi(e){return e.text?it(e.from.line+e.text.length-1,Q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Oi(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return zi(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=zi(t).ch-t.to.ch),it(r,n)}function Fi(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Ti(Oi(i.anchor,t),Oi(i.head,t)))}return Di(e.cm,r,e.sel.primIndex)}function Ni(e,t,r){return e.line==t.line?it(r.line,e.ch-t.ch+r.ch):it(r.line+(e.line-t.line),e.ch)}function Ei(e){e.doc.mode=Re(e.options,e.doc.modeOption),ji(e)}function ji(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,li(e,100),e.state.modeGen++,e.curOp&&mn(e)}function Pi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Q(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ii(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Ft(e),Nt(e,r);var i=n?n(e):1;i!=e.height&&Je(e,i)}(e,r,i,n),ur(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new Xt(c[o],i(o),n));return r}var l=t.from,s=t.to,c=t.text,d=Xe(e,l.line),u=Xe(e,s.line),h=Q(c),f=i(c.length-1),p=s.line-l.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(Pi(e,t)){var m=a(0,c.length-1);o(u,u.text,f),p&&e.remove(l.line,p),m.length&&e.insert(l.line,m)}else if(d==u)if(1==c.length)o(d,d.text.slice(0,l.ch)+h+d.text.slice(s.ch),f);else{var g=a(1,c.length-1);g.push(new Xt(h+d.text.slice(s.ch),f,n)),o(d,d.text.slice(0,l.ch)+c[0],i(0)),e.insert(l.line+1,g)}else if(1==c.length)o(d,d.text.slice(0,l.ch)+c[0]+u.text.slice(s.ch),i(0)),e.remove(l.line+1,p);else{o(d,d.text.slice(0,l.ch)+c[0],i(0)),o(u,h+u.text.slice(s.ch),f);var v=a(1,c.length-1);p>1&&e.remove(l.line+1,p-1),e.insert(l.line+1,v)}ur(e,"change",e,t)}function Hi(e,t,r){!function e(n,i,o){if(n.linked)for(var a=0;a<n.linked.length;++a){var l=n.linked[a];if(l.doc!=i){var s=o&&l.sharedHist;r&&!s||(t(l.doc,s),e(l.doc,n,s))}}}(e,null,!0)}function _i(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,hn(e),Ei(e),Wi(e),e.options.lineWrapping||Zt(e),e.options.mode=t.modeOption,mn(e)}function Wi(e){("rtl"==e.doc.direction?I:z)(e.display.lineDiv,"CodeMirror-rtl")}function $i(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Bi(e,t){var r={from:lt(t.from),to:zi(t),text:Ye(e,t.from,t.to)};return Ki(e,r,t.from.line,t.to.line+1),Hi(e,(function(e){return Ki(e,r,t.from.line,t.to.line+1)}),!0),r}function Ri(e){for(;e.length;){if(!Q(e).ranges)break;e.pop()}}function Vi(e,t,r,n){var i=e.history;i.undone.length=0;var o,a,l=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Ri(e.done),Q(e.done)):e.done.length&&!Q(e.done).ranges?Q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Q(e.done)):void 0}(i,i.lastOp==n)))a=Q(o.changes),0==ot(t.from,t.to)&&0==ot(t.from,a.to)?a.to=zi(t):o.changes.push(Bi(e,t));else{var s=Q(i.done);for(s&&s.ranges||qi(e.sel,i.done),o={changes:[Bi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||be(e,"historyAdded")}function Ui(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Q(i.done),t))?i.done[i.done.length-1]=t:qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Ri(i.undone)}function qi(e,t){var r=Q(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Ki(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),(function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o}))}function Gi(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function Zi(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Gi(r[i]));return n}(e,t),n=zt(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],a=n[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],c=0;c<o.length;++c)if(o[c].marker==s.marker)continue e;o.push(s)}else a&&(r[i]=a)}return r}function Xi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Mi.prototype.deepCopy.call(o):o);else{var a=o.changes,l=[];n.push({changes:l});for(var s=0;s<a.length;++s){var c=a[s],d=void 0;if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var u in c)(d=u.match(/^spans_(\d+)$/))&&V(t,Number(d[1]))>-1&&(Q(l)[u]=c[u],delete c[u])}}}return n}function Yi(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ot(t,i)<0;o!=ot(r,i)<0?(i=t,t=r):o!=ot(t,r)<0&&(t=r)}return new Ti(i,t)}return new Ti(r||t,t)}function Qi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),no(e,new Mi([Yi(e.sel.primary(),t,r,i)],0),n)}function Ji(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=Yi(e.sel.ranges[o],t[o],null,i);no(e,Di(e.cm,n,e.sel.primIndex),r)}function eo(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,no(e,Di(e.cm,i,e.sel.primIndex),n)}function to(e,t,r,n){no(e,Ai(t,r),n)}function ro(e,t,r){var n=e.history.done,i=Q(n);i&&i.ranges?(n[n.length-1]=t,io(e,t,r)):no(e,t,r)}function no(e,t,r){io(e,t,r),Ui(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function io(e,t,r){(ke(e,"beforeSelectionChange")||e.cm&&ke(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Ti(ut(e,t[r].anchor),ut(e,t[r].head))},origin:r&&r.origin};return be(e,"beforeSelectionChange",e,n),e.cm&&be(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Di(e.cm,n.ranges,n.ranges.length-1):t}(e,t,r));var n=r&&r.bias||(ot(t.primary().head,e.sel.primary().head)<0?-1:1);oo(e,lo(e,t,n,!0)),r&&!1===r.scroll||!e.cm||jn(e.cm)}function oo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ye(e.cm)),ur(e,"cursorActivity",e))}function ao(e){oo(e,lo(e,e.sel,null,!1))}function lo(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=co(e,a.anchor,l&&l.anchor,r,n),c=co(e,a.head,l&&l.head,r,n);(i||s!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Ti(s,c))}return i?Di(e.cm,i,t.primIndex):t}function so(e,t,r,n,i){var o=Xe(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,c="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,d="selectRight"in s?!s.selectRight:s.inclusiveRight;if((null==l.from||(c?l.from<=t.ch:l.from<t.ch))&&(null==l.to||(d?l.to>=t.ch:l.to>t.ch))){if(i&&(be(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!s.atomic)continue;if(r){var u=s.find(n<0?1:-1),h=void 0;if((n<0?d:c)&&(u=uo(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(h=ot(u,r))&&(n<0?h<0:h>0))return so(e,u,t,n,i)}var f=s.find(n<0?-1:1);return(n<0?c:d)&&(f=uo(e,f,n,f.line==t.line?o:null)),f?so(e,f,t,n,i):null}}return t}function co(e,t,r,n,i){var o=n||1,a=so(e,t,r,o,i)||!i&&so(e,t,r,o,!0)||so(e,t,r,-o,i)||!i&&so(e,t,r,-o,!0);return a||(e.cantEdit=!0,it(e.first,0))}function uo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?ut(e,it(t.line-1)):null:r>0&&t.ch==(n||Xe(e,t.line)).text.length?t.line<e.first+e.size-1?it(t.line+1,0):null:new it(t.line,t.ch+r)}function ho(e){e.setSelection(it(e.firstLine(),0),it(e.lastLine()),q)}function fo(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=ut(e,t)),r&&(n.to=ut(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),be(e,"beforeChange",e,n),e.cm&&be(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function po(e,t,r){if(e.cm){if(!e.cm.curOp)return ii(e.cm,po)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(ke(e,"beforeChange")||e.cm&&ke(e.cm,"beforeChange"))||(t=fo(e,t,!0))){var n=Lt&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=V(n,r)||(n||(n=[])).push(r)}})),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(ot(c.to,l.from)<0||ot(c.from,l.to)>0)){var d=[s,1],u=ot(c.from,l.from),h=ot(c.to,l.to);(u<0||!a.inclusiveLeft&&!u)&&d.push({from:c.from,to:l.from}),(h>0||!a.inclusiveRight&&!h)&&d.push({from:l.to,to:c.to}),i.splice.apply(i,d),s+=d.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)mo(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else mo(e,t)}}function mo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ot(t.from,t.to)){var r=Fi(e,t);Vi(e,t,r,e.cm?e.cm.curOp.id:NaN),bo(e,t,r,zt(e,t));var n=[];Hi(e,(function(e,r){r||-1!=V(n,e.history)||(xo(e.history,t),n.push(e.history)),bo(e,t,null,zt(e,t))}))}}function go(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,a=e.sel,l="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,c=0;c<l.length&&(i=l[c],r?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=l.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=l.pop()).ranges){if(n)return void l.push(i);break}if(qi(i,s),r&&!i.equals(e.sel))return void no(e,i,{clearRedo:!1});a=i}var d=[];qi(a,s),s.push({changes:d,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var u=ke(e,"beforeChange")||e.cm&&ke(e.cm,"beforeChange"),h=function(r){var n=i.changes[r];if(n.origin=t,u&&!fo(e,n,!1))return l.length=0,{};d.push(Bi(e,n));var o=r?Fi(e,n):Q(l);bo(e,n,o,Zi(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:zi(n)});var a=[];Hi(e,(function(e,t){t||-1!=V(a,e.history)||(xo(e.history,n),a.push(e.history)),bo(e,n,null,Zi(e,n))}))},f=i.changes.length-1;f>=0;--f){var p=h(f);if(p)return p.v}}}}function vo(e,t){if(0!=t&&(e.first+=t,e.sel=new Mi(J(e.sel.ranges,(function(e){return new Ti(it(e.anchor.line+t,e.anchor.ch),it(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){mn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)gn(e.cm,n,"gutter")}}function bo(e,t,r,n){if(e.cm&&!e.cm.curOp)return ii(e.cm,bo)(e,t,r,n);if(t.to.line<e.first)vo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);vo(e,i),t={from:it(e.first,0),to:it(t.to.line+i,t.to.ch),text:[Q(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:it(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ye(e,t.from,t.to),r||(r=Fi(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=et(Bt(Xe(n,o.line))),n.iter(s,a.line+1,(function(e){if(e==i.maxLine)return l=!0,!0})));n.sel.contains(t.from,t.to)>-1&&ye(e);Ii(n,t,r,un(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,(function(e){var t=Gt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=Xe(e,n).stateAfter;if(i&&(!(i instanceof ft)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}})(n,o.line),li(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?mn(e):o.line!=a.line||1!=t.text.length||Pi(e.doc,t)?mn(e,o.line,a.line+1,c):gn(e,o.line,"text");var d=ke(e,"changes"),u=ke(e,"change");if(u||d){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};u&&ur(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}(e.cm,t,n):Ii(e,t,n),io(e,r,q),e.cantEdit&&co(e,it(e.firstLine(),0))&&(e.cantEdit=!1)}}function wo(e,t,r,n,i){var o;n||(n=r),ot(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),po(e,{from:r,to:n,text:t,origin:i})}function yo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ko(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var l=0;l<o.ranges.length;l++)yo(o.ranges[l].anchor,t,r,n),yo(o.ranges[l].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var c=o.changes[s];if(r<c.from.line)c.from=it(c.from.line+n,c.from.ch),c.to=it(c.to.line+n,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function xo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;ko(e.done,r,n,i),ko(e.undone,r,n,i)}function Co(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=Xe(e,dt(e,t)):i=et(t),null==i?null:(n(o,i)&&e.cm&&gn(e.cm,i,r),o)}function So(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function Lo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}Ti.prototype.from=function(){return ct(this.anchor,this.head)},Ti.prototype.to=function(){return st(this.anchor,this.head)},Ti.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},So.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,Yt(i),ur(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},Lo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e),l=i.height;if(i.removeInner(e,a),r.height-=l-i.height,o==a&&(r.children.splice(n--,1),i.parent=null),0==(t-=a))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof So))){var s=[];this.collapse(s),this.children=[new So(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],a=o.chunkSize();if(e<=a){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var l=o.lines.length%25+25,s=l;s<o.lines.length;){var c=new So(o.lines.slice(s,s+=25));o.height-=c.height,n.children.splice(++i,0,c),c.parent=n}o.lines=o.lines.slice(0,l),n.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new Lo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=V(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new Lo(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var Mo=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function To(e,t,r){Kt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&En(e,r)}Mo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=et(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=Sr(this);Je(r,Math.max(0,r.height-o)),e&&(ni(e,(function(){To(e,r,-o),gn(e,n,"widget")})),ur(e,"lineWidgetCleared",e,this,n))}},Mo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Sr(this)-t;i&&(Ut(this.doc,n)||Je(n,n.height+i),r&&ni(r,(function(){r.curOp.forceUpdate=!0,To(r,n,i),ur(r,"lineWidgetChanged",r,e,et(n))})))},xe(Mo);var Do=0,Ao=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Do};function zo(e,t,r,n,i){if(n&&n.shared)return function(e,t,r,n,i){(n=$(n)).shared=!1;var o=[zo(e,t,r,n,i)],a=o[0],l=n.widgetNode;return Hi(e,(function(e){l&&(n.widgetNode=l.cloneNode(!0)),o.push(zo(e,ut(e,t),ut(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;a=Q(o)})),new Oo(o,a)}(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return ii(e.cm,zo)(e,t,r,n,i);var o=new Ao(e,i),a=ot(t,r);if(n&&$(n,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=E("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if($t(e,t.line,t,r,o)||t.line!=r.line&&$t(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Mt=!0}o.addToHistory&&Vi(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var l,s=t.line,c=e.cm;if(e.iter(s,r.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Bt(e)==c.display.maxLine&&(l=!0),o.collapsed&&s!=t.line&&Je(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Tt(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s})),o.collapsed&&e.iter(t.line,r.line+1,(function(t){Ut(e,t)&&Je(t,0)})),o.clearOnEnter&&me(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Lt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Do,o.atomic=!0),c){if(l&&(c.curOp.updateMaxLine=!0),o.collapsed)mn(c,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var d=t.line;d<=r.line;d++)gn(c,d,"text");o.atomic&&ao(c.doc),ur(c,"markerAdded",c,o)}return o}Ao.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&Xn(t),ke(this,"clear")){var n=this.find();n&&ur(this,"clear",n.from,n.to)}for(var i=null,o=null,a=0;a<this.lines.length;++a){var l=e.lines[a],s=Dt(l.markedSpans,e);t&&!e.collapsed?gn(t,et(l),"text"):t&&(null!=s.to&&(o=et(l)),null!=s.from&&(i=et(l))),l.markedSpans=At(l.markedSpans,s),null==s.from&&e.collapsed&&!Ut(e.doc,l)&&t&&Je(l,ln(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var d=Bt(e.lines[c]),u=Gt(d);u>t.display.maxLineLength&&(t.display.maxLine=d,t.display.maxLineLength=u,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&mn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ao(t.doc)),t&&ur(t,"markerCleared",t,this,i,o),r&&Yn(t),this.parent&&this.parent.clear()}},Ao.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Dt(o.markedSpans,this);if(null!=a.from&&(r=it(t?o:et(o),a.from),-1==e))return r;if(null!=a.to&&(n=it(t?o:et(o),a.to),1==e))return n}return r&&{from:r,to:n}},Ao.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&ni(n,(function(){var i=t.line,o=et(t.line),a=Er(n,o);if(a&&($r(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ut(r.doc,i)&&null!=r.height){var l=r.height;r.height=null;var s=Sr(r)-l;s&&Je(i,i.height+s)}ur(n,"markerChanged",n,e)}))},Ao.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=V(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ao.prototype.detachLine=function(e){if(this.lines.splice(V(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xe(Ao);var Oo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Fo(e){return e.findMarks(it(e.first,0),e.clipPos(it(e.lastLine())),(function(e){return e.parent}))}function No(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Hi(r.primary.doc,(function(e){return n.push(e)}));for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==V(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}Oo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ur(this,"clear")}},Oo.prototype.find=function(e,t){return this.primary.find(e,t)},xe(Oo);var Eo=0,jo=function e(t,r,n,i,o){if(!(this instanceof e))return new e(t,r,n,i,o);null==n&&(n=0),Lo.call(this,[new So([new Xt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var a=it(n,0);this.sel=Ai(a),this.history=new $i(null),this.id=++Eo,this.modeOption=r,this.lineSep=i,this.direction="rtl"==o?"rtl":"ltr",this.extend=!1,"string"==typeof t&&(t=this.splitLines(t)),Ii(this,{from:a,to:a,text:t}),no(this,Ai(a),q)};(jo.prototype=te(Lo.prototype,{constructor:jo,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Qe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ai((function(e){var t=it(this.first,0),r=this.first+this.size-1;po(this,{from:t,to:it(r,Xe(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pn(this.cm,0,0),no(this,Ai(t),q)})),replaceRange:function(e,t,r,n){wo(this,e,t=ut(this,t),r=r?ut(this,r):t,n)},getRange:function(e,t,r){var n=Ye(this,ut(this,e),ut(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(rt(this,e))return Xe(this,e)},getLineNumber:function(e){return et(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Xe(this,e)),Bt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ut(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ai((function(e,t,r){to(this,ut(this,"number"==typeof e?it(e,t||0):e),null,r)})),setSelection:ai((function(e,t,r){to(this,ut(this,e),ut(this,t||e),r)})),extendSelection:ai((function(e,t,r){Qi(this,ut(this,e),t&&ut(this,t),r)})),extendSelections:ai((function(e,t){Ji(this,ht(this,e),t)})),extendSelectionsBy:ai((function(e,t){Ji(this,ht(this,J(this.sel.ranges,e)),t)})),setSelections:ai((function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new Ti(ut(this,e[i].anchor),ut(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),no(this,Di(this.cm,n,t),r)}})),addSelection:ai((function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ti(ut(this,e),ut(this,t||e))),no(this,Di(this.cm,n,n.length-1),r)})),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=Ye(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Ye(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:ai((function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];n[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var l=t&&"end"!=t&&function(e,t,r){for(var n=[],i=it(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=Ni(l.from,i,o),c=Ni(zi(l),i,o);if(i=l.to,o=c,"around"==r){var d=e.sel.ranges[a],u=ot(d.head,d.anchor)<0;n[a]=new Ti(u?c:s,u?s:c)}else n[a]=new Ti(s,s)}return new Mi(n,e.sel.primIndex)}(this,n,t),s=n.length-1;s>=0;s--)po(this,n[s]);l?ro(this,l):this.cm&&jn(this.cm)})),undo:ai((function(){go(this,"undo")})),redo:ai((function(){go(this,"redo")})),undoSelection:ai((function(){go(this,"undo",!0)})),redoSelection:ai((function(){go(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new $i(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Xi(this.history.done),undone:Xi(this.history.undone)}},setHistory:function(e){var t=this.history=new $i(this.history.maxGeneration);t.done=Xi(e.done.slice(0),null,!0),t.undone=Xi(e.undone.slice(0),null,!0)},setGutterMarker:ai((function(e,t,r){return Co(this,e,"gutter",(function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&oe(n)&&(e.gutterMarkers=null),!0}))})),clearGutter:ai((function(e){var t=this;this.iter((function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Co(t,r,"gutter",(function(){return r.gutterMarkers[e]=null,oe(r.gutterMarkers)&&(r.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!rt(this,e))return null;if(t=e,!(e=Xe(this,e)))return null}else if(null==(t=et(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ai((function(e,t,r){return Co(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(D(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0}))})),removeLineClass:ai((function(e,t,r){return Co(this,e,"gutter"==t?"gutter":"class",(function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(D(r));if(!o)return!1;var a=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:ai((function(e,t,r){return function(e,t,r,n){var i=new Mo(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Co(e,t,"widget",(function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Ut(e,t)){var n=Kt(t)<e.scrollTop;Je(t,t.height+Sr(i)),n&&En(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&ur(o,"lineWidgetAdded",o,i,"number"==typeof t?t:et(t)),i}(this,e,t,r)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return zo(this,ut(this,e),ut(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return zo(this,e=ut(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Xe(this,(e=ut(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ut(this,e),t=ut(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i})),n},getAllMarks:function(){var e=[];return this.iter((function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)})),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r})),ut(this,it(r,t))},indexFromPos:function(e){var t=(e=ut(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+r})),t},copy:function(e){var t=new jo(Qe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new jo(Qe(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ot(o,a)){var l=zo(e,o,a,n.primary,n.primary.type);n.markers.push(l),l.parent=n}}}(n,Fo(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Oa&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){if(t.linked[r].doc==e){t.linked.splice(r,1),e.unlinkDoc(t),No(Fo(t));break}}if(e.history==this.history){var n=[e.id];Hi(e,(function(e){return n.push(e.id)}),!0),e.history=new $i(null),e.history.done=Xi(this.history.done,n),e.history.undone=Xi(this.history.undone,n)}},iterLinkedDocs:function(e){Hi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):je(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ai((function(e){var t;("rtl"!=e&&(e="ltr"),e!=this.direction)&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&ni(t=this.cm,(function(){Wi(t),mn(t)})))}))})).eachLine=jo.prototype.iter;var Po=0;function Io(e){var t=this;if(Ho(t),!we(t,e)&&!Lr(t.display,e)){Ce(e),d&&(Po=+new Date);var r=fn(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,l=function(e,n){if(!t.options.allowDropFileTypes||-1!=V(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=ii(t,(function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++a==i){var s={from:r=ut(t.doc,r),to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};po(t.doc,s),ro(t.doc,Ai(r,zi(s)))}})),l.readAsText(e)}},s=0;s<i;++s)l(n[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var c=e.dataTransfer.getData("Text");if(c){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),io(t.doc,Ai(r,r)),u)for(var h=0;h<u.length;++h)wo(t.doc,"",u[h].anchor,u[h].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ho(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _o(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation((function(){for(var t=0;t<r.length;t++)e(r[t])}))}}var Wo=!1;function $o(){var e;Wo||(me(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,_o(Bo)}),100))})),me(window,"blur",(function(){return _o(An)})),Wo=!0)}function Bo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ro={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Vo=0;Vo<10;Vo++)Ro[Vo+48]=Ro[Vo+96]=String(Vo);for(var Uo=65;Uo<=90;Uo++)Ro[Uo]=String.fromCharCode(Uo);for(var qo=1;qo<=12;qo++)Ro[qo+111]=Ro[qo+63235]="F"+qo;var Ko={};function Go(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else{if(!/^s(hift)?$/i.test(l))throw new Error("Unrecognized modifier name: "+l);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Zo(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=J(r.split(" "),Go),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=n):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(s){if(s!=a)throw new Error("Inconsistent bindings for "+l)}else t[l]=a}delete e[r]}for(var c in t)e[c]=t[c];return e}function Xo(e,t,r,n){var i=(t=ea(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Xo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var a=Xo(e,t.fallthrough[o],r,n);if(a)return a}}}function Yo(e){var t="string"==typeof e?e:Ro[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Qo(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(M?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(M?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Jo(e,t){if(m&&34==e.keyCode&&e.char)return!1;var r=Ro[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Qo(r,e,t))}function ea(e){return"string"==typeof e?Ko[e]:e}function ta(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&ot(o.from,Q(n).to)<=0;){var a=n.pop();if(ot(a.from,o.from)<0){o.from=a.from;break}}n.push(o)}ni(e,(function(){for(var t=n.length-1;t>=0;t--)wo(e.doc,"",n[t].from,n[t].to,"+delete");jn(e)}))}function ra(e,t,r){var n=se(e.text,t+r,r);return n<0||n>e.text.length?null:n}function na(e,t,r){var n=ra(e,t.ch,r);return null==n?null:new it(t.line,n,r<0?"after":"before")}function ia(e,t,r,n,i){if(e){var o=fe(r,t.doc.direction);if(o){var a,l=i<0?Q(o):o[0],s=i<0==(1==l.level)?"after":"before";if(l.level>0||"rtl"==t.doc.direction){var c=jr(t,r);a=i<0?r.text.length-1:0;var d=Pr(t,c,a).top;a=ce((function(e){return Pr(t,c,e).top==d}),i<0==(1==l.level)?l.from:l.to-1,a),"before"==s&&(a=ra(r,a,1))}else a=i<0?l.to:l.from;return new it(n,a,s)}}return new it(n,i<0?r.text.length:0,i<0?"before":"after")}Ko.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ko.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ko.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ko.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ko.default=x?Ko.macDefault:Ko.pcDefault;var oa={selectAll:ho,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(e){return ta(e,(function(t){if(t.empty()){var r=Xe(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:it(t.head.line+1,0)}:{from:t.head,to:it(t.head.line,r)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return ta(e,(function(t){return{from:it(t.from().line,0),to:ut(e.doc,it(t.to().line+1,0))}}))},delLineLeft:function(e){return ta(e,(function(e){return{from:it(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return ta(e,(function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return ta(e,(function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(it(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(it(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return aa(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return la(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var r=Xe(e.doc,t),n=function(e){for(var t;t=_t(e);)e=t.find(1,!0).line;return e}(r);n!=r&&(t=et(n));return ia(!0,e,r,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")}),G)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")}),G)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?la(e,t.head):n}),G)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),a=B(e.getLine(o.line),o.ch,n);t.push(Y(n-a%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ni(e,(function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=Xe(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new it(i.line,i.ch-1)),i.ch>0)i=new it(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),it(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Xe(e.doc,i.line-1).text;a&&(i=new it(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),it(i.line-1,a.length-1),i,"+transpose"))}r.push(new Ti(i,i))}e.setSelections(r)}))},newlineAndIndent:function(e){return ni(e,(function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);jn(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function aa(e,t){var r=Xe(e.doc,t),n=Bt(r);return n!=r&&(t=et(n)),ia(!0,e,n,t,1)}function la(e,t){var r=aa(e,t.line),n=Xe(e.doc,r.line),i=fe(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return it(r.line,a?0:o,r.sticky)}return r}function sa(e,t,r){if("string"==typeof t&&!(t=oa[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=U}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var ca=new R;function da(e,t,r,n){var i=e.state.keySeq;if(i){if(Yo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ca.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),ua(e,i+" "+t,r,n))return!0}return ua(e,t,r,n)}function ua(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Xo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Xo(t,e.options.extraKeys,r,e)||Xo(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&ur(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(Ce(r),Ln(e)),!!i}function ha(e,t){var r=Jo(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?da(e,"Shift-"+r,t,(function(t){return sa(e,t,!0)}))||da(e,r,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return sa(e,t)})):da(e,r,t,(function(t){return sa(e,t)})))}var fa=null;function pa(e){var t=this;if(t.curOp.focus=P(),!we(t,e)){d&&u<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ha(t,e);m&&(fa=n?r:null,n||88!=r||Ie||!(x?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(z(t,"CodeMirror-crosshair"),ve(document,"keyup",r),ve(document,"mouseover",r))}I(t,"CodeMirror-crosshair"),me(document,"keyup",r),me(document,"mouseover",r)}(t)}}function ma(e){16==e.keyCode&&(this.doc.sel.shift=!1),we(this,e)}function ga(e){var t=this;if(!(Lr(t.display,e)||we(t,e)||e.ctrlKey&&!e.altKey||x&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(m&&r==fa)return fa=null,void Ce(e);if(!m||e.which&&!(e.which<10)||!ha(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(function(e,t,r){return da(e,"'"+r+"'",t,(function(t){return sa(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var va,ba,wa=function(e,t,r){this.time=e,this.pos=t,this.button=r};function ya(e){var t=this,r=t.display;if(!(we(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,Lr(r,e))h||(r.scroller.draggable=!1,setTimeout((function(){return r.scroller.draggable=!0}),100));else if(!Ca(t,e)){var n=fn(t,e),i=De(e),o=n?function(e,t){var r=+new Date;return ba&&ba.compare(r,e,t)?(va=ba=null,"triple"):va&&va.compare(r,e,t)?(ba=new wa(r,e,t),va=null,"double"):(va=new wa(r,e,t),ba=null,"single")}(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&function(e,t,r,n,i){var o="Click";"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o);return da(e,Qo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=oa[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=U}finally{e.state.suppressEdits=!1}return n}))}(t,i,n,o,e)||(1==i?n?function(e,t,r,n){d?setTimeout(W(Mn,e),0):e.curOp.focus=P();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=C?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey);null==i.addNew&&(i.addNew=x?r.metaKey:r.ctrlKey);null==i.moveOnDrag&&(i.moveOnDrag=!(x?r.altKey:r.ctrlKey));return i}(e,r,n),a=e.doc.sel;e.options.dragDrop&&Oe&&!e.isReadOnly()&&"single"==r&&(i=a.contains(t))>-1&&(ot((i=a.ranges[i]).from(),t)<0||t.xRel>0)&&(ot(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,o=!1,a=ii(e,(function(t){h&&(i.scroller.draggable=!1),e.state.draggingText=!1,ve(i.wrapper.ownerDocument,"mouseup",a),ve(i.wrapper.ownerDocument,"mousemove",l),ve(i.scroller,"dragstart",s),ve(i.scroller,"drop",a),o||(Ce(t),n.addNew||Qi(e.doc,r,null,null,n.extend),h||d&&9==u?setTimeout((function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()}),20):i.input.focus())})),l=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},s=function(){return o=!0};h&&(i.scroller.draggable=!0);e.state.draggingText=a,a.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop();me(i.wrapper.ownerDocument,"mouseup",a),me(i.wrapper.ownerDocument,"mousemove",l),me(i.scroller,"dragstart",s),me(i.scroller,"drop",a),Tn(e),setTimeout((function(){return i.input.focus()}),20)}(e,n,t,o):function(e,t,r,n){var i=e.display,o=e.doc;Ce(t);var a,l,s=o.sel,c=s.ranges;n.addNew&&!n.extend?(l=o.sel.contains(r),a=l>-1?c[l]:new Ti(r,r)):(a=o.sel.primary(),l=o.sel.primIndex);if("rectangle"==n.unit)n.addNew||(a=new Ti(r,r)),r=fn(e,t,!0,!0),l=-1;else{var d=ka(e,r,n.unit);a=n.extend?Yi(a,d.anchor,d.head,n.extend):d}n.addNew?-1==l?(l=c.length,no(o,Di(e,c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==n.unit&&!n.extend?(no(o,Di(e,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):eo(o,l,a,K):(l=0,no(o,new Mi([a],0),K),s=o.sel);var u=r;function h(t){if(0!=ot(u,t))if(u=t,"rectangle"==n.unit){for(var i=[],c=e.options.tabSize,d=B(Xe(o,r.line).text,r.ch,c),h=B(Xe(o,t.line).text,t.ch,c),f=Math.min(d,h),p=Math.max(d,h),m=Math.min(r.line,t.line),g=Math.min(e.lastLine(),Math.max(r.line,t.line));m<=g;m++){var v=Xe(o,m).text,b=Z(v,f,c);f==p?i.push(new Ti(it(m,b),it(m,b))):v.length>b&&i.push(new Ti(it(m,b),it(m,Z(v,p,c))))}i.length||i.push(new Ti(r,r)),no(o,Di(e,s.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var w,y=a,k=ka(e,t,n.unit),x=y.anchor;ot(k.anchor,x)>0?(w=k.head,x=ct(y.from(),k.anchor)):(w=k.anchor,x=st(y.to(),k.head));var C=s.ranges.slice(0);C[l]=function(e,t){var r=t.anchor,n=t.head,i=Xe(e.doc,r.line);if(0==ot(r,n)&&r.sticky==n.sticky)return t;var o=fe(i);if(!o)return t;var a=ue(o,r.ch,r.sticky),l=o[a];if(l.from!=r.ch&&l.to!=r.ch)return t;var s,c=a+(l.from==r.ch==(1!=l.level)?0:1);if(0==c||c==o.length)return t;if(n.line!=r.line)s=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var d=ue(o,n.ch,n.sticky),u=d-a||(n.ch-r.ch)*(1==l.level?-1:1);s=d==c-1||d==c?u<0:u>0}var h=o[c+(s?-1:0)],f=s==(1==h.level),p=f?h.from:h.to,m=f?"after":"before";return r.ch==p&&r.sticky==m?t:new Ti(new it(r.line,p,m),n)}(e,new Ti(ut(o,x),w)),no(o,Di(e,C,l),K)}}var f=i.wrapper.getBoundingClientRect(),p=0;function m(t){var r=++p,a=fn(e,t,!0,"rectangle"==n.unit);if(a)if(0!=ot(a,u)){e.curOp.focus=P(),h(a);var l=Fn(i,o);(a.line>=l.to||a.line<l.from)&&setTimeout(ii(e,(function(){p==r&&m(t)})),150)}else{var s=t.clientY<f.top?-20:t.clientY>f.bottom?20:0;s&&setTimeout(ii(e,(function(){p==r&&(i.scroller.scrollTop+=s,m(t))})),50)}}function g(t){e.state.selectingText=!1,p=1/0,t&&(Ce(t),i.input.focus()),ve(i.wrapper.ownerDocument,"mousemove",v),ve(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var v=ii(e,(function(e){0!==e.buttons&&De(e)?m(e):g(e)})),b=ii(e,g);e.state.selectingText=b,me(i.wrapper.ownerDocument,"mousemove",v),me(i.wrapper.ownerDocument,"mouseup",b)}(e,n,t,o)}(t,n,o,e):Te(e)==r.scroller&&Ce(e):2==i?(n&&Qi(t.doc,n),setTimeout((function(){return r.input.focus()}),20)):3==i&&(T?t.display.input.onContextMenu(e):Tn(t)))}}function ka(e,t,r){if("char"==r)return new Ti(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Ti(it(t.line,0),ut(e.doc,it(t.line+1,0)));var n=r(e,t);return new Ti(n.from,n.to)}function xa(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ce(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!ke(e,r))return Le(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var c=a.gutters.childNodes[s];if(c&&c.getBoundingClientRect().right>=i)return be(e,r,e,tt(e.doc,o),e.display.gutterSpecs[s].className,t),Le(t)}}function Ca(e,t){return xa(e,t,"gutterClick",!0)}function Sa(e,t){Lr(e.display,t)||function(e,t){if(!ke(e,"gutterContextMenu"))return!1;return xa(e,t,"gutterContextMenu",!1)}(e,t)||we(e,t,"contextmenu")||T||e.display.input.onContextMenu(t)}function La(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rr(e)}wa.prototype.compare=function(e,t,r){return this.time+400>e&&0==ot(t,this.pos)&&r==this.button};var Ma={toString:function(){return"CodeMirror.Init"}},Ta={},Da={};function Aa(e,t,r){if(!t!=!(r&&r!=Ma)){var n=e.display.dragFunctions,i=t?me:ve;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function za(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(z(e.display.wrapper,"CodeMirror-wrap"),Zt(e)),hn(e),mn(e),Rr(e),setTimeout((function(){return Un(e)}),100)}function Oa(e,t){var r=this;if(!(this instanceof Oa))return new Oa(e,t);this.options=t=t?$(t):{},$(Ta,t,!1);var n=t.value;"string"==typeof n?n=new jo(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Oa.inputStyles[t.inputStyle](this),o=this.display=new yi(e,n,i,t);for(var a in o.wrapper.CodeMirror=this,La(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new R,keySeq:null,specialChars:null},t.autofocus&&!k&&o.input.focus(),d&&u<11&&setTimeout((function(){return r.display.input.reset(!0)}),20),function(e){var t=e.display;me(t.scroller,"mousedown",ii(e,ya)),me(t.scroller,"dblclick",d&&u<11?ii(e,(function(t){if(!we(e,t)){var r=fn(e,t);if(r&&!Ca(e,t)&&!Lr(e.display,t)){Ce(t);var n=e.findWordAt(r);Qi(e.doc,n.anchor,n.head)}}})):function(t){return we(e,t)||Ce(t)});me(t.scroller,"contextmenu",(function(t){return Sa(e,t)}));var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout((function(){return t.activeTouch=null}),1e3),(n=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}me(t.scroller,"touchstart",(function(i){if(!we(e,i)&&!o(i)&&!Ca(e,i)){t.input.ensurePolled(),clearTimeout(r);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),me(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),me(t.scroller,"touchend",(function(r){var n=t.activeTouch;if(n&&!Lr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var o,l=e.coordsChar(t.activeTouch,"page");o=!n.prev||a(n,n.prev)?new Ti(l,l):!n.prev.prev||a(n,n.prev.prev)?e.findWordAt(l):new Ti(it(l.line,0),ut(e.doc,it(l.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ce(r)}i()})),me(t.scroller,"touchcancel",i),me(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(_n(e,t.scroller.scrollTop),$n(e,t.scroller.scrollLeft,!0),be(e,"scroll",e))})),me(t.scroller,"mousewheel",(function(t){return Li(e,t)})),me(t.scroller,"DOMMouseScroll",(function(t){return Li(e,t)})),me(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){we(e,t)||Me(t)},over:function(t){we(e,t)||(!function(e,t){var r=fn(e,t);if(r){var n=document.createDocumentFragment();xn(e,r,n),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),F(e.display.dragCursor,n)}}(e,t),Me(t))},start:function(t){return function(e,t){if(d&&(!e.state.draggingText||+new Date-Po<100))Me(t);else if(!we(e,t)&&!Lr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!g)){var r=N("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",m&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),m&&r.parentNode.removeChild(r)}}(e,t)},drop:ii(e,Io),leave:function(t){we(e,t)||Ho(e)}};var l=t.input.getField();me(l,"keyup",(function(t){return ma.call(e,t)})),me(l,"keydown",ii(e,pa)),me(l,"keypress",ii(e,ga)),me(l,"focus",(function(t){return Dn(e,t)})),me(l,"blur",(function(t){return An(e,t)}))}(this),$o(),Xn(this),this.curOp.forceUpdate=!0,_i(this,n),t.autofocus&&!k||this.hasFocus()?setTimeout(W(Dn,this),20):An(this),Da)Da.hasOwnProperty(a)&&Da[a](r,t[a],Ma);gi(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Fa.length;++l)Fa[l](r);Yn(this),h&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto"),t.onload&&t.onload(this)}Oa.defaults=Ta,Oa.optionHandlers=Da;var Fa=[];function Na(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=vt(e,t).state:r="prev");var a=e.options.tabSize,l=Xe(o,t),s=B(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var c,d=l.text.match(/^\s*/)[0];if(n||/\S/.test(l.text)){if("smart"==r&&((c=o.mode.indent(i,l.text.slice(d.length),l.text))==U||c>150)){if(!n)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?B(Xe(o,t-1).text,null,a):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c);var u="",h=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)h+=a,u+="\t";if(h<c&&(u+=Y(c-h)),u!=d)return wo(o,u,it(t,0),it(t,d.length),"+input"),l.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var m=o.sel.ranges[p];if(m.head.line==t&&m.head.ch<d.length){var g=it(t,d.length);eo(o,p,new Ti(g,g));break}}}Oa.defineInitHook=function(e){return Fa.push(e)};var Ea=null;function ja(e){Ea=e}function Pa(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var a=+new Date-200,l="paste"==i||e.state.pasteIncoming>a,s=je(t),c=null;if(l&&n.ranges.length>1)if(Ea&&Ea.text.join("\n")==t){if(n.ranges.length%Ea.text.length==0){c=[];for(var d=0;d<Ea.text.length;d++)c.push(o.splitLines(Ea.text[d]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=J(s,(function(e){return[e]})));for(var u=e.curOp.updateInput,h=n.ranges.length-1;h>=0;h--){var f=n.ranges[h],p=f.from(),m=f.to();f.empty()&&(r&&r>0?p=it(p.line,p.ch-r):e.state.overwrite&&!l?m=it(m.line,Math.min(Xe(o,m.line).text.length,m.ch+Q(s).length)):l&&Ea&&Ea.lineWise&&Ea.text.join("\n")==t&&(p=m=it(p.line,0)));var g={from:p,to:m,text:c?c[h%c.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};po(e.doc,g),ur(e,"inputRead",e,g)}t&&!l&&Ha(e,t),jn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=u),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ia(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||ni(t,(function(){return Pa(t,r,0,null,"paste")})),!0}function Ha(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Na(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Na(e,i.head.line,"smart"));a&&ur(e,"electricInput",e,i.head.line)}}}function _a(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:it(i,0),head:it(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Wa(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function $a(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return h?e.style.width="1000px":e.setAttribute("wrap","off"),w&&(e.style.border="1px solid black"),Wa(e),t}function Ba(e,t,r,n,i){var o=t,a=r,l=Xe(e,t.line);function s(n){var o,a;if(o=i?function(e,t,r,n){var i=fe(t,e.doc.direction);if(!i)return na(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=ue(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return na(t,r,n);var l,s=function(e,r){return ra(t,e instanceof it?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(l=l||jr(e,t),tn(e,t,l,r)):{begin:0,end:t.text.length}},d=c("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var u=1==a.level==n<0,h=s(r,u?1:-1);if(null!=h&&(u?h<=a.to&&h<=d.end:h>=a.from&&h>=d.begin)){var f=u?"before":"after";return new it(r.line,h,f)}}var p=function(e,t,n){for(var o=function(e,t){return t?new it(r.line,s(e,1),"before"):new it(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),n.begin<=c&&c<n.end)return o(c,l)}},m=p(o+n,n,d);if(m)return m;var g=n>0?d.end:s(d.begin,-1);return null==g||n>0&&g==t.text.length||!(m=p(n>0?0:i.length-1,n,c(g)))?null:m}(e.cm,l,t,r):na(l,t,r),null==o){if(n||(a=t.line+r)<e.first||a>=e.first+e.size||(t=new it(a,t.ch,t.sticky),!(l=Xe(e,a))))return!1;t=ia(i,e.cm,l,t.line,r)}else t=o;return!0}if("char"==n)s();else if("column"==n)s(!0);else if("word"==n||"group"==n)for(var c=null,d="group"==n,u=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(r<0)||s(!h);h=!1){var f=l.text.charAt(t.ch)||"\n",p=ie(f,u)?"w":d&&"\n"==f?"n":!d||/\s/.test(f)?null:"p";if(!d||h||p||(p="s"),c&&c!=p){r<0&&(r=1,s(),t.sticky="after");break}if(p&&(c=p),r>0&&!s(!h))break}var m=co(e,t,o,a,!0);return at(o,m)&&(m.hitSide=!0),m}function Ra(e,t,r,n){var i,o,a=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(s-.5*ln(e.display),3);i=(r>0?t.bottom:t.top)+r*c}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=Jr(e,l,i)).outside;){if(r<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*r}return o}var Va=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new R,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ua(e,t){var r=Er(e,t.line);if(!r||r.hidden)return null;var n=Xe(e.doc,t.line),i=Fr(r,n,t.line),o=fe(n,e.doc.direction),a="left";o&&(a=ue(o,t.ch)%2?"right":"left");var l=_r(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function qa(e,t){return t&&(e.bad=!0),e}function Ka(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return qa(e.clipPos(it(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Ga(o,t,r)}}function Ga(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!j(n,t))return qa(it(et(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?Q(e.rest):e.line;return qa(it(et(o),o.text.length),i)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));l.parentNode!=n;)l=l.parentNode;var s=e.measure,c=s.maps;function d(t,r,n){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?s.map:c[i],a=0;a<o.length;a+=3){var l=o[a+2];if(l==t||l==r){var d=et(i<0?e.line:e.rest[i]),u=o[a]+n;return(n<0||l!=t)&&(u=o[a+(n?1:0)]),it(d,u)}}}var u=d(a,l,r);if(u)return qa(u,i);for(var h=l.nextSibling,f=a?a.nodeValue.length-r:0;h;h=h.nextSibling){if(u=d(h,h.firstChild,0))return qa(it(u.line,u.ch-f),i);f+=h.textContent.length}for(var p=l.previousSibling,m=r;p;p=p.previousSibling){if(u=d(p,p.firstChild,-1))return qa(it(u.line,u.ch+m),i);m+=p.textContent.length}}Va.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;function o(e){if(!we(n,e)){if(n.somethingSelected())ja({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=_a(n);ja({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,q),n.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var o=Ea.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=$a(),l=a.firstChild;n.display.lineSpace.insertBefore(a,n.display.lineSpace.firstChild),l.value=Ea.text.join("\n");var s=document.activeElement;_(l),setTimeout((function(){n.display.lineSpace.removeChild(a),s.focus(),s==i&&r.showPrimarySelection()}),50)}}Wa(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),me(i,"paste",(function(e){we(n,e)||Ia(e,n)||u<=11&&setTimeout(ii(n,(function(){return t.updateFromDOM()})),20)})),me(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),me(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),me(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),me(i,"touchstart",(function(){return r.forceCompositionEnd()})),me(i,"input",(function(){t.composing||t.readFromDOMSoon()})),me(i,"copy",o),me(i,"cut",o)},Va.prototype.prepareSelection=function(){var e=kn(this.cm,!1);return e.focus=this.cm.state.focused,e},Va.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Va.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Va.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)e.removeAllRanges();else{var o=Ka(t,e.anchorNode,e.anchorOffset),l=Ka(t,e.focusNode,e.focusOffset);if(!o||o.bad||!l||l.bad||0!=ot(ct(o,l),n)||0!=ot(st(o,l),i)){var s=t.display.view,c=n.line>=t.display.viewFrom&&Ua(t,n)||{node:s[0].measure.map[2],offset:0},d=i.line<t.display.viewTo&&Ua(t,i);if(!d){var u=s[s.length-1].measure,h=u.maps?u.maps[u.maps.length-1]:u.map;d={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&d){var f,p=e.rangeCount&&e.getRangeAt(0);try{f=A(c.node,c.offset,d.offset,d.node)}catch(e){}f&&(!a&&t.state.focused?(e.collapse(c.node,c.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),p&&null==e.anchorNode?e.addRange(p):a&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Va.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},Va.prototype.showMultipleSelections=function(e){F(this.cm.display.cursorDiv,e.cursors),F(this.cm.display.selectionDiv,e.selection)},Va.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Va.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return j(this.div,t)},Va.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Va.prototype.blur=function(){this.div.blur()},Va.prototype.getField=function(){return this.div},Va.prototype.supportsTouch=function(){return!0},Va.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ni(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},Va.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Va.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(y&&p&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=Ka(t,e.anchorNode,e.anchorOffset),n=Ka(t,e.focusNode,e.focusOffset);r&&n&&ni(t,(function(){no(t.doc,Ai(r,n),q),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)}))}}},Va.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),a=o.from(),l=o.to();if(0==a.ch&&a.line>n.firstLine()&&(a=it(a.line-1,Xe(n.doc,a.line-1).length)),l.ch==Xe(n.doc,l.line).text.length&&l.line<n.lastLine()&&(l=it(l.line+1,0)),a.line<i.viewFrom||l.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=pn(n,a.line))?(t=et(i.view[0].line),r=i.view[0].node):(t=et(i.view[e].line),r=i.view[e-1].node.nextSibling);var s,c,d=pn(n,l.line);if(d==i.view.length-1?(s=i.viewTo-1,c=i.lineDiv.lastChild):(s=et(i.view[d+1].line)-1,c=i.view[d+1].node.previousSibling),!r)return!1;for(var u=n.doc.splitLines(function(e,t,r,n,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function c(e){return function(t){return t.id==e}}function d(){a&&(o+=l,s&&(o+=l),a=s=!1)}function u(e){e&&(d(),o+=e)}function h(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void u(r);var o,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(it(n,0),it(i+1,0),c(+f));return void(p.length&&(o=p[0].find(0))&&u(Ye(e.doc,o.from,o.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&d();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),m&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;h(t),t!=r;)t=t.nextSibling,s=!1;return o}(n,r,c,t,s)),h=Ye(n.doc,it(t,0),it(s,Xe(n.doc,s).text.length));u.length>1&&h.length>1;)if(Q(u)==Q(h))u.pop(),h.pop(),s--;else{if(u[0]!=h[0])break;u.shift(),h.shift(),t++}for(var f=0,p=0,m=u[0],g=h[0],v=Math.min(m.length,g.length);f<v&&m.charCodeAt(f)==g.charCodeAt(f);)++f;for(var b=Q(u),w=Q(h),y=Math.min(b.length-(1==u.length?f:0),w.length-(1==h.length?f:0));p<y&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)++p;if(1==u.length&&1==h.length&&t==a.line)for(;f&&f>a.ch&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)f--,p++;u[u.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),u[0]=u[0].slice(f).replace(/\u200b+$/,"");var k=it(t,f),x=it(s,h.length?Q(h).length-p:0);return u.length>1||u[0]||ot(k,x)?(wo(n.doc,u,k,x,"+input"),!0):void 0},Va.prototype.ensurePolled=function(){this.forceCompositionEnd()},Va.prototype.reset=function(){this.forceCompositionEnd()},Va.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Va.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Va.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ni(this.cm,(function(){return mn(e.cm)}))},Va.prototype.setUneditable=function(e){e.contentEditable="false"},Va.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ii(this.cm,Pa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Va.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Va.prototype.onContextMenu=function(){},Va.prototype.resetPosition=function(){},Va.prototype.needsContentAttribute=!0;var Za=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new R,this.hasSelection=!1,this.composing=null};Za.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!we(n,e)){if(n.somethingSelected())ja({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=_a(n);ja({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,q):(r.prevInput="",i.value=t.text.join("\n"),_(i))}"cut"==e.type&&(n.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),w&&(i.style.width="0px"),me(i,"input",(function(){d&&u>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()})),me(i,"paste",(function(e){we(n,e)||Ia(e,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())})),me(i,"cut",o),me(i,"copy",o),me(e.scroller,"paste",(function(t){if(!Lr(e,t)&&!we(n,t)){if(!i.dispatchEvent)return n.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),me(e.lineSpace,"selectstart",(function(t){Lr(e,t)||Ce(t)})),me(i,"compositionstart",(function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),me(i,"compositionend",(function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)}))},Za.prototype.createField=function(e){this.wrapper=$a(),this.textarea=this.wrapper.firstChild},Za.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=kn(e);if(e.options.moveInputWithCursor){var i=Xr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return n},Za.prototype.showSelection=function(e){var t=this.cm.display;F(t.cursorDiv,e.cursors),F(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Za.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&_(this.textarea),d&&u>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",d&&u>=9&&(this.hasSelection=null))}},Za.prototype.getField=function(){return this.textarea},Za.prototype.supportsTouch=function(){return!1},Za.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!k||P()!=this.textarea))try{this.textarea.focus()}catch(e){}},Za.prototype.blur=function(){this.textarea.blur()},Za.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Za.prototype.receivedFocus=function(){this.slowPoll()},Za.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Za.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))}))},Za.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Pe(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(d&&u>=9&&this.hasSelection===i||x&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(n.length,i.length);a<l&&n.charCodeAt(a)==i.charCodeAt(a);)++a;return ni(t,(function(){Pa(t,i.slice(a),n.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Za.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Za.prototype.onKeyPress=function(){d&&u>=9&&(this.hasSelection=null),this.fastPoll()},Za.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=fn(r,e),a=n.scroller.scrollTop;if(o&&!m){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&ii(r,no)(r.doc,Ai(o),q);var l,s=i.style.cssText,c=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(d?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",h&&(l=window.scrollY),n.input.focus(),h&&window.scrollTo(null,l),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=g,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),d&&u>=9&&p(),T){Me(e);me(window,"mouseup",(function e(){ve(window,"mouseup",e),setTimeout(g,20)}))}else setTimeout(g,50)}function p(){if(null!=i.selectionStart){var e=r.somethingSelected(),o=""+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function g(){if(t.contextMenuPending==g&&(t.contextMenuPending=!1,t.wrapper.style.cssText=c,i.style.cssText=s,d&&u<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=a),null!=i.selectionStart)){(!d||d&&u<9)&&p();var e=0;n.detectingSelectAll=setTimeout((function o(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&""==t.prevInput?ii(r,ho)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())}),200)}}},Za.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Za.prototype.setUneditable=function(){},Za.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=Ma&&i(e,t,r)}:i)}e.defineOption=r,e.Init=Ma,r("value","",(function(e,t){return e.setValue(t)}),!0),r("mode",null,(function(e,t){e.doc.modeOption=t,Ei(e)}),!0),r("indentUnit",2,Ei,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,(function(e){ji(e),Rr(e),mn(e)}),!0),r("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(it(n,o))}n++}));for(var i=r.length-1;i>=0;i--)wo(e.doc,t,r[i],it(r[i].line,r[i].ch+t.length))}})),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=Ma&&e.refresh()})),r("specialCharPlaceholder",rr,(function(e){return e.refresh()}),!0),r("electricChars",!0),r("inputStyle",k?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running src")}),!0),r("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),r("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),r("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),r("rtlMoveVisually",!S),r("wholeLineUpdateBefore",!0),r("theme","default",(function(e){La(e),wi(e)}),!0),r("keyMap","default",(function(e,t,r){var n=ea(t),i=r!=Ma&&ea(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)})),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,za,!0),r("gutters",[],(function(e,t){e.display.gutterSpecs=vi(t,e.options.lineNumbers),wi(e)}),!0),r("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?dn(e.display)+"px":"0",e.refresh()}),!0),r("coverGutterNextToScrollbar",!1,(function(e){return Un(e)}),!0),r("scrollbarStyle","native",(function(e){Gn(e),Un(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),r("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=vi(e.options.gutters,t),wi(e)}),!0),r("firstLineNumber",1,wi,!0),r("lineNumberFormatter",(function(e){return e}),wi,!0),r("showCursorWhenSelecting",!1,yn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,(function(e,t){"nocursor"==t&&(An(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),r("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),r("dragDrop",!0,Aa),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,yn,!0),r("singleCursorHeightPerLine",!0,yn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,ji,!0),r("addModeClass",!1,ji,!0),r("pollInterval",100),r("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),r("historyEventDelay",1250),r("viewportMargin",10,(function(e){return e.refresh()}),!0),r("maxHighlightLength",1e4,ji,!0),r("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),r("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),r("autofocus",null),r("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),r("phrases",null)}(Oa),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&ii(this,t[e])(this,r,i),be(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](ea(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:oi((function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},(function(e){return e.priority})),this.state.modeGen++,mn(this)})),removeOverlay:oi((function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void mn(this)}})),indentLine:oi((function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),rt(this.doc,e)&&Na(this,e,t,r)})),indentSelection:oi((function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(Na(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&jn(t));else{var a=o.from(),l=o.to(),s=Math.max(n,a.line);n=Math.min(t.lastLine(),l.line-(l.ch?0:1))+1;for(var c=s;c<n;++c)Na(t,c,e);var d=t.doc.sel.ranges;0==a.ch&&r.length==d.length&&d[i].from().ch>0&&eo(t.doc,i,new Ti(a,d[i].to()),q)}}})),getTokenAt:function(e,t){return xt(this,e,t)},getLineTokens:function(e,t){return xt(this,it(e),t,!0)},getTokenTypeAt:function(e){e=ut(this.doc,e);var t,r=gt(this,Xe(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=n+i>>1;if((a?r[2*a-1]:0)>=o)i=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}n=a+1}}var l=t?t.indexOf("overlay "):-1;return l<0?t:0==l?null:t.slice(0,l-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var l=i[o[t][a]];l&&n.push(l)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var s=0;s<i._global.length;s++){var c=i._global[s];c.pred(o,this)&&-1==V(n,c.val)&&n.push(c.val)}return n},getStateAfter:function(e,t){var r=this.doc;return vt(this,(e=dt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Xr(this,null==e?r.head:"object"==n(e)?ut(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Zr(this,ut(this.doc,e),t||"page")},coordsChar:function(e,t){return Jr(this,(e=Gr(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Gr(this,{top:e,left:0},t||"page").top,tt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=Xe(this.doc,e)}else n=e;return Kr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Kt(n):0)},defaultTextHeight:function(){return ln(this.display)},defaultCharWidth:function(){return sn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,a,l,s=this.display,c=(e=Xr(this,ut(this.doc,e))).bottom,d=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==n)c=e.top;else if("above"==n||"near"==n){var u=Math.max(s.wrapper.clientHeight,this.doc.height),h=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(c=e.bottom),d+t.offsetWidth>h&&(d=h-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(d=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?d=0:"middle"==i&&(d=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=d+"px"),r&&(o=this,a={left:d,top:c,right:d+t.offsetWidth,bottom:c+t.offsetHeight},null!=(l=Nn(o,a)).scrollTop&&_n(o,l.scrollTop),null!=l.scrollLeft&&$n(o,l.scrollLeft))},triggerOnKeyDown:oi(pa),triggerOnKeyPress:oi(ga),triggerOnKeyUp:ma,triggerOnMouseDown:oi(ya),execCommand:function(e){if(oa.hasOwnProperty(e))return oa[e].call(null,this)},triggerElectric:oi((function(e){Ha(this,e)})),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=ut(this.doc,e),a=0;a<t&&!(o=Ba(this.doc,o,i,r,n)).hitSide;++a);return o},moveH:oi((function(e,t){var r=this;this.extendSelectionsBy((function(n){return r.display.shift||r.doc.extend||n.empty()?Ba(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()}),G)})),deleteH:oi((function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):ta(this,(function(r){var i=Ba(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}}))})),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var a=ut(this.doc,e),l=0;l<t;++l){var s=Xr(this,a,"div");if(null==o?o=s.left:s.left=o,(a=Ra(this,s,i,r)).hitSide)break}return a},moveV:oi((function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var l=Xr(r,a.head,"div");null!=a.goalColumn&&(l.left=a.goalColumn),i.push(l.left);var s=Ra(r,l,e,t);return"page"==t&&a==n.sel.primary()&&En(r,Zr(r,s,"div").top-l.top),s}),G),i.length)for(var a=0;a<n.sel.ranges.length;a++)n.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=Xe(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),a=ie(o,i)?function(e){return ie(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ie(e)};r>0&&a(t.charAt(r-1));)--r;for(;n<t.length&&a(t.charAt(n));)++n}return new Ti(it(e.line,r),it(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?I(this.display.cursorDiv,"CodeMirror-overwrite"):z(this.display.cursorDiv,"CodeMirror-overwrite"),be(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==P()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:oi((function(e,t){Pn(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ar(this)-this.display.barHeight,width:e.scrollWidth-Ar(this)-this.display.barWidth,clientHeight:Or(this),clientWidth:zr(this)}},scrollIntoView:oi((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:it(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){In(e),e.curOp.scrollToPos=t}(this,e):Hn(this,e.from,e.to,e.margin)})),setSize:oi((function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Br(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){gn(r,i,"widget");break}++i})),this.curOp.forceUpdate=!0,be(this,"refresh",this)})),operation:function(e){return ni(this,e)},startOperation:function(){return Xn(this)},endOperation:function(){return Yn(this)},refresh:oi((function(){var e=this.display.cachedTextHeight;mn(this),this.curOp.forceUpdate=!0,Rr(this),Pn(this,this.doc.scrollLeft,this.doc.scrollTop),fi(this.display),(null==e||Math.abs(e-ln(this.display))>.5)&&hn(this),be(this,"refresh",this)})),swapDoc:oi((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),_i(this,e),Rr(this),this.display.input.reset(),Pn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ur(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Oa);var Xa="iter insert remove copy getEditor constructor".split(" ");for(var Ya in jo.prototype)jo.prototype.hasOwnProperty(Ya)&&V(Xa,Ya)<0&&(Oa.prototype[Ya]=function(e){return function(){return e.apply(this.doc,arguments)}}(jo.prototype[Ya]));xe(jo),Oa.inputStyles={textarea:Za,contenteditable:Va},Oa.defineMode=function(e){Oa.defaults.mode||"null"==e||(Oa.defaults.mode=e),$e.apply(this,arguments)},Oa.defineMIME=function(e,t){We[e]=t},Oa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Oa.defineMIME("text/plain","null"),Oa.defineExtension=function(e,t){Oa.prototype[e]=t},Oa.defineDocExtension=function(e,t){jo.prototype[e]=t},Oa.fromTextArea=function(e,t){if((t=t?$(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=P();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=l.getValue()}var i;if(e.form&&(me(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(r){r.save=n,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,n(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(ve(e.form,"submit",n),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var l=Oa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return l},function(e){e.off=ve,e.on=me,e.wheelEventPixels=Si,e.Doc=jo,e.splitLines=je,e.countColumn=B,e.findColumn=Z,e.isWordChar=ne,e.Pass=U,e.signal=be,e.Line=Xt,e.changeEnd=zi,e.scrollbarModel=Kn,e.Pos=it,e.cmpPos=ot,e.modes=_e,e.mimeModes=We,e.resolveMode=Be,e.getMode=Re,e.modeExtensions=Ve,e.extendMode=Ue,e.copyState=qe,e.startState=Ge,e.innerMode=Ke,e.commands=oa,e.keyMap=Ko,e.keyName=Jo,e.isModifierKey=Yo,e.lookupKey=Xo,e.normalizeKeyMap=Zo,e.StringStream=Ze,e.SharedTextMarker=Oo,e.TextMarker=Ao,e.LineWidget=Mo,e.e_preventDefault=Ce,e.e_stopPropagation=Se,e.e_stop=Me,e.addClass=I,e.contains=j,e.rmClass=z}(Oa),Oa.version="5.49.2",window.CodeMirror=Oa;const Qa=Oa;var Ja={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},el={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};function tl(e){return tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tl(e)}function rl(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}Qa.defineMode("xml",(function(e,t){var r,n,i=e.indentUnit,o={},a=t.htmlMode?Ja:el;for(var l in a)o[l]=a[l];for(var l in t)o[l]=t[l];function s(e,t){function n(r){return t.tokenize=r,r(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(d("atom","]]>")):null:e.match("--")?n(d("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(u(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=d("meta","?>"),"meta"):(r=e.eat("/")?"closeTag":"openTag",t.tokenize=c,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function c(e,t){var n,i,o=e.next();if(">"==o||"/"==o&&e.eat(">"))return t.tokenize=s,r=">"==o?"endTag":"selfcloseTag","tag bracket";if("="==o)return r="equals",null;if("<"==o){t.tokenize=s,t.state=m,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(o)?(t.tokenize=(n=o,i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=c;break}return"string"},i.isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=s;break}r.next()}return e}}function u(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=u(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=s;break}return r.tokenize=u(e-1),r.tokenize(t,r)}}return"meta"}}function h(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function p(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!o.contextGrabbers.hasOwnProperty(r)||!o.contextGrabbers[r].hasOwnProperty(t))return;f(e)}}function m(e,t,r){return"openTag"==e?(r.tagStart=t.column(),g):"closeTag"==e?v:m}function g(e,t,r){return"word"==e?(r.tagName=t.current(),n="tag",y):o.allowMissingTagName&&"endTag"==e?(n="tag bracket",y(e,t,r)):(n="error",g)}function v(e,t,r){if("word"==e){var i=t.current();return r.context&&r.context.tagName!=i&&o.implicitlyClosed.hasOwnProperty(r.context.tagName)&&f(r),r.context&&r.context.tagName==i||!1===o.matchClosing?(n="tag",b):(n="tag error",w)}return o.allowMissingTagName&&"endTag"==e?(n="tag bracket",b(e,t,r)):(n="error",w)}function b(e,t,r){return"endTag"!=e?(n="error",b):(f(r),m)}function w(e,t,r){return n="error",b(e,0,r)}function y(e,t,r){if("word"==e)return n="attribute",k;if("endTag"==e||"selfcloseTag"==e){var i=r.tagName,a=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||o.autoSelfClosers.hasOwnProperty(i)?p(r,i):(p(r,i),r.context=new h(r,i,a==r.indented)),m}return n="error",y}function k(e,t,r){return"equals"==e?x:(o.allowMissing||(n="error"),y(e,0,r))}function x(e,t,r){return"string"==e?C:"word"==e&&o.allowUnquoted?(n="string",y):(n="error",y(e,0,r))}function C(e,t,r){return"string"==e?C:y(e,0,r)}return s.isInText=!0,{startState:function(e){var t={tokenize:s,state:m,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;r=null;var i=t.tokenize(e,t);return(i||r)&&"comment"!=i&&(n=null,t.state=t.state(r||i,e,t),n&&(i="error"==n?i+" error":n)),i},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+i;if(n&&n.noIndent)return Qa.Pass;if(e.tokenize!=c&&e.tokenize!=s)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==o.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+i*(o.multilineTagIndentFactor||1);if(o.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var a=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(a&&a[1])for(;n;){if(n.tagName==a[2]){n=n.prev;break}if(!o.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(a)for(;n;){var l=o.contextGrabbers[n.tagName];if(!l||!l.hasOwnProperty(a[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+i:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:o.htmlMode?"html":"xml",helperType:o.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=y)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],r=e.context;r;r=r.prev)r.tagName&&t.push(r.tagName);return t.reverse()}}})),Qa.defineMIME("text/xml","xml"),Qa.defineMIME("php","xml"),Qa.defineMIME("vue","xml"),Qa.defineMIME("html","xml"),Qa.defineMIME("application/xml","xml"),Qa.mimeModes.hasOwnProperty("text/html")||Qa.defineMIME("text/html",{name:"xml",htmlMode:!0}),Qa.defineMode("css",(function(e,t){var r=t.inline;t.propertyKeywords||(t=Qa.resolveMode("text/css"));var n,i,o=e.indentUnit,a=t.tokenHooks,l=t.documentTypes||{},s=t.mediaTypes||{},c=t.mediaFeatures||{},d=t.mediaValueKeywords||{},u=t.propertyKeywords||{},h=t.nonStandardPropertyKeywords||{},f=t.fontProperties||{},p=t.counterDescriptors||{},m=t.colorKeywords||{},g=t.valueKeywords||{},v=t.allowNested,b=t.lineComment,w=!0===t.supportsAtComponent;function y(e,t){return n=t,e}function k(e,t){var r=e.next();if(a[r]){var n=a[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),y("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?y(null,"compare"):'"'==r||"'"==r?(t.tokenize=x(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),y("atom","hash")):"!"==r?(e.match(/^\s*\w*/),y("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),y("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?y(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?y("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?y(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=C),y("variable callee","variable")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),y("property","word")):y(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),y("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?y("variable-2","variable-definition"):y("variable-2","variable")):e.match(/^\w+-/)?y("meta","meta"):void 0}function x(e){return function(t,r){for(var n,i=!1;null!=(n=t.next());){if(n==e&&!i){")"==e&&t.backUp(1);break}i=!i&&"\\"==n}return(n==e||!i&&")"!=e)&&(r.tokenize=null),y("string","string")}}function C(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=x(")"),y(null,"(")}function S(e,t,r){this.type=e,this.indent=t,this.prev=r}function L(e,t,r,n){return e.context=new S(r,t.indentation()+(!1===n?0:o),e.context),r}function M(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function T(e,t,r){return z[r.context.type](e,t,r)}function D(e,t,r,n){for(var i=n||1;i>0;i--)r.context=r.context.prev;return T(e,t,r)}function A(e){var t=e.current().toLowerCase();i=g.hasOwnProperty(t)?"atom":m.hasOwnProperty(t)?"keyword":"variable"}var z={top:function(e,t,r){if("{"==e)return L(r,t,"block");if("}"==e&&r.context.prev)return M(r);if(w&&/@component/i.test(e))return L(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return L(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return L(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return L(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return L(r,t,"interpolation");if(":"==e)return"pseudo";if(v&&"("==e)return L(r,t,"parens")}return r.context.type},block:function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return u.hasOwnProperty(n)?(i="property","maybeprop"):h.hasOwnProperty(n)?(i="string-2","maybeprop"):v?(i=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(i+=" error","maybeprop")}return"meta"==e?"block":v||"hash"!=e&&"qualifier"!=e?z.top(e,t,r):(i="error","block")},maybeprop:function(e,t,r){return":"==e?L(r,t,"prop"):T(e,t,r)},prop:function(e,t,r){if(";"==e)return M(r);if("{"==e&&v)return L(r,t,"propBlock");if("}"==e||"{"==e)return D(e,t,r);if("("==e)return L(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return L(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?M(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?D(e,t,r):")"==e?M(r):"("==e?L(r,t,"parens"):"interpolation"==e?L(r,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(i="variable-3",r.context.type):T(e,t,r)},documentTypes:function(e,t,r){return"word"==e&&l.hasOwnProperty(t.current())?(i="tag",r.context.type):z.atBlock(e,t,r)},atBlock:function(e,t,r){if("("==e)return L(r,t,"atBlock_parens");if("}"==e||";"==e)return D(e,t,r);if("{"==e)return M(r)&&L(r,t,v?"block":"top");if("interpolation"==e)return L(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();i="only"==n||"not"==n||"and"==n||"or"==n?"keyword":s.hasOwnProperty(n)?"attribute":c.hasOwnProperty(n)?"property":d.hasOwnProperty(n)?"keyword":u.hasOwnProperty(n)?"property":h.hasOwnProperty(n)?"string-2":g.hasOwnProperty(n)?"atom":m.hasOwnProperty(n)?"keyword":"error"}return r.context.type},atComponentBlock:function(e,t,r){return"}"==e?D(e,t,r):"{"==e?M(r)&&L(r,t,v?"block":"top",!1):("word"==e&&(i="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?M(r):"{"==e||"}"==e?D(e,t,r,2):z.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?L(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(i="variable","restricted_atBlock_before"):T(e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,M(r)):"word"==e?(i="@font-face"==r.stateArg&&!f.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(i="variable","keyframes"):"{"==e?L(r,t,"top"):T(e,t,r)},at:function(e,t,r){return";"==e?M(r):"{"==e||"}"==e?D(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?M(r):"{"==e||";"==e?D(e,t,r):("word"==e?i="variable":"variable"!=e&&"("!=e&&")"!=e&&(i="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new S(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||k)(e,t);return r&&"object"===tl(r)&&(n=r[1],r=r[0]),i=r,"comment"!=n&&(t.state=z[t.state](n,e,t)),i},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),i=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(i=Math.max(0,r.indent-o)):i=(r=r.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:b,fold:"brace"}}));var nl=["domain","regexp","url","url-prefix"],il=rl(nl),ol=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],al=rl(ol),ll=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],sl=rl(ll),cl=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],dl=rl(cl),ul=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],hl=rl(ul),fl=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],pl=rl(fl),ml=rl(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),gl=rl(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),vl=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],bl=rl(vl),wl=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],yl=rl(wl),kl=nl.concat(ol).concat(ll).concat(cl).concat(ul).concat(fl).concat(vl).concat(wl);function xl(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}function Cl(e){return Cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cl(e)}function Sl(e,t){var r,n,i=e.indentUnit,o=t.statementIndent,a=t.jsonld,l=t.json||a,s=t.typescript,c=t.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),u=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function f(e,t,i){return r=e,n=i,t}function p(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,i=!1;if(a&&"@"==e.peek()&&e.match(h))return t.tokenize=p,f("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||i);)i=!i&&"\\"==n;return i||(t.tokenize=p),f("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return f("number","number");if("."==n&&e.match(".."))return f("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return f(n);if("="==n&&e.eat(">"))return f("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return f("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),f("number","number");if("/"==n)return e.eat("*")?(t.tokenize=m,m(e,t)):e.eat("/")?(e.skipToEnd(),f("comment","comment")):Ke(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),f("regexp","string-2")):(e.eat("="),f("operator","operator",e.current()));if("`"==n)return t.tokenize=g,g(e,t);if("#"==n)return e.skipToEnd(),f("error","error");if("<"==n&&e.match("!--")||"-"==n&&e.match("->"))return e.skipToEnd(),f("comment","comment");if(u.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),f("operator","operator",e.current());if(c.test(n)){e.eatWhile(c);var i=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var o=d[i];return f(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return f("async","keyword",i)}return f("variable","variable",i)}}function m(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=p;break}n="*"==r}return f("comment","comment")}function g(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=p;break}n=!n&&"\\"==r}return f("quasi","string-2",e.current())}function v(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(s){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,a=r-1;a>=0;--a){var l=e.string.charAt(a),d="([{}])".indexOf(l);if(d>=0&&d<3){if(!i){++a;break}if(0==--i){"("==l&&(o=!0);break}}else if(d>=3&&d<6)++i;else if(c.test(l))o=!0;else if(/["'\/`]/.test(l))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==l&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var b={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function w(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function y(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var k={state:null,column:null,marked:null,cc:null};function x(){for(var e=arguments.length-1;e>=0;e--)k.cc.push(arguments[e])}function C(){return x.apply(null,arguments),!0}function S(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function L(e){var r=k.state;if(k.marked="def",r.context)if("var"==r.lexical.info&&r.context&&r.context.block){var n=M(e,r.context);if(null!=n)return void(r.context=n)}else if(!S(e,r.localVars))return void(r.localVars=new A(e,r.localVars));t.globalVars&&!S(e,r.globalVars)&&(r.globalVars=new A(e,r.globalVars))}function M(e,t){if(t){if(t.block){var r=M(e,t.prev);return r?r==t.prev?t:new D(r,t.vars,!0):null}return S(e,t.vars)?t:new D(t.prev,new A(e,t.vars),!1)}return null}function T(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function D(e,t,r){this.prev=e,this.vars=t,this.block=r}function A(e,t){this.name=e,this.next=t}var z=new A("this",new A("arguments",null));function O(){k.state.context=new D(k.state.context,k.state.localVars,!1),k.state.localVars=z}function F(){k.state.context=new D(k.state.context,k.state.localVars,!0),k.state.localVars=null}function N(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function E(e,t){var r=function(){var r=k.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new w(n,k.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function j(){var e=k.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function P(e){return function t(r){return r==e?C():";"==e||"}"==r||")"==r||"]"==r?x():C(t)}}function I(e,t){return"var"==e?C(E("vardef",t),be,P(";"),j):"keyword a"==e?C(E("form"),$,I,j):"keyword b"==e?C(E("form"),I,j):"keyword d"==e?k.stream.match(/^\s*$/,!1)?C():C(E("stat"),R,P(";"),j):"debugger"==e?C(P(";")):"{"==e?C(E("}"),F,oe,j,N):";"==e?C():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==j&&k.state.cc.pop()(),C(E("form"),$,I,j,Se)):"function"==e?C(De):"for"==e?C(E("form"),Le,I,j):"class"==e||s&&"interface"==t?(k.marked="keyword",C(E("form","class"==e?e:t),Ne,j)):"variable"==e?s&&"declare"==t?(k.marked="keyword",C(I)):s&&("module"==t||"enum"==t||"type"==t)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==t?C(Ue):"type"==t?C(ze,P("operator"),de,P(";")):C(E("form"),we,P("{"),E("}"),oe,j,j)):s&&"namespace"==t?(k.marked="keyword",C(E("form"),_,I,j)):s&&"abstract"==t?(k.marked="keyword",C(I)):C(E("stat"),Q):"switch"==e?C(E("form"),$,P("{"),E("}","switch"),F,oe,j,j,N):"case"==e?C(_,P(":")):"default"==e?C(P(":")):"catch"==e?C(E("form"),O,H,I,j,N):"export"==e?C(E("stat"),Ie,j):"import"==e?C(E("stat"),_e,j):"async"==e?C(I):"@"==t?C(_,I):x(E("stat"),_,P(";"),j)}function H(e){if("("==e)return C(Oe,P(")"))}function _(e,t){return B(e,t,!1)}function W(e,t){return B(e,t,!0)}function $(e){return"("!=e?x():C(E(")"),_,P(")"),j)}function B(e,t,r){if(k.state.fatArrowAt==k.stream.start){var n=r?Z:G;if("("==e)return C(O,E(")"),ne(Oe,")"),j,P("=>"),n,N);if("variable"==e)return x(O,we,P("=>"),n,N)}var i=r?U:V;return b.hasOwnProperty(e)?C(i):"function"==e?C(De,i):"class"==e||s&&"interface"==t?(k.marked="keyword",C(E("form"),Fe,j)):"keyword c"==e||"async"==e?C(r?W:_):"("==e?C(E(")"),R,P(")"),j,i):"operator"==e||"spread"==e?C(r?W:_):"["==e?C(E("]"),Ve,j,i):"{"==e?ie(ee,"}",null,i):"quasi"==e?x(q,i):"new"==e?C(function(e){return function(t){return"."==t?C(e?Y:X):"variable"==t&&s?C(me,e?U:V):x(e?W:_)}}(r)):"import"==e?C(_):C()}function R(e){return e.match(/[;\}\)\],]/)?x():x(_)}function V(e,t){return","==e?C(_):U(e,t,!1)}function U(e,t,r){var n=0==r?V:U,i=0==r?_:W;return"=>"==e?C(O,r?Z:G,N):"operator"==e?/\+\+|--/.test(t)||s&&"!"==t?C(n):s&&"<"==t&&k.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?C(E(">"),ne(de,">"),j,n):"?"==t?C(_,P(":"),i):C(i):"quasi"==e?x(q,n):";"!=e?"("==e?ie(W,")","call",n):"."==e?C(J,n):"["==e?C(E("]"),R,P("]"),j,n):s&&"as"==t?(k.marked="keyword",C(de,n)):"regexp"==e?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),C(i)):void 0:void 0}function q(e,t){return"quasi"!=e?x():"${"!=t.slice(t.length-2)?C(q):C(_,K)}function K(e){if("}"==e)return k.marked="string-2",k.state.tokenize=g,C(q)}function G(e){return v(k.stream,k.state),x("{"==e?I:_)}function Z(e){return v(k.stream,k.state),x("{"==e?I:W)}function X(e,t){if("target"==t)return k.marked="keyword",C(V)}function Y(e,t){if("target"==t)return k.marked="keyword",C(U)}function Q(e){return":"==e?C(j,I):x(V,P(";"),j)}function J(e){if("variable"==e)return k.marked="property",C()}function ee(e,t){return"async"==e?(k.marked="property",C(ee)):"variable"==e||"keyword"==k.style?(k.marked="property","get"==t||"set"==t?C(te):(s&&k.state.fatArrowAt==k.stream.start&&(r=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+r[0].length),C(re))):"number"==e||"string"==e?(k.marked=a?"property":k.style+" property",C(re)):"jsonld-keyword"==e?C(re):s&&T(t)?(k.marked="keyword",C(ee)):"["==e?C(_,ae,P("]"),re):"spread"==e?C(W,re):"*"==t?(k.marked="keyword",C(ee)):":"==e?x(re):void 0;var r}function te(e){return"variable"!=e?x(re):(k.marked="property",C(De))}function re(e){return":"==e?C(W):"("==e?x(De):void 0}function ne(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var a=k.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),C((function(r,n){return r==t||n==t?x():x(e)}),n)}return i==t||o==t?C():r&&r.indexOf(";")>-1?x(e):C(P(t))}return function(r,i){return r==t||i==t?C():x(e,n)}}function ie(e,t,r){for(var n=3;n<arguments.length;n++)k.cc.push(arguments[n]);return C(E(t,r),ne(e,t),j)}function oe(e){return"}"==e?C():x(I,oe)}function ae(e,t){if(s){if(":"==e)return C(de);if("?"==t)return C(ae)}}function le(e,t){if(s&&(":"==e||"in"==t))return C(de)}function se(e){if(s&&":"==e)return k.stream.match(/^\s*\w+\s+is\b/,!1)?C(_,ce,de):C(de)}function ce(e,t){if("is"==t)return k.marked="keyword",C()}function de(e,t){return"keyof"==t||"typeof"==t||"infer"==t?(k.marked="keyword",C("typeof"==t?W:de)):"variable"==e||"void"==t?(k.marked="type",C(pe)):"|"==t||"&"==t?C(de):"string"==e||"number"==e||"atom"==e?C(pe):"["==e?C(E("]"),ne(de,"]",","),j,pe):"{"==e?C(E("}"),ne(he,"}",",;"),j,pe):"("==e?C(ne(fe,")"),ue,pe):"<"==e?C(ne(de,">"),de):void 0}function ue(e){if("=>"==e)return C(de)}function he(e,t){return"variable"==e||"keyword"==k.style?(k.marked="property",C(he)):"?"==t||"number"==e||"string"==e?C(he):":"==e?C(de):"["==e?C(P("variable"),le,P("]"),he):"("==e?x(Ae,he):void 0}function fe(e,t){return"variable"==e&&k.stream.match(/^\s*[?:]/,!1)||"?"==t?C(fe):":"==e?C(de):"spread"==e?C(fe):x(de)}function pe(e,t){return"<"==t?C(E(">"),ne(de,">"),j,pe):"|"==t||"."==e||"&"==t?C(de):"["==e?C(de,P("]"),pe):"extends"==t||"implements"==t?(k.marked="keyword",C(de)):"?"==t?C(de,P(":"),de):void 0}function me(e,t){if("<"==t)return C(E(">"),ne(de,">"),j,pe)}function ge(){return x(de,ve)}function ve(e,t){if("="==t)return C(de)}function be(e,t){return"enum"==t?(k.marked="keyword",C(Ue)):x(we,ae,xe,Ce)}function we(e,t){return s&&T(t)?(k.marked="keyword",C(we)):"variable"==e?(L(t),C()):"spread"==e?C(we):"["==e?ie(ke,"]"):"{"==e?ie(ye,"}"):void 0}function ye(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),"spread"==e?C(we):"}"==e?x():"["==e?C(_,P("]"),P(":"),ye):C(P(":"),we,xe)):(L(t),C(xe))}function ke(){return x(we,xe)}function xe(e,t){if("="==t)return C(W)}function Ce(e){if(","==e)return C(be)}function Se(e,t){if("keyword b"==e&&"else"==t)return C(E("form","else"),I,j)}function Le(e,t){return"await"==t?C(Le):"("==e?C(E(")"),Me,j):void 0}function Me(e){return"var"==e?C(be,Te):"variable"==e?C(Te):x(Te)}function Te(e,t){return")"==e?C():";"==e?C(Te):"in"==t||"of"==t?(k.marked="keyword",C(_,Te)):x(_,Te)}function De(e,t){return"*"==t?(k.marked="keyword",C(De)):"variable"==e?(L(t),C(De)):"("==e?C(O,E(")"),ne(Oe,")"),j,se,I,N):s&&"<"==t?C(E(">"),ne(ge,">"),j,De):void 0}function Ae(e,t){return"*"==t?(k.marked="keyword",C(Ae)):"variable"==e?(L(t),C(Ae)):"("==e?C(O,E(")"),ne(Oe,")"),j,se,N):s&&"<"==t?C(E(">"),ne(ge,">"),j,Ae):void 0}function ze(e,t){return"keyword"==e||"variable"==e?(k.marked="type",C(ze)):"<"==t?C(E(">"),ne(ge,">"),j):void 0}function Oe(e,t){return"@"==t&&C(_,Oe),"spread"==e?C(Oe):s&&T(t)?(k.marked="keyword",C(Oe)):s&&"this"==e?C(ae,xe):x(we,ae,xe)}function Fe(e,t){return"variable"==e?Ne(e,t):Ee(e,t)}function Ne(e,t){if("variable"==e)return L(t),C(Ee)}function Ee(e,t){return"<"==t?C(E(">"),ne(ge,">"),j,Ee):"extends"==t||"implements"==t||s&&","==e?("implements"==t&&(k.marked="keyword"),C(s?de:_,Ee)):"{"==e?C(E("}"),je,j):void 0}function je(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||s&&T(t))&&k.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",C(je)):"variable"==e||"keyword"==k.style?(k.marked="property",C(s?Pe:De,je)):"number"==e||"string"==e?C(s?Pe:De,je):"["==e?C(_,ae,P("]"),s?Pe:De,je):"*"==t?(k.marked="keyword",C(je)):s&&"("==e?x(Ae,je):";"==e||","==e?C(je):"}"==e?C():"@"==t?C(_,je):void 0}function Pe(e,t){if("?"==t)return C(Pe);if(":"==e)return C(de,xe);if("="==t)return C(W);var r=k.state.lexical.prev;return x(r&&"interface"==r.info?Ae:De)}function Ie(e,t){return"*"==t?(k.marked="keyword",C(Re,P(";"))):"default"==t?(k.marked="keyword",C(_,P(";"))):"{"==e?C(ne(He,"}"),Re,P(";")):x(I)}function He(e,t){return"as"==t?(k.marked="keyword",C(P("variable"))):"variable"==e?x(W,He):void 0}function _e(e){return"string"==e?C():"("==e?x(_):x(We,$e,Re)}function We(e,t){return"{"==e?ie(We,"}"):("variable"==e&&L(t),"*"==t&&(k.marked="keyword"),C(Be))}function $e(e){if(","==e)return C(We,$e)}function Be(e,t){if("as"==t)return k.marked="keyword",C(We)}function Re(e,t){if("from"==t)return k.marked="keyword",C(_)}function Ve(e){return"]"==e?C():x(ne(W,"]"))}function Ue(){return x(E("form"),we,P("{"),E("}"),ne(qe,"}"),j,j)}function qe(){return x(we,xe)}function Ke(e,t,r){return t.tokenize==p&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return N.lex=!0,j.lex=!0,{startState:function(e){var r={tokenize:p,lastType:"sof",cc:[],lexical:new w((e||0)-i,0,"block",!1),localVars:t.localVars,context:t.localVars&&new D(null,null,!1),indented:e||0};return t.globalVars&&"object"===Cl(t.globalVars)&&(r.globalVars=t.globalVars),r},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),v(e,t)),t.tokenize!=m&&e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==r?i:(t.lastType="operator"!=r||"++"!=n&&"--"!=n?r:"incdec",function(e,t,r,n,i){var o=e.cc;for(k.state=e,k.stream=i,k.marked=null,k.cc=o,k.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?_:I)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return k.marked?k.marked:"variable"==r&&y(e,n)?"variable-2":t}}(t,i,r,n,e))},indent:function(e,r){if(e.tokenize==m)return Qa.Pass;if(e.tokenize!=p)return 0;var n,a=r&&r.charAt(0),l=e.lexical;if(!/^\s*else\b/.test(r))for(var s=e.cc.length-1;s>=0;--s){var c=e.cc[s];if(c==j)l=l.prev;else if(c!=Se)break}for(;("stat"==l.type||"form"==l.type)&&("}"==a||(n=e.cc[e.cc.length-1])&&(n==V||n==U)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;o&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,h=a==d;return"vardef"==d?l.indented+("operator"==e.lastType||","==e.lastType?l.info.length+1:0):"form"==d&&"{"==a?l.indented:"form"==d?l.indented+i:"stat"==d?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||u.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(e,r)?o||i:0):"switch"!=l.info||h||0==t.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:i):l.indented+(/^(?:case|default)\b/.test(r)?i:2*i)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:a,jsonMode:l,expressionAllowed:Ke,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=_&&t!=W||e.cc.pop()}}}Qa.registerHelper("hintWords","css",kl),Qa.defineMIME("text/css",{documentTypes:il,mediaTypes:al,mediaFeatures:sl,mediaValueKeywords:dl,propertyKeywords:hl,nonStandardPropertyKeywords:pl,fontProperties:ml,counterDescriptors:gl,colorKeywords:bl,valueKeywords:yl,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=xl,xl(e,t))}},name:"css"}),Qa.defineMIME("text/x-scss",{mediaTypes:al,mediaFeatures:sl,mediaValueKeywords:dl,propertyKeywords:hl,nonStandardPropertyKeywords:pl,colorKeywords:bl,valueKeywords:yl,fontProperties:ml,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=xl,xl(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),Qa.defineMIME("text/x-less",{mediaTypes:al,mediaFeatures:sl,mediaValueKeywords:dl,propertyKeywords:hl,nonStandardPropertyKeywords:pl,colorKeywords:bl,valueKeywords:yl,fontProperties:ml,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=xl,xl(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),Qa.defineMIME("text/x-gss",{documentTypes:il,mediaTypes:al,mediaFeatures:sl,propertyKeywords:hl,nonStandardPropertyKeywords:pl,fontProperties:ml,counterDescriptors:gl,colorKeywords:bl,valueKeywords:yl,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=xl,xl(e,t))}},name:"css",helperType:"gss"}),Qa.defineMIME("less","css"),Qa.defineMIME("scss","css"),Qa.defineMIME("sass","css"),Qa.defineMIME("style","css"),Qa.defineMode("javascript",Sl),Qa.defineMode("js",Sl),Qa.registerHelper("wordChars","javascript",/[\w$]/),Qa.defineMIME("json",{name:"javascript",json:!0}),Qa.defineMIME("typescript",{name:"javascript",typescript:!0}),Qa.defineMIME("ts",{name:"javascript",typescript:!0});["js","json","python","py","react","coffeescript","dart","go","jsx"].forEach((function(e){Qa.defineMIME(e,"javascript")})),Qa.defineMode("markdown",(function(e,t){var r=Qa.getMode(e,"text/html"),n="null"==r.name;void 0===t.highlightFormatting&&(t.highlightFormatting=!1),void 0===t.maxBlockquoteDepth&&(t.maxBlockquoteDepth=0),void 0===t.taskLists&&(t.taskLists=!1),void 0===t.strikethrough&&(t.strikethrough=!1),void 0===t.emoji&&(t.emoji=!1),void 0===t.fencedCodeBlockHighlighting&&(t.fencedCodeBlockHighlighting=!0),void 0===t.xml&&(t.xml=!0),void 0===t.tokenTypeOverrides&&(t.tokenTypeOverrides={});var i={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var o in i)i.hasOwnProperty(o)&&t.tokenTypeOverrides[o]&&(i[o]=t.tokenTypeOverrides[o]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,s=/^\[(x| )\](?=\s)/i,c=t.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,d=/^ *(?:\={1,}|-{1,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,h=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,p=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function m(e,t,r){return t.f=t.inline=r,r(e,t)}function g(e,t,r){return t.f=t.block=r,r(e,t)}function v(e){if(e.linkTitle=!1,e.linkHref=!1,e.linkText=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,e.f==w){var t=n;if(!t){var i=Qa.innerMode(r,e.htmlState);t="xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText}t&&(e.f=C,e.block=b,e.htmlState=null)}return e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine={stream:null},null}function b(r,n){var o,u=r.column()===n.indentation,p=!(o=n.prevLine.stream)||!/\S/.test(o.string),g=n.indentedCode,v=n.prevLine.hr,b=!1!==n.list,w=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=!1;var x=n.indentation;if(null===n.indentationDiff&&(n.indentationDiff=n.indentation,b)){for(n.list=null;x<n.listStack[n.listStack.length-1];)n.listStack.pop(),n.listStack.length?n.indentation=n.listStack[n.listStack.length-1]:n.list=!1;!1!==n.list&&(n.indentationDiff=x-n.listStack[n.listStack.length-1])}var C=!(p||v||n.prevLine.header||b&&g||n.prevLine.fencedCodeEnd),S=(!1===n.list||v||p)&&n.indentation<=w&&r.match(a),L=null;if(n.indentationDiff>=4&&(g||n.prevLine.fencedCodeEnd||n.prevLine.header||p))return r.skipToEnd(),n.indentedCode=!0,i.code;if(r.eatSpace())return null;if(u&&n.indentation<=w&&(L=r.match(c))&&L[1].length<=6)return n.quote=0,n.header=L[1].length,n.thisLine.header=!0,t.highlightFormatting&&(n.formatting="header"),n.f=n.inline,k(n);if(n.indentation<=w&&r.eat(">"))return n.quote=u?1:n.quote+1,t.highlightFormatting&&(n.formatting="quote"),r.eatSpace(),k(n);if(!S&&!n.setext&&u&&n.indentation<=w&&(L=r.match(l))){var M=L[1]?"ol":"ul";return n.indentation=x+r.current().length,n.list=!0,n.quote=0,n.listStack.push(n.indentation),n.em=!1,n.strong=!1,n.code=!1,n.strikethrough=!1,t.taskLists&&r.match(s,!1)&&(n.taskList=!0),n.f=n.inline,t.highlightFormatting&&(n.formatting=["list","list-"+M]),k(n)}return u&&n.indentation<=w&&(L=r.match(h,!0))?(n.quote=0,n.fencedEndRE=new RegExp(L[1]+"+ *$"),n.localMode=t.fencedCodeBlockHighlighting&&function(t){if(Qa.findModeByName){var r=Qa.findModeByName(t);r&&(t=r.mime||r.mimes[0])}var n=Qa.getMode(e,t);return"null"==n.name?null:n}(L[2]),n.localMode&&(n.localState=Qa.startState(n.localMode)),n.f=n.block=y,t.highlightFormatting&&(n.formatting="code-block"),n.code=-1,k(n)):n.setext||!(C&&b||n.quote||!1!==n.list||n.code||S||f.test(r.string))&&(L=r.lookAhead(1))&&(L=L.match(d))?(n.setext?(n.header=n.setext,n.setext=0,r.skipToEnd(),t.highlightFormatting&&(n.formatting="header")):(n.header="="==L[0].charAt(0)?1:2,n.setext=n.header),n.thisLine.header=!0,n.f=n.inline,k(n)):S?(r.skipToEnd(),n.hr=!0,n.thisLine.hr=!0,i.hr):"["===r.peek()?m(r,n,T):m(r,n,n.inline)}function w(e,t){var i=r.token(e,t.htmlState);if(!n){var o=Qa.innerMode(r,t.htmlState);("xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=C,t.block=b,t.htmlState=null)}return i}function y(e,r){var n,o=r.listStack[r.listStack.length-1]||0,a=r.indentation<o,l=o+3;return r.fencedEndRE&&r.indentation<=l&&(a||e.match(r.fencedEndRE))?(t.highlightFormatting&&(r.formatting="code-block"),a||(n=k(r)),r.localMode=r.localState=null,r.block=b,r.f=C,r.fencedEndRE=null,r.code=0,r.thisLine.fencedCodeEnd=!0,a?g(e,r,r.block):n):r.localMode?r.localMode.token(e,r.localState):(e.skipToEnd(),i.code)}function k(e){var r=[];if(e.formatting){r.push(i.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var n=0;n<e.formatting.length;n++)r.push(i.formatting+"-"+e.formatting[n]),"header"===e.formatting[n]&&r.push(i.formatting+"-"+e.formatting[n]+"-"+e.header),"quote"===e.formatting[n]&&(!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?r.push(i.formatting+"-"+e.formatting[n]+"-"+e.quote):r.push("error"))}if(e.taskOpen)return r.push("meta"),r.length?r.join(" "):null;if(e.taskClosed)return r.push("property"),r.length?r.join(" "):null;if(e.linkHref?r.push(i.linkHref,"url"):(e.strong&&r.push(i.strong),e.em&&r.push(i.em),e.strikethrough&&r.push(i.strikethrough),e.emoji&&r.push(i.emoji),e.linkText&&r.push(i.linkText),e.code&&r.push(i.code),e.image&&r.push(i.image),e.imageAltText&&r.push(i.imageAltText,"link"),e.imageMarker&&r.push(i.imageMarker)),e.header&&r.push(i.header,i.header+"-"+e.header),e.quote&&(r.push(i.quote),!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=e.quote?r.push(i.quote+"-"+e.quote):r.push(i.quote+"-"+t.maxBlockquoteDepth)),!1!==e.list){var o=(e.listStack.length-1)%3;o?1===o?r.push(i.list2):r.push(i.list3):r.push(i.list1)}return e.trailingSpaceNewLine?r.push("trailing-space-new-line"):e.trailingSpace&&r.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),r.length?r.join(" "):null}function x(e,t){if(e.match(u,!0))return k(t)}function C(e,n){var o=n.text(e,n);if(void 0!==o)return o;if(n.list)return n.list=null,k(n);if(n.taskList)return" "===e.match(s,!0)[1]?n.taskOpen=!0:n.taskClosed=!0,t.highlightFormatting&&(n.formatting="task"),n.taskList=!1,k(n);if(n.taskOpen=!1,n.taskClosed=!1,n.header&&e.match(/^#+$/,!0))return t.highlightFormatting&&(n.formatting="header"),k(n);var a=e.next();if(n.linkTitle){n.linkTitle=!1;var l=a;"("===a&&(l=")");var c="^\\s*(?:[^"+(l=String(l).replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(e.match(new RegExp(c),!0))return i.linkHref}if("`"===a){var d=n.formatting;t.highlightFormatting&&(n.formatting="code"),e.eatWhile("`");var u=e.current().length;if(0!=n.code||n.quote&&1!=u){if(u==n.code){var h=k(n);return n.code=0,h}return n.formatting=d,k(n)}return n.code=u,k(n)}if(n.code)return k(n);if("\\"===a&&(e.next(),t.highlightFormatting)){var f=k(n),m=i.formatting+"-escape";return f?f+" "+m:m}if("!"===a&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return n.imageMarker=!0,n.image=!0,t.highlightFormatting&&(n.formatting="image"),k(n);if("["===a&&n.imageMarker&&e.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return n.imageMarker=!1,n.imageAltText=!0,t.highlightFormatting&&(n.formatting="image"),k(n);if("]"===a&&n.imageAltText){t.highlightFormatting&&(n.formatting="image");var f=k(n);return n.imageAltText=!1,n.image=!1,n.inline=n.f=L,f}if("["===a&&!n.image)return n.linkText&&e.match(/^.*?\]/)||(n.linkText=!0,t.highlightFormatting&&(n.formatting="link")),k(n);if("]"===a&&n.linkText){t.highlightFormatting&&(n.formatting="link");var f=k(n);return n.linkText=!1,n.inline=n.f=e.match(/\(.*?\)| ?\[.*?\]/,!1)?L:C,f}if("<"===a&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=S,t.highlightFormatting&&(n.formatting="link"),(f=k(n))?f+=" ":f="",f+i.linkInline;if("<"===a&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=S,t.highlightFormatting&&(n.formatting="link"),(f=k(n))?f+=" ":f="",f+i.linkEmail;if(t.xml&&"<"===a&&e.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var v=e.string.indexOf(">",e.pos);if(-1!=v){var b=e.string.substring(e.start,v);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(n.md_inside=!0)}return e.backUp(1),n.htmlState=Qa.startState(r),g(e,n,w)}if(t.xml&&"<"===a&&e.match(/^\/\w*?>/))return n.md_inside=!1,"tag";if("*"===a||"_"===a){for(var y=1,x=1==e.pos?" ":e.string.charAt(e.pos-2);y<3&&e.eat(a);)y++;var M=e.peek()||" ",T=!/\s/.test(M)&&(!p.test(M)||/\s/.test(x)||p.test(x)),D=!/\s/.test(x)&&(!p.test(x)||/\s/.test(M)||p.test(M)),A=null,z=null;if(y%2&&(n.em||!T||"*"!==a&&D&&!p.test(x)?n.em!=a||!D||"*"!==a&&T&&!p.test(M)||(A=!1):A=!0),y>1&&(n.strong||!T||"*"!==a&&D&&!p.test(x)?n.strong!=a||!D||"*"!==a&&T&&!p.test(M)||(z=!1):z=!0),null!=z||null!=A){t.highlightFormatting&&(n.formatting=null==A?"strong":null==z?"em":"strong em"),!0===A&&(n.em=a),!0===z&&(n.strong=a);h=k(n);return!1===A&&(n.em=!1),!1===z&&(n.strong=!1),h}}else if(" "===a&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return k(n);e.backUp(1)}if(t.strikethrough)if("~"===a&&e.eatWhile(a)){if(n.strikethrough){t.highlightFormatting&&(n.formatting="strikethrough");h=k(n);return n.strikethrough=!1,h}if(e.match(/^[^\s]/,!1))return n.strikethrough=!0,t.highlightFormatting&&(n.formatting="strikethrough"),k(n)}else if(" "===a&&e.match(/^~~/,!0)){if(" "===e.peek())return k(n);e.backUp(2)}if(t.emoji&&":"===a&&e.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){n.emoji=!0,t.highlightFormatting&&(n.formatting="emoji");var O=k(n);return n.emoji=!1,O}return" "===a&&(e.match(/^ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),k(n)}function S(e,r){if(">"===e.next()){r.f=r.inline=C,t.highlightFormatting&&(r.formatting="link");var n=k(r);return n?n+=" ":n="",n+i.linkInline}return e.match(/^[^>]+/,!0),i.linkInline}function L(e,r){if(e.eatSpace())return null;var n,i=e.next();return"("===i||"["===i?(r.f=r.inline=(n="("===i?")":"]",function(e,r){if(e.next()===n){r.f=r.inline=C,t.highlightFormatting&&(r.formatting="link-string");var i=k(r);return r.linkHref=!1,i}return e.match(M[n]),r.linkHref=!0,k(r)}),t.highlightFormatting&&(r.formatting="link-string"),r.linkHref=!0,k(r)):"error"}var M={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function T(e,r){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(r.f=D,e.next(),t.highlightFormatting&&(r.formatting="link"),r.linkText=!0,k(r)):m(e,r,C)}function D(e,r){if(e.match(/^\]:/,!0)){r.f=r.inline=A,t.highlightFormatting&&(r.formatting="link");var n=k(r);return r.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),i.linkText}function A(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=C,i.linkHref+" url")}var z={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:C,text:x,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&Qa.copyState(r,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?Qa.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkText:e.linkText,linkTitle:e.linkTitle,linkHref:e.linkHref,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,emoji:e.emoji,header:e.header,setext:e.setext,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedEndRE:e.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return v(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=w)){var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=r,t.indentationDiff=null,r>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==w?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:z}},indent:function(e,t,n){return e.block==w&&r.indent?r.indent(e.htmlState,t,n):e.localState&&e.localMode.indent?e.localMode.indent(e.localState,t,n):Qa.Pass},blankLine:v,getType:k,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return z}),"xml"),Qa.defineMIME("text/src","markdown"),Qa.defineMIME("text/x-src","markdown");const Ll={tabSize:4,styleActiveLine:!0,lineNumbers:!0,lineWrapping:!1,line:!0,mode:"text/x-src",theme:"default",cursorHeight:.8,lineWiseCopyCut:!0};var Ml=r(93379),Tl=r.n(Ml),Dl=r(74402),Al={insert:"head",singleton:!1};Tl()(Dl.Z,Al);Dl.Z.locals;const zl={strong:!0,italic:!0,overline:!0,h1:!0,h2:!0,h3:!0,h4:!1,h5:!1,h6:!1,hr:!0,quote:!0,ul:!0,ol:!0,code:!0,link:!0,image:!0,uploadImage:!1,custom_image:!1,custom_uploadImage:!1,custom_uploadFile:!1,table:!0,checked:!0,notChecked:!0,split:!0,preview:!0,fullscreen:!0,theme:!0,exportmd:!0,importmd:!0,save:!1,clear:!1};function Ol(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ol(Object(r),!0).forEach((function(t){Nl(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ol(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Nl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const El={name:"markdown",props:{value:{type:[String,Number],default:""},theme:{type:String,default:"light"},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},toolbars:{type:Object,default:function(){return{}}},bordered:{type:Boolean,default:!0},autoSave:{type:Boolean,default:!1},interval:{type:Number,default:1e4},exportFileName:{type:String,default:"unnamed"},markedOptions:{type:Object,default:function(){return{}}},copyCode:{type:Boolean,default:!0},copyBtnText:{type:String,default:"复制代码"},isPreview:{type:Boolean,default:!1},isCustomFullscreen:{type:Boolean,default:!1}},data:function(){return{currentValue:"",timeoutId:null,indexLenth:1,html:"",preview:!1,split:!0,fullscreen:!1,scrollSide:"",lastInsert:"",timerId:null,themeName:"",themeSlideDown:!1,imgSlideDown:!1,imgs:[],scrolling:!0,editorScrollHeight:0,previewImgModal:!1,previewImgSrc:"",previewImgMode:"",tocTrigger:!1,tocShow:!1,tocAction:"",tocLists:[]}},computed:{tools:function(){var e=this.toolbars,t=void 0===e?{}:e;return Fl(Fl({},zl),t)}},methods:{insertLink:function(){this.insertContent("\n[link](href)")},insertImage:function(){this.insertContent("\n")},insertTable:function(){this.insertContent("\nheader 1 | header 2\n---|---\nrow 1 col 1 | row 1 col 2\nrow 2 col 1 | row 2 col 2\n\n")},handleSave:function(){var e=this.currentValue,t=this.themeName,r=this.html;this.$emit("on-save",{theme:t,value:e,html:r})},toggleSlideDown:function(){this.slideDown=!this.slideDown},setThemes:function(e){this.themeName=e,this.themeSlideDown=!1,this.$emit("on-theme-change",e)},exportFile:function(){!function(e,t){var r=document.createElement("a");if(r.setAttribute("href","data:text/plain;charset=UTF-8,"+encodeURIComponent(e)),r.setAttribute("download",t),r.style.display="none",document.createEvent){var n=document.createEvent("MouseEvents");n.initEvent("click",!0,!0),r.dispatchEvent(n)}else r.click()}(this.currentValue,this.exportFileName+".md")},importFile:function(e){var t=this,r=e.target.files[0];if(r){var n=r.type;if(["text/markdown","text/src"].includes(n)){var i=new FileReader;i.readAsText(r,{encoding:"utf-8"}),i.onload=function(){t.currentValue=i.result,e.target.value="",t.pro&&t.editor.setOption("value",t.currentValue)},i.onerror=function(e){console.error(e)}}}},handlePaste:function(e,t){for(var r=t.clipboardData,n=void 0===r?{}:r,i=n.types,o=void 0===i?[]:i,a=n.items,l=null,s=0;s<o.length;s++)if("Files"===o[s]){l=a[s];break}if(l){var c=l.getAsFile();/image/gi.test(c.type)&&(this.$emit("on-upload-image",c),t.preventDefault())}},mousescrollSide:function(e){this.scrollSide=e},addImageClickListener:function(){var e=this,t=this.imgs,r=void 0===t?[]:t;if(r.length>0)for(var n=0,i=r.length;n<i;n++)r[n].onclick=null;setTimeout((function(){if(e.$refs.preview){e.imgs=e.$refs.preview.querySelectorAll("img");for(var t=function(t,r){e.imgs[t].onclick=function(){var r=e.imgs[t].getAttribute("src");e.previewImage(r)}},r=0,n=e.imgs.length;r<n;r++)t(r)}}),600)},previewImage:function(e){var t=this,r=new Image;r.src=e,r.onload=function(){var n=r.naturalWidth,i=r.naturalHeight;t.previewImgMode=i/n>1.4?"horizontal":"vertical",t.previewImgSrc=e,t.previewImgModal=!0}},chooseImage:function(){var e=this,t=document.createElement("input");t.type="file",t.accept="image/*",t.onchange=function(){var r=t.files;r[0]&&(e.$emit("on-upload-image",r[0]),t.value="")},t.click()},addCopyListener:function(){var e=this;setTimeout((function(){var t=document.querySelectorAll(".code-block .copy-code");e.btns=t;for(var r=function(r,n){t[r].onclick=function(){var n=t[r].parentNode.querySelectorAll("pre")[0].innerText,i=document.createElement("input");i.setAttribute("value",n),document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i),e.$emit("on-copy",n)}},n=0,i=t.length;n<i;n++)r(n)}),600)},onCustom:function(e){this.$emit("on-custom",e)}},destroyed:function(){clearInterval(this.timerId)}};var jl=r(37352),Pl=r(43705);function Il(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Il(Object(r),!0).forEach((function(t){_l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Il(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wl={name:"markdown-pro",mixins:[El],data:function(){return{pro:!0,editor:null,lastPos:""}},mounted:function(){this.init(),this.createEditor()},methods:{init:function(){var e=this;this.currentValue=this.value,this.themeName=this.theme,this.preview=this.isPreview,this.currentValue=this.value,this.isPreview||setTimeout((function(){e.autoSave&&(e.timerId=setInterval((function(){e.handleSave()}),e.interval))}),20)},createEditor:function(){var e=this;this.editor=new Qa(this.$refs.codemirror,Hl({value:this.currentValue,onload:function(t){var r=t.doc.height,n=void 0===r?0:r;e.editorScrollHeight=n}},Ll)),this.addEditorLintener(),this.$emit("on-ready",{vm:this,insertContent:this.insertContent})},addEditorLintener:function(){var e=this,t=this.editor;t.on("change",(function(r){e.lastPos=t.getCursor(),e.currentValue=t.getValue();var n=r.doc.height;e.editorScrollHeight=n})),t.on("scroll",this.markdownScroll),t.on("paste",this.handlePaste),t.on("keydown",(function(t,r){83===r.keyCode?(r.metaKey||r.ctrlKey)&&(r.preventDefault(),e.handleSave()):13===r.keyCode?e.listerenKeyupEnter(r):8===r.keyCode&&e.listerenDelete(t)})),t.on("focus",(function(){e.lastPos=t.getCursor()}))},insertContent:function(e){this.editor.replaceSelection(e),this.lastInsert=e.replace(/\n/g,"")},setCursor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=this.editor;r.setCursor(e,t),r.focus()},insertStrong:function(){var e=this.editor,t=this.lastPos,r=void 0===t?{}:t,n=r.line,i=void 0===n?0:n,o=r.ch,a=void 0===o?0:o,l=e.getSelection();l?this.insertContent("**"+l+"**"):(this.insertContent("****"),this.setCursor(i,a+2))},insertItalic:function(){var e=this.editor,t=this.lastPos,r=void 0===t?{}:t,n=r.line,i=void 0===n?0:n,o=r.ch,a=void 0===o?0:o,l=e.getSelection();l?this.insertContent("*"+l+"*"):(this.insertContent("**"),this.setCursor(i,a+1))},insertUnderline:function(){var e=this.editor,t=this.lastPos,r=void 0===t?{}:t,n=r.line,i=void 0===n?0:n,o=r.ch,a=void 0===o?0:o,l=e.getSelection();l?this.insertContent("<u>"+l+"</u>"):(this.insertContent("<u></u>"),this.setCursor(i,a+3))},insertOverline:function(){var e=this.editor,t=this.lastPos,r=void 0===t?{}:t,n=r.line,i=void 0===n?0:n,o=r.ch,a=void 0===o?0:o,l=e.getSelection();l?this.insertContent("~~"+l+"~~"):(this.insertContent("~~~~"),this.setCursor(i,a+2))},insertTitle:function(e){var t={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "},r=this.editor,n=this.lastPos,i=(void 0===n?{}:n).line,o=r.getSelection();if(o)this.insertContent("\n"+t[e]+o+"\n");else{var a=t[e];r.isClean()?(this.insertContent(a),this.setCursor(0,a.length)):(this.insertContent("\n"+a),this.setCursor(i+1,a.length))}},insertLine:function(){this.editor.isClean()?this.insertContent("----\n"):this.insertContent("\n\n----\n")},insertQuote:function(){var e=this.editor,t=this.lastPos,r=(void 0===t?{}:t).line,n=void 0===r?0:r,i=e.getSelection();i?this.insertContent("\n> "+i+"\n\n"):e.isClean()?(this.insertContent("> "),this.setCursor(0,3)):(this.insertContent("\n> "),this.setCursor(n+1,3))},insertUl:function(){var e=this.editor,t=this.lastPos,r=void 0===t?{}:t,n=r.line,i=void 0===n?0:n,o=r.ch,a=void 0===o?0:o,l=e.getSelection();l?this.insertContent("\n- "+l+"\n\n"):e.isClean()||0===a?(this.insertContent("- "),this.setCursor(i,3)):(this.insertContent("\n- "),this.setCursor(i+1,3))},insertOl:function(){var e=this.editor,t=this.lastPos,r=void 0===t?{}:t,n=r.line,i=void 0===n?0:n,o=r.ch,a=void 0===o?0:o,l=e.getSelection();l?this.insertContent("\n1. "+l+"\n\n"):e.isClean()||0===a?(this.insertContent("1. "),this.setCursor(i,4)):(this.insertContent("\n1. "),this.setCursor(i+1,4))},insertCode:function(){var e=this.editor,t=this.lastPos,r=(void 0===t?{}:t).line,n=e.getSelection();n?this.insertContent("\n```\n"+n+"\n```\n"):e.isClean()?(this.insertContent("```\n\n```"),this.setCursor(1,0)):(this.insertContent("\n```\n\n```"),this.setCursor(r+2,0))},insertFinished:function(){var e=this.editor,t=this.lastPos,r=void 0===t?{}:t,n=r.line,i=void 0===n?0:n,o=r.ch,a=void 0===o?0:o,l=e.getSelection();l?this.insertContent("\n- [x] "+l+"\n\n"):e.isClean()||0===a?(this.insertContent("- [x] "),this.setCursor(i,6)):(this.insertContent("\n- [x] "),this.setCursor(i+1,6))},insertNotFinished:function(){var e=this.editor,t=this.lastPos,r=void 0===t?{}:t,n=r.line,i=void 0===n?0:n,o=r.ch,a=void 0===o?0:o,l=e.getSelection();l?this.insertContent("\n- [ ] "+l+"\n\n"):e.isClean()||0===a?(this.insertContent("- [ ] "),this.setCursor(i,6)):(this.insertContent("\n- [ ] "),this.setCursor(i+1,6))},listerenKeyupEnter:function(e){var t=this.lastInsert;if(t){["-","- [ ]","- [x]"].includes(t.trim())?(e.preventDefault(),this.insertContent("\n"+t)):/^\d+\.$/.test(t.trim())&&(e.preventDefault(),this.insertContent("\n"+(parseInt(t,0)+1)+". "))}},listerenDelete:function(){var e=this;setTimeout((function(){var t=e.editor;t.isClean()||""===t.getValue().split("\n").pop()&&(e.lastInsert="")}),20)},onDelete:function(){var e=this.currentValue.split("\n");""===e[e.length-1]&&(this.lastInsert="")},markdownScroll:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.scrolling&&"left"===this.scrollSide){var t=e.doc,r=t.height,n=t.scrollTop,i=this.$refs.preview,o=i.offsetHeight,a=i.scrollHeight;i.scrollTop=parseInt(n*(a-o)/(r-o),0)}},previewScroll:function(){var e=this;if(this.scrolling&&"right"===this.scrollSide){var t=this.$refs.preview,r=t.offsetHeight,n=t.scrollHeight,i=t.scrollTop,o=parseInt(i*(this.editorScrollHeight-r)/(n-r),0);this.editor.scrollTo(0,o);var a,l,s=$A(this.$refs.preview);s.find("h1,h2,h3,h4,h5").each((function(t,r){if((a=$A(r)).offset().top-s.offset().top>=0&&(l=a.attr("toc-id")))return e.tocAction=l,!1}))}},redo:function(){var e=this.editor;e.redo(),setTimeout((function(){e.refresh()}),20)},tocLevel:function(e,t){var r=9999;return void 0===t&&(t=this.tocLists),t.forEach((function(e){var t=e.level;r=Math.min(r,t)})),9999===r?e:e-(r-1)},tocClick:function(e){this.tocAction=e.anchor;var t=$A(this.$refs.preview),r=t.find("h"+e.level+'[toc-id="'+this.tocAction+'"]');r&&t.animate({scrollTop:r.offset().top-t.offset().top+t.scrollTop()})}},watch:{currentValue:function(){var e=this;clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){var t=e.currentValue,r=(0,jl.Z)(t,Hl({sanitize:!1},e.markedOptions)).replace(/href="/gi,'target="_blank" href="');if(e.copyCode&&""!==r&&(r=r.replace(/<pre>/g,'<div class="code-block"><span class="copy-code">'+e.copyBtnText+"</span><pre>").replace(/<\/pre>/g,"</pre></div>")),/\[\[TOC\]\]/.test(r)){var n="";Pl.Z.tocItems.forEach((function(t){n+='<li class="toc-anchor-item" onclick="_goTocAction(this, \''.concat(t.level,"', '").concat(t.anchor,'\')"><span class="toc-link-').concat(e.tocLevel(t.level,Pl.Z.tocItems),'" title="').concat(t.text,'">').concat(t.text,"</span></li>")})),r=r.replace(/\[\[TOC\]\]/g,'<ul class="toc-anchor">'.concat(n,"</ul>"))}e.html=r,e.tocLists=Pl.Z.tocItems,e.tocTrigger||(e.tocShow=e.tocLists.length>1),Pl.Z.reset(),e.addImageClickListener(),e.addCopyListener(),e.$emit("input",t)}),30)},value:function(){var e=this.value;this.currentValue!==e&&(this.currentValue=e,this.editor.setOption("value",e))}}},$l=Wl;var Bl=r(25712),Rl={insert:"head",singleton:!1};Tl()(Bl.Z,Rl);Bl.Z.locals;var Vl=r(51900);const Ul=(0,Vl.Z)($l,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{ref:"markdown",class:"markdown "+(e.fullscreen?"fullscreen":"")+" "+(e.bordered?"border":""),style:{width:e.width+("string"==typeof e.width?"":"px"),height:e.height+("string"==typeof e.height?"":"px")}},[r("ul",{directives:[{name:"show",rawName:"v-show",value:!e.preview,expression:"!preview"}],staticClass:"markdown-toolbars"},[r("li",[e._t("title")],2),e._v(" "),e.tools.undo?r("li",{attrs:{name:e.$L("撤销")}},[r("span",{staticClass:"iconfont icon-undo",on:{click:function(t){return e.editor.undo()}}})]):e._e(),e._v(" "),e.tools.redo?r("li",{attrs:{name:e.$L("重做")},on:{click:e.redo}},[r("span",{staticClass:"iconfont icon-redo"})]):e._e(),e._v(" "),e.tools.strong?r("li",{attrs:{name:e.$L("粗体")}},[r("span",{staticClass:"iconfont icon-bold",on:{click:e.insertStrong}})]):e._e(),e._v(" "),e.tools.italic?r("li",{attrs:{name:e.$L("斜体")}},[r("span",{staticClass:"iconfont icon-italic",on:{click:e.insertItalic}})]):e._e(),e._v(" "),e.tools.overline?r("li",{attrs:{name:e.$L("删除线")}},[r("span",{staticClass:"iconfont icon-overline",on:{click:e.insertOverline}})]):e._e(),e._v(" "),e.tools.overline?r("li",{attrs:{name:e.$L("下划线")}},[r("span",{staticClass:"iconfont icon-under-line",on:{click:e.insertUnderline}})]):e._e(),e._v(" "),e.tools.h1?r("li",{attrs:{name:e.$L("标题1")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(t){return e.insertTitle(1)}}},[e._v("h1")])]):e._e(),e._v(" "),e.tools.h2?r("li",{attrs:{name:e.$L("标题2")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(t){return e.insertTitle(2)}}},[e._v("h2")])]):e._e(),e._v(" "),e.tools.h3?r("li",{attrs:{name:e.$L("标题3")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(t){return e.insertTitle(3)}}},[e._v("h3")])]):e._e(),e._v(" "),e.tools.h4?r("li",{attrs:{name:e.$L("标题4")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(t){return e.insertTitle(4)}}},[e._v("h4")])]):e._e(),e._v(" "),e.tools.h5?r("li",{attrs:{name:e.$L("标题5")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(t){return e.insertTitle(5)}}},[e._v("h5")])]):e._e(),e._v(" "),e.tools.h6?r("li",{attrs:{name:e.$L("标题6")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(t){return e.insertTitle(6)}}},[e._v("h6")])]):e._e(),e._v(" "),e.tools.hr?r("li",{attrs:{name:e.$L("分割线")}},[r("span",{staticClass:"iconfont icon-horizontal",on:{click:e.insertLine}})]):e._e(),e._v(" "),e.tools.quote?r("li",{attrs:{name:e.$L("引用")}},[r("span",{staticClass:"iconfont icon-quote",staticStyle:{"font-size":"16px"},on:{click:e.insertQuote}})]):e._e(),e._v(" "),e.tools.ul?r("li",{attrs:{name:e.$L("无序列表")}},[r("span",{staticClass:"iconfont icon-ul",on:{click:e.insertUl}})]):e._e(),e._v(" "),e.tools.ol?r("li",{attrs:{name:e.$L("有序列表")}},[r("span",{staticClass:"iconfont icon-ol",on:{click:e.insertOl}})]):e._e(),e._v(" "),e.tools.code?r("li",{attrs:{name:e.$L("代码块")}},[r("span",{staticClass:"iconfont icon-code",on:{click:e.insertCode}})]):e._e(),e._v(" "),e.tools.notChecked?r("li",{attrs:{name:e.$L("未完成列表")}},[r("span",{staticClass:"iconfont icon-checked-false",on:{click:e.insertNotFinished}})]):e._e(),e._v(" "),e.tools.checked?r("li",{attrs:{name:e.$L("已完成列表")}},[r("span",{staticClass:"iconfont icon-checked",on:{click:e.insertFinished}})]):e._e(),e._v(" "),e.tools.link?r("li",{attrs:{name:e.$L("链接")}},[r("span",{staticClass:"iconfont icon-link",on:{click:e.insertLink}})]):e._e(),e._v(" "),e.tools.image?r("li",{attrs:{name:e.$L("图片")}},[r("span",{staticClass:"iconfont icon-img",on:{click:e.insertImage}})]):e._e(),e._v(" "),e.tools.uploadImage?r("li",{attrs:{name:e.$L("本地图片")}},[r("span",{staticClass:"iconfont icon-upload-img",on:{click:e.chooseImage}})]):e._e(),e._v(" "),e.tools.custom_image?r("li",{attrs:{name:e.$L("浏览图片")}},[r("span",{staticClass:"iconfont icon-img",on:{click:function(t){return e.onCustom("image-browse")}}})]):e._e(),e._v(" "),e.tools.custom_uploadImage?r("li",{attrs:{name:e.$L("上传图片")}},[r("span",{staticClass:"iconfont icon-upload-img",on:{click:function(t){return e.onCustom("image-upload")}}})]):e._e(),e._v(" "),e.tools.custom_uploadFile?r("li",{attrs:{name:e.$L("上传文件")}},[r("span",{staticClass:"icon-svg",on:{click:function(t){return e.onCustom("file-upload")}}},[r("svg",{staticClass:"icon",attrs:{t:"1599285632421",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"45640",width:"16",height:"16"}},[r("path",{attrs:{d:"M127.519 892.879v-763.34h655.448V514.69h63.612V81.831c0-8.783-7.12-15.903-15.903-15.903H79.81c-8.783 0-15.903 7.12-15.903 15.903v858.757c0 8.783 7.12 15.903 15.903 15.903h493.993v-63.612H127.519z",fill:"#999999","p-id":"45641"}}),r("path",{attrs:{d:"M231.608 228.388h447.269V292H231.608zM231.608 384.409h447.269v63.612H231.608zM231.608 540.43h245.141v63.612H231.608zM231.608 696.451h245.141v63.612H231.608zM923.269 762.938L745.315 584.984c-3.545-3.545-8.34-5.074-12.966-4.596a15.931 15.931 0 0 0-9.848 4.616L544.586 762.918c-6.248 6.248-6.248 16.379 0 22.627l22.353 22.353c6.248 6.248 16.379 6.248 22.627 0l112.555-112.555v245.148c0 8.837 7.163 16 16 16h31.612c8.837 0 16-7.163 16-16V695.363l112.555 112.555c6.248 6.248 16.379 6.248 22.627 0l22.353-22.353c6.249-6.248 6.249-16.378 0.001-22.627z",fill:"#999999","p-id":"45642"}})])])]):e._e(),e._v(" "),e.tools.table?r("li",{attrs:{name:e.$L("表格")}},[r("span",{staticClass:"iconfont icon-table",on:{click:e.insertTable}})]):e._e(),e._v(" "),e.tools.theme?r("li",{staticClass:"shift-theme",attrs:{name:e.$L("代码块主题")}},[r("div",[r("span",{staticClass:"iconfont icon-theme",on:{click:function(t){e.themeSlideDown=!e.themeSlideDown}}}),e._v(" "),r("ul",{class:{active:e.themeSlideDown},on:{mouseleave:function(t){e.themeSlideDown=!1}}},[r("li",{on:{click:function(t){return e.setThemes("light")}}},[e._v("Light")]),e._v(" "),r("li",{on:{click:function(t){return e.setThemes("dark")}}},[e._v("VS Code")]),e._v(" "),r("li",{on:{click:function(t){return e.setThemes("oneDark")}}},[e._v("Atom OneDark")]),e._v(" "),r("li",{on:{click:function(t){return e.setThemes("gitHub")}}},[e._v("GitHub")])])])]):e._e(),e._v(" "),r("li",{directives:[{name:"show",rawName:"v-show",value:e.tools.importmd,expression:"tools.importmd"}],staticClass:"import-file",attrs:{name:e.$L("导入文件")}},[r("span",{staticClass:"iconfont icon-daoru",on:{click:e.importFile}}),e._v(" "),r("input",{attrs:{type:"file",accept:"text/markdown"},on:{change:function(t){return e.importFile(t)}}})]),e._v(" "),r("li",{directives:[{name:"show",rawName:"v-show",value:e.tools.exportmd,expression:"tools.exportmd"}],attrs:{name:e.$L("保存到本地")}},[r("span",{staticClass:"iconfont icon-download",on:{click:e.exportFile}})]),e._v(" "),e.tools.split&&e.split?r("li",{attrs:{name:e.$L("全屏编辑")}},[r("span",{staticClass:"iconfont icon-md",on:{click:function(t){e.split=!1}}})]):e._e(),e._v(" "),e.tools.split&&!e.split?r("li",{attrs:{name:e.$L("分屏显示")}},[r("span",{staticClass:"iconfont icon-group",on:{click:function(t){e.split=!0}}})]):e._e(),e._v(" "),e.tools.preview?r("li",{attrs:{name:e.$L("预览")}},[r("span",{staticClass:"iconfont icon-preview",on:{click:function(t){e.preview=!0}}})]):e._e(),e._v(" "),e.tools.clear?r("li",{attrs:{name:e.$L("清空")},on:{click:function(t){e.value=""}}},[r("span",{staticClass:"iconfont icon-clear"})]):e._e(),e._v(" "),e.tools.save?r("li",{attrs:{name:e.$L("保存")},on:{click:e.handleSave}},[r("span",{staticClass:"iconfont icon-save"})]):e._e(),e._v(" "),r("li",{attrs:{name:e.$L(e.scrolling?"同步滚动:开":"同步滚动:关")}},[r("span",{directives:[{name:"show",rawName:"v-show",value:e.scrolling,expression:"scrolling"}],staticClass:"iconfont icon-on",on:{click:function(t){e.scrolling=!e.scrolling}}}),e._v(" "),r("span",{directives:[{name:"show",rawName:"v-show",value:!e.scrolling,expression:"!scrolling"}],staticClass:"iconfont icon-off",on:{click:function(t){e.scrolling=!e.scrolling}}})]),e._v(" "),r("li",{attrs:{name:e.$L("html转markdown")},on:{click:function(t){return e.onCustom("html2md")}}},[r("span",{staticStyle:{width:"auto","font-size":"14px",padding:"0 6px"}},[e._v("HTML2MD")])]),e._v(" "),r("li",{staticClass:"empty"}),e._v(" "),r("li",{attrs:{name:e.$L("菜单")},on:{click:function(t){e.tocTrigger=!0}}},[r("span",{directives:[{name:"show",rawName:"v-show",value:e.tocShow,expression:"tocShow"}],staticClass:"icon-svg",on:{click:function(t){e.tocShow=!e.tocShow}}},[r("svg",{staticClass:"icon",attrs:{t:"1611551476626",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4615",width:"22",height:"22"}},[r("path",{attrs:{d:"M370.1 371.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7zM370.1 712.4h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.2-2.6 5.7-5.7 5.7z m333.5-7.5H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.1-2.7 5.7-5.8 5.7zM370.1 542.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7z","p-id":"4616",fill:"#1890ff"}}),r("path",{attrs:{d:"M847.1 560.4V250.1s0-24.7-14-46.4c-10.8-16.8-30-31.8-64.2-31.8h-261c-0.2 0-0.3 0-0.5 0.1H255s-78.1 0-78.1 78.1l0.1 213.4V774s0 24.7 13.9 46.3c10.8 16.8 30 31.8 64.2 31.8h261.1c0.2 0 0.3 0 0.5-0.1H769s78.1 0 78.1-78.1l-0.1-213.4 0.1-0.1z m-39 213.6c-1.3 38.5-38.9 39-38.9 39h-514c-1.3-0.1-2.5-0.2-3.8-0.3-5.4-1.1-15.7-4.1-23.9-11.7-9-9.7-11.2-22.3-11.7-26.1v-0.7l0.1-524.2c1.3-38.5 38.9-39 38.9-39h514c1.3 0.1 2.5 0.2 3.7 0.3 5.4 1.1 15.7 4.1 23.9 11.7 9 9.7 11.2 22.2 11.7 26 0 0.2 0 0.5 0.1 0.7l-0.1 524.3z","p-id":"4617",fill:"#1890ff"}})])]),e._v(" "),r("span",{directives:[{name:"show",rawName:"v-show",value:!e.tocShow,expression:"!tocShow"}],staticClass:"icon-svg",on:{click:function(t){e.tocShow=!e.tocShow}}},[r("svg",{staticClass:"icon",attrs:{t:"1611551476626",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4615",width:"22",height:"22"}},[r("path",{attrs:{d:"M370.1 371.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7zM370.1 712.4h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.2-2.6 5.7-5.7 5.7z m333.5-7.5H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.1-2.7 5.7-5.8 5.7zM370.1 542.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7z","p-id":"4616",fill:"#777777"}}),r("path",{attrs:{d:"M847.1 560.4V250.1s0-24.7-14-46.4c-10.8-16.8-30-31.8-64.2-31.8h-261c-0.2 0-0.3 0-0.5 0.1H255s-78.1 0-78.1 78.1l0.1 213.4V774s0 24.7 13.9 46.3c10.8 16.8 30 31.8 64.2 31.8h261.1c0.2 0 0.3 0 0.5-0.1H769s78.1 0 78.1-78.1l-0.1-213.4 0.1-0.1z m-39 213.6c-1.3 38.5-38.9 39-38.9 39h-514c-1.3-0.1-2.5-0.2-3.8-0.3-5.4-1.1-15.7-4.1-23.9-11.7-9-9.7-11.2-22.3-11.7-26.1v-0.7l0.1-524.2c1.3-38.5 38.9-39 38.9-39h514c1.3 0.1 2.5 0.2 3.7 0.3 5.4 1.1 15.7 4.1 23.9 11.7 9 9.7 11.2 22.2 11.7 26 0 0.2 0 0.5 0.1 0.7l-0.1 524.3z","p-id":"4617",fill:"#777777"}})])])]),e._v(" "),e.tools.fullscreen&&!e.fullscreen?r("li",{attrs:{name:e.$L("全屏")}},[r("span",{staticClass:"iconfont icon-fullscreen",on:{click:function(t){e.fullscreen=!e.fullscreen}}})]):e._e(),e._v(" "),e.tools.fullscreen&&e.fullscreen?r("li",{attrs:{name:e.$L("退出全屏")}},[r("span",{staticClass:"iconfont icon-quite",on:{click:function(t){e.fullscreen=!e.fullscreen}}})]):e._e(),e._v(" "),e.tools.custom_fullscreen&&!e.isCustomFullscreen?r("li",{attrs:{name:e.$L("全屏")}},[r("span",{staticClass:"iconfont icon-fullscreen",on:{click:function(t){return e.onCustom("fullscreen")}}})]):e._e(),e._v(" "),e.tools.custom_fullscreen&&e.isCustomFullscreen?r("li",{attrs:{name:e.$L("退出全屏")}},[r("span",{staticClass:"iconfont icon-quite",on:{click:function(t){return e.onCustom("fullscreen")}}})]):e._e()]),e._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:e.preview&&!e.isPreview,expression:"preview && !isPreview"}],staticClass:"close-preview",on:{click:function(t){e.preview=!1}}},[r("span",{staticClass:"iconfont icon-close"})]),e._v(" "),r("div",{staticClass:"markdown-content",style:{background:e.preview?"#fff":""}},[r("div",{directives:[{name:"show",rawName:"v-show",value:!e.preview,expression:"!preview"}],ref:"codemirror",staticClass:"codemirror",on:{mouseenter:function(t){return e.mousescrollSide("left")}}}),e._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:e.preview?e.preview:e.split,expression:"preview ? preview : split"}],ref:"preview",class:"markdown-preview markdown-theme-"+e.themeName,on:{scroll:e.previewScroll,mouseenter:function(t){return e.mousescrollSide("right")}}},[r("div",{ref:"previewInner",domProps:{innerHTML:e._s(e.html)}})]),e._v(" "),r("ul",{directives:[{name:"show",rawName:"v-show",value:e.tocShow,expression:"tocShow"}],staticClass:"toc-anchor"},e._l(e.tocLists,(function(t){return r("li",{key:t.anchor,staticClass:"toc-anchor-item",on:{click:function(r){return e.tocClick(t)}}},[r("span",{class:"toc-link-"+e.tocLevel(t.level)+(e.tocAction==t.anchor?" toc-link-action":""),attrs:{anchor:t.anchor,title:t.text}},[e._v(e._s(t.text))])])})),0)]),e._v(" "),r("div",{class:["preview-img",e.previewImgModal?"active":""]},[r("span",{staticClass:"close icon-close iconfont",on:{click:function(t){e.previewImgModal=!1}}}),e._v(" "),r("img",{class:[e.previewImgMode],attrs:{src:e.previewImgSrc,alt:""}})])])}),[],!1,null,"c274aad4",null).exports;var ql=r(55305),Kl=r(20629);function Gl(e){return Gl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gl(e)}function Zl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Xl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zl(Object(r),!0).forEach((function(t){Yl(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ql={name:"MDEditor",components:{ImgUpload:ql.Z,MarkdownPro:Ul},props:{value:{default:""},height:{default:380},toolbars:{type:Object,default:function(){return{strong:!0,italic:!0,overline:!0,h1:!0,h2:!0,h3:!0,h4:!1,h5:!1,h6:!1,hr:!0,quote:!0,ul:!0,ol:!0,code:!0,link:!0,image:!1,uploadImage:!1,table:!0,checked:!0,notChecked:!0,split:!0,preview:!0,fullscreen:!1,theme:!1,exportmd:!1,importmd:!1,save:!1,clear:!1,custom_image:!0,custom_uploadImage:!0,custom_uploadFile:!0,custom_fullscreen:!0}}}},data:function(){return{content:"",transfer:!1,html2md:!1,htmlValue:"",uploadIng:0,uploadFormat:["jpg","jpeg","png","gif","doc","docx","xls","xlsx","ppt","pptx","txt","esp","pdf","rar","zip","gz","ai","avi","bmp","cdr","eps","mov","mp3","mp4","pr","psd","svg","tif"],actionUrl:$A.apiUrl("system/fileupload"),maxSize:204800}},mounted:function(){this.content=this.value},activated:function(){this.content=this.value},computed:Xl(Xl({},(0,Kl.rn)(["userToken"])),{},{headers:function(){return{fd:$A.getStorageString("userWsFd"),token:this.userToken}}}),watch:{value:function(e){null==e&&(e=""),this.content=e},content:function(e){this.$emit("input",e)}},methods:{editorImage:function(e){for(var t=0;t<e.length;t++){var r=e[t];"object"===Gl(r)&&"string"==typeof r.url&&(this.transfer?this.$refs.md2.insertContent("\n"):this.$refs.md1.insertContent("\n"))}},customClick:function(e){switch(e){case"image-browse":this.$refs.myUpload.browsePicture();break;case"image-upload":this.$refs.myUpload.handleClick();break;case"file-upload":this.$refs.fileUpload.handleClick();break;case"fullscreen":this.transfer=!this.transfer;break;case"html2md":this.html2md=!0}},htmlOk:function(){var e=this;$A.loadScript("js/html2md.js",(function(t){null===t&&"function"==typeof toMarkdown?(e.transfer?e.$refs.md2.insertContent("\n"+toMarkdown(e.htmlValue,{gfm:!0})):e.$refs.md1.insertContent("\n"+toMarkdown(e.htmlValue,{gfm:!0})),e.htmlValue=""):$A.modalAlert("组件加载失败!")}))},handleUploadImageUpload:function(e){this.$refs.myUpload.handleManual(e)},handleProgress:function(){this.uploadIng++},handleSuccess:function(e,t){if(this.uploadIng--,1===e.ret){var r="[".concat(e.data.name," (").concat($A.bytesToSize(1024*e.data.size),")](").concat(e.data.url,")");this.transfer?this.$refs.md2.insertContent(r):this.$refs.md1.insertContent(r)}else $A.modalWarning({title:"上传失败",content:"文件 "+t.name+" 上传失败,"+e.msg})},handleError:function(){this.uploadIng--},handleFormatError:function(e){$A.modalWarning({title:"文件格式不正确",content:"文件 "+e.name+" 格式不正确,仅支持上传:"+this.uploadFormat.join(",")})},handleMaxSize:function(e){$A.modalWarning({title:"超出文件大小限制",content:"文件 "+e.name+" 太大,不能超过:"+$A.bytesToSize(1024*this.maxSize)+"。"})},handleBeforeUpload:function(){return!0}}},Jl=Ql;var es=r(53419),ts={insert:"head",singleton:!1};Tl()(es.Z,ts);es.Z.locals;var rs=r(10979),ns={insert:"head",singleton:!1};Tl()(rs.Z,ns);rs.Z.locals;const is=(0,Vl.Z)(Jl,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"mdeditor-wrapper"},[r("div",{staticClass:"mdeditor-box"},[r("MarkdownPro",{ref:"md1",attrs:{height:e.height,toolbars:e.toolbars,copyBtnText:e.$L("复制代码"),"is-custom-fullscreen":e.transfer},on:{"on-custom":e.customClick,"on-upload-image":e.handleUploadImageUpload},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}}),e._v(" "),r("ImgUpload",{ref:"myUpload",staticClass:"upload-control",attrs:{type:"callback",uploadIng:e.uploadIng,num:"50"},on:{"update:uploadIng":function(t){e.uploadIng=t},"update:upload-ing":function(t){e.uploadIng=t},"on-callback":e.editorImage}}),e._v(" "),r("Upload",{ref:"fileUpload",staticClass:"upload-control",attrs:{name:"files",action:e.actionUrl,headers:e.headers,multiple:"",format:e.uploadFormat,"show-upload-list":!1,"max-size":e.maxSize,"on-progress":e.handleProgress,"on-success":e.handleSuccess,"on-error":e.handleError,"on-format-error":e.handleFormatError,"on-exceeded-size":e.handleMaxSize,"before-upload":e.handleBeforeUpload}})],1),e._v(" "),e.uploadIng>0?r("Spin",{attrs:{fix:""}},[r("Icon",{staticClass:"icon-loading",attrs:{type:"ios-loading"}}),e._v(" "),r("div",[e._v(e._s(e.$L("正在上传文件...")))])],1):e._e(),e._v(" "),r("Modal",{staticClass:"mdeditor-transfer",attrs:{"footer-hide":"",fullscreen:"",transfer:"",closable:!1},model:{value:e.transfer,callback:function(t){e.transfer=t},expression:"transfer"}},[r("div",{staticClass:"mdeditor-transfer-body"},[e.transfer?r("MarkdownPro",{ref:"md2",attrs:{toolbars:e.toolbars,copyBtnText:e.$L("复制代码"),"is-custom-fullscreen":e.transfer,height:"100%"},on:{"on-custom":e.customClick,"on-upload-image":e.handleUploadImageUpload},model:{value:e.content,callback:function(t){e.content=t},expression:"content"}}):e._e()],1),e._v(" "),e.uploadIng>0?r("Spin",{attrs:{fix:""}},[r("Icon",{staticClass:"icon-loading",attrs:{type:"ios-loading"}}),e._v(" "),r("div",[e._v(e._s(e.$L("正在上传文件...")))])],1):e._e()],1),e._v(" "),r("Modal",{attrs:{title:"html转markdown",okText:"转换成markdown",width:"680","class-name":"simple-modal",transfer:""},on:{"on-ok":e.htmlOk},model:{value:e.html2md,callback:function(t){e.html2md=t},expression:"html2md"}},[r("Input",{attrs:{type:"textarea",rows:14,placeholder:"请输入html代码..."},model:{value:e.htmlValue,callback:function(t){e.htmlValue=t},expression:"htmlValue"}})],1)],1)}),[],!1,null,"44cfcde5",null).exports}}]); |