You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
312 KiB
54 lines
312 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[33,7],{"+NIl":function(Ye,Ie,k){(function(P){P(k("VrN/"))})(function(P){"use strict";P.defineMode("stex",function(re,V){"use strict";function ce(q,_){q.cmdState.push(_)}function oe(q){return q.cmdState.length>0?q.cmdState[q.cmdState.length-1]:null}function F(q){var _=q.cmdState.pop();_&&_.closeBracket()}function R(q){for(var _=q.cmdState,j=_.length-1;j>=0;j--){var L=_[j];if(L.name=="DEFAULT")continue;return L}return{styleIdentifier:function(){return null}}}function T(q,_,j){return function(){this.name=q,this.bracketNo=0,this.style=_,this.styles=j,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var w={};w.importmodule=T("importmodule","tag",["string","builtin"]),w.documentclass=T("documentclass","tag",["","atom"]),w.usepackage=T("usepackage","tag",["atom"]),w.begin=T("begin","tag",["atom"]),w.end=T("end","tag",["atom"]),w.label=T("label","tag",["atom"]),w.ref=T("ref","tag",["atom"]),w.eqref=T("eqref","tag",["atom"]),w.cite=T("cite","tag",["atom"]),w.bibitem=T("bibitem","tag",["atom"]),w.Bibitem=T("Bibitem","tag",["atom"]),w.RBibitem=T("RBibitem","tag",["atom"]),w.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function N(q,_){q.f=_}function I(q,_){var j;if(q.match(/^\\[a-zA-Z@]+/)){var L=q.current().slice(1);return j=w.hasOwnProperty(L)?w[L]:w.DEFAULT,j=new j,ce(_,j),N(_,he),j.style}if(q.match(/^\\[$&%#{}_]/))return"tag";if(q.match(/^\\[,;!\/\\]/))return"tag";if(q.match("\\["))return N(_,function(J,le){return U(J,le,"\\]")}),"keyword";if(q.match("\\("))return N(_,function(J,le){return U(J,le,"\\)")}),"keyword";if(q.match("$$"))return N(_,function(J,le){return U(J,le,"$$")}),"keyword";if(q.match("$"))return N(_,function(J,le){return U(J,le,"$")}),"keyword";var G=q.next();if(G=="%")return q.skipToEnd(),"comment";if(G=="}"||G=="]"){if(j=oe(_),j)j.closeBracket(G),N(_,he);else return"error";return"bracket"}else return G=="{"||G=="["?(j=w.DEFAULT,j=new j,ce(_,j),"bracket"):/\d/.test(G)?(q.eatWhile(/[\w.%]/),"atom"):(q.eatWhile(/[\w\-_]/),j=R(_),j.name=="begin"&&(j.argument=q.current()),j.styleIdentifier())}function U(q,_,j){if(q.eatSpace())return null;if(j&&q.match(j))return N(_,I),"keyword";if(q.match(/^\\[a-zA-Z@]+/))return"tag";if(q.match(/^[a-zA-Z]+/))return"variable-2";if(q.match(/^\\[$&%#{}_]/))return"tag";if(q.match(/^\\[,;!\/]/))return"tag";if(q.match(/^[\^_&]/))return"tag";if(q.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(q.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var L=q.next();return L=="{"||L=="}"||L=="["||L=="]"||L=="("||L==")"?"bracket":L=="%"?(q.skipToEnd(),"comment"):"error"}function he(q,_){var j=q.peek(),L;return j=="{"||j=="["?(L=oe(_),L.openBracket(j),q.eat(j),N(_,I),"bracket"):/[ \t\r]/.test(j)?(q.eat(j),null):(N(_,I),F(_),I(q,_))}return{startState:function(){var q=V.inMathMode?function(_,j){return U(_,j)}:I;return{cmdState:[],f:q}},copyState:function(q){return{cmdState:q.cmdState.slice(),f:q.f}},token:function(q,_){return _.f(q,_)},blankLine:function(q){q.f=I,q.cmdState.length=0},lineComment:"%"}}),P.defineMIME("text/x-stex","stex"),P.defineMIME("text/x-latex","stex")})},"19Vz":function(Ye,Ie,k){(function(P){P(k("VrN/"))})(function(P){P.defineOption("placeholder","",function(T,w,N){var I=N&&N!=P.Init;if(w&&!I)T.on("blur",oe),T.on("change",F),T.on("swapDoc",F),P.on(T.getInputField(),"compositionupdate",T.state.placeholderCompose=function(){ce(T)}),F(T);else if(!w&&I){T.off("blur",oe),T.off("change",F),T.off("swapDoc",F),P.off(T.getInputField(),"compositionupdate",T.state.placeholderCompose),re(T);var U=T.getWrapperElement();U.className=U.className.replace(" CodeMirror-empty","")}w&&!T.hasFocus()&&oe(T)});function re(T){T.state.placeholder&&(T.state.placeholder.parentNode.removeChild(T.state.placeholder),T.state.placeholder=null)}function V(T){re(T);var w=T.state.placeholder=document.createElement("pre");w.style.cssText="height: 0; overflow: visible",w.style.direction=T.getOption("direction"),w.className="CodeMirror-placeholder CodeMirror-line-like";var N=T.getOption("placeholder");typeof N=="string"&&(N=document.createTextNode(N)),w.appendChild(N),T.display.lineSpace.insertBefore(w,T.display.lineSpace.firstChild)}function ce(T){setTimeout(function(){var w=!1,N=T.getInputField();N.nodeName=="TEXTAREA"?w=!N.value:T.lineCount()==1&&(w=!/[^\u200b]/.test(N.querySelector(".CodeMirror-line").textContent)),w?V(T):re(T)},20)}function oe(T){R(T)&&V(T)}function F(T){var w=T.getWrapperElement(),N=R(T);w.className=w.className.replace(" CodeMirror-empty","")+(N?" CodeMirror-empty":""),N?V(T):re(T)}function R(T){return T.lineCount()===1&&T.getLine(0)===""}})},"1eCo":function(Ye,Ie,k){(function(P){P(k("VrN/"))})(function(P){"use strict";var re={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},V={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};P.defineMode("xml",function(ce,oe){var F=ce.indentUnit,R={},T=oe.htmlMode?re:V;for(var w in T)R[w]=T[w];for(var w in oe)R[w]=oe[w];var N,I;function U(y,H){function D(S){return H.tokenize=S,S(y,H)}var g=y.next();if(g=="<")return y.eat("!")?y.eat("[")?y.match("CDATA[")?D(_("atom","]]>")):null:y.match("--")?D(_("comment","-->")):y.match("DOCTYPE",!0,!0)?(y.eatWhile(/[\w\._\-]/),D(j(1))):null:y.eat("?")?(y.eatWhile(/[\w\._\-]/),H.tokenize=_("meta","?>"),"meta"):(N=y.eat("/")?"closeTag":"openTag",H.tokenize=he,"tag bracket");if(g=="&"){var B;return y.eat("#")?y.eat("x")?B=y.eatWhile(/[a-fA-F\d]/)&&y.eat(";"):B=y.eatWhile(/[\d]/)&&y.eat(";"):B=y.eatWhile(/[\w\.\-:]/)&&y.eat(";"),B?"atom":"error"}else return y.eatWhile(/[^&<]/),null}U.isInText=!0;function he(y,H){var D=y.next();if(D==">"||D=="/"&&y.eat(">"))return H.tokenize=U,N=D==">"?"endTag":"selfcloseTag","tag bracket";if(D=="=")return N="equals",null;if(D=="<"){H.tokenize=U,H.state=le,H.tagName=H.tagStart=null;var g=H.tokenize(y,H);return g?g+" tag error":"tag error"}else return/[\'\"]/.test(D)?(H.tokenize=q(D),H.stringStartCol=y.column(),H.tokenize(y,H)):(y.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function q(y){var H=function(D,g){for(;!D.eol();)if(D.next()==y){g.tokenize=he;break}return"string"};return H.isInAttribute=!0,H}function _(y,H){return function(D,g){for(;!D.eol();){if(D.match(H)){g.tokenize=U;break}D.next()}return y}}function j(y){return function(H,D){for(var g;(g=H.next())!=null;){if(g=="<")return D.tokenize=j(y+1),D.tokenize(H,D);if(g==">")if(y==1){D.tokenize=U;break}else return D.tokenize=j(y-1),D.tokenize(H,D)}return"meta"}}function L(y,H,D){this.prev=y.context,this.tagName=H,this.indent=y.indented,this.startOfLine=D,(R.doNotIndent.hasOwnProperty(H)||y.context&&y.context.noIndent)&&(this.noIndent=!0)}function G(y){y.context&&(y.context=y.context.prev)}function J(y,H){for(var D;;){if(!y.context)return;if(D=y.context.tagName,!R.contextGrabbers.hasOwnProperty(D)||!R.contextGrabbers[D].hasOwnProperty(H))return;G(y)}}function le(y,H,D){return y=="openTag"?(D.tagStart=H.column(),ke):y=="closeTag"?ye:le}function ke(y,H,D){return y=="word"?(D.tagName=H.current(),I="tag",_e):R.allowMissingTagName&&y=="endTag"?(I="tag bracket",_e(y,H,D)):(I="error",ke)}function ye(y,H,D){if(y=="word"){var g=H.current();return D.context&&D.context.tagName!=g&&R.implicitlyClosed.hasOwnProperty(D.context.tagName)&&G(D),D.context&&D.context.tagName==g||R.matchClosing===!1?(I="tag",ge):(I="tag error",Se)}else return R.allowMissingTagName&&y=="endTag"?(I="tag bracket",ge(y,H,D)):(I="error",Se)}function ge(y,H,D){return y!="endTag"?(I="error",ge):(G(D),le)}function Se(y,H,D){return I="error",ge(y,H,D)}function _e(y,H,D){if(y=="word")return I="attribute",me;if(y=="endTag"||y=="selfcloseTag"){var g=D.tagName,B=D.tagStart;return D.tagName=D.tagStart=null,y=="selfcloseTag"||R.autoSelfClosers.hasOwnProperty(g)?J(D,g):(J(D,g),D.context=new L(D,g,B==D.indented)),le}return I="error",_e}function me(y,H,D){return y=="equals"?je:(R.allowMissing||(I="error"),_e(y,H,D))}function je(y,H,D){return y=="string"?ie:y=="word"&&R.allowUnquoted?(I="string",_e):(I="error",_e(y,H,D))}function ie(y,H,D){return y=="string"?ie:_e(y,H,D)}return{startState:function(y){var H={tokenize:U,state:le,indented:y||0,tagName:null,tagStart:null,context:null};return y!=null&&(H.baseIndent=y),H},token:function(y,H){if(!H.tagName&&y.sol()&&(H.indented=y.indentation()),y.eatSpace())return null;N=null;var D=H.tokenize(y,H);return(D||N)&&D!="comment"&&(I=null,H.state=H.state(N||D,y,H),I&&(D=I=="error"?D+" error":I)),D},indent:function(y,H,D){var g=y.context;if(y.tokenize.isInAttribute)return y.tagStart==y.indented?y.stringStartCol+1:y.indented+F;if(g&&g.noIndent)return P.Pass;if(y.tokenize!=he&&y.tokenize!=U)return D?D.match(/^(\s*)/)[0].length:0;if(y.tagName)return R.multilineTagIndentPastTag!==!1?y.tagStart+y.tagName.length+2:y.tagStart+F*(R.multilineTagIndentFactor||1);if(R.alignCDATA&&/<!\[CDATA\[/.test(H))return 0;var B=H&&/^<(\/)?([\w_:\.-]*)/.exec(H);if(B&&B[1])for(;g;)if(g.tagName==B[2]){g=g.prev;break}else if(R.implicitlyClosed.hasOwnProperty(g.tagName))g=g.prev;else break;else if(B)for(;g;){var S=R.contextGrabbers[g.tagName];if(S&&S.hasOwnProperty(B[2]))g=g.prev;else break}for(;g&&g.prev&&!g.startOfLine;)g=g.prev;return g?g.indent+F:y.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:R.htmlMode?"html":"xml",helperType:R.htmlMode?"html":"xml",skipAttribute:function(y){y.state==je&&(y.state=_e)},xmlCurrentTag:function(y){return y.tagName?{name:y.tagName,close:y.type=="closeTag"}:null},xmlCurrentContext:function(y){for(var H=[],D=y.context;D;D=D.prev)D.tagName&&H.push(D.tagName);return H.reverse()}}}),P.defineMIME("text/xml","xml"),P.defineMIME("application/xml","xml"),P.mimeModes.hasOwnProperty("text/html")||P.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7ahc":function(Ye,Ie,k){"use strict";k.d(Ie,"a",function(){return ke});var P=k("k1fw"),re=k("0Owb"),V=k("+L6B"),ce=k("2/Rp"),oe=k("y8nQ"),F=k("Vl3Y"),R=k("tJVT"),T=k("OaEy"),w=k("2fM7"),N=k("q1tI"),I=k.n(N),U=k("VrN/"),he=k.n(U),q=k("p77/"),_=k.n(q),j=k("c5Ni"),L=k.n(j),G=w.a.Option,J={labelCol:{span:4},wrapperCol:{span:20}},le={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ie.b=function(ye){var ge=ye.callback,Se=ye.onCancel,_e=Object(N.useState)("python"),me=Object(R.a)(_e,2),je=me[0],ie=me[1];function y(D){ie(le[D][1])}function H(D){ge(D)}return I.a.createElement(F.a,Object(re.a)({},J,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:H}),I.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},I.a.createElement(w.a,{onChange:y},Object.keys(le).map(function(D){return I.a.createElement(G,{key:D,value:D},le[D][0])}))),I.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},I.a.createElement(ke,{mode:je})),I.a.createElement("div",{className:"flex-container flex-end"},I.a.createElement(ce.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),I.a.createElement(ce.a,{type:"ghost",onClick:Se},"\u53D6\u6D88")))};function ke(ye){var ge=ye.value,Se=ye.onChange,_e=ye.mode,me=ye.options,je=me===void 0?{}:me,ie=Object(N.useRef)(),y=Object(N.useState)(),H=Object(R.a)(y,2),D=H[0],g=H[1];return Object(N.useEffect)(function(){if(D){function B(S){var E=S.getValue();Se&&Se(E)}return D.on("change",B),function(){D.off("change",B)}}},[D,Se]),Object(N.useEffect)(function(){D&&D.setOption("mode",_e)},[D,_e]),Object(N.useEffect)(function(){D&&((ge!==D.getValue()||ge==="")&&setTimeout(function(){D.setValue(ge||" ")},300))},[D,ge]),Object(N.useEffect)(function(){if(ie.current&&!D){var B=he.a.fromTextArea(ie.current,Object(P.a)({mode:_e,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},je));g(B)}},[ie.current,D]),I.a.createElement("div",{className:"my-codemirror-container"},I.a.createElement("textarea",{ref:ie}))}},"8EBN":function(Ye,Ie,k){(function(P){P(k("VrN/"))})(function(P){"use strict";P.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var re=0;re<P.modeInfo.length;re++){var V=P.modeInfo[re];V.mimes&&(V.mime=V.mimes[0])}P.findModeByMIME=function(ce){ce=ce.toLowerCase();for(var oe=0;oe<P.modeInfo.length;oe++){var F=P.modeInfo[oe];if(F.mime==ce)return F;if(F.mimes){for(var R=0;R<F.mimes.length;R++)if(F.mimes[R]==ce)return F}}if(/\+xml$/.test(ce))return P.findModeByMIME("application/xml");if(/\+json$/.test(ce))return P.findModeByMIME("application/json")},P.findModeByExtension=function(ce){ce=ce.toLowerCase();for(var oe=0;oe<P.modeInfo.length;oe++){var F=P.modeInfo[oe];if(F.ext){for(var R=0;R<F.ext.length;R++)if(F.ext[R]==ce)return F}}},P.findModeByFileName=function(ce){for(var oe=0;oe<P.modeInfo.length;oe++){var F=P.modeInfo[oe];if(F.file&&F.file.test(ce))return F}var R=ce.lastIndexOf("."),T=R>-1&&ce.substring(R+1,ce.length);if(T)return P.findModeByExtension(T)},P.findModeByName=function(ce){ce=ce.toLowerCase();for(var oe=0;oe<P.modeInfo.length;oe++){var F=P.modeInfo[oe];if(F.name.toLowerCase()==ce)return F;if(F.alias){for(var R=0;R<F.alias.length;R++)if(F.alias[R].toLowerCase()==ce)return F}}}})},"9VGf":function(Ye,Ie,k){"use strict";k.d(Ie,"a",function(){return V});var P=k("q1tI"),re=k.n(P);function V(ce,oe){var F=Object(P.useRef)();Object(P.useEffect)(function(){F.current=ce}),Object(P.useEffect)(function(){function R(){F.current()}if(oe!==null){var T=setInterval(R,oe);return function(){return clearInterval(T)}}},[oe])}},"9ivq":function(Ye,Ie,k){},Bd2K:function(Ye,Ie,k){(function(P){P(k("VrN/"),k("osHv"))})(function(P){P.defineOption("autoCloseTags",!1,function(w,N,I){if(I!=P.Init&&I&&w.removeKeyMap("autoCloseTags"),!N)return;var U={name:"autoCloseTags"};(typeof N!="object"||N.whenClosing!==!1)&&(U["'/'"]=function(he){return F(he)}),(typeof N!="object"||N.whenOpening!==!1)&&(U["'>'"]=function(he){return ce(he)}),w.addKeyMap(U)});var re=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],V=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function ce(w){if(w.getOption("disableInput"))return P.Pass;for(var N=w.listSelections(),I=[],U=w.getOption("autoCloseTags"),he=0;he<N.length;he++){if(!N[he].empty())return P.Pass;var q=N[he].head,_=w.getTokenAt(q),j=P.innerMode(w.getMode(),_.state),L=j.state,G=j.mode.xmlCurrentTag&&j.mode.xmlCurrentTag(L),J=G&&G.name;if(!J)return P.Pass;var le=j.mode.configuration=="html",ke=typeof U=="object"&&U.dontCloseTags||le&&re,ye=typeof U=="object"&&U.indentTags||le&&V;_.end>q.ch&&(J=J.slice(0,J.length-_.end+q.ch));var ge=J.toLowerCase();if(!J||_.type=="string"&&(_.end!=q.ch||!/[\"\']/.test(_.string.charAt(_.string.length-1))||_.string.length==1)||_.type=="tag"&&G.close||_.string.indexOf("/")==q.ch-_.start-1||ke&&R(ke,ge)>-1||T(w,j.mode.xmlCurrentContext&&j.mode.xmlCurrentContext(L)||[],J,q,!0))return P.Pass;var Se=typeof U=="object"&&U.emptyTags;if(Se&&R(Se,J)>-1){I[he]={text:"/>",newPos:P.Pos(q.line,q.ch+2)};continue}var _e=ye&&R(ye,ge)>-1;I[he]={indent:_e,text:">"+(_e?`
|
|
|
|
`:"")+"</"+J+">",newPos:_e?P.Pos(q.line+1,0):P.Pos(q.line,q.ch+1)}}for(var me=typeof U=="object"&&U.dontIndentOnAutoClose,he=N.length-1;he>=0;he--){var je=I[he];w.replaceRange(je.text,N[he].head,N[he].anchor,"+insert");var ie=w.listSelections().slice(0);ie[he]={head:je.newPos,anchor:je.newPos},w.setSelections(ie),!me&&je.indent&&(w.indentLine(je.newPos.line,null,!0),w.indentLine(je.newPos.line+1,null,!0))}}function oe(w,N){for(var I=w.listSelections(),U=[],he=N?"/":"</",q=w.getOption("autoCloseTags"),_=typeof q=="object"&&q.dontIndentOnSlash,j=0;j<I.length;j++){if(!I[j].empty())return P.Pass;var L=I[j].head,G=w.getTokenAt(L),J=P.innerMode(w.getMode(),G.state),le=J.state;if(N&&(G.type=="string"||G.string.charAt(0)!="<"||G.start!=L.ch-1))return P.Pass;var ke,ye=J.mode.name!="xml"&&w.getMode().name=="htmlmixed";if(ye&&J.mode.name=="javascript")ke=he+"script";else if(ye&&J.mode.name=="css")ke=he+"style";else{var ge=J.mode.xmlCurrentContext&&J.mode.xmlCurrentContext(le);if(!ge||ge.length&&T(w,ge,ge[ge.length-1],L))return P.Pass;ke=he+ge[ge.length-1]}w.getLine(L.line).charAt(G.end)!=">"&&(ke+=">"),U[j]=ke}if(w.replaceSelections(U),I=w.listSelections(),!_)for(var j=0;j<I.length;j++)(j==I.length-1||I[j].head.line<I[j+1].head.line)&&w.indentLine(I[j].head.line)}function F(w){return w.getOption("disableInput")?P.Pass:oe(w,!0)}P.commands.closeTag=function(w){return oe(w)};function R(w,N){if(w.indexOf)return w.indexOf(N);for(var I=0,U=w.length;I<U;++I)if(w[I]==N)return I;return-1}function T(w,N,I,U,he){if(!P.scanForClosingTag)return!1;var q=Math.min(w.lastLine()+1,U.line+500),_=P.scanForClosingTag(w,U,null,q);if(!_||_.tag!=I)return!1;for(var j=he?1:0,L=N.length-1;L>=0&&N[L]==I;L--)++j;U=_.to;for(var L=1;L<j;L++){var G=P.scanForClosingTag(w,U,null,q);if(!G||G.tag!=I)return!1;U=G.to}return!0}})},BjJ7:function(Ye,Ie,k){"use strict";k.d(Ie,"d",function(){return re}),k.d(Ie,"c",function(){return V}),k.d(Ie,"e",function(){return ce}),k.d(Ie,"b",function(){return oe}),k.d(Ie,"a",function(){return R});var P=k("m3rI");function re(T){var w=!0;if(T.length>0){for(var N=0;N<T.length;N++)if(T[N].compile_success==0||!T[N].compile_success){w=!1;break}}else w=!1;return w}function V(T){for(var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",N=[],I=0;I<T.length;I++){var U=T[I],he=w?"".concat(w,"/").concat(U.name):"".concat(U.name);N.push({title:U.name,isLeaf:!(U.type==="tree"),key:he})}return N}function ce(T,w,N){for(var I=0;I<T.length;I++){var U=T[I];if(U.key===w){U.children=N;break}U.children&&ce(U.children,w,N)}return T}function oe(T,w,N){var I;return function(){var U=this,he=arguments,q=function(){I=null,N||T.apply(U,he)},_=N&&!I;clearTimeout(I),I=setTimeout(q,w),_&&T.apply(U,he)}}var F=!0,R=P.a.API_SERVER},"C+DQ":function(Ye,Ie,k){},ELLl:function(Ye,Ie,k){(function(P){P(k("VrN/"))})(function(P){var re={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},V=P.Pos;P.defineOption("autoCloseBrackets",!1,function(_,j,L){L&&L!=P.Init&&(_.removeKeyMap(oe),_.state.closeBrackets=null),j&&(F(ce(j,"pairs")),_.state.closeBrackets=j,_.addKeyMap(oe))});function ce(_,j){return j=="pairs"&&typeof _=="string"?_:typeof _=="object"&&_[j]!=null?_[j]:re[j]}var oe={Backspace:w,Enter:N};function F(_){for(var j=0;j<_.length;j++){var L=_.charAt(j),G="'"+L+"'";oe[G]||(oe[G]=R(L))}}F(re.pairs+"`");function R(_){return function(j){return U(j,_)}}function T(_){var j=_.state.closeBrackets;if(!j||j.override)return j;var L=_.getModeAt(_.getCursor());return L.closeBrackets||j}function w(_){var j=T(_);if(!j||_.getOption("disableInput"))return P.Pass;for(var L=ce(j,"pairs"),G=_.listSelections(),J=0;J<G.length;J++){if(!G[J].empty())return P.Pass;var le=he(_,G[J].head);if(!le||L.indexOf(le)%2!=0)return P.Pass}for(var J=G.length-1;J>=0;J--){var ke=G[J].head;_.replaceRange("",V(ke.line,ke.ch-1),V(ke.line,ke.ch+1),"+delete")}}function N(_){var j=T(_),L=j&&ce(j,"explode");if(!L||_.getOption("disableInput"))return P.Pass;for(var G=_.listSelections(),J=0;J<G.length;J++){if(!G[J].empty())return P.Pass;var le=he(_,G[J].head);if(!le||L.indexOf(le)%2!=0)return P.Pass}_.operation(function(){var ke=_.lineSeparator()||`
|
|
`;_.replaceSelection(ke+ke,null),_.execCommand("goCharLeft"),G=_.listSelections();for(var ye=0;ye<G.length;ye++){var ge=G[ye].head.line;_.indentLine(ge,null,!0),_.indentLine(ge+1,null,!0)}})}function I(_){var j=P.cmpPos(_.anchor,_.head)>0;return{anchor:new V(_.anchor.line,_.anchor.ch+(j?-1:1)),head:new V(_.head.line,_.head.ch+(j?1:-1))}}function U(_,j){var L=T(_);if(!L||_.getOption("disableInput"))return P.Pass;var G=ce(L,"pairs"),J=G.indexOf(j);if(J==-1)return P.Pass;for(var le=ce(L,"closeBefore"),ke=ce(L,"triples"),ye=G.charAt(J+1)==j,ge=_.listSelections(),Se=J%2==0,_e,me=0;me<ge.length;me++){var je=ge[me],ie=je.head,y,H=_.getRange(ie,V(ie.line,ie.ch+1));if(Se&&!je.empty())y="surround";else if((ye||!Se)&&H==j)ye&&q(_,ie)?y="both":ke.indexOf(j)>=0&&_.getRange(ie,V(ie.line,ie.ch+3))==j+j+j?y="skipThree":y="skip";else if(ye&&ie.ch>1&&ke.indexOf(j)>=0&&_.getRange(V(ie.line,ie.ch-2),ie)==j+j){if(ie.ch>2&&/\bstring/.test(_.getTokenTypeAt(V(ie.line,ie.ch-2))))return P.Pass;y="addFour"}else if(ye){var D=ie.ch==0?" ":_.getRange(V(ie.line,ie.ch-1),ie);if(!P.isWordChar(H)&&D!=j&&!P.isWordChar(D))y="both";else return P.Pass}else if(Se&&(H.length===0||/\s/.test(H)||le.indexOf(H)>-1))y="both";else return P.Pass;if(!_e)_e=y;else if(_e!=y)return P.Pass}var g=J%2?G.charAt(J-1):j,B=J%2?j:G.charAt(J+1);_.operation(function(){if(_e=="skip")_.execCommand("goCharRight");else if(_e=="skipThree")for(var S=0;S<3;S++)_.execCommand("goCharRight");else if(_e=="surround"){for(var E=_.getSelections(),S=0;S<E.length;S++)E[S]=g+E[S]+B;_.replaceSelections(E,"around"),E=_.listSelections().slice();for(var S=0;S<E.length;S++)E[S]=I(E[S]);_.setSelections(E)}else _e=="both"?(_.replaceSelection(g+B,null),_.triggerElectric(g+B),_.execCommand("goCharLeft")):_e=="addFour"&&(_.replaceSelection(g+g+g+g,"before"),_.execCommand("goCharRight"))})}function he(_,j){var L=_.getRange(V(j.line,j.ch-1),V(j.line,j.ch+1));return L.length==2?L:null}function q(_,j){var L=_.getTokenAt(V(j.line,j.ch+1));return/\bstring/.test(L.type)&&L.start==j.ch&&(j.ch==0||!/\bstring/.test(_.getTokenTypeAt(j)))}})},GfqC:function(Ye,Ie,k){"use strict";var P=k("q1tI"),re=k.n(P),V=k("TSYQ"),ce=k.n(V);function oe(x,c){var l="cannot "+x.method+" "+x.action+" "+c.status+"'",h=new Error(l);return h.status=c.status,h.method=x.method,h.url=x.action,h}function F(x){var c=x.responseText||x.response;if(!c)return c;try{return JSON.parse(c)}catch(l){return c}}function R(x){var c=new XMLHttpRequest;x.onProgress&&c.upload&&(c.upload.onprogress=function(A){A.total>0&&(A.percent=A.loaded/A.total*100),x.onProgress(A)});var l=new FormData;x.data&&Object.keys(x.data).forEach(function(C){var A=x.data[C];if(Array.isArray(A)){A.forEach(function(Z){l.append(C+"[]",Z)});return}l.append(C,x.data[C])}),x.file instanceof Blob?l.append(x.filename,x.file,x.file.name):l.append(x.filename,x.file),c.onerror=function(A){x.onError(A)},c.onload=function(){return c.status<200||c.status>=300?x.onError(oe(x,c),F(c)):x.onSuccess(F(c),c)},c.open(x.method,x.action,!0),x.withCredentials&&"withCredentials"in c&&(c.withCredentials=!0);var h=x.headers||{};return h["X-Requested-With"]!==null&&c.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(h).forEach(function(C){h[C]!==null&&c.setRequestHeader(C,h[C])}),c.send(l),{abort:function(){c.abort()}}}var T=+new Date,w=0;function N(){return"rc-upload-"+T+"-"+ ++w}function I(x,c){return x.indexOf(c,x.length-c.length)!==-1}var U=function(x,c){if(x&&c){var l=Array.isArray(c)?c:c.split(","),h=x.name||"",C=x.type||"",A=C.replace(/\/.*$/,"");return l.some(function(Z){var de=Z.trim();return de.charAt(0)==="."?I(h.toLowerCase(),de.toLowerCase()):/\/\*$/.test(de)?A===de.replace(/\/.*$/,""):C===de})}return!0};function he(x,c){var l=x.createReader(),h=[];function C(){l.readEntries(function(A){var Z=Array.prototype.slice.apply(A);h=h.concat(Z);var de=!Z.length;de?c(h):C()})}C()}var q=function(c,l,h){var C=function A(Z,de){de=de||"",Z.isFile?Z.file(function(X){h(X)&&(Z.fullPath&&!X.webkitRelativePath&&(Object.defineProperties(X,{webkitRelativePath:{writable:!0}}),X.webkitRelativePath=Z.fullPath.replace(/^\//,""),Object.defineProperties(X,{webkitRelativePath:{writable:!1}})),l([X]))}):Z.isDirectory&&he(Z,function(X){X.forEach(function(ne){A(ne,""+de+Z.name+"/")})})};c.forEach(function(A){C(A.webkitGetAsEntry())})},_=q,j=Object.assign||function(x){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(x[h]=l[h])}return x},L=function(){function x(c,l){var h=[],C=!0,A=!1,Z=void 0;try{for(var de=c[Symbol.iterator](),X;!(C=(X=de.next()).done)&&!(h.push(X.value),l&&h.length===l);C=!0);}catch(ne){A=!0,Z=ne}finally{try{!C&&de.return&&de.return()}finally{if(A)throw Z}}return h}return function(c,l){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return x(c,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),G=function(){function x(c,l){for(var h=0;h<l.length;h++){var C=l[h];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(c,C.key,C)}}return function(c,l,h){return l&&x(c.prototype,l),h&&x(c,h),c}}();function J(x,c,l){return c in x?Object.defineProperty(x,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):x[c]=l,x}function le(x,c){var l={};for(var h in x){if(c.indexOf(h)>=0)continue;if(!Object.prototype.hasOwnProperty.call(x,h))continue;l[h]=x[h]}return l}function ke(x,c){if(!(x instanceof c))throw new TypeError("Cannot call a class as a function")}function ye(x,c){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:x}function ge(x,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);x.prototype=Object.create(c&&c.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(x,c):x.__proto__=c)}var Se=function(c){return Object.keys(c).reduce(function(l,h){return(h.substr(0,5)==="data-"||h.substr(0,5)==="aria-"||h==="role")&&(l[h]=c[h]),l},{})},_e=function(x){ge(c,x);function c(){var l,h,C,A;ke(this,c);for(var Z=arguments.length,de=Array(Z),X=0;X<Z;X++)de[X]=arguments[X];return A=(h=(C=ye(this,(l=c.__proto__||Object.getPrototypeOf(c)).call.apply(l,[this].concat(de))),C),C.state={uid:N()},C.reqs={},C.onChange=function(ne){var te=ne.target.files;C.uploadFiles(te),C.reset()},C.onClick=function(ne){var te=C.fileInput;if(!te)return;var z=C.props,Y=z.children,xe=z.onClick;Y&&Y.type==="button"&&(te.parentNode.focus(),te.parentNode.querySelector("button").blur()),te.click(),xe&&xe(ne)},C.onKeyDown=function(ne){ne.key==="Enter"&&C.onClick()},C.onFileDrop=function(ne){var te=C.props.multiple;if(ne.preventDefault(),ne.type==="dragover")return;if(C.props.directory)_(Array.prototype.slice.call(ne.dataTransfer.items),C.uploadFiles,function(Y){return U(Y,C.props.accept)});else{var z=Array.prototype.slice.call(ne.dataTransfer.files).filter(function(Y){return U(Y,C.props.accept)});te===!1&&(z=z.slice(0,1)),C.uploadFiles(z)}},C.uploadFiles=function(ne){var te=Array.prototype.slice.call(ne);te.map(function(z){return z.uid=N(),z}).forEach(function(z){C.upload(z,te)})},C.saveFileInput=function(ne){C.fileInput=ne},h),ye(C,A)}return G(c,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(h,C){var A=this,Z=this.props;if(!Z.beforeUpload)return setTimeout(function(){return A.post(h)},0);var de=Z.beforeUpload(h,C);de&&de.then?de.then(function(X){var ne=Object.prototype.toString.call(X);return ne==="[object File]"||ne==="[object Blob]"?A.post(X):A.post(h)}).catch(function(X){console.log(X)}):de!==!1&&setTimeout(function(){return A.post(h)},0);return}},{key:"post",value:function(h){var C=this;if(!this._isMounted)return;var A=this.props,Z=A.onStart,de=A.onProgress,X=A.transformFile,ne=X===void 0?function(te){return te}:X;new Promise(function(te){var z=A.action;return typeof z=="function"&&(z=z(h)),te(z)}).then(function(te){var z=h.uid,Y=A.customRequest||R,xe=Promise.resolve(ne(h)).then(function(f){var b=A.data;return typeof b=="function"&&(b=b(f)),Promise.all([f,b])}).catch(function(f){console.error(f)});xe.then(function(f){var b=L(f,2),p=b[0],W=b[1],Q={action:te,filename:A.name,data:W,file:p,headers:A.headers,withCredentials:A.withCredentials,method:A.method||"post",onProgress:de?function($){de($,h)}:null,onSuccess:function(pe,Ee){delete C.reqs[z],A.onSuccess(pe,h,Ee)},onError:function(pe,Ee){delete C.reqs[z],A.onError(pe,Ee,h)}};Z(h),C.reqs[z]=Y(Q)})})}},{key:"reset",value:function(){this.setState({uid:N()})}},{key:"abort",value:function(h){var C=this.reqs;if(h){var A=h;h&&h.uid&&(A=h.uid),C[A]&&C[A].abort&&C[A].abort(),delete C[A]}else Object.keys(C).forEach(function(Z){C[Z]&&C[Z].abort&&C[Z].abort(),delete C[Z]})}},{key:"render",value:function(){var h,C=this.props,A=C.component,Z=C.prefixCls,de=C.className,X=C.disabled,ne=C.id,te=C.style,z=C.multiple,Y=C.accept,xe=C.children,f=C.directory,b=C.openFileDialogOnClick,p=C.onMouseEnter,W=C.onMouseLeave,Q=le(C,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),$=ce()((h={},J(h,Z,!0),J(h,Z+"-disabled",X),J(h,de,de),h)),pe=X?{}:{onClick:b?this.onClick:function(){},onKeyDown:b?this.onKeyDown:function(){},onMouseEnter:p,onMouseLeave:W,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return re.a.createElement(A,j({},pe,{className:$,role:"button",style:te}),re.a.createElement("input",j({},Se(Q),{id:ne,type:"file",ref:this.saveFileInput,onClick:function(Ue){return Ue.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Y,directory:f?"directory":null,webkitdirectory:f?"webkitdirectory":null,multiple:z,onChange:this.onChange})),xe)}}]),c}(P.Component),me=_e,je=Object.assign||function(x){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var h in l)Object.prototype.hasOwnProperty.call(l,h)&&(x[h]=l[h])}return x},ie=function(){function x(c,l){for(var h=0;h<l.length;h++){var C=l[h];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(c,C.key,C)}}return function(c,l,h){return l&&x(c.prototype,l),h&&x(c,h),c}}();function y(x,c){if(!(x instanceof c))throw new TypeError("Cannot call a class as a function")}function H(x,c){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:x}function D(x,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);x.prototype=Object.create(c&&c.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(x,c):x.__proto__=c)}function g(){}var B=function(x){D(c,x);function c(){var l,h,C,A;y(this,c);for(var Z=arguments.length,de=Array(Z),X=0;X<Z;X++)de[X]=arguments[X];return A=(h=(C=H(this,(l=c.__proto__||Object.getPrototypeOf(c)).call.apply(l,[this].concat(de))),C),C.saveUploader=function(ne){C.uploader=ne},h),H(C,A)}return ie(c,[{key:"abort",value:function(h){this.uploader.abort(h)}},{key:"render",value:function(){return re.a.createElement(me,je({},this.props,{ref:this.saveUploader}))}}]),c}(P.Component);B.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:g,onError:g,onSuccess:g,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var S=B,E=Ie.a=S},Gytx:function(Ye,Ie){Ye.exports=function(P,re,V,ce){var oe=V?V.call(ce,P,re):void 0;if(oe!==void 0)return!!oe;if(P===re)return!0;if(typeof P!="object"||!P||typeof re!="object"||!re)return!1;var F=Object.keys(P),R=Object.keys(re);if(F.length!==R.length)return!1;for(var T=Object.prototype.hasOwnProperty.bind(re),w=0;w<F.length;w++){var N=F[w];if(!T(N))return!1;var I=P[N],U=re[N];if(oe=V?V.call(ce,I,U,N):void 0,oe===!1||oe===void 0&&I!==U)return!1}return!0}},HmJG:function(Ye,Ie,k){},LdHM:function(Ye,Ie,k){"use strict";k.d(Ie,"b",function(){return le}),k.d(Ie,"a",function(){return ye});var P=k("1OyB"),re=k("vuIU"),V=k("Ji7U"),ce=k("LK+K"),oe=k("q1tI"),F=k("rePB"),R=k("Ff2n"),T=k("ODXe"),w=k("4IlW"),N=k("bX4T"),I=k("YrtM"),U=k("TSYQ"),he=k.n(U),q=k("+nKL"),_=k("8OUc"),j=function(h,C){var A=h.prefixCls,Z=h.id,de=h.flattenOptions,X=h.childrenAsData,ne=h.values,te=h.searchValue,z=h.multiple,Y=h.defaultActiveFirstOption,xe=h.height,f=h.itemHeight,b=h.notFoundContent,p=h.open,W=h.menuItemSelectedIcon,Q=h.virtual,$=h.onSelect,pe=h.onToggleOpen,Ee=h.onActiveValue,Ue=h.onScroll,Re=h.onMouseEnter,Fe="".concat(A,"-item"),We=Object(I.a)(function(){return de},[p,de],function(Be,se){return se[0]&&Be[1]!==se[1]}),et=oe.useRef(null),ot=function(se){se.preventDefault()},yt=function(se){et.current&&et.current.scrollTo({index:se})},ht=function(se){for(var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ne=We.length,Ae=0;Ae<Ne;Ae+=1){var Xe=(se+Ae*Te+Ne)%Ne,tt=We[Xe],Je=tt.group,pt=tt.data;if(!Je&&!pt.disabled)return Xe}return-1},kt=oe.useState(function(){return ht(0)}),gt=Object(T.a)(kt,2),At=gt[0],Le=gt[1],Lt=function(se){Le(se);var Te=We[se];if(!Te){Ee(null,-1);return}Ee(Te.data.value,se)};oe.useEffect(function(){Lt(Y!==!1?ht(0):-1)},[We.length,te]),oe.useEffect(function(){var Be=setTimeout(function(){if(!z&&p&&ne.size===1){var se=Array.from(ne)[0],Te=We.findIndex(function(Ne){var Ae=Ne.data;return Ae.value===se});Lt(Te),yt(Te)}});return function(){return clearTimeout(Be)}},[p]);var vt=function(se){se!==void 0&&$(se,{selected:!ne.has(se)}),z||pe(!1)};if(oe.useImperativeHandle(C,function(){return{onKeyDown:function(se){var Te=se.which;switch(Te){case w.a.UP:case w.a.DOWN:{var Ne=0;if(Te===w.a.UP?Ne=-1:Te===w.a.DOWN&&(Ne=1),Ne!==0){var Ae=ht(At+Ne,Ne);yt(Ae),Lt(Ae)}break}case w.a.ENTER:{var Xe=We[At];Xe&&!Xe.data.disabled?vt(Xe.data.value):vt(void 0),p&&se.preventDefault();break}case w.a.ESC:pe(!1)}},onKeyUp:function(){},scrollTo:function(se){yt(se)}}}),We.length===0)return oe.createElement("div",{role:"listbox",id:"".concat(Z,"_list"),className:"".concat(Fe,"-empty"),onMouseDown:ot},b);function Qe(Be){var se=We[Be];if(!se)return null;var Te=se.data||{},Ne=Te.value,Ae=Te.label,Xe=Te.children,tt=Object(N.a)(Te,!0),Je=X?Xe:Ae;return se?oe.createElement("div",Object.assign({"aria-label":typeof Je=="string"?Je:null},tt,{key:Be,role:"option",id:"".concat(Z,"_list_").concat(Be),"aria-selected":ne.has(Ne)}),Ne):null}return oe.createElement(oe.Fragment,null,oe.createElement("div",{role:"listbox",id:"".concat(Z,"_list"),style:{height:0,width:0,overflow:"hidden"}},Qe(At-1),Qe(At),Qe(At+1)),oe.createElement(q.a,{itemKey:"key",ref:et,data:We,height:xe,itemHeight:f,fullHeight:!1,onMouseDown:ot,onScroll:Ue,virtual:Q,onMouseEnter:Re},function(Be,se){var Te,Ne=Be.group,Ae=Be.groupOption,Xe=Be.data,tt=Xe.label,Je=Xe.key;if(Ne)return oe.createElement("div",{className:he()(Fe,"".concat(Fe,"-group"))},tt!==void 0?tt:Je);var pt=Xe.disabled,Tt=Xe.value,zt=Xe.title,st=Xe.children,Nt=Xe.style,qe=Xe.className,un=Object(R.a)(Xe,["disabled","value","title","children","style","className"]),Ft=ne.has(Tt),It="".concat(Fe,"-option"),cn=he()(Fe,It,qe,(Te={},Object(F.a)(Te,"".concat(It,"-grouped"),Ae),Object(F.a)(Te,"".concat(It,"-active"),At===se&&!pt),Object(F.a)(Te,"".concat(It,"-disabled"),pt),Object(F.a)(Te,"".concat(It,"-selected"),Ft),Te)),dn=X?st:tt,Et=!W||typeof W=="function"||Ft;return oe.createElement("div",Object.assign({},un,{"aria-selected":Ft,className:cn,title:zt,onMouseMove:function(){if(At===se||pt)return;Lt(se)},onClick:function(){pt||vt(Tt)},style:Nt}),oe.createElement("div",{className:"".concat(It,"-content")},dn||Tt),oe.isValidElement(W)||Ft,Et&&oe.createElement(_.a,{className:"".concat(Fe,"-option-state"),customizeIcon:W,customizeIconProps:{isSelected:Ft}},Ft?"\u2713":null))}))},L=oe.forwardRef(j);L.displayName="OptionList";var G=L,J=function(){return null};J.isSelectOption=!0;var le=J,ke=function(){return null};ke.isSelectOptGroup=!0;var ye=ke,ge=k("VTBJ"),Se=k("Zm9Q");function _e(l){var h=l.key,C=l.props,A=C.children,Z=C.value,de=Object(R.a)(C,["children","value"]);return Object(ge.a)({key:h,value:Z!==void 0?Z:h,children:A},de)}function me(l){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Se.a)(l).map(function(C,A){if(!oe.isValidElement(C)||!C.type)return null;var Z=C.type.isSelectOptGroup,de=C.key,X=C.props,ne=X.children,te=Object(R.a)(X,["children"]);return h||!Z?_e(C):Object(ge.a)(Object(ge.a)({key:"__RC_SELECT_GRP__".concat(de===null?A:de,"__"),label:de},te),{},{options:me(ne)})}).filter(function(C){return C})}var je=k("2Qr1"),ie=k("qNPg"),y=k("U8pU"),H=k("Kwbf"),D=k("WKfj");function g(l){var h=l.mode,C=l.options,A=l.children,Z=l.backfill,de=l.allowClear,X=l.placeholder,ne=l.getInputElement,te=l.showSearch,z=l.onSearch,Y=l.defaultOpen,xe=l.autoFocus,f=l.labelInValue,b=l.value,p=l.inputValue,W=l.optionLabelProp,Q=h==="multiple"||h==="tags",$=te!==void 0?te:Q||h==="combobox",pe=C||me(A);if(Object(H.a)(h!=="tags"||pe.every(function(Fe){return!Fe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),h==="tags"||h==="combobox"){var Ee=pe.some(function(Fe){return Fe.options?Fe.options.some(function(We){return typeof("value"in We?We.value:We.key)=="number"}):typeof("value"in Fe?Fe.value:Fe.key)=="number"});Object(H.a)(!Ee,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(H.a)(h!=="combobox"||!W,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(H.a)(h==="combobox"||!Z,"`backfill` only works with `combobox` mode."),Object(H.a)(h==="combobox"||!ne,"`getInputElement` only work with `combobox` mode."),Object(H.b)(h!=="combobox"||!ne||!de||!X,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),z&&!$&&h!=="combobox"&&h!=="tags"&&Object(H.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(H.b)(!Y||xe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),b!=null){var Ue=Object(D.d)(b);Object(H.a)(!f||Ue.every(function(Fe){return Object(y.a)(Fe)==="object"&&("key"in Fe||"value"in Fe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(H.a)(!Q||Array.isArray(b),"`value` should be array when `mode` is `multiple` or `tags`")}if(A){var Re=null;Object(Se.a)(A).some(function(Fe){if(!oe.isValidElement(Fe)||!Fe.type)return!1;var We=Fe.type;if(We.isSelectOption)return!1;if(We.isSelectOptGroup){var et=Object(Se.a)(Fe.props.children).every(function(ot){return!oe.isValidElement(ot)||!Fe.type||ot.type.isSelectOption?!0:(Re=ot.type,!1)});return!et}return Re=We,!0}),Re&&Object(H.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Re.displayName||Re.name||Re,"`.")),Object(H.a)(p===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=g,S=Object(ie.a)({prefixCls:"rc-select",components:{optionList:G},convertChildrenToData:me,flattenOptions:je.d,getLabeledValue:je.e,filterOptions:je.b,isValueDisabled:je.g,findValueOption:je.c,warningProps:B,fillOptionsWithMissingValue:je.a}),E=function(l){Object(V.a)(C,l);var h=Object(ce.a)(C);function C(){var A;return Object(P.a)(this,C),A=h.apply(this,arguments),A.selectRef=oe.createRef(),A.focus=function(){A.selectRef.current.focus()},A.blur=function(){A.selectRef.current.blur()},A}return Object(re.a)(C,[{key:"render",value:function(){return oe.createElement(S,Object.assign({ref:this.selectRef},this.props))}}]),C}(oe.Component);E.Option=le,E.OptGroup=ye;var x=E,c=Ie.c=x},M8RZ:function(Ye,Ie,k){"use strict";k.d(Ie,"a",function(){return w});var P=k("fWQN"),re=k("mtLc"),V=k("yKVA"),ce=k("879j"),oe=k("q1tI"),F=k.n(oe),R=k("i8i4"),T=k.n(R),w=function(N){Object(V.a)(U,N);var I=Object(ce.a)(U);function U(he){var q;Object(P.a)(this,U),q=I.call(this,he);var _=window.document;return q.node=_.createElement("div"),_.body.appendChild(q.node),q}return Object(re.a)(U,[{key:"render",value:function(){var q=this.props.children;return Object(R.createPortal)(q,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),U}(F.a.Component)},Ot1p:function(Ye,Ie,k){"use strict";var P=k("2qtc"),re=k("kLXV"),V=k("rAM+"),ce=k("miYZ"),oe=k("tsqr"),F=k("tJVT"),R=k("jrin"),T=k("q1tI"),w=k.n(T),N=k("VrN/"),I=k.n(N),U=k("bdgK"),he=k("p77/"),q=k("Bd2K"),_=k("ELLl"),j=k("19Vz"),L=k("lZu9"),G=k("+NIl"),J=k("kSUc"),le=k("9Bee"),ke=function(se){var Te=se.value,Ne=Te===void 0?"":Te,Ae=se.className,Xe=se.showTextOnly,tt=se.showLines,Je=se.style,pt=Je===void 0?{}:Je,Tt=Object(T.useMemo)(function(){return""},[Ne]);return w.a.createElement(w.a.Fragment,null,w.a.createElement("div",{dangerouslySetInnerHTML:{__html:Tt}}))},ye=k("0Owb"),ge=k("dejd"),Se=k("C+DQ"),_e=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function me(se){var Te=se.onActionCallback,Ne=se.title,Ae=se.icon,Xe=se.actionName,tt=se.className,Je=tt===void 0?"":tt,pt=se.children;function Tt(){Te(Xe)}return w.a.createElement("a",{title:Ne,className:Je,onClick:Tt},w.a.createElement("i",{className:"md-iconfont ".concat(Ae)}),pt)}var je=function(se){var Te=se.watch,Ne=se.showNullButton,Ae=se.onActionCallback,Xe=se.fullScreen,tt=se.insertTemp,Je=se.hidetoolBar,pt=[].concat(_e,[{title:"".concat(Te?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Te?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return w.a.createElement("ul",{className:"markdown-toolbar-container"},!Je&&pt.map(function(Tt,zt){return w.a.createElement("li",{key:zt},Tt.actionName?w.a.createElement(me,Object(ye.a)({},Tt,{onActionCallback:Ae})):w.a.createElement("span",{className:"v-line"}))}),Ne?w.a.createElement("li",null,w.a.createElement(me,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ae},w.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,tt&&w.a.createElement("li",null,w.a.createElement(me,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(tt),onActionCallback:Ae},w.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),w.a.createElement("li",{className:"btn-full-screen"},w.a.createElement(me,{icon:"".concat(Xe?"icon-shrink":"icon-enlarge"),title:Xe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ae})))},ie=k("M8RZ"),y=k("+L6B"),H=k("2/Rp"),D=k("y8nQ"),g=k("Vl3Y"),B=k("5NDa"),S=k("5rEg"),E={labelCol:{span:4},wrapperCol:{span:20}},x=function(se){var Te=se.callback,Ne=se.onCancel;function Ae(Xe){Te(Xe)}return w.a.createElement(g.a,Object(ye.a)({},E,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ae}),w.a.createElement(g.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},w.a.createElement(S.a,null)),w.a.createElement(g.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},w.a.createElement(S.a,null)),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(H.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},c=k("7ahc"),l=k("HmJG"),h=k("BjJ7"),C=g.a.useForm,A={width:280,marginRight:10},Z={labelCol:{span:5},wrapperCol:{span:19}},de=function(se){var Te=se.callback,Ne=se.onCancel,Ae=C(),Xe=Object(F.a)(Ae,1),tt=Xe[0];function Je(zt){Te(zt)}function pt(zt,st){tt.setFieldsValue({src:"/api/attachments/".concat(zt.id),type:st.type})}function Tt(zt){var st=zt.target.files[0];ne(st,pt)}return w.a.createElement(g.a,Object(ye.a)({form:tt},Z,{className:"upload-image-panel",onFinish:Je}),w.a.createElement(g.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},w.a.createElement("div",{className:"flex-container"},w.a.createElement(g.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},w.a.createElement(S.a,{style:A})),w.a.createElement(X,{onFileChange:Tt}))),w.a.createElement(g.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},w.a.createElement(S.a,{style:{width:264}})),w.a.createElement(g.a.Item,{style:{textAlign:"right"}},w.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(H.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))};function X(se){var Te=se.onFileChange;return w.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",w.a.createElement("input",{type:"file",onChange:Te}))}function ne(se,Te){if(!se)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ne=new FormData;Ne.append("editormd-image-file",se),Ne.append("file_param_name","editormd-image-file"),Ne.append("byxhr","true");var Ae=new window.XMLHttpRequest;Ae.withCredentials=!0,Ae.addEventListener("load",function(Xe){Te(JSON.parse(Xe.target.responseText),se)},!1),Ae.addEventListener("error",function(Xe){console.error(Xe)},!1),Ae.open("POST","".concat(h.a,"/api/attachments.json")),Ae.send(Ne)}var te=k("giR+"),z=k("fyUT"),Y=k("7Kak"),xe=k("9yH6"),f=xe.a.Group,b={margin:"0 8px"},p=function(se){var Te=se.callback,Ne=se.onCancel;function Ae(Xe){Te(Xe)}return w.a.createElement(g.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ae},w.a.createElement("div",{className:"flex-container"},w.a.createElement("span",{style:b},"\u5355\u5143\u683C\u6570\uFF1A"),w.a.createElement("span",{style:b},"\u884C\u6570"),w.a.createElement(g.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},w.a.createElement(z.a,null)),w.a.createElement("span",{style:b},"\u5217\u6570"),w.a.createElement(g.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},w.a.createElement(z.a,null))),w.a.createElement("div",{className:"flex-container",style:{marginTop:12}},w.a.createElement("span",{style:b},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),w.a.createElement(g.a.Item,{name:"align"},w.a.createElement(f,null,w.a.createElement(xe.a,{value:"default"},w.a.createElement("i",{className:"fa fa-align-justify"})),w.a.createElement(xe.a,{value:"left"},w.a.createElement("i",{className:"fa fa-align-left"})),w.a.createElement(xe.a,{value:"center"},w.a.createElement("i",{className:"fa fa-align-center"})),w.a.createElement(xe.a,{value:"right"},w.a.createElement("i",{className:"fa fa-align-right"}))))),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(H.a,{type:"ghost",onClick:Ne},"\u53D6\u6D88")))},W=k("m3rI"),Q="link",$="upload-image",pe="code-block",Ee="add-table",Ue="------------",Re={default:Ue,left:":".concat(Ue),center:":".concat(Ue,":"),right:"".concat(Ue,":")},Fe=k("9VGf"),We,et;function ot(){}var yt=0,ht=1e4,kt="\u2581",gt=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function At(se){return/^\d+$/.test(se)?"".concat(se,"px"):se}var Le=navigator.platform.toUpperCase().indexOf("MAC")>=0,Lt=Le?"Cmd":"Ctrl",vt=(We={},Object(R.a)(We,Lt+"-B","bold"),Object(R.a)(We,Lt+"-I","italic"),We),Qe=(et={},Object(R.a)(et,Q,"\u6DFB\u52A0\u94FE\u63A5"),Object(R.a)(et,pe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(R.a)(et,$,"\u6DFB\u52A0\u56FE\u7247"),Object(R.a)(et,Ee,"\u6DFB\u52A0\u8868\u683C"),et),Be=Ie.a=function(se){var Te=se.defaultValue,Ne=Te===void 0?"":Te,Ae=se.onChange,Xe=se.width,tt=Xe===void 0?"100%":Xe,Je=se.height,pt=Je===void 0?400:Je,Tt=se.miniToolbar,zt=Tt===void 0?!1:Tt,st=se.isFocus,Nt=st===void 0?!1:st,qe=se.watch,un=se.insertTemp,Ft=se.mode,It=Ft===void 0?"markdown":Ft,cn=se.id,dn=cn===void 0?"markdown-editor-id":cn,Et=se.showResizeBar,Kt=Et===void 0?!1:Et,fn=se.noStorage,zn=fn===void 0?!1:fn,vi=se.showNullButton,lr=vi===void 0?!1:vi,ur=se.hidetoolBar,On=ur===void 0?!1:ur,bi=se.fullScreen,an=bi===void 0?!1:bi,Xn=se.onBlur,cr=se.onCMBeforeChange,ct=se.onFullScreen,Oe=se.className,wn=Oe===void 0?"":Oe,dr=se.disablePaste,on=dr===void 0?!1:dr,Ze=se.placeholder,En=Ze===void 0?"":Ze,An=se.values,Gn=An===void 0?"":An,ae=Object(T.useState)(null),ze=Object(F.a)(ae,2),fe=ze[0],jr=ze[1],fr=Object(T.useState)(Ne),Kn=Object(F.a)(fr,2),Vn=Kn[0],He=Kn[1],Zi=Object(T.useState)(qe),Fr=Object(F.a)(Zi,2),sn=Fr[0],tn=Fr[1],yi=Object(T.useState)(an),Ir=Object(F.a)(yi,2),Qt=Ir[0],hr=Ir[1],xi=Object(T.useState)(""),pr=Object(F.a)(xi,2),Cn=pr[0],Sn=pr[1],wi=Object(T.useState)(0),Ur=Object(F.a)(wi,2),Yn=Ur[0],Wr=Ur[1],Ei=Object(T.useState)(pt),ln=Object(F.a)(Ei,2),Ci=ln[0],Si=ln[1],mr=Object(T.useState)(!1),Mn=Object(F.a)(mr,2),Fa=Mn[0],Hr=Mn[1],qn=Object(T.useRef)(),Br=Object(T.useRef)(),Dn=Object(T.useRef)(),Jn=Object(T.useRef)();Object(T.useEffect)(function(){He(Gn),fe==null||fe.setValue(Gn)},[Gn]),Object(T.useEffect)(function(){ct==null||ct(Qt)},[Qt]),Object(T.useEffect)(function(){if(qn.current){var Me=I.a.fromTextArea(qn.current,{mode:It,lineNumbers:!zt,lineWrapping:!0,value:Ne,autoCloseTags:!0,autoCloseBrackets:!0});Nt&&Me.focus();function Ge(Ke,rt){if(on){rt.preventDefault();return}var it=rt.clipboardData;if(it){var lt=it.types.toString(),xt=it.items,dt=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];if(lt==="Files"||it.types.indexOf("Files")>-1){if(rt.preventDefault(),It=="stex")return;try{var Ut,hn=xt[1];((Ut=xt[0])===null||Ut===void 0?void 0:Ut.kind)==="file"&&(hn=xt[0]);var ut=hn.getAsFile(),_n=ut.name.split(".").pop();ne(ut,function(Wt){if(Wt.id){var Rn,Nn,vr;(ut==null||((Rn=ut.type)===null||Rn===void 0)?void 0:Rn.indexOf("image"))>-1?Me.replaceSelection(".concat(Wt.content_type,")")):(ut==null||((Nn=ut.type)===null||Nn===void 0)?void 0:Nn.indexOf("video"))>-1?Me.replaceSelection('<video width="100%" controls src="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(ut==null||((vr=ut.type)===null||vr===void 0)?void 0:vr.indexOf("pdf"))>-1?Me.replaceSelection('<a href="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(ut.type,'&disposition=inline" target="_blank">').concat(ut.name,"</a>")):dt.includes(_n)?Me.replaceSelection('<a href="'.concat(W.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(ut.name,"</a>")):Me.replaceSelection("[".concat(ut.name,"](").concat(W.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){oe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Me.on("paste",Ge),jr(Me),function(){Me.off("paste",Ge)}}},[]);var ki=Object(T.useCallback)(function(){if(Br.current)try{}catch(Me){console.log(Me,"---- to set md editor body height")}},[Ci,Br,Qt]);Object(T.useEffect)(function(){function Me(){var Ke=new U.default(function(rt){var it=Object(V.a)(rt),lt;try{for(it.s();!(lt=it.n()).done;){var xt=lt.value;(xt.target.offsetHeight>0||xt.target.offsetWidth>0)&&(ki(),fe.setSize("100%","100%"),fe.refresh())}}catch(dt){it.e(dt)}finally{it.f()}});return Ke.observe(qn.current.parentElement),Ke}if(fe){var Ge=Me();return function(){Ge.unobserve(qn.current.parentElement)}}},[fe,ki]),Object(T.useEffect)(function(){if(fe){for(var Me=[],Ge=function(){var xt=rt[Ke];it=Object(F.a)(xt,2);var dt=it[0],Ut=it[1],hn=Object(R.a)({},dt,function(){zr(Ut)});Me.push(hn),fe.addKeyMap(hn)},Ke=0,rt=Object.entries(vt);Ke<rt.length;Ke++){var it;Ge()}return function(){var lt=Object(V.a)(Me),xt;try{for(lt.s();!(xt=lt.n()).done;){var dt=xt.value;fe.removeKeyMap(dt)}}catch(Ut){lt.e(Ut)}finally{lt.f()}}}},[fe]),Object(T.useEffect)(function(){an!==Qt&&hr(an)},[an]),Object(Fe.a)(function(){if(!zn&&Yn>0){var Me=new Date().getTime(),Ge=window.sessionStorage.getItem(dn);Me>=Yn+ht&&(!Ge||Ge!==Vn)&&(window.sessionStorage.setItem(dn,Vn),Hr(!0))}},ht),Object(T.useEffect)(function(){tn(qe)},[fe,qe]),Object(T.useEffect)(function(){fe&&(Nt&&fe.focus())},[fe,Nt]),Object(T.useEffect)(function(){if(sn&&fe){var Me=fe.getScrollerElement();function Ge(Ke){var rt=Ke.target;if(Jn.current){var it=rt.scrollTop/rt.scrollHeight;Jn.current.scrollTop=Jn.current.scrollHeight*it}}return Me.addEventListener("scroll",Ge),function(){Me.removeEventListener("scroll",Ge)}}},[fe,sn]),Object(T.useEffect)(function(){if(fe&&cr){function Me(Ge,Ke){cr(Ge,Ke)}return fe.on("beforeChange",Me),function(){fe.off("beforeChange",Me)}}},[fe,cr]),Object(T.useEffect)(function(){if(fe&&Xn){function Me(){Xn(fe.getValue())}return fe.on("blur",Me),function(){fe.off("blur",Me)}}},[fe,Xn]),Object(T.useEffect)(function(){if(fe){function Me(Ge){var Ke=Ge.getValue();He(Ke),Wr(new Date().getTime()),Ge.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ae&&Ae(Ke)}return fe.on("change",Me),function(){fe.off("change",Me)}}},[fe,Ae]),Object(T.useEffect)(function(){fe&&(Ne==null?(fe.setValue(""),He("")):Ne!==fe.getValue()&&(fe.setValue(Ne),He(Ne),fe.setCursor(fe.lineCount(),0)))},[fe,Ne]);var zr=Object(T.useCallback)(function(Me){var Ge=fe.getCursor(),Ke=fe.getSelection(),rt=Ke.split(`
|
|
`);switch(Me){case"bold":return fe.replaceSelection("**"+Ke+"**"),Ke===""&&fe.setCursor(Ge.line,Ge.ch+2),fe.focus();case"italic":return fe.replaceSelection("*"+Ke+"*"),Ke===""&&fe.setCursor(Ge.line,Ge.ch+1),fe.focus();case"code":return fe.replaceSelection("`"+Ke+"`"),Ke===""&&fe.setCursor(Ge.line,Ge.ch+1),fe.focus();case"inline-latex":return fe.replaceSelection("`$$"+Ke+"$$`"),Ke===""&&fe.setCursor(Ge.line,Ge.ch+3),fe.focus();case"latex":return fe.replaceSelection("```latex\n"+Ke+"\n```"),fe.setCursor(Ge.line+1,Ke.length+1),fe.focus();case"line-break":return fe.replaceSelection(`<br/>
|
|
`),fe.focus();case"list-ul":return Ke===""?fe.replaceSelection("- "+Ke):fe.replaceSelection(rt.map(function(it){return it===""?"":"- ".concat(it)}).join(`
|
|
`)),fe.focus();case"list-ol":return Ke===""?fe.replaceSelection("1. "+Ke):fe.replaceSelection(rt.map(function(it,lt){return it===""?"":"".concat(lt+1,". ").concat(it)}).join(`
|
|
`)),fe.focus();case"add-null-ch":return Ke===""&&fe.setCursor(Ge.line,Ge.ch+1),fe.replaceSelection(kt),fe.focus();case"inster-template-1":return Ke===""&&fe.setCursor(Ge.line,Ge.ch),fe.replaceSelection(gt),fe.focus();case"eraser":return fe.setValue(""),fe.focus();case"trigger-watch":return tn(!sn),fe.focus();case"trigger-full-screen":return hr(!Qt),fe.focus();case Q:Sn(Q);return;case pe:Sn(pe);return;case $:Sn($);return;case Ee:Sn(Ee);return;default:throw new Error}},[fe,sn,Qt]),Zn=Object(T.useCallback)(function(Me){Sn("");switch(Cn){case Q:var Ge=Me.title,Ke=Me.link;return fe.replaceSelection("[".concat(Ge,"](").concat(Ke,")")),fe.focus();case pe:var rt=Me.language,it=Me.content;return fe.replaceSelection(["```"+rt,it,"```"].join(`
|
|
`)),fe.focus();case $:var lt=Me.src,xt=Me.alt;return fe.replaceSelection(".concat(lt,' "').concat(xt,'" )')),fe.focus();case Ee:for(var dt=Me.row,Ut=Me.col,hn=Me.align,ut=`
|
|
`,_n=0;_n<dt;_n++){for(var Wt=[],Rn=[],Nn=0;Nn<Ut;Nn++)_n===1&&Rn.push(Re[hn]),Wt.push(" ");_n===1&&(ut+="| ".concat(Rn.join(" | "),` |
|
|
`)),ut+="| ".concat(Wt.join(Ut===1?"":" | "),` |
|
|
`)}return fe.replaceSelection(ut+`
|
|
`),fe.focus();default:throw new Error}},[fe,Cn]),gr=Object(T.useMemo)(function(){switch(Cn){case Q:return w.a.createElement(x,{callback:Zn,onCancel:vn});case pe:return w.a.createElement(c.b,{callback:Zn,onCancel:vn});case $:return w.a.createElement(de,{callback:Zn,onCancel:vn});case Ee:return w.a.createElement(p,{callback:Zn,onCancel:vn});default:return null}},[Cn]);function vn(){Sn("")}Object(T.useEffect)(function(){if(Dn.current){var Me=Dn.current,Ge=!1,Ke=0;function rt(xt){Ge=!0,Ke=xt.pageY}function it(){Ge=!1}function lt(xt){if(Ge){var dt=xt.pageY-Ke;dt<0&&(dt=0),dt>300&&(dt=300);var Ut=pt+dt+"px";Si(Ut)}}return Me.addEventListener("mousedown",rt),document.addEventListener("mousemove",lt),document.addEventListener("mouseup",it),function(){Me.removeEventListener("mousedown",rt),document.removeEventListener("mousemove",lt),document.removeEventListener("mouseup",it)}}},[fe,Dn]),Object(T.useEffect)(function(){Si(pt)},[pt]);var Xr=At(tt),Li=At(Ci),Ti={width:Xr,height:Li},Gr=Object(T.useMemo)(function(){if(Yn){var Me=new Date(Yn),Ge=Me.getHours(),Ke=Me.getMinutes(),rt=Me.getSeconds();return Ge=Ge<10?"0"+Ge:Ge,Ke=Ke<10?"0"+Ke:Ke,rt=rt<10?"0"+rt:rt,"".concat(Ge,":").concat(Ke,":").concat(rt)}return 0},[Yn]);function Ia(){window.sessionStorage.removeItem(dn),Hr(!1),Wr(0)}function Qi(){Hr(!1),Wr(0),fe.setValue(window.sessionStorage.getItem(dn))}return w.a.createElement(T.Fragment,null,w.a.createElement("div",{className:"markdown-editor-wrapper",ref:Br},w.a.createElement("div",{className:"markdown-editor-container ".concat(wn," ").concat(sn?"on-preview":""," ").concat(zt?"mini":""," ").concat(Qt?"full-screen":""),style:Ti},w.a.createElement(je,{insertTemp:un,watch:sn,fullScreen:Qt,showNullButton:lr,onActionCallback:zr,hidetoolBar:On}),w.a.createElement("div",{className:"markdown-editor-body"},w.a.createElement("div",{className:"codemirror-container"},w.a.createElement("textarea",{ref:qn,placeholder:En})),sn?w.a.createElement("div",{ref:Jn,className:"preview-container"},It==="stex"&&w.a.createElement(ke,{value:Vn}),It!=="stex"&&w.a.createElement(le.a,{value:Vn})):null))),Kt?w.a.createElement("a",{ref:Dn,className:"editor-resize"}):null,w.a.createElement(ie.a,null,Qe[Cn]?w.a.createElement(re.a,{centered:!0,title:Qe[Cn],visible:!0,onCancel:vn,footer:null},gr):null))}},"VrN/":function(Ye,Ie,k){(function(P,re){Ye.exports=re()})(this,function(){"use strict";var P=navigator.userAgent,re=navigator.platform,V=/gecko\/\d/i.test(P),ce=/MSIE \d/.test(P),oe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(P),F=/Edge\/(\d+)/.exec(P),R=ce||oe||F,T=R&&(ce?document.documentMode||6:+(F||oe)[1]),w=!F&&/WebKit\//.test(P),N=w&&/Qt\/\d+\.\d+/.test(P),I=!F&&/Chrome\//.test(P),U=/Opera\//.test(P),he=/Apple Computer/.test(navigator.vendor),q=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(P),_=/PhantomJS/.test(P),j=!F&&/AppleWebKit/.test(P)&&/Mobile\/\w+/.test(P),L=/Android/.test(P),G=j||L||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(P),J=j||/Mac/.test(re),le=/\bCrOS\b/.test(P),ke=/win/i.test(re),ye=U&&P.match(/Version\/(\d*\.\d*)/);ye&&(ye=Number(ye[1])),ye&&ye>=15&&(U=!1,w=!0);var ge=J&&(N||U&&(ye==null||ye<12.11)),Se=V||R&&T>=9;function _e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var me=function(e,t){var r=e.className,n=_e(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 je(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ie(e,t){return je(e).appendChild(t)}function y(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function H(e,t,r,n){var i=y(e,t,r,n);return i.setAttribute("role","presentation"),i}var D;document.createRange?D=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:D=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function g(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(){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 S(e,t){var r=e.className;_e(t).test(r)||(e.className+=(r?" ":"")+t)}function E(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!_e(r[n]).test(t)&&(t+=" "+r[n]);return t}var x=function(e){e.select()};j?x=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:R&&(x=function(e){try{e.select()}catch(t){}});function c(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function l(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function h(e,t,r,n,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=n||0,o=i||0;;){var s=e.indexOf(" ",a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=r-o%r,a=s+1}}var C=function(){this.id=null,this.f=null,this.time=0,this.handler=c(this.onTimeout,this)};C.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},C.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)};function A(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var Z=50,de={toString:function(){return"CodeMirror.Pass"}},X={scroll:!1},ne={origin:"*mouse"},te={origin:"+move"};function z(e,t,r){for(var n=0,i=0;;){var a=e.indexOf(" ",n);a==-1&&(a=e.length);var o=a-n;if(a==e.length||i+o>=t)return n+Math.min(o,t-i);if(i+=a-n,i+=r-i%r,n=a+1,i>=t)return n}}var Y=[""];function xe(e){for(;Y.length<=e;)Y.push(f(Y)+" ");return Y[e]}function f(e){return e[e.length-1]}function b(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function p(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function W(){}function Q(e,t){var r;return Object.create?r=Object.create(e):(W.prototype=e,r=new W),t&&l(t,r),r}var $=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function pe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||$.test(e))}function Ee(e,t){return t?t.source.indexOf("\\w")>-1&&pe(e)?!0:t.test(e):pe(e)}function Ue(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Re=/[\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 Fe(e){return e.charCodeAt(0)>=768&&Re.test(e)}function We(e,t,r){for(;(r<0?t>0:t<e.length)&&Fe(e.charAt(t));)t+=r;return t}function et(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,a=n<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:r;e(a)?r=a:t=a+n}}function ot(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<r&&o.to>t||t==r&&o.to==t)&&(n(Math.max(o.from,t),Math.min(o.to,r),o.level==1?"rtl":"ltr",a),i=!0)}i||n(t,r,"ltr")}var yt=null;function ht(e,t,r){var n;yt=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&r=="before"?n=i:yt=i),a.from==t&&(a.from!=a.to&&r!="before"?n=i:yt=i)}return n!=null?n:yt}var kt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(d){return d<=247?e.charAt(d):1424<=d&&d<=1524?"R":1536<=d&&d<=1785?t.charAt(d-1536):1774<=d&&d<=2220?"r":8192<=d&&d<=8203?"w":d==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function u(d,m,v){this.level=d,this.from=m,this.to=v}return function(d,m){var v=m=="ltr"?"L":"R";if(d.length==0||m=="ltr"&&!n.test(d))return!1;for(var M=d.length,O=[],K=0;K<M;++K)O.push(r(d.charCodeAt(K)));for(var ee=0,ue=v;ee<M;++ee){var ve=O[ee];ve=="m"?O[ee]=ue:ue=ve}for(var we=0,be=v;we<M;++we){var Ce=O[we];Ce=="1"&&be=="r"?O[we]="n":a.test(Ce)&&(be=Ce,Ce=="r"&&(O[we]="R"))}for(var Pe=1,De=O[0];Pe<M-1;++Pe){var Ve=O[Pe];Ve=="+"&&De=="1"&&O[Pe+1]=="1"?O[Pe]="1":Ve==","&&De==O[Pe+1]&&(De=="1"||De=="n")&&(O[Pe]=De),De=Ve}for(var at=0;at<M;++at){var _t=O[at];if(_t==",")O[at]="N";else if(_t=="%"){var mt=void 0;for(mt=at+1;mt<M&&O[mt]=="%";++mt);for(var en=at&&O[at-1]=="!"||mt<M&&O[mt]=="1"?"1":"N",qt=at;qt<mt;++qt)O[qt]=en;at=mt-1}}for(var Ct=0,Jt=v;Ct<M;++Ct){var jt=O[Ct];Jt=="L"&&jt=="1"?O[Ct]="L":a.test(jt)&&(Jt=jt)}for(var Ot=0;Ot<M;++Ot)if(i.test(O[Ot])){var St=void 0;for(St=Ot+1;St<M&&i.test(O[St]);++St);for(var bt=(Ot?O[Ot-1]:v)=="L",Zt=(St<M?O[St]:v)=="L",Nr=bt==Zt?bt?"L":"R":v,Bn=Ot;Bn<St;++Bn)O[Bn]=Nr;Ot=St-1}for(var Bt=[],xn,Rt=0;Rt<M;)if(o.test(O[Rt])){var Pa=Rt;for(++Rt;Rt<M&&o.test(O[Rt]);++Rt);Bt.push(new u(0,Pa,Rt))}else{var Tn=Rt,or=Bt.length,sr=m=="rtl"?1:0;for(++Rt;Rt<M&&O[Rt]!="L";++Rt);for(var Gt=Tn;Gt<Rt;)if(s.test(O[Gt])){Tn<Gt&&(Bt.splice(or,0,new u(1,Tn,Gt)),or+=sr);var Pr=Gt;for(++Gt;Gt<Rt&&s.test(O[Gt]);++Gt);Bt.splice(or,0,new u(2,Pr,Gt)),or+=sr,Tn=Gt}else++Gt;Tn<Rt&&Bt.splice(or,0,new u(1,Tn,Rt))}return m=="ltr"&&(Bt[0].level==1&&(xn=d.match(/^\s+/))&&(Bt[0].from=xn[0].length,Bt.unshift(new u(0,0,xn[0].length))),f(Bt).level==1&&(xn=d.match(/\s+$/))&&(f(Bt).to-=xn[0].length,Bt.push(new u(0,M-xn[0].length,M)))),m=="rtl"?Bt.reverse():Bt}}();function gt(e,t){var r=e.order;return r==null&&(r=e.order=kt(e.text,t)),r}var At=[],Le=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]||At).concat(r)}};function Lt(e,t){return e._handlers&&e._handlers[t]||At}function vt(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 a=A(i,r);a>-1&&(n[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Qe(e,t){var r=Lt(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Be(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Qe(e,r||t.type,e,t),tt(t)||t.codemirrorIgnore}function se(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)A(r,t[n])==-1&&r.push(t[n])}function Te(e,t){return Lt(e,t).length>0}function Ne(e){e.prototype.on=function(t,r){Le(this,t,r)},e.prototype.off=function(t,r){vt(this,t,r)}}function Ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function tt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Je(e){Ae(e),Xe(e)}function pt(e){return e.target||e.srcElement}function Tt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),J&&e.ctrlKey&&t==1&&(t=3),t}var zt=function(){if(R&&T<9)return!1;var e=y("div");return"draggable"in e||"dragDrop"in e}(),st;function Nt(e){if(st==null){var t=y("span","\u200B");ie(e,y("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(st=t.offsetWidth<=1&&t.offsetHeight>2&&!(R&&T<8))}var r=st?y("span","\u200B"):y("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var qe;function un(e){if(qe!=null)return qe;var t=ie(e,document.createTextNode("A\u062EA")),r=D(t,0,1).getBoundingClientRect(),n=D(t,1,2).getBoundingClientRect();return je(e),!r||r.left==r.right?!1:qe=n.right-r.right<3}var Ft=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(`
|
|
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=a.indexOf("\r");o!=-1?(r.push(a.slice(0,o)),t+=o+1):(r.push(a),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},It=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},cn=function(){var e=y("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),dn=null;function Et(e){if(dn!=null)return dn;var t=ie(e,y("span","x")),r=t.getBoundingClientRect(),n=D(t,0,1).getBoundingClientRect();return dn=Math.abs(r.left-n.left)>1}var Kt={},fn={};function zn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Kt[e]=t}function vi(e,t){fn[e]=t}function lr(e){if(typeof e=="string"&&fn.hasOwnProperty(e))e=fn[e];else if(e&&typeof e.name=="string"&&fn.hasOwnProperty(e.name)){var t=fn[e.name];typeof t=="string"&&(t={name:t}),e=Q(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return lr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return lr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ur(e,t){t=lr(t);var r=Kt[t.name];if(!r)return ur(e,"text/plain");var n=r(e,t);if(On.hasOwnProperty(t.name)){var i=On[t.name];for(var a in i){if(!i.hasOwnProperty(a))continue;n.hasOwnProperty(a)&&(n["_"+a]=n[a]),n[a]=i[a]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)n[o]=t.modeProps[o];return n}var On={};function bi(e,t){var r=On.hasOwnProperty(e)?On[e]:On[e]={};l(t,r)}function an(e,t){if(t===!0)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 Xn(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function cr(e,t,r){return e.startState?e.startState(t,r):!0}var ct=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};ct.prototype.eol=function(){return this.pos>=this.string.length},ct.prototype.sol=function(){return this.pos==this.lineStart},ct.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ct.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ct.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},ct.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ct.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ct.prototype.skipToEnd=function(){this.pos=this.string.length},ct.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ct.prototype.backUp=function(e){this.pos-=e},ct.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=h(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?h(this.string,this.lineStart,this.tabSize):0)},ct.prototype.indentation=function(){return h(this.string,null,this.tabSize)-(this.lineStart?h(this.string,this.lineStart,this.tabSize):0)},ct.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(o){return r?o.toLowerCase():o},i=this.string.substr(this.pos,e.length);if(n(i)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},ct.prototype.current=function(){return this.string.slice(this.start,this.pos)},ct.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ct.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ct.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Oe(e,t){if(t-=e.first,t<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],a=i.chunkSize();if(t<a){r=i;break}t-=a}return r.lines[t]}function wn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(a){var o=a.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function dr(e,t,r){var n=[];return e.iter(t,r,function(i){n.push(i.text)}),n}function on(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Ze(e){if(e.parent==null)return null;for(var t=e.parent,r=A(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 En(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],a=i.height;if(t<a){e=i;continue e}t-=a,r+=i.chunkSize()}return r}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o],u=s.height;if(t<u)break;t-=u}return r+o}function An(e,t){return t>=e.first&&t<e.first+e.size}function Gn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ae(e,t,r){if(r===void 0&&(r=null),!(this instanceof ae))return new ae(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ze(e,t){return e.line-t.line||e.ch-t.ch}function fe(e,t){return e.sticky==t.sticky&&ze(e,t)==0}function jr(e){return ae(e.line,e.ch)}function fr(e,t){return ze(e,t)<0?t:e}function Kn(e,t){return ze(e,t)<0?e:t}function Vn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function He(e,t){if(t.line<e.first)return ae(e.first,0);var r=e.first+e.size-1;return t.line>r?ae(r,Oe(e,r).text.length):Zi(t,Oe(e,t.line).text.length)}function Zi(e,t){var r=e.ch;return r==null||r>t?ae(e.line,t):r<0?ae(e.line,0):e}function Fr(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=He(e,t[n]);return r}var sn=function(e,t){this.state=e,this.lookAhead=t},tn=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};tn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},tn.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}},tn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},tn.fromSaved=function(e,t,r){return t instanceof sn?new tn(e,an(e.mode,t.state),r,t.lookAhead):new tn(e,an(e.mode,t),r)},tn.prototype.save=function(e){var t=e!==!1?an(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new sn(t,this.maxLookAhead):t};function yi(e,t,r,n){var i=[e.state.modeGen],a={};Ur(e,t.text,e.doc.mode,r,function(d,m){return i.push(d,m)},a,n);for(var o=r.state,s=function(d){r.baseTokens=i;var m=e.state.overlays[d],v=1,M=0;r.state=!0,Ur(e,t.text,m.mode,r,function(O,K){for(var ee=v;M<O;){var ue=i[v];ue>O&&i.splice(v,1,O,i[v+1],ue),v+=2,M=Math.min(O,ue)}if(!K)return;if(m.opaque)i.splice(ee,v-ee,O,"overlay "+K),v=ee+2;else for(;ee<v;ee+=2){var ve=i[ee+1];i[ee+1]=(ve?ve+" ":"")+"overlay "+K}},a),r.state=o,r.baseTokens=null,r.baseTokenPos=1},u=0;u<e.state.overlays.length;++u)s(u);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Ir(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Qt(e,Ze(t)),i=t.text.length>e.options.maxHighlightLength&&an(e.doc.mode,n.state),a=yi(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.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 Qt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new tn(n,!0,t);var a=Yn(e,t,r),o=a>n.first&&Oe(n,a-1).stateAfter,s=o?tn.fromSaved(n,o,a):new tn(n,cr(n.mode),a);return n.iter(a,t,function(u){hr(e,u.text,s);var d=s.line;u.stateAfter=d==t-1||d%5==0||d>=i.viewFrom&&d<i.viewTo?s.save():null,s.nextLine()}),r&&(n.modeFrontier=s.line),s}function hr(e,t,r,n){var i=e.doc.mode,a=new ct(t,e.options.tabSize,r);for(a.start=a.pos=n||0,t==""&&xi(i,r.state);!a.eol();)pr(i,a,r.state),a.start=a.pos}function xi(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Xn(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function pr(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Xn(e,r).mode);var a=e.token(t,r);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var Cn=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Sn(e,t,r,n){var i=e.doc,a=i.mode,o;t=He(i,t);var s=Oe(i,t.line),u=Qt(e,t.line,r),d=new ct(s.text,e.options.tabSize,u),m;for(n&&(m=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,o=pr(a,d,u.state),n&&m.push(new Cn(d,o,an(i.mode,u.state)));return n?m:new Cn(d,o,u.state)}function wi(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";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Ur(e,t,r,n,i,a,o){var s=r.flattenSpans;s==null&&(s=e.options.flattenSpans);var u=0,d=null,m=new ct(t,e.options.tabSize,n),v,M=e.options.addModeClass&&[null];for(t==""&&wi(xi(r,n.state),a);!m.eol();){if(m.pos>e.options.maxHighlightLength?(s=!1,o&&hr(e,t,n,m.pos),m.pos=t.length,v=null):v=wi(pr(r,m,n.state,M),a),M){var O=M[0].name;O&&(v="m-"+(v?O+" "+v:O))}if(!s||d!=v){for(;u<m.start;)u=Math.min(m.start,u+5e3),i(u,d);d=v}m.start=m.pos}for(;u<m.pos;){var K=Math.min(m.pos,u+5e3);i(K,d),u=K}}function Yn(e,t,r){for(var n,i,a=e.doc,o=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var u=Oe(a,s-1),d=u.stateAfter;if(d&&(!r||s+(d instanceof sn?d.lookAhead:0)<=a.modeFrontier))return s;var m=h(u.text,null,e.options.tabSize);(i==null||n>m)&&(i=s-1,n=m)}return i}function Wr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var i=Oe(e,n).stateAfter;if(i&&(!(i instanceof sn)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Ei=!1,ln=!1;function Ci(){Ei=!0}function Si(){ln=!0}function mr(e,t,r){this.marker=e,this.from=t,this.to=r}function Mn(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Fa(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Hr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function qn(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);if(s||a.from==t&&o.type=="bookmark"&&(!r||!a.marker.insertLeft)){var u=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(n||(n=[])).push(new mr(o,a.from,u?null:a.to))}}return n}function Br(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);if(s||a.from==t&&o.type=="bookmark"&&(!r||a.marker.insertLeft)){var u=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(n||(n=[])).push(new mr(o,u?null:a.from-t,a.to==null?null:a.to-t))}}return n}function Dn(e,t){if(t.full)return null;var r=An(e,t.from.line)&&Oe(e,t.from.line).markedSpans,n=An(e,t.to.line)&&Oe(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,a=t.to.ch,o=ze(t.from,t.to)==0,s=qn(r,i,o),u=Br(n,a,o),d=t.text.length==1,m=f(t.text).length+(d?i:0);if(s)for(var v=0;v<s.length;++v){var M=s[v];if(M.to==null){var O=Mn(u,M.marker);O?d&&(M.to=O.to==null?null:O.to+m):M.to=i}}if(u)for(var K=0;K<u.length;++K){var ee=u[K];if(ee.to!=null&&(ee.to+=m),ee.from==null){var ue=Mn(s,ee.marker);ue||(ee.from=m,d&&(s||(s=[])).push(ee))}else ee.from+=m,d&&(s||(s=[])).push(ee)}s&&(s=Jn(s)),u&&u!=s&&(u=Jn(u));var ve=[s];if(!d){var we=t.text.length-2,be;if(we>0&&s)for(var Ce=0;Ce<s.length;++Ce)s[Ce].to==null&&(be||(be=[])).push(new mr(s[Ce].marker,null,null));for(var Pe=0;Pe<we;++Pe)ve.push(be);ve.push(u)}return ve}function Jn(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ki(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(O){if(O.markedSpans)for(var K=0;K<O.markedSpans.length;++K){var ee=O.markedSpans[K].marker;ee.readOnly&&(!n||A(n,ee)==-1)&&(n||(n=[])).push(ee)}}),!n)return null;for(var i=[{from:t,to:r}],a=0;a<n.length;++a)for(var o=n[a],s=o.find(0),u=0;u<i.length;++u){var d=i[u];if(ze(d.to,s.from)<0||ze(d.from,s.to)>0)continue;var m=[u,1],v=ze(d.from,s.from),M=ze(d.to,s.to);(v<0||!o.inclusiveLeft&&!v)&&m.push({from:d.from,to:s.from}),(M>0||!o.inclusiveRight&&!M)&&m.push({from:s.to,to:d.to}),i.splice.apply(i,m),u+=m.length-3}return i}function zr(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function Zn(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function gr(e){return e.inclusiveLeft?-1:0}function vn(e){return e.inclusiveRight?1:0}function Xr(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),i=t.find(),a=ze(n.from,i.from)||gr(e)-gr(t);if(a)return-a;var o=ze(n.to,i.to)||vn(e)-vn(t);return o||t.id-e.id}function Li(e,t){var r=ln&&e.markedSpans,n;if(r)for(var i=void 0,a=0;a<r.length;++a)i=r[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!n||Xr(n,i.marker)<0)&&(n=i.marker);return n}function Ti(e){return Li(e,!0)}function Gr(e){return Li(e,!1)}function Ia(e,t){var r=ln&&e.markedSpans,n;if(r)for(var i=0;i<r.length;++i){var a=r[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!n||Xr(n,a.marker)<0)&&(n=a.marker)}return n}function Qi(e,t,r,n,i){var a=Oe(e,t),o=ln&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var u=o[s];if(!u.marker.collapsed)continue;var d=u.marker.find(0),m=ze(d.from,r)||gr(u.marker)-gr(i),v=ze(d.to,n)||vn(u.marker)-vn(i);if(m>=0&&v<=0||m<=0&&v>=0)continue;if(m<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?ze(d.to,r)>=0:ze(d.to,r)>0)||m>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?ze(d.from,n)<=0:ze(d.from,n)<0))return!0}}function Me(e){for(var t;t=Ti(e);)e=t.find(-1,!0).line;return e}function Ge(e){for(var t;t=Gr(e);)e=t.find(1,!0).line;return e}function Ke(e){for(var t,r;t=Gr(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function rt(e,t){var r=Oe(e,t),n=Me(r);return r==n?t:Ze(n)}function it(e,t){if(t>e.lastLine())return t;var r=Oe(e,t),n;if(!lt(e,r))return t;for(;n=Gr(r);)r=n.find(1,!0).line;return Ze(r)+1}function lt(e,t){var r=ln&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i){if(n=r[i],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&xt(e,t,n))return!0}}function xt(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return xt(e,n.line,Mn(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(i.to==null||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&xt(e,t,i))return!0}function dt(e){e=Me(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var a=r.parent;a;r=a,a=r.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==r)break;t+=s.height}return t}function Ut(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=Ti(n);){var i=r.find(0,!0);n=i.from.line,t+=i.from.ch-i.to.ch}for(n=e;r=Gr(n);){var a=r.find(0,!0);t-=n.text.length-a.from.ch,n=a.to.line,t+=n.text.length-a.to.ch}return t}function hn(e){var t=e.display,r=e.doc;t.maxLine=Oe(r,r.first),t.maxLineLength=Ut(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var i=Ut(n);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var ut=function(e,t,r){this.text=e,Zn(this,t),this.height=r?r(this):1};ut.prototype.lineNo=function(){return Ze(this)},Ne(ut);function _n(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),zr(e),Zn(e,r);var i=n?n(e):1;i!=e.height&&on(e,i)}function Wt(e){e.parent=null,zr(e)}var Rn={},Nn={};function vr(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Nn:Rn;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Ua(e,t){var r=H("span",null,null,w?"padding-right: .1px":null),n={pre:H("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 a=i?t.rest[i-1]:t.line,o=void 0;n.pos=0,n.addToken=ks,un(e.display.measure)&&(o=gt(a,e.doc.direction))&&(n.addToken=Ts(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&Ze(a);Os(a,n,Ir(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=E(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=E(a.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Nt(e.display.measure))),i==0?(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(w){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Qe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=E(n.pre.className,n.textClass||"")),n}function Ss(e){var t=y("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ks(e,t,r,n,i,a,o){if(!t)return;var s=e.splitSpaces?Ls(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,m;if(!u.test(t))e.col+=t.length,m=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,m),R&&T<9&&(d=!0),e.pos+=t.length;else{m=document.createDocumentFragment();for(var v=0;;){u.lastIndex=v;var M=u.exec(t),O=M?M.index-v:t.length-v;if(O){var K=document.createTextNode(s.slice(v,v+O));R&&T<9?m.appendChild(y("span",[K])):m.appendChild(K),e.map.push(e.pos,e.pos+O,K),e.col+=O,e.pos+=O}if(!M)break;v+=O+1;var ee=void 0;if(M[0]==" "){var ue=e.cm.options.tabSize,ve=ue-e.col%ue;ee=m.appendChild(y("span",xe(ve),"cm-tab")),ee.setAttribute("role","presentation"),ee.setAttribute("cm-text"," "),e.col+=ve}else M[0]=="\r"||M[0]==`
|
|
`?(ee=m.appendChild(y("span",M[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ee.setAttribute("cm-text",M[0]),e.col+=1):(ee=e.cm.options.specialCharPlaceholder(M[0]),ee.setAttribute("cm-text",M[0]),R&&T<9?m.appendChild(y("span",[ee])):m.appendChild(ee),e.col+=1);e.map.push(e.pos,e.pos+1,ee),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,r||n||i||d||a||o){var we=r||"";n&&(we+=n),i&&(we+=i);var be=y("span",[m],we,a);if(o)for(var Ce in o)o.hasOwnProperty(Ce)&&Ce!="style"&&Ce!="class"&&be.setAttribute(Ce,o[Ce]);return e.content.appendChild(be)}e.content.appendChild(m)}function Ls(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&r&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),n+=a,r=a==" "}return n}function Ts(e,t){return function(r,n,i,a,o,s,u){i=i?i+" cm-force-border":"cm-force-border";for(var d=r.pos,m=d+n.length;;){for(var v=void 0,M=0;M<t.length&&!(v=t[M],v.to>d&&v.from<=d);M++);if(v.to>=m)return e(r,n,i,a,o,s,u);e(r,n.slice(0,v.to-d),i,a,null,s,u),a=null,n=n.slice(v.to-d),d=v.to}}}function Wa(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 Os(e,t,r){var n=e.markedSpans,i=e.text,a=0;if(!n){for(var o=1;o<r.length;o+=2)t.addToken(t,i.slice(a,a=r[o]),vr(r[o+1],t.cm.options));return}for(var s=i.length,u=0,d=1,m="",v,M,O=0,K,ee,ue,ve,we;;){if(O==u){K=ee=ue=M="",we=null,ve=null,O=Infinity;for(var be=[],Ce=void 0,Pe=0;Pe<n.length;++Pe){var De=n[Pe],Ve=De.marker;if(Ve.type=="bookmark"&&De.from==u&&Ve.widgetNode)be.push(Ve);else if(De.from<=u&&(De.to==null||De.to>u||Ve.collapsed&&De.to==u&&De.from==u)){if(De.to!=null&&De.to!=u&&O>De.to&&(O=De.to,ee=""),Ve.className&&(K+=" "+Ve.className),Ve.css&&(M=(M?M+";":"")+Ve.css),Ve.startStyle&&De.from==u&&(ue+=" "+Ve.startStyle),Ve.endStyle&&De.to==O&&(Ce||(Ce=[])).push(Ve.endStyle,De.to),Ve.title&&((we||(we={})).title=Ve.title),Ve.attributes)for(var at in Ve.attributes)(we||(we={}))[at]=Ve.attributes[at];Ve.collapsed&&(!ve||Xr(ve.marker,Ve)<0)&&(ve=De)}else De.from>u&&O>De.from&&(O=De.from)}if(Ce)for(var _t=0;_t<Ce.length;_t+=2)Ce[_t+1]==O&&(ee+=" "+Ce[_t]);if(!ve||ve.from==u)for(var mt=0;mt<be.length;++mt)Wa(t,0,be[mt]);if(ve&&(ve.from||0)==u){if(Wa(t,(ve.to==null?s+1:ve.to)-u,ve.marker,ve.from==null),ve.to==null)return;ve.to==u&&(ve=!1)}}if(u>=s)break;for(var en=Math.min(s,O);;){if(m){var qt=u+m.length;if(!ve){var Ct=qt>en?m.slice(0,en-u):m;t.addToken(t,Ct,v?v+K:K,ue,u+Ct.length==O?ee:"",M,we)}if(qt>=en){m=m.slice(en-u),u=en;break}u=qt,ue=""}m=i.slice(a,a=r[d++]),v=vr(r[d++],t.cm.options)}}}function Ha(e,t,r){this.line=t,this.rest=Ke(t),this.size=this.rest?Ze(f(this.rest))-r+1:1,this.node=this.text=null,this.hidden=lt(e,t)}function Oi(e,t,r){for(var n=[],i,a=t;a<r;a=i){var o=new Ha(e.doc,Oe(e.doc,a),a);i=a+o.size,n.push(o)}return n}var br=null;function As(e){br?br.ops.push(e):e.ownsGroup=br={ops:[e],delayedCallbacks:[]}}function Ms(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)}function Ds(e,t){var r=e.ownsGroup;if(!r)return;try{Ms(r)}finally{br=null,t(r)}}var Kr=null;function Pt(e,t){var r=Lt(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),i;br?i=br.delayedCallbacks:Kr?i=Kr:(i=Kr=[],setTimeout(_s,0));for(var a=function(s){i.push(function(){return r[s].apply(null,n)})},o=0;o<r.length;++o)a(o)}function _s(){var e=Kr;Kr=null;for(var t=0;t<e.length;++t)e[t]()}function Ba(e,t,r,n){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Ns(e,t):a=="gutter"?Xa(e,t,r,n):a=="class"?$i(e,t):a=="widget"&&Ps(e,t,n)}t.changes=null}function Vr(e){return e.node==e.text&&(e.node=y("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),R&&T<8&&(e.node.style.zIndex=2)),e.node}function Rs(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=Vr(t);t.background=n.insertBefore(y("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function za(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Ua(e,t)}function Ns(e,t){var r=t.text.className,n=za(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,$i(e,t)):r&&(t.text.className=r)}function $i(e,t){Rs(e,t),t.line.wrapClass?Vr(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 Xa(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=Vr(t);t.gutterBackground=y("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 a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=Vr(t),s=t.gutter=y("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),o.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=s.appendChild(y("div",Gn(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var u=0;u<e.display.gutterSpecs.length;++u){var d=e.display.gutterSpecs[u].className,m=a.hasOwnProperty(d)&&a[d];m&&s.appendChild(y("div",[m],"CodeMirror-gutter-elt","left: "+n.gutterLeft[d]+"px; width: "+n.gutterWidth[d]+"px"))}}}function Ps(e,t,r){t.alignable&&(t.alignable=null);for(var n=_e("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);Ga(e,t,r)}function js(e,t,r,n){var i=za(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),$i(e,t),Xa(e,t,r,n),Ga(e,t,n),t.node}function Ga(e,t,r){if(Ka(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Ka(e,t.rest[n],t,r,!1)}function Ka(e,t,r,n,i){if(!t.widgets)return;for(var a=Vr(r),o=0,s=t.widgets;o<s.length;++o){var u=s[o],d=y("div",[u.node],"CodeMirror-linewidget"+(u.className?" "+u.className:""));u.handleMouseEvents||d.setAttribute("cm-ignore-events","true"),Fs(u,d,r,n),e.display.input.setUneditable(d),i&&u.above?a.insertBefore(d,r.gutter||r.text):a.appendChild(d),Pt(u,"redraw")}}function Fs(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 Yr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!g(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;"),ie(t.display.measure,y("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function kn(e,t){for(var r=pt(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ai(e){return e.lineSpace.offsetTop}function ea(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Va(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=ie(e.measure,y("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 bn(e){return Z-e.display.nativeBarWidth}function Qn(e){return e.display.scroller.clientWidth-bn(e)-e.display.barWidth}function ta(e){return e.display.scroller.clientHeight-bn(e)-e.display.barHeight}function Is(e,t,r){var n=e.options.lineWrapping,i=n&&Qn(e);if(!t.measure.heights||n&&t.measure.width!=i){var a=t.measure.heights=[];if(n){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var u=o[s],d=o[s+1];Math.abs(u.bottom-d.bottom)>2&&a.push((u.bottom+d.top)/2-r.top)}}a.push(r.bottom-r.top)}}function Ya(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(Ze(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Us(e,t){t=Me(t);var r=Ze(t),n=e.display.externalMeasured=new Ha(e.doc,t,r);n.lineN=r;var i=n.built=Ua(e,n);return n.text=i.pre,ie(e.display.lineMeasure,i.pre),n}function qa(e,t,r,n){return yn(e,yr(e,t),r,n)}function na(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[tr(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function yr(e,t){var r=Ze(t),n=na(e,r);n&&!n.text?n=null:n&&n.changes&&(Ba(e,n,r,la(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var i=Ya(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function yn(e,t,r,n,i){t.before&&(r=-1);var a=r+(n||""),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Is(e,t.view,t.rect),t.hasHeights=!0),o=Hs(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 Ja={left:0,right:0,top:0,bottom:0};function Za(e,t,r){for(var n,i,a,o,s,u,d=0;d<e.length;d+=3)if(s=e[d],u=e[d+1],t<s?(i=0,a=1,o="left"):t<u?(i=t-s,a=i+1):(d==e.length-3||t==u&&e[d+3]>t)&&(a=u-s,i=a-1,t>=u&&(o="right")),i!=null){if(n=e[d+2],s==u&&r==(n.insertLeft?"left":"right")&&(o=r),r=="left"&&i==0)for(;d&&e[d-2]==e[d-3]&&e[d-1].insertLeft;)n=e[(d-=3)+2],o="left";if(r=="right"&&i==u-s)for(;d<e.length-3&&e[d+3]==e[d+4]&&!e[d+5].insertLeft;)n=e[(d+=3)+2],o="right";break}return{node:n,start:i,end:a,collapse:o,coverStart:s,coverEnd:u}}function Ws(e,t){var r=Ja;if(t=="left")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 Hs(e,t,r,n){var i=Za(t.map,r,n),a=i.node,o=i.start,s=i.end,u=i.collapse,d;if(a.nodeType==3){for(var m=0;m<4;m++){for(;o&&Fe(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+s<i.coverEnd&&Fe(t.line.text.charAt(i.coverStart+s));)++s;if(R&&T<9&&o==0&&s==i.coverEnd-i.coverStart?d=a.parentNode.getBoundingClientRect():d=Ws(D(a,o,s).getClientRects(),n),d.left||d.right||o==0)break;s=o,o=o-1,u="right"}R&&T<11&&(d=Bs(e.display.measure,d))}else{o>0&&(u=n="right");var v;e.options.lineWrapping&&(v=a.getClientRects()).length>1?d=v[n=="right"?v.length-1:0]:d=a.getBoundingClientRect()}if(R&&T<9&&!o&&(!d||!d.left&&!d.right)){var M=a.parentNode.getClientRects()[0];M?d={left:M.left,right:M.left+wr(e.display),top:M.top,bottom:M.bottom}:d=Ja}for(var O=d.top-t.rect.top,K=d.bottom-t.rect.top,ee=(O+K)/2,ue=t.view.measure.heights,ve=0;ve<ue.length-1&&!(ee<ue[ve]);ve++);var we=ve?ue[ve-1]:0,be=ue[ve],Ce={left:(u=="right"?d.right:d.left)-t.rect.left,right:(u=="left"?d.left:d.right)-t.rect.left,top:we,bottom:be};return!d.left&&!d.right&&(Ce.bogus=!0),e.options.singleCursorHeightPerLine||(Ce.rtop=O,Ce.rbottom=K),Ce}function Bs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Et(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}}function Qa(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 $a(e){e.display.externalMeasure=null,je(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Qa(e.display.view[t])}function qr(e){$a(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function eo(){return I&&L?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function to(){return I&&L?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ra(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Yr(e.widgets[r]));return t}function Mi(e,t,r,n,i){if(!i){var a=ra(t);r.top+=a,r.bottom+=a}if(n=="line")return r;n||(n="local");var o=dt(t);if(n=="local"?o+=Ai(e.display):o-=e.display.viewOffset,n=="page"||n=="window"){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(n=="window"?0:to());var u=s.left+(n=="window"?0:eo());r.left+=u,r.right+=u}return r.top+=o,r.bottom+=o,r}function no(e,t,r){if(r=="div")return t;var n=t.left,i=t.top;if(r=="page")n-=eo(),i-=to();else if(r=="local"||!r){var a=e.display.sizer.getBoundingClientRect();n+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:n-o.left,top:i-o.top}}function ia(e,t,r,n,i){return n||(n=Oe(e.doc,t.line)),Mi(e,n,qa(e,n,t.ch,i),r)}function pn(e,t,r,n,i,a){n=n||Oe(e.doc,t.line),i||(i=yr(e,n));function o(K,ee){var ue=yn(e,i,K,ee?"right":"left",a);return ee?ue.left=ue.right:ue.right=ue.left,Mi(e,n,ue,r)}var s=gt(n,e.doc.direction),u=t.ch,d=t.sticky;if(u>=n.text.length?(u=n.text.length,d="before"):u<=0&&(u=0,d="after"),!s)return o(d=="before"?u-1:u,d=="before");function m(K,ee,ue){var ve=s[ee],we=ve.level==1;return o(ue?K-1:K,we!=ue)}var v=ht(s,u,d),M=yt,O=m(u,v,d=="before");return M!=null&&(O.other=m(u,M,d!="before")),O}function ro(e,t){var r=0;t=He(e.doc,t),e.options.lineWrapping||(r=wr(e.display)*t.ch);var n=Oe(e.doc,t.line),i=dt(n)+Ai(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function aa(e,t,r,n,i){var a=ae(e,t,r);return a.xRel=i,n&&(a.outside=n),a}function oa(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return aa(n.first,0,null,-1,-1);var i=En(n,r),a=n.first+n.size-1;if(i>a)return aa(n.first+n.size-1,Oe(n,a).text.length,null,1,1);t<0&&(t=0);for(var o=Oe(n,i);;){var s=zs(e,o,i,t,r),u=Ia(o,s.ch+(s.xRel>0||s.outside>0?1:0));if(!u)return s;var d=u.find(1);if(d.line==i)return d;o=Oe(n,i=d.line)}}function io(e,t,r,n){n-=ra(t);var i=t.text.length,a=et(function(o){return yn(e,r,o-1).bottom<=n},i,0);return i=et(function(o){return yn(e,r,o).top>n},a,i),{begin:a,end:i}}function ao(e,t,r,n){r||(r=yr(e,t));var i=Mi(e,t,yn(e,r,n),"line").top;return io(e,t,r,i)}function sa(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function zs(e,t,r,n,i){i-=dt(t);var a=yr(e,t),o=ra(t),s=0,u=t.text.length,d=!0,m=gt(t,e.doc.direction);if(m){var v=(e.options.lineWrapping?Gs:Xs)(e,t,r,a,m,n,i);d=v.level!=1,s=d?v.from:v.to-1,u=d?v.to:v.from-1}var M=null,O=null,K=et(function(Pe){var De=yn(e,a,Pe);return De.top+=o,De.bottom+=o,sa(De,n,i,!1)?(De.top<=i&&De.left<=n&&(M=Pe,O=De),!0):!1},s,u),ee,ue,ve=!1;if(O){var we=n-O.left<O.right-n,be=we==d;K=M+(be?0:1),ue=be?"after":"before",ee=we?O.left:O.right}else{!d&&(K==u||K==s)&&K++,ue=K==0?"after":K==t.text.length?"before":yn(e,a,K-(d?1:0)).bottom+o<=i==d?"after":"before";var Ce=pn(e,ae(r,K,ue),"line",t,a);ee=Ce.left,ve=i<Ce.top?-1:i>=Ce.bottom?1:0}return K=We(t.text,K,1),aa(r,K,ue,ve,n-ee)}function Xs(e,t,r,n,i,a,o){var s=et(function(v){var M=i[v],O=M.level!=1;return sa(pn(e,ae(r,O?M.to:M.from,O?"before":"after"),"line",t,n),a,o,!0)},0,i.length-1),u=i[s];if(s>0){var d=u.level!=1,m=pn(e,ae(r,d?u.from:u.to,d?"after":"before"),"line",t,n);sa(m,a,o,!0)&&m.top>o&&(u=i[s-1])}return u}function Gs(e,t,r,n,i,a,o){var s=io(e,t,n,o),u=s.begin,d=s.end;/\s/.test(t.text.charAt(d-1))&&d--;for(var m=null,v=null,M=0;M<i.length;M++){var O=i[M];if(O.from>=d||O.to<=u)continue;var K=O.level!=1,ee=yn(e,n,K?Math.min(d,O.to)-1:Math.max(u,O.from)).right,ue=ee<a?a-ee+1e9:ee-a;(!m||v>ue)&&(m=O,v=ue)}return m||(m=i[i.length-1]),m.from<u&&(m={from:u,to:m.to,level:m.level}),m.to>d&&(m={from:m.from,to:d,level:m.level}),m}var $n;function xr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if($n==null){$n=y("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)$n.appendChild(document.createTextNode("x")),$n.appendChild(y("br"));$n.appendChild(document.createTextNode("x"))}ie(e.measure,$n);var r=$n.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),je(e.measure),r||1}function wr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=y("span","xxxxxxxxxx"),r=y("pre",[t],"CodeMirror-line-like");ie(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function la(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;r[s]=a.offsetLeft+a.clientLeft+i,n[s]=a.clientWidth}return{fixedPos:ua(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ua(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function oo(e){var t=xr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/wr(e.display)-3);return function(i){if(lt(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return r?a+(Math.ceil(i.text.length/n)||1)*t:a+t}}function ca(e){var t=e.doc,r=oo(e);t.iter(function(n){var i=r(n);i!=n.height&&on(n,i)})}function er(e,t,r,n){var i=e.display;if(!r&&pt(t).getAttribute("cm-not-content")=="true")return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch(v){return null}var u=oa(e,a,o),d;if(n&&u.xRel>0&&(d=Oe(e.doc,u.line).text).length==u.ch){var m=h(d,d.length,e.options.tabSize)-d.length;u=ae(u.line,Math.max(0,Math.round((a-Va(e.display).left)/wr(e.display))-m))}return u}function tr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Vt(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)ln&&rt(e.doc,t)<i.viewTo&&jn(e);else if(r<=i.viewFrom)ln&&it(e.doc,r+n)>i.viewFrom?jn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)jn(e);else if(t<=i.viewFrom){var a=Di(e,r,r+n,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=n):jn(e)}else if(r>=i.viewTo){var o=Di(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):jn(e)}else{var s=Di(e,t,t,-1),u=Di(e,r,r+n,1);s&&u?(i.view=i.view.slice(0,s.index).concat(Oi(e,s.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=n):jn(e)}var d=i.externalMeasured;d&&(r<d.lineN?d.lineN+=n:t<d.lineN+d.size&&(i.externalMeasured=null))}function Pn(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)return;var a=n.view[tr(e,t)];if(a.node==null)return;var o=a.changes||(a.changes=[]);A(o,r)==-1&&o.push(r)}function jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Di(e,t,r,n){var i=tr(e,t),a,o=e.display.view;if(!ln||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,u=0;u<i;u++)s+=o[u].size;if(s!=t){if(n>0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,r+=a}for(;rt(e.doc,r)!=r;){if(i==(n<0?0:o.length-1))return null;r+=n*o[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function Ks(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Oi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Oi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(tr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Oi(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,tr(e,r)))),n.viewTo=r}function so(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 Jr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function lo(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),a=n.selection=document.createDocumentFragment(),o=0;o<r.sel.ranges.length;o++){if(!t&&o==r.sel.primIndex)continue;var s=r.sel.ranges[o];if(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)continue;var u=s.empty();(u||e.options.showCursorWhenSelecting)&&uo(e,s.head,i),u||Vs(e,s,a)}return n}function uo(e,t,r){var n=pn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(y("div","\xA0","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 a=r.appendChild(y("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=n.other.left+"px",a.style.top=n.other.top+"px",a.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function _i(e,t){return e.top-t.top||e.left-t.left}function Vs(e,t,r){var n=e.display,i=e.doc,a=document.createDocumentFragment(),o=Va(e.display),s=o.left,u=Math.max(n.sizerWidth,Qn(e)-n.sizer.offsetLeft)-o.right,d=i.direction=="ltr";function m(be,Ce,Pe,De){Ce<0&&(Ce=0),Ce=Math.round(Ce),De=Math.round(De),a.appendChild(y("div",null,"CodeMirror-selected","position: absolute; left: "+be+`px;
|
|
top: `+Ce+"px; width: "+(Pe==null?u-be:Pe)+`px;
|
|
height: `+(De-Ce)+"px"))}function v(be,Ce,Pe){var De=Oe(i,be),Ve=De.text.length,at,_t;function mt(Ct,Jt){return ia(e,ae(be,Ct),"div",De,Jt)}function en(Ct,Jt,jt){var Ot=ao(e,De,null,Ct),St=Jt=="ltr"==(jt=="after")?"left":"right",bt=jt=="after"?Ot.begin:Ot.end-(/\s/.test(De.text.charAt(Ot.end-1))?2:1);return mt(bt,St)[St]}var qt=gt(De,i.direction);return ot(qt,Ce||0,Pe==null?Ve:Pe,function(Ct,Jt,jt,Ot){var St=jt=="ltr",bt=mt(Ct,St?"left":"right"),Zt=mt(Jt-1,St?"right":"left"),Nr=Ce==null&&Ct==0,Bn=Pe==null&&Jt==Ve,Bt=Ot==0,xn=!qt||Ot==qt.length-1;if(Zt.top-bt.top<=3){var Rt=(d?Nr:Bn)&&Bt,Pa=(d?Bn:Nr)&&xn,Tn=Rt?s:(St?bt:Zt).left,or=Pa?u:(St?Zt:bt).right;m(Tn,bt.top,or-Tn,bt.bottom)}else{var sr,Gt,Pr,ja;St?(sr=d&&Nr&&Bt?s:bt.left,Gt=d?u:en(Ct,jt,"before"),Pr=d?s:en(Jt,jt,"after"),ja=d&&Bn&&xn?u:Zt.right):(sr=d?en(Ct,jt,"before"):s,Gt=!d&&Nr&&Bt?u:bt.right,Pr=!d&&Bn&&xn?s:Zt.left,ja=d?en(Jt,jt,"after"):u),m(sr,bt.top,Gt-sr,bt.bottom),bt.bottom<Zt.top&&m(s,bt.bottom,null,Zt.top),m(Pr,Zt.top,ja-Pr,Zt.bottom)}(!at||_i(bt,at)<0)&&(at=bt),_i(Zt,at)<0&&(at=Zt),(!_t||_i(bt,_t)<0)&&(_t=bt),_i(Zt,_t)<0&&(_t=Zt)}),{start:at,end:_t}}var M=t.from(),O=t.to();if(M.line==O.line)v(M.line,M.ch,O.ch);else{var K=Oe(i,M.line),ee=Oe(i,O.line),ue=Me(K)==Me(ee),ve=v(M.line,M.ch,ue?K.text.length+1:null).end,we=v(O.line,ue?0:null,O.ch).start;ue&&(ve.top<we.top-2?(m(ve.right,ve.top,null,ve.bottom),m(s,we.top,we.left,we.bottom)):m(ve.right,ve.top,we.left-ve.right,ve.bottom)),ve.bottom<we.top&&m(s,ve.bottom,null,we.top)}r.appendChild(a)}function da(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Er(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function co(e){e.state.focused||(e.display.input.focus(),fa(e))}function fo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Er(e))},100)}function fa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Qe(e,"focus",e,t),e.state.focused=!0,S(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),w&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),da(e)}function Er(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Qe(e,"blur",e,t),e.state.focused=!1,me(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ri(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],a=e.options.lineWrapping,o=void 0,s=0;if(i.hidden)continue;if(R&&T<8){var u=i.node.offsetTop+i.node.offsetHeight;o=u-r,r=u}else{var d=i.node.getBoundingClientRect();o=d.bottom-d.top,!a&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-d.left-1)}var m=i.line.height-o;if((m>.005||m<-.005)&&(on(i.line,o),ho(i.line),i.rest))for(var v=0;v<i.rest.length;v++)ho(i.rest[v]);if(s>e.display.sizerWidth){var M=Math.ceil(s/wr(e.display));M>e.display.maxLineLength&&(e.display.maxLineLength=M,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function ho(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 Ni(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ai(e));var i=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,a=En(t,n),o=En(t,i);if(r&&r.ensure){var s=r.ensure.from.line,u=r.ensure.to.line;s<a?(a=s,o=En(t,dt(Oe(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=o&&(a=En(t,dt(Oe(t,u))-e.wrapper.clientHeight),o=u)}return{from:a,to:Math.max(o,a+1)}}function Ys(e,t){if(Be(e,"scrollCursorIntoView"))return;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),i!=null&&!_){var a=y("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-Ai(e.display))+`px;
|
|
height: `+(t.bottom-t.top+bn(e)+r.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}function qs(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(t=t.ch?ae(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?ae(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,s=pn(e,t),u=!r||r==t?s:pn(e,r);i={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-n,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+n};var d=ha(e,i),m=e.doc.scrollTop,v=e.doc.scrollLeft;if(d.scrollTop!=null&&(Qr(e,d.scrollTop),Math.abs(e.doc.scrollTop-m)>1&&(o=!0)),d.scrollLeft!=null&&(nr(e,d.scrollLeft),Math.abs(e.doc.scrollLeft-v)>1&&(o=!0)),!o)break}return i}function Js(e,t){var r=ha(e,t);r.scrollTop!=null&&Qr(e,r.scrollTop),r.scrollLeft!=null&&nr(e,r.scrollLeft)}function ha(e,t){var r=e.display,n=xr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,a=ta(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+ea(r),u=t.top<n,d=t.bottom>s-n;if(t.top<i)o.scrollTop=u?0:t.top;else if(t.bottom>i+a){var m=Math.min(t.top,(d?s:t.bottom)-a);m!=i&&(o.scrollTop=m)}var v=e.options.fixedGutter?0:r.gutters.offsetWidth,M=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-v,O=Qn(e)-r.gutters.offsetWidth,K=t.right-t.left>O;return K&&(t.right=t.left+O),t.left<10?o.scrollLeft=0:t.left<M?o.scrollLeft=Math.max(0,t.left+v-(K?0:10)):t.right>O+M-3&&(o.scrollLeft=t.right+(K?0:10)-O),o}function pa(e,t){if(t==null)return;Pi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Cr(e){Pi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Zr(e,t,r){(t!=null||r!=null)&&Pi(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Zs(e,t){Pi(e),e.curOp.scrollToPos=t}function Pi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=ro(e,t.from),n=ro(e,t.to);po(e,r,n,t.margin)}}function po(e,t,r,n){var i=ha(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});Zr(e,i.scrollLeft,i.scrollTop)}function Qr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;V||ga(e,{top:t}),mo(e,t,!0),V&&ga(e),ti(e,100)}function mo(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function nr(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function $r(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+ea(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+bn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var rr=function(e,t,r){this.cm=r;var n=this.vert=y("div",[y("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=y("div",[y("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),Le(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Le(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,R&&T<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};rr.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 a=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},rr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},rr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},rr.prototype.zeroWidthHack=function(){var e=J&&!q?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new C,this.disableVert=new C},rr.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var i=e.getBoundingClientRect(),a=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},rr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ei=function(){};ei.prototype.update=function(){return{bottom:0,right:0}},ei.prototype.setScrollLeft=function(){},ei.prototype.setScrollTop=function(){},ei.prototype.clear=function(){};function Sr(e,t){t||(t=$r(e));var r=e.display.barWidth,n=e.display.barHeight;go(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Ri(e),go(e,$r(e)),r=e.display.barWidth,n=e.display.barHeight}function go(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=""}var vo={native:rr,null:ei};function bo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&me(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new vo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Le(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?nr(e,t):Qr(e,t)},e),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function ir(e){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:++Qs},As(e.curOp)}function ar(e){var t=e.curOp;t&&Ds(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;$s(r)})}function $s(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var n=0;n<t.length;n++)tl(t[n]);for(var i=0;i<t.length;i++)nl(t[i]);for(var a=0;a<t.length;a++)rl(t[a]);for(var o=0;o<t.length;o++)il(t[o])}function el(e){var t=e.cm,r=t.display;ol(t),e.updateMaxLine&&hn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ji(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ma(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Ri(t),e.barMeasure=$r(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=qa(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+bn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Qn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&nr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Sr(t,e.barMeasure),e.updatedDisplay&&ba(t,e.barMeasure),e.selectionChanged&&da(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&co(e.cm)}function il(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&yo(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&mo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&nr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=qs(t,He(n,e.scrollToPos.from),He(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var s=0;s<a.length;++s)a[s].lines.length||Qe(a[s],"hide");if(o)for(var u=0;u<o.length;++u)o[u].lines.length&&Qe(o[u],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Qe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function $t(e,t){if(e.curOp)return t();ir(e);try{return t()}finally{ar(e)}}function Mt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ir(e);try{return t.apply(e,arguments)}finally{ar(e)}}}function Xt(e){return function(){if(this.curOp)return e.apply(this,arguments);ir(this);try{return e.apply(this,arguments)}finally{ar(this)}}}function Dt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ir(t);try{return e.apply(this,arguments)}finally{ar(t)}}}function ti(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,c(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=Qt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(n.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?an(t.mode,n.state):null,u=yi(e,a,n,!0);s&&(n.state=s),a.styles=u.styles;var d=a.styleClasses,m=u.classes;m?a.styleClasses=m:d&&(a.styleClasses=null);for(var v=!o||o.length!=a.styles.length||d!=m&&(!d||!m||d.bgClass!=m.bgClass||d.textClass!=m.textClass),M=0;!v&&M<o.length;++M)v=o[M]!=a.styles[M];v&&i.push(n.line),a.stateAfter=n.save(),n.nextLine()}else a.text.length<=e.options.maxHighlightLength&&hr(e,a.text,n),a.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ti(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&$t(e,function(){for(var a=0;a<i.length;a++)Pn(e,i[a],"text")})}var ji=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Ni(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Qn(e),this.force=r,this.dims=la(e),this.events=[]};ji.prototype.signal=function(e,t){Te(e,t)&&this.events.push(arguments)},ji.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Qe.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=bn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=bn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=B();if(!t||!g(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&g(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==B())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&g(document.body,e.anchorNode)&&g(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)}}function ma(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return jn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&so(e)==0)return!1;wo(e)&&(jn(e),t.dims=la(e));var i=n.first+n.size,a=Math.max(t.visible.from-e.options.viewportMargin,n.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<a&&a-r.viewFrom<20&&(a=Math.max(n.first,r.viewFrom)),r.viewTo>o&&r.viewTo-o<20&&(o=Math.min(i,r.viewTo)),ln&&(a=rt(e.doc,a),o=it(e.doc,o));var s=a!=r.viewFrom||o!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Ks(e,a,o),r.viewOffset=dt(Oe(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=so(e);if(!s&&u==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var d=sl(e);return u>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(d),je(r.cursorDiv),je(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ti(e,400)),r.updateLineNumbers=null,!0}function yo(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Qn(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+ea(e.display)-ta(e),r.top)}),t.visible=Ni(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Ni(e.display,e.doc,r));if(!ma(e,t))break;Ri(e);var i=$r(e);Jr(e),Sr(e,i),ba(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 ga(e,t){var r=new ji(e,t);if(ma(e,r)){Ri(e),yo(e,r);var n=$r(e);Jr(e),Sr(e,n),ba(e,n),r.finish()}}function ul(e,t,r){var n=e.display,i=e.options.lineNumbers,a=n.lineDiv,o=a.firstChild;function s(K){var ee=K.nextSibling;return w&&J&&e.display.currentWheelTarget==K?K.style.display="none":K.parentNode.removeChild(K),ee}for(var u=n.view,d=n.viewFrom,m=0;m<u.length;m++){var v=u[m];if(!v.hidden)if(!v.node||v.node.parentNode!=a){var M=js(e,v,d,r);a.insertBefore(M,o)}else{for(;o!=v.node;)o=s(o);var O=i&&t!=null&&t<=d&&v.lineNumber;v.changes&&(A(v.changes,"gutter")>-1&&(O=!1),Ba(e,v,d,r)),O&&(je(v.lineNumber),v.lineNumber.appendChild(document.createTextNode(Gn(e.options,d)))),o=v.node.nextSibling}d+=v.size}for(;o;)o=s(o)}function va(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ba(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+bn(e)+"px"}function xo(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=ua(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=n+"px",o=0;o<r.length;o++)if(!r[o].hidden){e.options.fixedGutter&&(r[o].gutter&&(r[o].gutter.style.left=a),r[o].gutterBackground&&(r[o].gutterBackground.style.left=a));var s=r[o].alignable;if(s)for(var u=0;u<s.length;u++)s[u].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}function wo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Gn(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(y("div",[y("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(a,n.lineGutter.offsetWidth-o)+1,n.lineNumWidth=n.lineNumInnerWidth+o,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",va(e.display),!0}return!1}function ya(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!="string"&&(o=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:a,style:o})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function Eo(e){var t=e.gutters,r=e.gutterSpecs;je(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],a=i.className,o=i.style,s=t.appendChild(y("div",null,"CodeMirror-gutter "+a));o&&(s.style.cssText=o),a=="CodeMirror-linenumbers"&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",va(e)}function ni(e){Eo(e.display),Vt(e),xo(e)}function cl(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=y("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=y("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=H("div",null,"CodeMirror-code"),i.selectionDiv=y("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=y("div",null,"CodeMirror-cursors"),i.measure=y("div",null,"CodeMirror-measure"),i.lineMeasure=y("div",null,"CodeMirror-measure"),i.lineSpace=H("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=H("div",[i.lineSpace],"CodeMirror-lines");i.mover=y("div",[a],null,"position: relative"),i.sizer=y("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=y("div",null,null,"position: absolute; height: "+Z+"px; width: 1px;"),i.gutters=y("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=y("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=y("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),R&&T<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!w&&!(V&&G)&&(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=ya(n.gutters,n.lineNumbers),Eo(i),r.init(i)}var Fi=0,nn=null;R?nn=-.53:V?nn=15:I?nn=-.7:he&&(nn=-1/3);function Co(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function dl(e){var t=Co(e);return t.x*=nn,t.y*=nn,t}function So(e,t){var r=Co(t),n=r.x,i=r.y,a=e.display,o=a.scroller,s=o.scrollWidth>o.clientWidth,u=o.scrollHeight>o.clientHeight;if(!(n&&s||i&&u))return;if(i&&J&&w){e:for(var d=t.target,m=a.view;d!=o;d=d.parentNode)for(var v=0;v<m.length;v++)if(m[v].node==d){e.display.currentWheelTarget=d;break e}}if(n&&!V&&!U&&nn!=null){i&&u&&Qr(e,Math.max(0,o.scrollTop+i*nn)),nr(e,Math.max(0,o.scrollLeft+n*nn)),(!i||i&&u)&&Ae(t),a.wheelStartX=null;return}if(i&&nn!=null){var M=i*nn,O=e.doc.scrollTop,K=O+a.wrapper.clientHeight;M<0?O=Math.max(0,O+M-50):K=Math.min(e.doc.height,K+M+50),ga(e,{top:O,bottom:K})}Fi<20&&(a.wheelStartX==null?(a.wheelStartX=o.scrollLeft,a.wheelStartY=o.scrollTop,a.wheelDX=n,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX==null)return;var ee=o.scrollLeft-a.wheelStartX,ue=o.scrollTop-a.wheelStartY,ve=ue&&a.wheelDY&&ue/a.wheelDY||ee&&a.wheelDX&&ee/a.wheelDX;if(a.wheelStartX=a.wheelStartY=null,!ve)return;nn=(nn*Fi+ve)/(Fi+1),++Fi},200)):(a.wheelDX+=n,a.wheelDY+=i))}var rn=function(e,t){this.ranges=e,this.primIndex=t};rn.prototype.primary=function(){return this.ranges[this.primIndex]},rn.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(!fe(r.anchor,n.anchor)||!fe(r.head,n.head))return!1}return!0},rn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new $e(jr(this.ranges[t].anchor),jr(this.ranges[t].head));return new rn(e,this.primIndex)},rn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},rn.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(ze(t,n.from())>=0&&ze(e,n.to())<=0)return r}return-1};var $e=function(e,t){this.anchor=e,this.head=t};$e.prototype.from=function(){return Kn(this.anchor,this.head)},$e.prototype.to=function(){return fr(this.anchor,this.head)},$e.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function mn(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(M,O){return ze(M.from(),O.from())}),r=A(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],u=ze(s.to(),o.from());if(n&&!o.empty()?u>0:u>=0){var d=Kn(s.from(),o.from()),m=fr(s.to(),o.to()),v=s.empty()?o.from()==o.head:s.from()==s.head;a<=r&&--r,t.splice(--a,2,new $e(v?m:d,v?d:m))}}return new rn(t,r)}function Fn(e,t){return new rn([new $e(e,t||e)],0)}function In(e){return e.text?ae(e.from.line+e.text.length-1,f(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ko(e,t){if(ze(e,t.from)<0)return e;if(ze(e,t.to)<=0)return In(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+=In(t).ch-t.to.ch),ae(r,n)}function xa(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new $e(ko(i.anchor,t),ko(i.head,t)))}return mn(e.cm,r,e.sel.primIndex)}function Lo(e,t,r){return e.line==t.line?ae(r.line,e.ch-t.ch+r.ch):ae(r.line+(e.line-t.line),e.ch)}function fl(e,t,r){for(var n=[],i=ae(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],u=Lo(s.from,i,a),d=Lo(In(s),i,a);if(i=s.to,a=d,r=="around"){var m=e.sel.ranges[o],v=ze(m.head,m.anchor)<0;n[o]=new $e(v?d:u,v?u:d)}else n[o]=new $e(u,u)}return new rn(n,e.sel.primIndex)}function wa(e){e.doc.mode=ur(e.options,e.doc.modeOption),ri(e)}function ri(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&Vt(e)}function To(e,t){return t.from.ch==0&&t.to.ch==0&&f(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ea(e,t,r,n){function i(we){return r?r[we]:null}function a(we,be,Ce){_n(we,be,Ce,n),Pt(we,"change",we,t)}function o(we,be){for(var Ce=[],Pe=we;Pe<be;++Pe)Ce.push(new ut(d[Pe],i(Pe),n));return Ce}var s=t.from,u=t.to,d=t.text,m=Oe(e,s.line),v=Oe(e,u.line),M=f(d),O=i(d.length-1),K=u.line-s.line;if(t.full)e.insert(0,o(0,d.length)),e.remove(d.length,e.size-d.length);else if(To(e,t)){var ee=o(0,d.length-1);a(v,v.text,O),K&&e.remove(s.line,K),ee.length&&e.insert(s.line,ee)}else if(m==v)if(d.length==1)a(m,m.text.slice(0,s.ch)+M+m.text.slice(u.ch),O);else{var ue=o(1,d.length-1);ue.push(new ut(M+m.text.slice(u.ch),O,n)),a(m,m.text.slice(0,s.ch)+d[0],i(0)),e.insert(s.line+1,ue)}else if(d.length==1)a(m,m.text.slice(0,s.ch)+d[0]+v.text.slice(u.ch),i(0)),e.remove(s.line+1,K);else{a(m,m.text.slice(0,s.ch)+d[0],i(0)),a(v,M+v.text.slice(u.ch),O);var ve=o(1,d.length-1);K>1&&e.remove(s.line+1,K-1),e.insert(s.line+1,ve)}Pt(e,"change",e,t)}function Un(e,t,r){function n(i,a,o){if(i.linked)for(var s=0;s<i.linked.length;++s){var u=i.linked[s];if(u.doc==a)continue;var d=o&&u.sharedHist;if(r&&!d)continue;t(u.doc,d),n(u.doc,i,d)}}n(e,null,!0)}function Oo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ca(e),wa(e),Ao(e),e.options.lineWrapping||hn(e),e.options.mode=t.modeOption,Vt(e)}function Ao(e){(e.doc.direction=="rtl"?S:me)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){$t(e,function(){Ao(e),Vt(e)})}function Ii(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ca(e,t){var r={from:jr(t.from),to:In(t),text:wn(e,t.from,t.to)};return _o(e,r,t.from.line,t.to.line+1),Un(e,function(n){return _o(n,r,t.from.line,t.to.line+1)},!0),r}function Mo(e){for(;e.length;){var t=f(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Mo(e.done),f(e.done);if(e.done.length&&!f(e.done).ranges)return f(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),f(e.done)}function Do(e,t,r,n){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=pl(i,i.lastOp==n)))s=f(o.changes),ze(t.from,t.to)==0&&ze(t.from,s.to)==0?s.to=In(t):o.changes.push(Ca(e,t));else{var u=f(i.done);for((!u||!u.ranges)&&Ui(e.sel,i.done),o={changes:[Ca(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=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||Qe(e,"historyAdded")}function ml(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)}function gl(e,t,r,n){var i=e.history,a=n&&n.origin;r==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||ml(e,a,f(i.done),t))?i.done[i.done.length-1]=t:Ui(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=r,n&&n.clearRedo!==!1&&Mo(i.undone)}function Ui(e,t){var r=f(t);r&&r.ranges&&r.equals(e)||t.push(e)}function _o(e,t,r,n){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(o){o.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=o.markedSpans),++a})}function vl(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 bl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(vl(r[i]));return n}function Ro(e,t){var r=bl(e,t),n=Dn(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var a=r[i],o=n[i];if(a&&o){e:for(var s=0;s<o.length;++s){for(var u=o[s],d=0;d<a.length;++d)if(a[d].marker==u.marker)continue e;a.push(u)}}else o&&(r[i]=o)}return r}function kr(e,t,r){for(var n=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){n.push(r?rn.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];n.push({changes:s});for(var u=0;u<o.length;++u){var d=o[u],m=void 0;if(s.push({from:d.from,to:d.to,text:d.text}),t)for(var v in d)(m=v.match(/^spans_(\d+)$/))&&(A(t,Number(m[1]))>-1&&(f(s)[v]=d[v],delete d[v]))}}return n}function Sa(e,t,r,n){if(n){var i=e.anchor;if(r){var a=ze(t,i)<0;a!=ze(r,i)<0?(i=t,t=r):a!=ze(t,r)<0&&(t=r)}return new $e(i,t)}else return new $e(r||t,t)}function Wi(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ht(e,new rn([Sa(e.sel.primary(),t,r,i)],0),n)}function No(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)n[a]=Sa(e.sel.ranges[a],t[a],null,i);var o=mn(e.cm,n,e.sel.primIndex);Ht(e,o,r)}function ka(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Ht(e,mn(e.cm,i,e.sel.primIndex),n)}function Po(e,t,r,n){Ht(e,Fn(t,r),n)}function yl(e,t,r){var n={ranges:t.ranges,update:function(i){this.ranges=[];for(var a=0;a<i.length;a++)this.ranges[a]=new $e(He(e,i[a].anchor),He(e,i[a].head))},origin:r&&r.origin};return Qe(e,"beforeSelectionChange",e,n),e.cm&&Qe(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?mn(e.cm,n.ranges,n.ranges.length-1):t}function jo(e,t,r){var n=e.history.done,i=f(n);i&&i.ranges?(n[n.length-1]=t,Hi(e,t,r)):Ht(e,t,r)}function Ht(e,t,r){Hi(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Hi(e,t,r){(Te(e,"beforeSelectionChange")||e.cm&&Te(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,r));var n=r&&r.bias||(ze(t.primary().head,e.sel.primary().head)<0?-1:1);Fo(e,Uo(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&Cr(e.cm)}function Fo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,se(e.cm)),Pt(e,"cursorActivity",e)}function Io(e){Fo(e,Uo(e,e.sel,null,!1))}function Uo(e,t,r,n){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],u=Bi(e,o.anchor,s&&s.anchor,r,n),d=Bi(e,o.head,s&&s.head,r,n);(i||u!=o.anchor||d!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new $e(u,d))}return i?mn(e.cm,i,t.primIndex):t}function Lr(e,t,r,n,i){var a=Oe(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],u=s.marker,d="selectLeft"in u?!u.selectLeft:u.inclusiveLeft,m="selectRight"in u?!u.selectRight:u.inclusiveRight;if((s.from==null||(d?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(m?s.to>=t.ch:s.to>t.ch))){if(i&&(Qe(u,"beforeCursorEnter"),u.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!u.atomic)continue;if(r){var v=u.find(n<0?1:-1),M=void 0;if((n<0?m:d)&&(v=Wo(e,v,-n,v&&v.line==t.line?a:null)),v&&v.line==t.line&&(M=ze(v,r))&&(n<0?M<0:M>0))return Lr(e,v,t,n,i)}var O=u.find(n<0?-1:1);return(n<0?d:m)&&(O=Wo(e,O,n,O.line==t.line?a:null)),O?Lr(e,O,t,n,i):null}}return t}function Bi(e,t,r,n,i){var a=n||1,o=Lr(e,t,r,a,i)||!i&&Lr(e,t,r,a,!0)||Lr(e,t,r,-a,i)||!i&&Lr(e,t,r,-a,!0);return o||(e.cantEdit=!0,ae(e.first,0))}function Wo(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?He(e,ae(t.line-1)):null:r>0&&t.ch==(n||Oe(e,t.line)).text.length?t.line<e.first+e.size-1?ae(t.line+1,0):null:new ae(t.line,t.ch+r)}function Ho(e){e.setSelection(ae(e.firstLine(),0),ae(e.lastLine()),X)}function Bo(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(i,a,o,s){i&&(n.from=He(e,i)),a&&(n.to=He(e,a)),o&&(n.text=o),s!==void 0&&(n.origin=s)}),Qe(e,"beforeChange",e,n),e.cm&&Qe(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 Tr(e,t,r){if(e.cm){if(!e.cm.curOp)return Mt(e.cm,Tr)(e,t,r);if(e.cm.state.suppressEdits)return}if((Te(e,"beforeChange")||e.cm&&Te(e.cm,"beforeChange"))&&(t=Bo(e,t,!0),!t))return;var n=Ei&&!r&&ki(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)zo(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else zo(e,t)}function zo(e,t){if(t.text.length==1&&t.text[0]==""&&ze(t.from,t.to)==0)return;var r=xa(e,t);Do(e,t,r,e.cm?e.cm.curOp.id:NaN),ii(e,t,r,Dn(e,t));var n=[];Un(e,function(i,a){!a&&A(n,i.history)==-1&&(Vo(i.history,t),n.push(i.history)),ii(i,t,null,Dn(i,t))})}function zi(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var i=e.history,a,o=e.sel,s=t=="undo"?i.done:i.undone,u=t=="undo"?i.undone:i.done,d=0;d<s.length&&!(a=s[d],r?a.ranges&&!a.equals(e.sel):!a.ranges);d++);if(d==s.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Ui(a,u),r&&!a.equals(e.sel)){Ht(e,a,{clearRedo:!1});return}o=a}else if(n){s.push(a);return}else break;var m=[];Ui(o,u),u.push({changes:m,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var v=Te(e,"beforeChange")||e.cm&&Te(e.cm,"beforeChange"),M=function(ee){var ue=a.changes[ee];if(ue.origin=t,v&&!Bo(e,ue,!1))return s.length=0,{};m.push(Ca(e,ue));var ve=ee?xa(e,ue):f(s);ii(e,ue,ve,Ro(e,ue)),!ee&&e.cm&&e.cm.scrollIntoView({from:ue.from,to:In(ue)});var we=[];Un(e,function(be,Ce){!Ce&&A(we,be.history)==-1&&(Vo(be.history,ue),we.push(be.history)),ii(be,ue,null,Ro(be,ue))})},O=a.changes.length-1;O>=0;--O){var K=M(O);if(K)return K.v}}function Xo(e,t){if(t==0)return;if(e.first+=t,e.sel=new rn(b(e.sel.ranges,function(i){return new $e(ae(i.anchor.line+t,i.anchor.ch),ae(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){Vt(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Pn(e.cm,n,"gutter")}}function ii(e,t,r,n){if(e.cm&&!e.cm.curOp)return Mt(e.cm,ii)(e,t,r,n);if(t.to.line<e.first){Xo(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Xo(e,i),t={from:ae(e.first,0),to:ae(t.to.line+i,t.to.ch),text:[f(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:ae(a,Oe(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=wn(e,t.from,t.to),r||(r=xa(e,t)),e.cm?xl(e.cm,t,n):Ea(e,t,n),Hi(e,r,X),e.cantEdit&&Bi(e,ae(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,r){var n=e.doc,i=e.display,a=t.from,o=t.to,s=!1,u=a.line;e.options.lineWrapping||(u=Ze(Me(Oe(n,a.line))),n.iter(u,o.line+1,function(O){if(O==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&se(e),Ea(n,t,r,oo(e)),e.options.lineWrapping||(n.iter(u,a.line+t.text.length,function(O){var K=Ut(O);K>i.maxLineLength&&(i.maxLine=O,i.maxLineLength=K,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),Wr(n,a.line),ti(e,400);var d=t.text.length-(o.line-a.line)-1;t.full?Vt(e):a.line==o.line&&t.text.length==1&&!To(e.doc,t)?Pn(e,a.line,"text"):Vt(e,a.line,o.line+1,d);var m=Te(e,"changes"),v=Te(e,"change");if(v||m){var M={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};v&&Pt(e,"change",e,M),m&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(M)}e.display.selForContextMenu=null}function Or(e,t,r,n,i){var a;n||(n=r),ze(n,r)<0&&(a=[n,r],r=a[0],n=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Tr(e,{from:r,to:n,text:t,origin:i})}function Go(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 a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)Go(a.ranges[s].anchor,t,r,n),Go(a.ranges[s].head,t,r,n);continue}for(var u=0;u<a.changes.length;++u){var d=a.changes[u];if(r<d.from.line)d.from=ae(d.from.line+n,d.from.ch),d.to=ae(d.to.line+n,d.to.ch);else if(t<=d.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function Vo(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 ai(e,t,r,n){var i=t,a=t;return typeof t=="number"?a=Oe(e,Vn(e,t)):i=Ze(t),i==null?null:(n(a,i)&&e.cm&&Pn(e.cm,i,r),a)}function oi(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}oi.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,Wt(i),Pt(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}};function si(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}si.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var a=Math.min(t,i-e),o=n.height;if(n.removeInner(e,a),this.height-=o-n.height,i==a&&(this.children.splice(r--,1),n.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof oi))){var s=[];this.collapse(s),this.children=[new oi(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){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var u=new oi(i.lines.slice(s,s+=25));i.height-=u.height,this.children.splice(++n,0,u),u.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new si(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=A(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new si(e.children);n.parent=e,e.children=[n,r],e=n}r.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],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,r))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var li=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};li.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Ze(r);if(n==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var a=Yr(this);on(r,Math.max(0,r.height-a)),e&&($t(e,function(){Yo(e,r,-a),Pn(e,n,"widget")}),Pt(e,"lineWidgetCleared",e,this,n))},li.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Yr(this)-t;if(!i)return;lt(this.doc,n)||on(n,n.height+i),r&&$t(r,function(){r.curOp.forceUpdate=!0,Yo(r,n,i),Pt(r,"lineWidgetChanged",r,e,Ze(n))})},Ne(li);function Yo(e,t,r){dt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&pa(e,r)}function wl(e,t,r,n){var i=new li(e,r,n),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ai(e,t,"widget",function(o){var s=o.widgets||(o.widgets=[]);if(i.insertAt==null?s.push(i):s.splice(Math.min(s.length-1,Math.max(0,i.insertAt)),0,i),i.line=o,a&&!lt(e,o)){var u=dt(o)<e.scrollTop;on(o,o.height+Yr(i)),u&&pa(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Pt(a,"lineWidgetAdded",a,i,typeof t=="number"?t:Ze(t)),i}var qo=0,Wn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++qo};Wn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&ir(e),Te(this,"clear")){var r=this.find();r&&Pt(this,"clear",r.from,r.to)}for(var n=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Mn(o.markedSpans,this);e&&!this.collapsed?Pn(e,Ze(o),"text"):e&&(s.to!=null&&(i=Ze(o)),s.from!=null&&(n=Ze(o))),o.markedSpans=Fa(o.markedSpans,s),s.from==null&&this.collapsed&&!lt(this.doc,o)&&e&&on(o,xr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var d=Me(this.lines[u]),m=Ut(d);m>e.display.maxLineLength&&(e.display.maxLine=d,e.display.maxLineLength=m,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Vt(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Io(e.doc)),e&&Pt(e,"markerCleared",e,this,n,i),t&&ar(e),this.parent&&this.parent.clear()},Wn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Mn(a.markedSpans,this);if(o.from!=null&&(r=ae(t?a:Ze(a),o.from),e==-1))return r;if(o.to!=null&&(n=ae(t?a:Ze(a),o.to),e==1))return n}return r&&{from:r,to:n}},Wn.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;$t(n,function(){var i=t.line,a=Ze(t.line),o=na(n,a);if(o&&(Qa(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!lt(r.doc,i)&&r.height!=null){var s=r.height;r.height=null;var u=Yr(r)-s;u&&on(i,i.height+u)}Pt(n,"markerChanged",n,e)})},Wn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||A(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Wn.prototype.detachLine=function(e){if(this.lines.splice(A(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ne(Wn);function Ar(e,t,r,n,i){if(n&&n.shared)return El(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Mt(e.cm,Ar)(e,t,r,n,i);var a=new Wn(e,i),o=ze(t,r);if(n&&l(n,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=H("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Qi(e,t.line,t,r,a)||t.line!=r.line&&Qi(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Si()}a.addToHistory&&Do(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s=t.line,u=e.cm,d;if(e.iter(s,r.line+1,function(v){u&&a.collapsed&&!u.options.lineWrapping&&Me(v)==u.display.maxLine&&(d=!0),a.collapsed&&s!=t.line&&on(v,0),Hr(v,new mr(a,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),a.collapsed&&e.iter(t.line,r.line+1,function(v){lt(e,v)&&on(v,0)}),a.clearOnEnter&&Le(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(Ci(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++qo,a.atomic=!0),u){if(d&&(u.curOp.updateMaxLine=!0),a.collapsed)Vt(u,t.line,r.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var m=t.line;m<=r.line;m++)Pn(u,m,"text");a.atomic&&Io(u.doc),Pt(u,"markerAdded",u,a)}return a}var ui=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};ui.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Pt(this,"clear")},ui.prototype.find=function(e,t){return this.primary.find(e,t)},Ne(ui);function El(e,t,r,n,i){n=l(n),n.shared=!1;var a=[Ar(e,t,r,n,i)],o=a[0],s=n.widgetNode;return Un(e,function(u){s&&(n.widgetNode=s.cloneNode(!0)),a.push(Ar(u,He(u,t),He(u,r),n,i));for(var d=0;d<u.linked.length;++d)if(u.linked[d].isParent)return;o=f(a)}),new ui(a,o)}function Jo(e){return e.findMarks(ae(e.first,0),e.clipPos(ae(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(ze(a,o)){var s=Ar(e,a,o,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function Sl(e){for(var t=function(n){var i=e[n],a=[i.primary.doc];Un(i.primary.doc,function(u){return a.push(u)});for(var o=0;o<i.markers.length;o++){var s=i.markers[o];A(a,s.doc)==-1&&(s.parent=null,i.markers.splice(o--,1))}},r=0;r<e.length;r++)t(r)}var kl=0,Yt=function(e,t,r,n,i){if(!(this instanceof Yt))return new Yt(e,t,r,n,i);r==null&&(r=0),si.call(this,[new oi([new ut("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=ae(r,0);this.sel=Fn(a),this.history=new Ii(null),this.id=++kl,this.modeOption=t,this.lineSep=n,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ea(this,{from:a,to:a,text:e}),Ht(this,Fn(a),X)};Yt.prototype=Q(si.prototype,{constructor:Yt,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=dr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Dt(function(e){var t=ae(this.first,0),r=this.first+this.size-1;Tr(this,{from:t,to:ae(r,Oe(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Zr(this.cm,0,0),Ht(this,Fn(t),X)}),replaceRange:function(e,t,r,n){t=He(this,t),r=r?He(this,r):t,Or(this,e,t,r,n)},getRange:function(e,t,r){var n=wn(this,He(this,e),He(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(An(this,e))return Oe(this,e)},getLineNumber:function(e){return Ze(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Oe(this,e)),Me(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return He(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Dt(function(e,t,r){Po(this,He(this,typeof e=="number"?ae(e,t||0):e),null,r)}),setSelection:Dt(function(e,t,r){Po(this,He(this,e),He(this,t||e),r)}),extendSelection:Dt(function(e,t,r){Wi(this,He(this,e),t&&He(this,t),r)}),extendSelections:Dt(function(e,t){No(this,Fr(this,e),t)}),extendSelectionsBy:Dt(function(e,t){var r=b(this.sel.ranges,e);No(this,Fr(this,r),t)}),setSelections:Dt(function(e,t,r){if(!e.length)return;for(var n=[],i=0;i<e.length;i++)n[i]=new $e(He(this,e[i].anchor),He(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ht(this,mn(this.cm,n,t),r)}),addSelection:Dt(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new $e(He(this,e),He(this,t||e))),Ht(this,mn(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var i=wn(this,t[n].from(),t[n].to());r=r?r.concat(i):i}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=wn(this,r[n].from(),r[n].to());e!==!1&&(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:Dt(function(e,t,r){for(var n=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];n[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:r}}for(var s=t&&t!="end"&&fl(this,n,t),u=n.length-1;u>=0;u--)Tr(this,n[u]);s?jo(this,s):this.cm&&Cr(this.cm)}),undo:Dt(function(){zi(this,"undo")}),redo:Dt(function(){zi(this,"redo")}),undoSelection:Dt(function(){zi(this,"undo",!0)}),redoSelection:Dt(function(){zi(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(){var e=this;this.history=new Ii(this.history.maxGeneration),Un(this,function(t){return t.history=e.history},!0)},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:kr(this.history.done),undone:kr(this.history.undone)}},setHistory:function(e){var t=this.history=new Ii(this.history.maxGeneration);t.done=kr(e.done.slice(0),null,!0),t.undone=kr(e.undone.slice(0),null,!0)},setGutterMarker:Dt(function(e,t,r){return ai(this,e,"gutter",function(n){var i=n.gutterMarkers||(n.gutterMarkers={});return i[t]=r,!r&&Ue(i)&&(n.gutterMarkers=null),!0})}),clearGutter:Dt(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&ai(t,r,"gutter",function(){return r.gutterMarkers[e]=null,Ue(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!An(this,e))return null;if(t=e,e=Oe(this,e),!e)return null}else if(t=Ze(e),t==null)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:Dt(function(e,t,r){return ai(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[i])n[i]=r;else{if(_e(r).test(n[i]))return!1;n[i]+=" "+r}return!0})}),removeLineClass:Dt(function(e,t,r){return ai(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=n[i];if(a)if(r==null)n[i]=null;else{var o=a.match(_e(r));if(!o)return!1;var s=o.index+o[0].length;n[i]=a.slice(0,o.index)+(!o.index||s==a.length?"":" ")+a.slice(s)||null}else return!1;return!0})}),addLineWidget:Dt(function(e,t,r){return wl(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Ar(this,He(this,e),He(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=He(this,e),Ar(this,e,e,r,"bookmark")},findMarksAt:function(e){e=He(this,e);var t=[],r=Oe(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=He(this,e),t=He(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var u=o[s];!(u.to!=null&&i==e.line&&e.ch>=u.to||u.from==null&&i!=e.line||u.from!=null&&i==t.line&&u.from>=t.ch)&&(!r||r(u.marker))&&n.push(u.marker.parent||u.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)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+n;if(a>e)return t=e,!0;e-=a,++r}),He(this,ae(r,t))},indexFromPos:function(e){e=He(this,e);var t=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(n){t+=n.text.length+r}),t},copy:function(e){var t=new Yt(dr(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;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new Yt(dr(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}],Cl(n,Jo(this)),n},unlinkDoc:function(e){if(e instanceof ft&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(Jo(this));break}if(e.history==this.history){var n=[e.id];Un(e,function(i){return n.push(i.id)},!0),e.history=new Ii(null),e.history.done=kr(this.history.done,n),e.history.undone=kr(this.history.undone,n)}},iterLinkedDocs:function(e){Un(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ft(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Dt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),Yt.prototype.eachLine=Yt.prototype.iter;var Zo=0;function Ll(e){var t=this;if(Qo(t),Be(t,e)||kn(t.display,e))return;Ae(e),R&&(Zo=+new Date);var r=er(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,a=Array(i),o=0,s=function(){++o==i&&Mt(t,function(){r=He(t.doc,r);var O={from:r,to:r,text:t.doc.splitLines(a.filter(function(K){return K!=null}).join(t.doc.lineSeparator())),origin:"paste"};Tr(t.doc,O),jo(t.doc,Fn(He(t.doc,r),He(t.doc,In(O))))})()},u=function(O,K){if(t.options.allowDropFileTypes&&A(t.options.allowDropFileTypes,O.type)==-1){s();return}var ee=new FileReader;ee.onerror=function(){return s()},ee.onload=function(){var ue=ee.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ue)){s();return}a[K]=ue,s()},ee.readAsText(O)},d=0;d<n.length;d++)u(n[d],d);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var m=e.dataTransfer.getData("Text");if(m){var v;if(t.state.draggingText&&!t.state.draggingText.copy&&(v=t.listSelections()),Hi(t.doc,Fn(r,r)),v)for(var M=0;M<v.length;++M)Or(t.doc,"",v[M].anchor,v[M].head,"drag");t.replaceSelection(m,"around","paste"),t.display.input.focus()}}catch(O){}}}function Tl(e,t){if(R&&(!e.state.draggingText||+new Date-Zo<100)){Je(t);return}if(Be(e,t)||kn(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!he){var r=y("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",U&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),U&&r.parentNode.removeChild(r)}}function Ol(e,t){var r=er(e,t);if(!r)return;var n=document.createDocumentFragment();uo(e,r,n),e.display.dragCursor||(e.display.dragCursor=y("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ie(e.display.dragCursor,n)}function Qo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function $o(e){if(!document.getElementsByClassName)return;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 a=0;a<r.length;a++)e(r[a])})}var es=!1;function Al(){if(es)return;Ml(),es=!0}function Ml(){var e;Le(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,$o(Dl)},100))}),Le(window,"blur",function(){return $o(Er)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Hn={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:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},ci=0;ci<10;ci++)Hn[ci+48]=Hn[ci+96]=String(ci);for(var Xi=65;Xi<=90;Xi++)Hn[Xi]=String.fromCharCode(Xi);for(var di=1;di<=12;di++)Hn[di+111]=Hn[di+63235]="F"+di;var Ln={};Ln.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"},Ln.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"},Ln.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"},Ln.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"]},Ln.default=J?Ln.macDefault:Ln.pcDefault;function _l(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Rl(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=b(r.split(" "),_l),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(" "),o=n):(s=i.slice(0,a+1).join(" "),o="...");var u=t[s];if(!u)t[s]=o;else if(u!=o)throw new Error("Inconsistent bindings for "+s)}delete e[r]}for(var d in t)e[d]=t[d];return e}function Mr(e,t,r,n){t=Gi(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&r(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Mr(e,t.fallthrough,r,n);for(var a=0;a<t.fallthrough.length;a++){var o=Mr(e,t.fallthrough[a],r,n);if(o)return o}}}function ts(e){var t=typeof e=="string"?e:Hn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ns(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ge?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ge?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function rs(e,t){if(U&&e.keyCode==34&&e.char)return!1;var r=Hn[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),ns(r,e,t))}function Gi(e){return typeof e=="string"?Ln[e]:e}function Dr(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var a=t(r[i]);n.length&&ze(a.from,f(n).to)<=0;){var o=n.pop();if(ze(o.from,a.from)<0){a.from=o.from;break}}n.push(a)}$t(e,function(){for(var s=n.length-1;s>=0;s--)Or(e.doc,"",n[s].from,n[s].to,"+delete");Cr(e)})}function La(e,t,r){var n=We(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Ta(e,t,r){var n=La(e,t.ch,r);return n==null?null:new ae(t.line,n,r<0?"after":"before")}function Oa(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=gt(r,t.doc.direction);if(a){var o=i<0?f(a):a[0],s=i<0==(o.level==1),u=s?"after":"before",d;if(o.level>0||t.doc.direction=="rtl"){var m=yr(t,r);d=i<0?r.text.length-1:0;var v=yn(t,m,d).top;d=et(function(M){return yn(t,m,M).top==v},i<0==(o.level==1)?o.from:o.to-1,d),u=="before"&&(d=La(r,d,1))}else d=i<0?o.to:o.from;return new ae(n,d,u)}}return new ae(n,i<0?r.text.length:0,i<0?"before":"after")}function Nl(e,t,r,n){var i=gt(t,e.doc.direction);if(!i)return Ta(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 a=ht(i,r.ch,r.sticky),o=i[a];if(e.doc.direction=="ltr"&&o.level%2==0&&(n>0?o.to>r.ch:o.from<r.ch))return Ta(t,r,n);var s=function(ve,we){return La(t,ve instanceof ae?ve.ch:ve,we)},u,d=function(ve){return e.options.lineWrapping?(u=u||yr(e,t),ao(e,t,u,ve)):{begin:0,end:t.text.length}},m=d(r.sticky=="before"?s(r,-1):r.ch);if(e.doc.direction=="rtl"||o.level==1){var v=o.level==1==n<0,M=s(r,v?1:-1);if(M!=null&&(v?M<=o.to&&M<=m.end:M>=o.from&&M>=m.begin)){var O=v?"before":"after";return new ae(r.line,M,O)}}var K=function(ve,we,be){for(var Ce=function(at,_t){return _t?new ae(r.line,s(at,1),"before"):new ae(r.line,at,"after")};ve>=0&&ve<i.length;ve+=we){var Pe=i[ve],De=we>0==(Pe.level!=1),Ve=De?be.begin:s(be.end,-1);if(Pe.from<=Ve&&Ve<Pe.to)return Ce(Ve,De);if(Ve=De?Pe.from:s(Pe.to,-1),be.begin<=Ve&&Ve<be.end)return Ce(Ve,De)}},ee=K(a+n,n,m);if(ee)return ee;var ue=n>0?m.end:s(m.begin,-1);return ue!=null&&!(n>0&&ue==t.text.length)&&(ee=K(n>0?0:i.length-1,n,d(ue)),ee)?ee:null}var fi={selectAll:Ho,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),X)},killLine:function(e){return Dr(e,function(t){if(t.empty()){var r=Oe(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ae(t.head.line+1,0)}:{from:t.head,to:ae(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Dr(e,function(t){return{from:ae(t.from().line,0),to:He(e.doc,ae(t.to().line+1,0))}})},delLineLeft:function(e){return Dr(e,function(t){return{from:ae(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Dr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Dr(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(ae(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ae(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return is(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return as(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(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")},te)},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")},te)},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/)?as(e,t.head):n},te)},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,"codepoint")},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(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var a=r[i].from(),o=h(e.getLine(a.line),a.ch,n);t.push(xe(n-o%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return $t(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var i=t[n].head,a=Oe(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new ae(i.line,i.ch-1)),i.ch>0)i=new ae(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),ae(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=Oe(e.doc,i.line-1).text;o&&(i=new ae(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),ae(i.line-1,o.length-1),i,"+transpose"))}}r.push(new $e(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return $t(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);Cr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function is(e,t){var r=Oe(e.doc,t),n=Me(r);return n!=r&&(t=Ze(n)),Oa(!0,e,n,t,1)}function Pl(e,t){var r=Oe(e.doc,t),n=Ge(r);return n!=r&&(t=Ze(n)),Oa(!0,e,r,t,-1)}function as(e,t){var r=is(e,t.line),n=Oe(e.doc,r.line),i=gt(n,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(r.ch,n.text.search(/\S/)),o=t.line==r.line&&t.ch<=a&&t.ch;return ae(r.line,o?0:a,r.sticky)}return r}function Ki(e,t,r){if(typeof t=="string"&&(t=fi[t],!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)!=de}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function jl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Mr(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Mr(t,e.options.extraKeys,r,e)||Mr(t,e.options.keyMap,r,e)}var Fl=new C;function hi(e,t,r,n){var i=e.state.keySeq;if(i){if(ts(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),os(e,i+" "+t,r,n))return!0}return os(e,t,r,n)}function os(e,t,r,n){var i=jl(e,t,n);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Pt(e,"keyHandled",e,t,r),(i=="handled"||i=="multi")&&(Ae(r),da(e)),!!i}function ss(e,t){var r=rs(t,!0);return r?t.shiftKey&&!e.state.keySeq?hi(e,"Shift-"+r,t,function(n){return Ki(e,n,!0)})||hi(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Ki(e,n)}):hi(e,r,t,function(n){return Ki(e,n)}):!1}function Il(e,t,r){return hi(e,"'"+r+"'",t,function(n){return Ki(e,n,!0)})}var Aa=null;function ls(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=B(),Be(t,e))return;R&&T<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=ss(t,e);U&&(Aa=n?r:null,!n&&r==88&&!cn&&(J?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),V&&!J&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;S(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(me(t,"CodeMirror-crosshair"),vt(document,"keyup",r),vt(document,"mouseover",r))}Le(document,"keyup",r),Le(document,"mouseover",r)}function us(e){e.keyCode==16&&(this.doc.sel.shift=!1),Be(this,e)}function cs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(kn(t.display,e)||Be(t,e)||e.ctrlKey&&!e.altKey||J&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(U&&r==Aa){Aa=null,Ae(e);return}if(U&&(!e.which||e.which<10)&&ss(t,e))return;var i=String.fromCharCode(n==null?r:n);if(i=="\b")return;if(Il(t,e,i))return;t.display.input.onKeyPress(e)}var Wl=400,Ma=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ma.prototype.compare=function(e,t,r){return this.time+Wl>e&&ze(t,this.pos)==0&&r==this.button};var pi,mi;function Hl(e,t){var r=+new Date;return mi&&mi.compare(r,e,t)?(pi=mi=null,"triple"):pi&&pi.compare(r,e,t)?(mi=new Ma(r,e,t),pi=null,"double"):(pi=new Ma(r,e,t),mi=null,"single")}function ds(e){var t=this,r=t.display;if(Be(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,kn(r,e)){w||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Da(t,e))return;var n=er(t,e),i=Tt(e),a=n?Hl(n,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),n&&Bl(t,i,n,a,e))return;i==1?n?Xl(t,n,a,e):pt(e)==r.scroller&&Ae(e):i==2?(n&&Wi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(Se?t.display.input.onContextMenu(e):fo(t))}function Bl(e,t,r,n,i){var a="Click";return n=="double"?a="Double"+a:n=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,hi(e,ns(a,i),i,function(o){if(typeof o=="string"&&(o=fi[o]),!o)return!1;var s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=o(e,r)!=de}finally{e.state.suppressEdits=!1}return s})}function zl(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var a=le?r.shiftKey&&r.metaKey:r.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=J?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(J?r.altKey:r.ctrlKey)),i}function Xl(e,t,r,n){R?setTimeout(c(co,e),0):e.curOp.focus=B();var i=zl(e,r,n),a=e.doc.sel,o;e.options.dragDrop&&zt&&!e.isReadOnly()&&r=="single"&&(o=a.contains(t))>-1&&(ze((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(ze(o.to(),t)>0||t.xRel<0)?Gl(e,n,t,i):Kl(e,n,t,i)}function Gl(e,t,r,n){var i=e.display,a=!1,o=Mt(e,function(d){w&&(i.scroller.draggable=!1),e.state.draggingText=!1,vt(i.wrapper.ownerDocument,"mouseup",o),vt(i.wrapper.ownerDocument,"mousemove",s),vt(i.scroller,"dragstart",u),vt(i.scroller,"drop",o),a||(Ae(d),n.addNew||Wi(e.doc,r,null,null,n.extend),w&&!he||R&&T==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),s=function(d){a=a||Math.abs(t.clientX-d.clientX)+Math.abs(t.clientY-d.clientY)>=10},u=function(){return a=!0};w&&(i.scroller.draggable=!0),e.state.draggingText=o,o.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),Le(i.wrapper.ownerDocument,"mouseup",o),Le(i.wrapper.ownerDocument,"mousemove",s),Le(i.scroller,"dragstart",u),Le(i.scroller,"drop",o),fo(e),setTimeout(function(){return i.input.focus()},20)}function fs(e,t,r){if(r=="char")return new $e(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new $e(ae(t.line,0),He(e.doc,ae(t.line+1,0)));var n=r(e,t);return new $e(n.from,n.to)}function Kl(e,t,r,n){var i=e.display,a=e.doc;Ae(t);var o,s,u=a.sel,d=u.ranges;if(n.addNew&&!n.extend?(s=a.sel.contains(r),s>-1?o=d[s]:o=new $e(r,r)):(o=a.sel.primary(),s=a.sel.primIndex),n.unit=="rectangle")n.addNew||(o=new $e(r,r)),r=er(e,t,!0,!0),s=-1;else{var m=fs(e,r,n.unit);n.extend?o=Sa(o,m.anchor,m.head,n.extend):o=m}n.addNew?s==-1?(s=d.length,Ht(a,mn(e,d.concat([o]),s),{scroll:!1,origin:"*mouse"})):d.length>1&&d[s].empty()&&n.unit=="char"&&!n.extend?(Ht(a,mn(e,d.slice(0,s).concat(d.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=a.sel):ka(a,s,o,ne):(s=0,Ht(a,new rn([o],0),ne),u=a.sel);var v=r;function M(be){if(ze(v,be)==0)return;if(v=be,n.unit=="rectangle"){for(var Ce=[],Pe=e.options.tabSize,De=h(Oe(a,r.line).text,r.ch,Pe),Ve=h(Oe(a,be.line).text,be.ch,Pe),at=Math.min(De,Ve),_t=Math.max(De,Ve),mt=Math.min(r.line,be.line),en=Math.min(e.lastLine(),Math.max(r.line,be.line));mt<=en;mt++){var qt=Oe(a,mt).text,Ct=z(qt,at,Pe);at==_t?Ce.push(new $e(ae(mt,Ct),ae(mt,Ct))):qt.length>Ct&&Ce.push(new $e(ae(mt,Ct),ae(mt,z(qt,_t,Pe))))}Ce.length||Ce.push(new $e(r,r)),Ht(a,mn(e,u.ranges.slice(0,s).concat(Ce),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(be)}else{var Jt=o,jt=fs(e,be,n.unit),Ot=Jt.anchor,St;ze(jt.anchor,Ot)>0?(St=jt.head,Ot=Kn(Jt.from(),jt.anchor)):(St=jt.anchor,Ot=fr(Jt.to(),jt.head));var bt=u.ranges.slice(0);bt[s]=Vl(e,new $e(He(a,Ot),St)),Ht(a,mn(e,bt,s),ne)}}var O=i.wrapper.getBoundingClientRect(),K=0;function ee(be){var Ce=++K,Pe=er(e,be,!0,n.unit=="rectangle");if(!Pe)return;if(ze(Pe,v)!=0){e.curOp.focus=B(),M(Pe);var De=Ni(i,a);(Pe.line>=De.to||Pe.line<De.from)&&setTimeout(Mt(e,function(){K==Ce&&ee(be)}),150)}else{var Ve=be.clientY<O.top?-20:be.clientY>O.bottom?20:0;Ve&&setTimeout(Mt(e,function(){if(K!=Ce)return;i.scroller.scrollTop+=Ve,ee(be)}),50)}}function ue(be){e.state.selectingText=!1,K=Infinity,be&&(Ae(be),i.input.focus()),vt(i.wrapper.ownerDocument,"mousemove",ve),vt(i.wrapper.ownerDocument,"mouseup",we),a.history.lastSelOrigin=null}var ve=Mt(e,function(be){be.buttons===0||!Tt(be)?ue(be):ee(be)}),we=Mt(e,ue);e.state.selectingText=we,Le(i.wrapper.ownerDocument,"mousemove",ve),Le(i.wrapper.ownerDocument,"mouseup",we)}function Vl(e,t){var r=t.anchor,n=t.head,i=Oe(e.doc,r.line);if(ze(r,n)==0&&r.sticky==n.sticky)return t;var a=gt(i);if(!a)return t;var o=ht(a,r.ch,r.sticky),s=a[o];if(s.from!=r.ch&&s.to!=r.ch)return t;var u=o+(s.from==r.ch==(s.level!=1)?0:1);if(u==0||u==a.length)return t;var d;if(n.line!=r.line)d=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var m=ht(a,n.ch,n.sticky),v=m-o||(n.ch-r.ch)*(s.level==1?-1:1);m==u-1||m==u?d=v<0:d=v>0}var M=a[u+(d?-1:0)],O=d==(M.level==1),K=O?M.from:M.to,ee=O?"after":"before";return r.ch==K&&r.sticky==ee?t:new $e(new ae(r.line,K,ee),n)}function hs(e,t,r,n){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch(M){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ae(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!Te(e,r))return tt(t);a-=s.top-o.viewOffset;for(var u=0;u<e.display.gutterSpecs.length;++u){var d=o.gutters.childNodes[u];if(d&&d.getBoundingClientRect().right>=i){var m=En(e.doc,a),v=e.display.gutterSpecs[u];return Qe(e,r,e,m,v.className,t),tt(t)}}}function Da(e,t){return hs(e,t,"gutterClick",!0)}function ps(e,t){if(kn(e.display,t)||Yl(e,t))return;if(Be(e,t,"contextmenu"))return;Se||e.display.input.onContextMenu(t)}function Yl(e,t){return Te(e,"gutterContextMenu")?hs(e,t,"gutterContextMenu",!1):!1}function ms(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qr(e)}var _r={toString:function(){return"CodeMirror.Init"}},gs={},Vi={};function ql(e){var t=e.optionHandlers;function r(n,i,a,o){e.defaults[n]=i,a&&(t[n]=o?function(s,u,d){d!=_r&&a(s,u,d)}:a)}e.defineOption=r,e.Init=_r,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,wa(n)},!0),r("indentUnit",2,wa,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){ri(n),qr(n),Vt(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!i)return;var a=[],o=n.doc.first;n.doc.iter(function(u){for(var d=0;;){var m=u.text.indexOf(i,d);if(m==-1)break;d=m+i.length,a.push(ae(o,m))}o++});for(var s=a.length-1;s>=0;s--)Or(n.doc,i,a[s],ae(a[s].line,a[s].ch+i.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,i,a){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),a!=_r&&n.refresh()}),r("specialCharPlaceholder",Ss,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",G?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!ke),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){ms(n),ni(n)},!0),r("keyMap","default",function(n,i,a){var o=Gi(i),s=a!=_r&&Gi(a);s&&s.detach&&s.detach(n,o),o.attach&&o.attach(n,s||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=ya(i,n.options.lineNumbers),ni(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?ua(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Sr(n)},!0),r("scrollbarStyle","native",function(n){bo(n),Sr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=ya(n.options.gutters,i),ni(n)},!0),r("firstLineNumber",1,ni,!0),r("lineNumberFormatter",function(n){return n},ni,!0),r("showCursorWhenSelecting",!1,Jr,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(Er(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("screenReaderLabel",null,function(n,i){i=i===""?null:i,n.display.input.screenReaderLabelChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,Jr,!0),r("singleCursorHeightPerLine",!0,Jr,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,ri,!0),r("addModeClass",!1,ri,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,ri,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=_r;if(!t!=!n){var i=e.display.dragFunctions,a=t?Le:vt;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(S(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(me(e.display.wrapper,"CodeMirror-wrap"),hn(e)),ca(e),Vt(e),qr(e),setTimeout(function(){return Sr(e)},100)}function ft(e,t){var r=this;if(!(this instanceof ft))return new ft(e,t);this.options=t=t?l(t):{},l(gs,t,!1);var n=t.value;typeof n=="string"?n=new Yt(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new ft.inputStyles[t.inputStyle](this),a=this.display=new cl(e,n,i,t);a.wrapper.CodeMirror=this,ms(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),bo(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 C,keySeq:null,specialChars:null},t.autofocus&&!G&&a.input.focus(),R&&T<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Ql(this),Al(),ir(this),this.curOp.forceUpdate=!0,Oo(this,n),t.autofocus&&!G||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&fa(r)},20):Er(this);for(var o in Vi)Vi.hasOwnProperty(o)&&Vi[o](this,t[o],_r);wo(this),t.finishInit&&t.finishInit(this);for(var s=0;s<_a.length;++s)_a[s](this);ar(this),w&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}ft.defaults=gs,ft.optionHandlers=Vi;function Ql(e){var t=e.display;Le(t.scroller,"mousedown",Mt(e,ds)),R&&T<11?Le(t.scroller,"dblclick",Mt(e,function(u){if(Be(e,u))return;var d=er(e,u);if(!d||Da(e,u)||kn(e.display,u))return;Ae(u);var m=e.findWordAt(d);Wi(e.doc,m.anchor,m.head)})):Le(t.scroller,"dblclick",function(u){return Be(e,u)||Ae(u)}),Le(t.scroller,"contextmenu",function(u){return ps(e,u)}),Le(t.input.getField(),"contextmenu",function(u){t.scroller.contains(u.target)||ps(e,u)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function a(u){if(u.touches.length!=1)return!1;var d=u.touches[0];return d.radiusX<=1&&d.radiusY<=1}function o(u,d){if(d.left==null)return!0;var m=d.left-u.left,v=d.top-u.top;return m*m+v*v>20*20}Le(t.scroller,"touchstart",function(u){if(!Be(e,u)&&!a(u)&&!Da(e,u)){t.input.ensurePolled(),clearTimeout(r);var d=+new Date;t.activeTouch={start:d,moved:!1,prev:d-n.end<=300?n:null},u.touches.length==1&&(t.activeTouch.left=u.touches[0].pageX,t.activeTouch.top=u.touches[0].pageY)}}),Le(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Le(t.scroller,"touchend",function(u){var d=t.activeTouch;if(d&&!kn(t,u)&&d.left!=null&&!d.moved&&new Date-d.start<300){var m=e.coordsChar(t.activeTouch,"page"),v;!d.prev||o(d,d.prev)?v=new $e(m,m):!d.prev.prev||o(d,d.prev.prev)?v=e.findWordAt(m):v=new $e(ae(m.line,0),He(e.doc,ae(m.line+1,0))),e.setSelection(v.anchor,v.head),e.focus(),Ae(u)}i()}),Le(t.scroller,"touchcancel",i),Le(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Qr(e,t.scroller.scrollTop),nr(e,t.scroller.scrollLeft,!0),Qe(e,"scroll",e))}),Le(t.scroller,"mousewheel",function(u){return So(e,u)}),Le(t.scroller,"DOMMouseScroll",function(u){return So(e,u)}),Le(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(u){Be(e,u)||Je(u)},over:function(u){Be(e,u)||(Ol(e,u),Je(u))},start:function(u){return Tl(e,u)},drop:Mt(e,Ll),leave:function(u){Be(e,u)||Qo(e)}};var s=t.input.getField();Le(s,"keyup",function(u){return us.call(e,u)}),Le(s,"keydown",Mt(e,ls)),Le(s,"keypress",Mt(e,cs)),Le(s,"focus",function(u){return fa(e,u)}),Le(s,"blur",function(u){return Er(e,u)})}var _a=[];ft.defineInitHook=function(e){return _a.push(e)};function gi(e,t,r,n){var i=e.doc,a;r==null&&(r="add"),r=="smart"&&(i.mode.indent?a=Qt(e,t).state:r="prev");var o=e.options.tabSize,s=Oe(i,t),u=h(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var d=s.text.match(/^\s*/)[0],m;if(!n&&!/\S/.test(s.text))m=0,r="not";else if(r=="smart"&&(m=i.mode.indent(a,s.text.slice(d.length),s.text),m==de||m>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?m=h(Oe(i,t-1).text,null,o):m=0:r=="add"?m=u+e.options.indentUnit:r=="subtract"?m=u-e.options.indentUnit:typeof r=="number"&&(m=u+r),m=Math.max(0,m);var v="",M=0;if(e.options.indentWithTabs)for(var O=Math.floor(m/o);O;--O)M+=o,v+=" ";if(M<m&&(v+=xe(m-M)),v!=d)return Or(i,v,ae(t,0),ae(t,d.length),"+input"),s.stateAfter=null,!0;for(var K=0;K<i.sel.ranges.length;K++){var ee=i.sel.ranges[K];if(ee.head.line==t&&ee.head.ch<d.length){var ue=ae(t,d.length);ka(i,K,new $e(ue,ue));break}}}var gn=null;function Yi(e){gn=e}function Ra(e,t,r,n,i){var a=e.doc;e.display.shift=!1,n||(n=a.sel);var o=+new Date-200,s=i=="paste"||e.state.pasteIncoming>o,u=Ft(t),d=null;if(s&&n.ranges.length>1)if(gn&&gn.text.join(`
|
|
`)==t){if(n.ranges.length%gn.text.length==0){d=[];for(var m=0;m<gn.text.length;m++)d.push(a.splitLines(gn.text[m]))}}else u.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(d=b(u,function(ve){return[ve]}));for(var v=e.curOp.updateInput,M=n.ranges.length-1;M>=0;M--){var O=n.ranges[M],K=O.from(),ee=O.to();O.empty()&&(r&&r>0?K=ae(K.line,K.ch-r):e.state.overwrite&&!s?ee=ae(ee.line,Math.min(Oe(a,ee.line).text.length,ee.ch+f(u).length)):s&&gn&&gn.lineWise&&gn.text.join(`
|
|
`)==u.join(`
|
|
`)&&(K=ee=ae(K.line,0)));var ue={from:K,to:ee,text:d?d[M%d.length]:u,origin:i||(s?"paste":e.state.cutIncoming>o?"cut":"+input")};Tr(e.doc,ue),Pt(e,"inputRead",e,ue)}t&&!s&&bs(e,t),Cr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=v),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function vs(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&$t(t,function(){return Ra(t,r,0,null,"paste")}),!0}function bs(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;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)continue;var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){o=gi(e,i.head.line,"smart");break}}else a.electricInput&&(a.electricInput.test(Oe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=gi(e,i.head.line,"smart")));o&&Pt(e,"electricInput",e,i.head.line)}}function ys(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,a={anchor:ae(i,0),head:ae(i+1,0)};r.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:r}}function xs(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function ws(){var e=y("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=y("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return w?e.style.width="1000px":e.setAttribute("wrap","off"),j&&(e.style.border="1px solid black"),xs(e),t}function $l(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,i){var a=this.options,o=a[n];if(a[n]==i&&n!="mode")return;a[n]=i,t.hasOwnProperty(n)&&Mt(this,t[n])(this,i,o),Qe(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,i){this.state.keyMaps[i?"push":"unshift"](Gi(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==n||i[a].name==n)return i.splice(a,1),!0},addOverlay:Xt(function(n,i){var a=n.token?n:e.getMode(this.options,n);if(a.startState)throw new Error("Overlays may not be stateful.");p(this.state.overlays,{mode:a,modeSpec:n,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,Vt(this)}),removeOverlay:Xt(function(n){for(var i=this.state.overlays,a=0;a<i.length;++a){var o=i[a].modeSpec;if(o==n||typeof n=="string"&&o.name==n){i.splice(a,1),this.state.modeGen++,Vt(this);return}}}),indentLine:Xt(function(n,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),An(this.doc,n)&&gi(this,n,i,a)}),indentSelection:Xt(function(n){for(var i=this.doc.sel.ranges,a=-1,o=0;o<i.length;o++){var s=i[o];if(s.empty())s.head.line>a&&(gi(this,s.head.line,n,!0),a=s.head.line,o==this.doc.sel.primIndex&&Cr(this));else{var u=s.from(),d=s.to(),m=Math.max(a,u.line);a=Math.min(this.lastLine(),d.line-(d.ch?0:1))+1;for(var v=m;v<a;++v)gi(this,v,n);var M=this.doc.sel.ranges;u.ch==0&&i.length==M.length&&M[o].from().ch>0&&ka(this.doc,o,new $e(u,M[o].to()),X)}}}),getTokenAt:function(n,i){return Sn(this,n,i)},getLineTokens:function(n,i){return Sn(this,ae(n),i,!0)},getTokenTypeAt:function(n){n=He(this.doc,n);var i=Ir(this,Oe(this.doc,n.line)),a=0,o=(i.length-1)/2,s=n.ch,u;if(s==0)u=i[2];else for(;;){var d=a+o>>1;if((d?i[d*2-1]:0)>=s)o=d;else if(i[d*2+1]<s)a=d+1;else{u=i[d*2+2];break}}var m=u?u.indexOf("overlay "):-1;return m<0?u:m==0?null:u.slice(0,m-1)},getModeAt:function(n){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(n).state).mode:i},getHelper:function(n,i){return this.getHelpers(n,i)[0]},getHelpers:function(n,i){var a=[];if(!r.hasOwnProperty(i))return a;var o=r[i],s=this.getModeAt(n);if(typeof s[i]=="string")o[s[i]]&&a.push(o[s[i]]);else if(s[i])for(var u=0;u<s[i].length;u++){var d=o[s[i][u]];d&&a.push(d)}else s.helperType&&o[s.helperType]?a.push(o[s.helperType]):o[s.name]&&a.push(o[s.name]);for(var m=0;m<o._global.length;m++){var v=o._global[m];v.pred(s,this)&&A(a,v.val)==-1&&a.push(v.val)}return a},getStateAfter:function(n,i){var a=this.doc;return n=Vn(a,n==null?a.first+a.size-1:n),Qt(this,n+1,i).state},cursorCoords:function(n,i){var a,o=this.doc.sel.primary();return n==null?a=o.head:typeof n=="object"?a=He(this.doc,n):a=n?o.from():o.to(),pn(this,a,i||"page")},charCoords:function(n,i){return ia(this,He(this.doc,n),i||"page")},coordsChar:function(n,i){return n=no(this,n,i||"page"),oa(this,n.left,n.top)},lineAtHeight:function(n,i){return n=no(this,{top:n,left:0},i||"page").top,En(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,i,a){var o=!1,s;if(typeof n=="number"){var u=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>u&&(n=u,o=!0),s=Oe(this.doc,n)}else s=n;return Mi(this,s,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-dt(s):0)},defaultTextHeight:function(){return xr(this.display)},defaultCharWidth:function(){return wr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,a,o,s){var u=this.display;n=pn(this,He(this.doc,n));var d=n.bottom,m=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),u.sizer.appendChild(i),o=="over")d=n.top;else if(o=="above"||o=="near"){var v=Math.max(u.wrapper.clientHeight,this.doc.height),M=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);(o=="above"||n.bottom+i.offsetHeight>v)&&n.top>i.offsetHeight?d=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=v&&(d=n.bottom),m+i.offsetWidth>M&&(m=M-i.offsetWidth)}i.style.top=d+"px",i.style.left=i.style.right="",s=="right"?(m=u.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(s=="left"?m=0:s=="middle"&&(m=(u.sizer.clientWidth-i.offsetWidth)/2),i.style.left=m+"px"),a&&Js(this,{left:m,top:d,right:m+i.offsetWidth,bottom:d+i.offsetHeight})},triggerOnKeyDown:Xt(ls),triggerOnKeyPress:Xt(cs),triggerOnKeyUp:us,triggerOnMouseDown:Xt(ds),execCommand:function(n){if(fi.hasOwnProperty(n))return fi[n].call(null,this)},triggerElectric:Xt(function(n){bs(this,n)}),findPosH:function(n,i,a,o){var s=1;i<0&&(s=-1,i=-i);for(var u=He(this.doc,n),d=0;d<i&&!(u=Na(this.doc,u,s,a,o),u.hitSide);++d);return u},moveH:Xt(function(n,i){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?Na(a.doc,o.head,n,i,a.options.rtlMoveVisually):n<0?o.from():o.to()},te)}),deleteH:Xt(function(n,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):Dr(this,function(s){var u=Na(o,s.head,n,i,!1);return n<0?{from:u,to:s.head}:{from:s.head,to:u}})}),findPosV:function(n,i,a,o){var s=1,u=o;i<0&&(s=-1,i=-i);for(var d=He(this.doc,n),m=0;m<i;++m){var v=pn(this,d,"div");if(u==null?u=v.left:v.left=u,d=Es(this,v,s,a),d.hitSide)break}return d},moveV:Xt(function(n,i){var a=this,o=this.doc,s=[],u=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(m){if(u)return n<0?m.from():m.to();var v=pn(a,m.head,"div");m.goalColumn!=null&&(v.left=m.goalColumn),s.push(v.left);var M=Es(a,v,n,i);return i=="page"&&m==o.sel.primary()&&pa(a,ia(a,M,"div").top-v.top),M},te),s.length)for(var d=0;d<o.sel.ranges.length;d++)o.sel.ranges[d].goalColumn=s[d]}),findWordAt:function(n){var i=this.doc,a=Oe(i,n.line).text,o=n.ch,s=n.ch;if(a){var u=this.getHelper(n,"wordChars");(n.sticky=="before"||s==a.length)&&o?--o:++s;for(var d=a.charAt(o),m=Ee(d,u)?function(v){return Ee(v,u)}:/\s/.test(d)?function(v){return/\s/.test(v)}:function(v){return!/\s/.test(v)&&!Ee(v)};o>0&&m(a.charAt(o-1));)--o;for(;s<a.length&&m(a.charAt(s));)++s}return new $e(ae(n.line,o),ae(n.line,s))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?S(this.display.cursorDiv,"CodeMirror-overwrite"):me(this.display.cursorDiv,"CodeMirror-overwrite"),Qe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Xt(function(n,i){Zr(this,n,i)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-bn(this)-this.display.barHeight,width:n.scrollWidth-bn(this)-this.display.barWidth,clientHeight:ta(this),clientWidth:Qn(this)}},scrollIntoView:Xt(function(n,i){n==null?(n={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof n=="number"?n={from:ae(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=i||0,n.from.line!=null?Zs(this,n):po(this,n.from,n.to,n.margin)}),setSize:Xt(function(n,i){var a=this,o=function(u){return typeof u=="number"||/^\d+$/.test(String(u))?u+"px":u};n!=null&&(this.display.wrapper.style.width=o(n)),i!=null&&(this.display.wrapper.style.height=o(i)),this.options.lineWrapping&&$a(this);var s=this.display.viewFrom;this.doc.iter(s,this.display.viewTo,function(u){if(u.widgets){for(var d=0;d<u.widgets.length;d++)if(u.widgets[d].noHScroll){Pn(a,s,"widget");break}}++s}),this.curOp.forceUpdate=!0,Qe(this,"refresh",this)}),operation:function(n){return $t(this,n)},startOperation:function(){return ir(this)},endOperation:function(){return ar(this)},refresh:Xt(function(){var n=this.display.cachedTextHeight;Vt(this),this.curOp.forceUpdate=!0,qr(this),Zr(this,this.doc.scrollLeft,this.doc.scrollTop),va(this.display),(n==null||Math.abs(n-xr(this.display))>.5||this.options.lineWrapping)&&ca(this),Qe(this,"refresh",this)}),swapDoc:Xt(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Oo(this,n),qr(this),this.display.input.reset(),Zr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Pt(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:n},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}},Ne(e),e.registerHelper=function(n,i,a){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=a},e.registerGlobalHelper=function(n,i,a,o){e.registerHelper(n,i,o),r[n]._global.push({pred:a,val:o})}}function Na(e,t,r,n,i){var a=t,o=r,s=Oe(e,t.line),u=i&&e.direction=="rtl"?-r:r;function d(){var we=t.line+u;return we<e.first||we>=e.first+e.size?!1:(t=new ae(we,t.ch,t.sticky),s=Oe(e,we))}function m(we){var be;if(n=="codepoint"){var Ce=s.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Ce)?be=null:be=new ae(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(Ce>=55296&&Ce<56320?2:1))),-r)}else i?be=Nl(e.cm,s,t,r):be=Ta(s,t,r);if(be==null)if(!we&&d())t=Oa(i,e.cm,s,t.line,u);else return!1;else t=be;return!0}if(n=="char"||n=="codepoint")m();else if(n=="column")m(!0);else if(n=="word"||n=="group")for(var v=null,M=n=="group",O=e.cm&&e.cm.getHelper(t,"wordChars"),K=!0;!(r<0&&!m(!K));K=!1){var ee=s.text.charAt(t.ch)||`
|
|
`,ue=Ee(ee,O)?"w":M&&ee==`
|
|
`?"n":!M||/\s/.test(ee)?null:"p";if(M&&!K&&!ue&&(ue="s"),v&&v!=ue){r<0&&(r=1,m(),t.sticky="after");break}if(ue&&(v=ue),r>0&&!m(!K))break}var ve=Bi(e,t,a,o,!0);return fe(a,ve)&&(ve.hitSide=!0),ve}function Es(e,t,r,n){var i=e.doc,a=t.left,o;if(n=="page"){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*xr(e.display),3);o=(r>0?t.bottom:t.top)+r*u}else n=="line"&&(o=r>0?t.bottom+3:t.top-3);for(var d;!(d=oa(e,a,o),!d.outside);){if(r<0?o<=0:o>=i.height){d.hitSide=!0;break}o+=r*5}return d}var nt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new C,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};nt.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;xs(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function a(s){for(var u=s.target;u;u=u.parentNode){if(u==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(u.className))break}return!1}Le(i,"paste",function(s){if(!a(s)||Be(n,s)||vs(s,n))return;T<=11&&setTimeout(Mt(n,function(){return t.updateFromDOM()}),20)}),Le(i,"compositionstart",function(s){t.composing={data:s.data,done:!1}}),Le(i,"compositionupdate",function(s){t.composing||(t.composing={data:s.data,done:!1})}),Le(i,"compositionend",function(s){t.composing&&(s.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Le(i,"touchstart",function(){return r.forceCompositionEnd()}),Le(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(s){if(!a(s)||Be(n,s))return;if(n.somethingSelected())Yi({lineWise:!1,text:n.getSelections()}),s.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var u=ys(n);Yi({lineWise:!0,text:u.text}),s.type=="cut"&&n.operation(function(){n.setSelections(u.ranges,0,X),n.replaceSelection("",null,"cut")})}else return;if(s.clipboardData){s.clipboardData.clearData();var d=gn.text.join(`
|
|
`);if(s.clipboardData.setData("Text",d),s.clipboardData.getData("Text")==d){s.preventDefault();return}}var m=ws(),v=m.firstChild;n.display.lineSpace.insertBefore(m,n.display.lineSpace.firstChild),v.value=gn.text.join(`
|
|
`);var M=document.activeElement;x(v),setTimeout(function(){n.display.lineSpace.removeChild(m),M.focus(),M==i&&r.showPrimarySelection()},50)}Le(i,"copy",o),Le(i,"cut",o)},nt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},nt.prototype.prepareSelection=function(){var e=lo(this.cm,!1);return e.focus=document.activeElement==this.div,e},nt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},nt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},nt.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();return}var a=qi(t,e.anchorNode,e.anchorOffset),o=qi(t,e.focusNode,e.focusOffset);if(a&&!a.bad&&o&&!o.bad&&ze(Kn(a,o),n)==0&&ze(fr(a,o),i)==0)return;var s=t.display.view,u=n.line>=t.display.viewFrom&&Cs(t,n)||{node:s[0].measure.map[2],offset:0},d=i.line<t.display.viewTo&&Cs(t,i);if(!d){var m=s[s.length-1].measure,v=m.maps?m.maps[m.maps.length-1]:m.map;d={node:v[v.length-1],offset:v[v.length-2]-v[v.length-3]}}if(!u||!d){e.removeAllRanges();return}var M=e.rangeCount&&e.getRangeAt(0),O;try{O=D(u.node,u.offset,d.offset,d.node)}catch(K){}O&&(!V&&t.state.focused?(e.collapse(u.node,u.offset),O.collapsed||(e.removeAllRanges(),e.addRange(O))):(e.removeAllRanges(),e.addRange(O)),M&&e.anchorNode==null?e.addRange(M):V&&this.startGracePeriod()),this.rememberSelection()},nt.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)},nt.prototype.showMultipleSelections=function(e){ie(this.cm.display.cursorDiv,e.cursors),ie(this.cm.display.selectionDiv,e.selection)},nt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},nt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return g(this.div,t)},nt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},nt.prototype.blur=function(){this.div.blur()},nt.prototype.getField=function(){return this.div},nt.prototype.supportsTouch=function(){return!0},nt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():$t(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},nt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},nt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(L&&I&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=qi(t,e.anchorNode,e.anchorOffset),n=qi(t,e.focusNode,e.focusOffset);r&&n&&$t(t,function(){Ht(t.doc,Fn(r,n),X),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},nt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=ae(n.line-1,Oe(e.doc,n.line-1).length)),i.ch==Oe(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=ae(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;n.line==t.viewFrom||(a=tr(e,n.line))==0?(o=Ze(t.view[0].line),s=t.view[0].node):(o=Ze(t.view[a].line),s=t.view[a-1].node.nextSibling);var u=tr(e,i.line),d,m;if(u==t.view.length-1?(d=t.viewTo-1,m=t.lineDiv.lastChild):(d=Ze(t.view[u+1].line)-1,m=t.view[u+1].node.previousSibling),!s)return!1;for(var v=e.doc.splitLines(tu(e,s,m,o,d)),M=wn(e.doc,ae(o,0),ae(d,Oe(e.doc,d).text.length));v.length>1&&M.length>1;)if(f(v)==f(M))v.pop(),M.pop(),d--;else if(v[0]==M[0])v.shift(),M.shift(),o++;else break;for(var O=0,K=0,ee=v[0],ue=M[0],ve=Math.min(ee.length,ue.length);O<ve&&ee.charCodeAt(O)==ue.charCodeAt(O);)++O;for(var we=f(v),be=f(M),Ce=Math.min(we.length-(v.length==1?O:0),be.length-(M.length==1?O:0));K<Ce&&we.charCodeAt(we.length-K-1)==be.charCodeAt(be.length-K-1);)++K;if(v.length==1&&M.length==1&&o==n.line)for(;O&&O>n.ch&&we.charCodeAt(we.length-K-1)==be.charCodeAt(be.length-K-1);)O--,K++;v[v.length-1]=we.slice(0,we.length-K).replace(/^\u200b+/,""),v[0]=v[0].slice(O).replace(/\u200b+$/,"");var Pe=ae(o,O),De=ae(d,M.length?f(M).length-K:0);if(v.length>1||v[0]||ze(Pe,De))return Or(e.doc,v,Pe,De,"+input"),!0},nt.prototype.ensurePolled=function(){this.forceCompositionEnd()},nt.prototype.reset=function(){this.forceCompositionEnd()},nt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},nt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},nt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&$t(this.cm,function(){return Vt(e.cm)})},nt.prototype.setUneditable=function(e){e.contentEditable="false"},nt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Mt(this.cm,Ra)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},nt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},nt.prototype.onContextMenu=function(){},nt.prototype.resetPosition=function(){},nt.prototype.needsContentAttribute=!0;function Cs(e,t){var r=na(e,t.line);if(!r||r.hidden)return null;var n=Oe(e.doc,t.line),i=Ya(r,n,t.line),a=gt(n,e.doc.direction),o="left";if(a){var s=ht(a,t.ch);o=s%2?"right":"left"}var u=Za(i.map,t.ch,o);return u.offset=u.collapse=="right"?u.end:u.start,u}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Rr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,i){var a="",o=!1,s=e.doc.lineSeparator(),u=!1;function d(O){return function(K){return K.id==O}}function m(){o&&(a+=s,u&&(a+=s),o=u=!1)}function v(O){O&&(m(),a+=O)}function M(O){if(O.nodeType==1){var K=O.getAttribute("cm-text");if(K){v(K);return}var ee=O.getAttribute("cm-marker"),ue;if(ee){var ve=e.findMarks(ae(n,0),ae(i+1,0),d(+ee));ve.length&&(ue=ve[0].find(0))&&v(wn(e.doc,ue.from,ue.to).join(s));return}if(O.getAttribute("contenteditable")=="false")return;var we=/^(pre|div|p|li|table|br)$/i.test(O.nodeName);if(!/^br$/i.test(O.nodeName)&&O.textContent.length==0)return;we&&m();for(var be=0;be<O.childNodes.length;be++)M(O.childNodes[be]);/^(pre|p)$/i.test(O.nodeName)&&(u=!0),we&&(o=!0)}else O.nodeType==3&&v(O.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(M(t),t==r);)t=t.nextSibling,u=!1;return a}function qi(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Rr(e.clipPos(ae(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 a=e.display.view[i];if(a.node==n)return nu(a,t,r)}}function nu(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!g(n,t))return Rr(ae(Ze(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var a=e.rest?f(e.rest):e.line;return Rr(ae(Ze(a),a.text.length),i)}var o=t.nodeType==3?t:null,s=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,r&&(r=o.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var u=e.measure,d=u.maps;function m(ue,ve,we){for(var be=-1;be<(d?d.length:0);be++)for(var Ce=be<0?u.map:d[be],Pe=0;Pe<Ce.length;Pe+=3){var De=Ce[Pe+2];if(De==ue||De==ve){var Ve=Ze(be<0?e.line:e.rest[be]),at=Ce[Pe]+we;return(we<0||De!=ue)&&(at=Ce[Pe+(we?1:0)]),ae(Ve,at)}}}var v=m(o,s,r);if(v)return Rr(v,i);for(var M=s.nextSibling,O=o?o.nodeValue.length-r:0;M;M=M.nextSibling){if(v=m(M,M.firstChild,0),v)return Rr(ae(v.line,v.ch-O),i);O+=M.textContent.length}for(var K=s.previousSibling,ee=r;K;K=K.previousSibling){if(v=m(K,K.firstChild,-1),v)return Rr(ae(v.line,v.ch+ee),i);ee+=K.textContent.length}}var wt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new C,this.hasSelection=!1,this.composing=null};wt.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),j&&(i.style.width="0px"),Le(i,"input",function(){R&&T>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Le(i,"paste",function(o){if(Be(n,o)||vs(o,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function a(o){if(Be(n,o))return;if(n.somethingSelected())Yi({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var s=ys(n);Yi({lineWise:!0,text:s.text}),o.type=="cut"?n.setSelections(s.ranges,null,X):(r.prevInput="",i.value=s.text.join(`
|
|
`),x(i))}else return;o.type=="cut"&&(n.state.cutIncoming=+new Date)}Le(i,"cut",a),Le(i,"copy",a),Le(e.scroller,"paste",function(o){if(kn(e,o)||Be(n,o))return;if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var s=new Event("paste");s.clipboardData=o.clipboardData,i.dispatchEvent(s)}),Le(e.lineSpace,"selectstart",function(o){kn(e,o)||Ae(o)}),Le(i,"compositionstart",function(){var o=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:o,range:n.markText(o,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Le(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},wt.prototype.createField=function(e){this.wrapper=ws(),this.textarea=this.wrapper.firstChild},wt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},wt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=lo(e);if(e.options.moveInputWithCursor){var i=pn(e,r.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return n},wt.prototype.showSelection=function(e){var t=this.cm,r=t.display;ie(r.cursorDiv,e.cursors),ie(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},wt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&x(this.textarea),R&&T>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",R&&T>=9&&(this.hasSelection=null))},wt.prototype.getField=function(){return this.textarea},wt.prototype.supportsTouch=function(){return!1},wt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!G||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},wt.prototype.blur=function(){this.textarea.blur()},wt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},wt.prototype.receivedFocus=function(){this.slowPoll()},wt.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},wt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},wt.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||It(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(R&&T>=9&&this.hasSelection===i||J&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!n&&(n="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,s=Math.min(n.length,i.length);o<s&&n.charCodeAt(o)==i.charCodeAt(o);)++o;return $t(t,function(){Ra(t,i.slice(o),n.length-o,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
`)>-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},wt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},wt.prototype.onKeyPress=function(){R&&T>=9&&(this.hasSelection=null),this.fastPoll()},wt.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=er(r,e),o=n.scroller.scrollTop;if(!a||U)return;var s=r.options.resetSelectionOnContextMenu;s&&r.doc.sel.contains(a)==-1&&Mt(r,Ht)(r.doc,Fn(a),X);var u=i.style.cssText,d=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+`px;
|
|
z-index: 1000; background: `+(R?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var v;w&&(v=window.scrollY),n.input.focus(),w&&window.scrollTo(null,v),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=O,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function M(){if(i.selectionStart!=null){var ee=r.somethingSelected(),ue="\u200B"+(ee?i.value:"");i.value="\u21DA",i.value=ue,t.prevInput=ee?"":"\u200B",i.selectionStart=1,i.selectionEnd=ue.length,n.selForContextMenu=r.doc.sel}}function O(){if(t.contextMenuPending!=O)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,R&&T<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=o),i.selectionStart!=null){(!R||R&&T<9)&&M();var ee=0,ue=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Mt(r,Ho)(r):ee++<10?n.detectingSelectAll=setTimeout(ue,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ue,200)}}if(R&&T>=9&&M(),Se){Je(e);var K=function(){vt(window,"mouseup",K),setTimeout(O,20)};Le(window,"mouseup",K)}else setTimeout(O,50)},wt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},wt.prototype.setUneditable=function(){},wt.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?l(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=B();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(Le(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){n(),a.submit=i,a.submit(),a.submit=o}}catch(u){}}t.finishInit=function(u){u.save=n,u.getTextArea=function(){return e},u.toTextArea=function(){u.toTextArea=isNaN,n(),e.parentNode.removeChild(u.getWrapperElement()),e.style.display="",e.form&&(vt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var s=ft(function(u){return e.parentNode.insertBefore(u,e.nextSibling)},t);return s}function iu(e){e.off=vt,e.on=Le,e.wheelEventPixels=dl,e.Doc=Yt,e.splitLines=Ft,e.countColumn=h,e.findColumn=z,e.isWordChar=pe,e.Pass=de,e.signal=Qe,e.Line=ut,e.changeEnd=In,e.scrollbarModel=vo,e.Pos=ae,e.cmpPos=ze,e.modes=Kt,e.mimeModes=fn,e.resolveMode=lr,e.getMode=ur,e.modeExtensions=On,e.extendMode=bi,e.copyState=an,e.startState=cr,e.innerMode=Xn,e.commands=fi,e.keyMap=Ln,e.keyName=rs,e.isModifierKey=ts,e.lookupKey=Mr,e.normalizeKeyMap=Rl,e.StringStream=ct,e.SharedTextMarker=ui,e.TextMarker=Wn,e.LineWidget=li,e.e_preventDefault=Ae,e.e_stopPropagation=Xe,e.e_stop=Je,e.addClass=S,e.contains=g,e.rmClass=me,e.keyNames=Hn}ql(ft),$l(ft);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ji in Yt.prototype)Yt.prototype.hasOwnProperty(Ji)&&A(au,Ji)<0&&(ft.prototype[Ji]=function(e){return function(){return e.apply(this.doc,arguments)}}(Yt.prototype[Ji]));return Ne(Yt),ft.inputStyles={textarea:wt,contenteditable:nt},ft.defineMode=function(e){!ft.defaults.mode&&e!="null"&&(ft.defaults.mode=e),zn.apply(this,arguments)},ft.defineMIME=vi,ft.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ft.defineMIME("text/plain","null"),ft.defineExtension=function(e,t){ft.prototype[e]=t},ft.defineDocExtension=function(e,t){Yt.prototype[e]=t},ft.fromTextArea=ru,iu(ft),ft.version="5.58.2",ft})},Y1PL:function(Ye,Ie,k){"use strict";var P=k("wx14"),re=k("1OyB"),V=k("vuIU"),ce=k("Ji7U"),oe=k("LK+K"),F=k("q1tI"),R=k("VTBJ"),T=k("rePB"),w=k("Zm9Q"),N=k("Kwbf"),I=k("c+Xe"),U=k("m+aA"),he=k("bdgK"),q=new Map;function _(X){X.forEach(function(ne){var te,z=ne.target;(te=q.get(z))===null||te===void 0||te.forEach(function(Y){return Y(z)})})}var j=new he.default(_),L=null,G=null;function J(X,ne){q.has(X)||(q.set(X,new Set),j.observe(X)),q.get(X).add(ne)}function le(X,ne){q.has(X)&&(q.get(X).delete(ne),q.get(X).size||(j.unobserve(X),q.delete(X)))}var ke=function(X){Object(ce.a)(te,X);var ne=Object(oe.a)(te);function te(){return Object(re.a)(this,te),ne.apply(this,arguments)}return Object(V.a)(te,[{key:"render",value:function(){return this.props.children}}]),te}(F.Component),ye=F.createContext(null);function ge(X){var ne=X.children,te=X.onBatchResize,z=F.useRef(0),Y=F.useRef([]),xe=F.useContext(ye),f=F.useCallback(function(b,p,W){z.current+=1;var Q=z.current;Y.current.push({size:b,element:p,data:W}),Promise.resolve().then(function(){Q===z.current&&(te==null||te(Y.current),Y.current=[])}),xe==null||xe(b,p,W)},[te,xe]);return F.createElement(ye.Provider,{value:f},ne)}function Se(X){var ne=X.children,te=X.disabled,z=F.useRef(null),Y=F.useRef(null),xe=F.useContext(ye),f=F.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),b=F.isValidElement(ne)&&Object(I.c)(ne),p=b?ne.ref:null,W=F.useMemo(function(){return Object(I.a)(p,z)},[p,z]),Q=F.useRef(X);Q.current=X;var $=F.useCallback(function(pe){var Ee=Q.current,Ue=Ee.onResize,Re=Ee.data,Fe=pe.getBoundingClientRect(),We=Fe.width,et=Fe.height,ot=pe.offsetWidth,yt=pe.offsetHeight,ht=Math.floor(We),kt=Math.floor(et);if(f.current.width!==ht||f.current.height!==kt||f.current.offsetWidth!==ot||f.current.offsetHeight!==yt){var gt={width:ht,height:kt,offsetWidth:ot,offsetHeight:yt};f.current=gt;var At=ot===Math.round(We)?We:ot,Le=yt===Math.round(et)?et:yt,Lt=Object(R.a)(Object(R.a)({},gt),{},{offsetWidth:At,offsetHeight:Le});xe==null||xe(Lt,pe,Re),Ue&&Promise.resolve().then(function(){Ue(Lt,pe)})}},[]);return F.useEffect(function(){var pe=Object(U.a)(z.current)||Object(U.a)(Y.current);return pe&&!te&&J(pe,$),function(){return le(pe,$)}},[z.current,te]),F.createElement(ke,{ref:Y},b?F.cloneElement(ne,{ref:W}):ne)}var _e="rc-observer-key";function me(X){var ne=X.children,te=Object(w.a)(ne);return te.map(function(z,Y){var xe=(z==null?void 0:z.key)||"".concat(_e,"-").concat(Y);return F.createElement(Se,Object(P.a)({},X,{key:xe}),z)})}me.Collection=ge;var je=me,ie=k("bT9E"),y=k("TSYQ"),H=k.n(y),D=`
|
|
min-height:0 !important;
|
|
max-height:none !important;
|
|
height:0 !important;
|
|
visibility:hidden !important;
|
|
overflow:hidden !important;
|
|
position:absolute !important;
|
|
z-index:-1000 !important;
|
|
top:0 !important;
|
|
right:0 !important
|
|
`,g=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],B={},S;function E(X){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,te=X.getAttribute("id")||X.getAttribute("data-reactid")||X.getAttribute("name");if(ne&&B[te])return B[te];var z=window.getComputedStyle(X),Y=z.getPropertyValue("box-sizing")||z.getPropertyValue("-moz-box-sizing")||z.getPropertyValue("-webkit-box-sizing"),xe=parseFloat(z.getPropertyValue("padding-bottom"))+parseFloat(z.getPropertyValue("padding-top")),f=parseFloat(z.getPropertyValue("border-bottom-width"))+parseFloat(z.getPropertyValue("border-top-width")),b=g.map(function(W){return"".concat(W,":").concat(z.getPropertyValue(W))}).join(";"),p={sizingStyle:b,paddingSize:xe,borderSize:f,boxSizing:Y};return ne&&te&&(B[te]=p),p}function x(X){var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;S||(S=document.createElement("textarea"),S.setAttribute("tab-index","-1"),S.setAttribute("aria-hidden","true"),document.body.appendChild(S)),X.getAttribute("wrap")?S.setAttribute("wrap",X.getAttribute("wrap")):S.removeAttribute("wrap");var Y=E(X,ne),xe=Y.paddingSize,f=Y.borderSize,b=Y.boxSizing,p=Y.sizingStyle;S.setAttribute("style","".concat(p,";").concat(D)),S.value=X.value||X.placeholder||"";var W=Number.MIN_SAFE_INTEGER,Q=Number.MAX_SAFE_INTEGER,$=S.scrollHeight,pe;if(b==="border-box"?$+=f:b==="content-box"&&($-=xe),te!==null||z!==null){S.value=" ";var Ee=S.scrollHeight-xe;te!==null&&(W=Ee*te,b==="border-box"&&(W=W+xe+f),$=Math.max(W,$)),z!==null&&(Q=Ee*z,b==="border-box"&&(Q=Q+xe+f),pe=$>Q?"":"hidden",$=Math.min(Q,$))}return{height:$,minHeight:W,maxHeight:Q,overflowY:pe,resize:"none"}}var c=k("Gytx"),l=k.n(c),h;(function(X){X[X.NONE=0]="NONE",X[X.RESIZING=1]="RESIZING",X[X.RESIZED=2]="RESIZED"})(h||(h={}));var C=function(X){Object(ce.a)(te,X);var ne=Object(oe.a)(te);function te(z){var Y;return Object(re.a)(this,te),Y=ne.call(this,z),Y.nextFrameActionId=void 0,Y.resizeFrameId=void 0,Y.textArea=void 0,Y.saveTextArea=function(xe){Y.textArea=xe},Y.handleResize=function(xe){var f=Y.state.resizeStatus,b=Y.props,p=b.autoSize,W=b.onResize;if(f!==h.NONE)return;typeof W=="function"&&W(xe),p&&Y.resizeOnNextFrame()},Y.resizeOnNextFrame=function(){cancelAnimationFrame(Y.nextFrameActionId),Y.nextFrameActionId=requestAnimationFrame(Y.resizeTextarea)},Y.resizeTextarea=function(){var xe=Y.props.autoSize;if(!xe||!Y.textArea)return;var f=xe.minRows,b=xe.maxRows,p=x(Y.textArea,!1,f,b);Y.setState({textareaStyles:p,resizeStatus:h.RESIZING},function(){cancelAnimationFrame(Y.resizeFrameId),Y.resizeFrameId=requestAnimationFrame(function(){Y.setState({resizeStatus:h.RESIZED},function(){Y.resizeFrameId=requestAnimationFrame(function(){Y.setState({resizeStatus:h.NONE}),Y.fixFirefoxAutoScroll()})})})})},Y.renderTextArea=function(){var xe=Y.props,f=xe.prefixCls,b=f===void 0?"rc-textarea":f,p=xe.autoSize,W=xe.onResize,Q=xe.className,$=xe.disabled,pe=Y.state,Ee=pe.textareaStyles,Ue=pe.resizeStatus,Re=Object(ie.a)(Y.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Fe=H()(b,Q,Object(T.a)({},"".concat(b,"-disabled"),$));"value"in Re&&(Re.value=Re.value||"");var We=Object(R.a)(Object(R.a)(Object(R.a)({},Y.props.style),Ee),Ue===h.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return F.createElement(je,{onResize:Y.handleResize,disabled:!(p||W)},F.createElement("textarea",Object(P.a)({},Re,{className:Fe,style:We,ref:Y.saveTextArea})))},Y.state={textareaStyles:{},resizeStatus:h.NONE},Y}return Object(V.a)(te,[{key:"componentDidUpdate",value:function(Y){(Y.value!==this.props.value||!l()(Y.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var Y=this.textArea.selectionStart,xe=this.textArea.selectionEnd;this.textArea.setSelectionRange(Y,xe)}}catch(f){}}},{key:"render",value:function(){return this.renderTextArea()}}]),te}(F.Component),A=C,Z=function(X){Object(ce.a)(te,X);var ne=Object(oe.a)(te);function te(z){var Y;Object(re.a)(this,te),Y=ne.call(this,z),Y.resizableTextArea=void 0,Y.focus=function(){Y.resizableTextArea.textArea.focus()},Y.saveTextArea=function(f){Y.resizableTextArea=f},Y.handleChange=function(f){var b=Y.props.onChange;Y.setValue(f.target.value,function(){Y.resizableTextArea.resizeTextarea()}),b&&b(f)},Y.handleKeyDown=function(f){var b=Y.props,p=b.onPressEnter,W=b.onKeyDown;f.keyCode===13&&p&&p(f),W&&W(f)};var xe=typeof z.value=="undefined"||z.value===null?z.defaultValue:z.value;return Y.state={value:xe},Y}return Object(V.a)(te,[{key:"setValue",value:function(Y,xe){"value"in this.props||this.setState({value:Y},xe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return F.createElement(A,Object(P.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Y){return"value"in Y?{value:Y.value}:null}}]),te}(F.Component),de=Ie.a=Z},ZpRC:function(Ye,Ie,k){"use strict";function P(I){return typeof I=="object"&&I!=null&&I.nodeType===1}function re(I,U){return(!U||I!=="hidden")&&I!=="visible"&&I!=="clip"}function V(I,U){if(I.clientHeight<I.scrollHeight||I.clientWidth<I.scrollWidth){var he=getComputedStyle(I,null);return re(he.overflowY,U)||re(he.overflowX,U)||function(q){var _=function(j){if(!j.ownerDocument||!j.ownerDocument.defaultView)return null;try{return j.ownerDocument.defaultView.frameElement}catch(L){return null}}(q);return!!_&&(_.clientHeight<q.scrollHeight||_.clientWidth<q.scrollWidth)}(I)}return!1}function ce(I,U,he,q,_,j,L,G){return j<I&&L>U||j>I&&L<U?0:j<=I&&G<=he||L>=U&&G>=he?j-I-q:L>U&&G<he||j<I&&G>he?L-U+_:0}var oe=function(I,U){var he=window,q=U.scrollMode,_=U.block,j=U.inline,L=U.boundary,G=U.skipOverflowHiddenElements,J=typeof L=="function"?L:function(Ee){return Ee!==L};if(!P(I))throw new TypeError("Invalid target");for(var le=document.scrollingElement||document.documentElement,ke=[],ye=I;P(ye)&&J(ye);){if((ye=ye.parentElement)===le){ke.push(ye);break}ye!=null&&ye===document.body&&V(ye)&&!V(document.documentElement)||ye!=null&&V(ye,G)&&ke.push(ye)}for(var ge=he.visualViewport?he.visualViewport.width:innerWidth,Se=he.visualViewport?he.visualViewport.height:innerHeight,_e=window.scrollX||pageXOffset,me=window.scrollY||pageYOffset,je=I.getBoundingClientRect(),ie=je.height,y=je.width,H=je.top,D=je.right,g=je.bottom,B=je.left,S=_==="start"||_==="nearest"?H:_==="end"?g:H+ie/2,E=j==="center"?B+y/2:j==="end"?D:B,x=[],c=0;c<ke.length;c++){var l=ke[c],h=l.getBoundingClientRect(),C=h.height,A=h.width,Z=h.top,de=h.right,X=h.bottom,ne=h.left;if(q==="if-needed"&&H>=0&&B>=0&&g<=Se&&D<=ge&&H>=Z&&g<=X&&B>=ne&&D<=de)return x;var te=getComputedStyle(l),z=parseInt(te.borderLeftWidth,10),Y=parseInt(te.borderTopWidth,10),xe=parseInt(te.borderRightWidth,10),f=parseInt(te.borderBottomWidth,10),b=0,p=0,W="offsetWidth"in l?l.offsetWidth-l.clientWidth-z-xe:0,Q="offsetHeight"in l?l.offsetHeight-l.clientHeight-Y-f:0;if(le===l)b=_==="start"?S:_==="end"?S-Se:_==="nearest"?ce(me,me+Se,Se,Y,f,me+S,me+S+ie,ie):S-Se/2,p=j==="start"?E:j==="center"?E-ge/2:j==="end"?E-ge:ce(_e,_e+ge,ge,z,xe,_e+E,_e+E+y,y),b=Math.max(0,b+me),p=Math.max(0,p+_e);else{b=_==="start"?S-Z-Y:_==="end"?S-X+f+Q:_==="nearest"?ce(Z,X,C,Y,f+Q,S,S+ie,ie):S-(Z+C/2)+Q/2,p=j==="start"?E-ne-z:j==="center"?E-(ne+A/2)+W/2:j==="end"?E-de+xe+W:ce(ne,de,A,z,xe+W,E,E+y,y);var $=l.scrollLeft,pe=l.scrollTop;S+=pe-(b=Math.max(0,Math.min(pe+b,l.scrollHeight-C+Q))),E+=$-(p=Math.max(0,Math.min($+p,l.scrollWidth-A+W)))}x.push({el:l,top:b,left:p})}return x};function F(I){return I===Object(I)&&Object.keys(I).length!==0}function R(I,U){U===void 0&&(U="auto");var he="scrollBehavior"in document.body.style;I.forEach(function(q){var _=q.el,j=q.top,L=q.left;_.scroll&&he?_.scroll({top:j,left:L,behavior:U}):(_.scrollTop=j,_.scrollLeft=L)})}function T(I){return I===!1?{block:"end",inline:"nearest"}:F(I)?I:{block:"start",inline:"nearest"}}function w(I,U){var he=!I.ownerDocument.documentElement.contains(I);if(F(U)&&typeof U.behavior=="function")return U.behavior(he?[]:oe(I,U));if(he)return;var q=T(U);return R(oe(I,q),q.behavior)}var N=Ie.a=w},Zss7:function(Ye,Ie,k){var P;(function(re){var V=/^\s+/,ce=/\s+$/,oe=0,F=re.round,R=re.min,T=re.max,w=re.random;function N(f,b){if(f=f||"",b=b||{},f instanceof N)return f;if(!(this instanceof N))return new N(f,b);var p=I(f);this._originalInput=f,this._r=p.r,this._g=p.g,this._b=p.b,this._a=p.a,this._roundA=F(100*this._a)/100,this._format=b.format||p.format,this._gradientType=b.gradientType,this._r<1&&(this._r=F(this._r)),this._g<1&&(this._g=F(this._g)),this._b<1&&(this._b=F(this._b)),this._ok=p.ok,this._tc_id=oe++}N.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var f=this.toRgb();return(f.r*299+f.g*587+f.b*114)/1e3},getLuminance:function(){var f=this.toRgb(),b,p,W,Q,$,pe;return b=f.r/255,p=f.g/255,W=f.b/255,b<=.03928?Q=b/12.92:Q=re.pow((b+.055)/1.055,2.4),p<=.03928?$=p/12.92:$=re.pow((p+.055)/1.055,2.4),W<=.03928?pe=W/12.92:pe=re.pow((W+.055)/1.055,2.4),.2126*Q+.7152*$+.0722*pe},setAlpha:function(f){return this._a=x(f),this._roundA=F(100*this._a)/100,this},toHsv:function(){var f=_(this._r,this._g,this._b);return{h:f.h*360,s:f.s,v:f.v,a:this._a}},toHsvString:function(){var f=_(this._r,this._g,this._b),b=F(f.h*360),p=F(f.s*100),W=F(f.v*100);return this._a==1?"hsv("+b+", "+p+"%, "+W+"%)":"hsva("+b+", "+p+"%, "+W+"%, "+this._roundA+")"},toHsl:function(){var f=he(this._r,this._g,this._b);return{h:f.h*360,s:f.s,l:f.l,a:this._a}},toHslString:function(){var f=he(this._r,this._g,this._b),b=F(f.h*360),p=F(f.s*100),W=F(f.l*100);return this._a==1?"hsl("+b+", "+p+"%, "+W+"%)":"hsla("+b+", "+p+"%, "+W+"%, "+this._roundA+")"},toHex:function(f){return L(this._r,this._g,this._b,f)},toHexString:function(f){return"#"+this.toHex(f)},toHex8:function(f){return G(this._r,this._g,this._b,this._a,f)},toHex8String:function(f){return"#"+this.toHex8(f)},toRgb:function(){return{r:F(this._r),g:F(this._g),b:F(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+F(this._r)+", "+F(this._g)+", "+F(this._b)+")":"rgba("+F(this._r)+", "+F(this._g)+", "+F(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:F(c(this._r,255)*100)+"%",g:F(c(this._g,255)*100)+"%",b:F(c(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+F(c(this._r,255)*100)+"%, "+F(c(this._g,255)*100)+"%, "+F(c(this._b,255)*100)+"%)":"rgba("+F(c(this._r,255)*100)+"%, "+F(c(this._g,255)*100)+"%, "+F(c(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:S[L(this._r,this._g,this._b,!0)]||!1},toFilter:function(f){var b="#"+J(this._r,this._g,this._b,this._a),p=b,W=this._gradientType?"GradientType = 1, ":"";if(f){var Q=N(f);p="#"+J(Q._r,Q._g,Q._b,Q._a)}return"progid:DXImageTransform.Microsoft.gradient("+W+"startColorstr="+b+",endColorstr="+p+")"},toString:function(f){var b=!!f;f=f||this._format;var p=!1,W=this._a<1&&this._a>=0,Q=!b&&W&&(f==="hex"||f==="hex6"||f==="hex3"||f==="hex4"||f==="hex8"||f==="name");return Q?f==="name"&&this._a===0?this.toName():this.toRgbString():(f==="rgb"&&(p=this.toRgbString()),f==="prgb"&&(p=this.toPercentageRgbString()),(f==="hex"||f==="hex6")&&(p=this.toHexString()),f==="hex3"&&(p=this.toHexString(!0)),f==="hex4"&&(p=this.toHex8String(!0)),f==="hex8"&&(p=this.toHex8String()),f==="name"&&(p=this.toName()),f==="hsl"&&(p=this.toHslString()),f==="hsv"&&(p=this.toHsvString()),p||this.toHexString())},clone:function(){return N(this.toString())},_applyModification:function(f,b){var p=f.apply(null,[this].concat([].slice.call(b)));return this._r=p._r,this._g=p._g,this._b=p._b,this.setAlpha(p._a),this},lighten:function(){return this._applyModification(ge,arguments)},brighten:function(){return this._applyModification(Se,arguments)},darken:function(){return this._applyModification(_e,arguments)},desaturate:function(){return this._applyModification(le,arguments)},saturate:function(){return this._applyModification(ke,arguments)},greyscale:function(){return this._applyModification(ye,arguments)},spin:function(){return this._applyModification(me,arguments)},_applyCombination:function(f,b){return f.apply(null,[this].concat([].slice.call(b)))},analogous:function(){return this._applyCombination(D,arguments)},complement:function(){return this._applyCombination(je,arguments)},monochromatic:function(){return this._applyCombination(g,arguments)},splitcomplement:function(){return this._applyCombination(H,arguments)},triad:function(){return this._applyCombination(ie,arguments)},tetrad:function(){return this._applyCombination(y,arguments)}},N.fromRatio=function(f,b){if(typeof f=="object"){var p={};for(var W in f)f.hasOwnProperty(W)&&(W==="a"?p[W]=f[W]:p[W]=de(f[W]));f=p}return N(f,b)};function I(f){var b={r:0,g:0,b:0},p=1,W=null,Q=null,$=null,pe=!1,Ee=!1;return typeof f=="string"&&(f=Y(f)),typeof f=="object"&&(z(f.r)&&z(f.g)&&z(f.b)?(b=U(f.r,f.g,f.b),pe=!0,Ee=String(f.r).substr(-1)==="%"?"prgb":"rgb"):z(f.h)&&z(f.s)&&z(f.v)?(W=de(f.s),Q=de(f.v),b=j(f.h,W,Q),pe=!0,Ee="hsv"):z(f.h)&&z(f.s)&&z(f.l)&&(W=de(f.s),$=de(f.l),b=q(f.h,W,$),pe=!0,Ee="hsl"),f.hasOwnProperty("a")&&(p=f.a)),p=x(p),{ok:pe,format:f.format||Ee,r:R(255,T(b.r,0)),g:R(255,T(b.g,0)),b:R(255,T(b.b,0)),a:p}}function U(f,b,p){return{r:c(f,255)*255,g:c(b,255)*255,b:c(p,255)*255}}function he(f,b,p){f=c(f,255),b=c(b,255),p=c(p,255);var W=T(f,b,p),Q=R(f,b,p),$,pe,Ee=(W+Q)/2;if(W==Q)$=pe=0;else{var Ue=W-Q;pe=Ee>.5?Ue/(2-W-Q):Ue/(W+Q);switch(W){case f:$=(b-p)/Ue+(b<p?6:0);break;case b:$=(p-f)/Ue+2;break;case p:$=(f-b)/Ue+4;break}$/=6}return{h:$,s:pe,l:Ee}}function q(f,b,p){var W,Q,$;f=c(f,360),b=c(b,100),p=c(p,100);function pe(Re,Fe,We){return We<0&&(We+=1),We>1&&(We-=1),We<1/6?Re+(Fe-Re)*6*We:We<1/2?Fe:We<2/3?Re+(Fe-Re)*(2/3-We)*6:Re}if(b===0)W=Q=$=p;else{var Ee=p<.5?p*(1+b):p+b-p*b,Ue=2*p-Ee;W=pe(Ue,Ee,f+1/3),Q=pe(Ue,Ee,f),$=pe(Ue,Ee,f-1/3)}return{r:W*255,g:Q*255,b:$*255}}function _(f,b,p){f=c(f,255),b=c(b,255),p=c(p,255);var W=T(f,b,p),Q=R(f,b,p),$,pe,Ee=W,Ue=W-Q;if(pe=W===0?0:Ue/W,W==Q)$=0;else{switch(W){case f:$=(b-p)/Ue+(b<p?6:0);break;case b:$=(p-f)/Ue+2;break;case p:$=(f-b)/Ue+4;break}$/=6}return{h:$,s:pe,v:Ee}}function j(f,b,p){f=c(f,360)*6,b=c(b,100),p=c(p,100);var W=re.floor(f),Q=f-W,$=p*(1-b),pe=p*(1-Q*b),Ee=p*(1-(1-Q)*b),Ue=W%6,Re=[p,pe,$,$,Ee,p][Ue],Fe=[Ee,p,p,pe,$,$][Ue],We=[$,$,Ee,p,p,pe][Ue];return{r:Re*255,g:Fe*255,b:We*255}}function L(f,b,p,W){var Q=[Z(F(f).toString(16)),Z(F(b).toString(16)),Z(F(p).toString(16))];return W&&Q[0].charAt(0)==Q[0].charAt(1)&&Q[1].charAt(0)==Q[1].charAt(1)&&Q[2].charAt(0)==Q[2].charAt(1)?Q[0].charAt(0)+Q[1].charAt(0)+Q[2].charAt(0):Q.join("")}function G(f,b,p,W,Q){var $=[Z(F(f).toString(16)),Z(F(b).toString(16)),Z(F(p).toString(16)),Z(X(W))];return Q&&$[0].charAt(0)==$[0].charAt(1)&&$[1].charAt(0)==$[1].charAt(1)&&$[2].charAt(0)==$[2].charAt(1)&&$[3].charAt(0)==$[3].charAt(1)?$[0].charAt(0)+$[1].charAt(0)+$[2].charAt(0)+$[3].charAt(0):$.join("")}function J(f,b,p,W){var Q=[Z(X(W)),Z(F(f).toString(16)),Z(F(b).toString(16)),Z(F(p).toString(16))];return Q.join("")}N.equals=function(f,b){return!f||!b?!1:N(f).toRgbString()==N(b).toRgbString()},N.random=function(){return N.fromRatio({r:w(),g:w(),b:w()})};function le(f,b){b=b===0?0:b||10;var p=N(f).toHsl();return p.s-=b/100,p.s=l(p.s),N(p)}function ke(f,b){b=b===0?0:b||10;var p=N(f).toHsl();return p.s+=b/100,p.s=l(p.s),N(p)}function ye(f){return N(f).desaturate(100)}function ge(f,b){b=b===0?0:b||10;var p=N(f).toHsl();return p.l+=b/100,p.l=l(p.l),N(p)}function Se(f,b){b=b===0?0:b||10;var p=N(f).toRgb();return p.r=T(0,R(255,p.r-F(255*-(b/100)))),p.g=T(0,R(255,p.g-F(255*-(b/100)))),p.b=T(0,R(255,p.b-F(255*-(b/100)))),N(p)}function _e(f,b){b=b===0?0:b||10;var p=N(f).toHsl();return p.l-=b/100,p.l=l(p.l),N(p)}function me(f,b){var p=N(f).toHsl(),W=(p.h+b)%360;return p.h=W<0?360+W:W,N(p)}function je(f){var b=N(f).toHsl();return b.h=(b.h+180)%360,N(b)}function ie(f){var b=N(f).toHsl(),p=b.h;return[N(f),N({h:(p+120)%360,s:b.s,l:b.l}),N({h:(p+240)%360,s:b.s,l:b.l})]}function y(f){var b=N(f).toHsl(),p=b.h;return[N(f),N({h:(p+90)%360,s:b.s,l:b.l}),N({h:(p+180)%360,s:b.s,l:b.l}),N({h:(p+270)%360,s:b.s,l:b.l})]}function H(f){var b=N(f).toHsl(),p=b.h;return[N(f),N({h:(p+72)%360,s:b.s,l:b.l}),N({h:(p+216)%360,s:b.s,l:b.l})]}function D(f,b,p){b=b||6,p=p||30;var W=N(f).toHsl(),Q=360/p,$=[N(f)];for(W.h=(W.h-(Q*b>>1)+720)%360;--b;)W.h=(W.h+Q)%360,$.push(N(W));return $}function g(f,b){b=b||6;for(var p=N(f).toHsv(),W=p.h,Q=p.s,$=p.v,pe=[],Ee=1/b;b--;)pe.push(N({h:W,s:Q,v:$})),$=($+Ee)%1;return pe}N.mix=function(f,b,p){p=p===0?0:p||50;var W=N(f).toRgb(),Q=N(b).toRgb(),$=p/100,pe={r:(Q.r-W.r)*$+W.r,g:(Q.g-W.g)*$+W.g,b:(Q.b-W.b)*$+W.b,a:(Q.a-W.a)*$+W.a};return N(pe)},N.readability=function(f,b){var p=N(f),W=N(b);return(re.max(p.getLuminance(),W.getLuminance())+.05)/(re.min(p.getLuminance(),W.getLuminance())+.05)},N.isReadable=function(f,b,p){var W=N.readability(f,b),Q,$;$=!1,Q=xe(p);switch(Q.level+Q.size){case"AAsmall":case"AAAlarge":$=W>=4.5;break;case"AAlarge":$=W>=3;break;case"AAAsmall":$=W>=7;break}return $},N.mostReadable=function(f,b,p){var W=null,Q=0,$,pe,Ee,Ue;p=p||{},pe=p.includeFallbackColors,Ee=p.level,Ue=p.size;for(var Re=0;Re<b.length;Re++)$=N.readability(f,b[Re]),$>Q&&(Q=$,W=N(b[Re]));return N.isReadable(f,W,{level:Ee,size:Ue})||!pe?W:(p.includeFallbackColors=!1,N.mostReadable(f,["#fff","#000"],p))};var B=N.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=N.hexNames=E(B);function E(f){var b={};for(var p in f)f.hasOwnProperty(p)&&(b[f[p]]=p);return b}function x(f){return f=parseFloat(f),(isNaN(f)||f<0||f>1)&&(f=1),f}function c(f,b){C(f)&&(f="100%");var p=A(f);return f=R(b,T(0,parseFloat(f))),p&&(f=parseInt(f*b,10)/100),re.abs(f-b)<1e-6?1:f%b/parseFloat(b)}function l(f){return R(1,T(0,f))}function h(f){return parseInt(f,16)}function C(f){return typeof f=="string"&&f.indexOf(".")!=-1&&parseFloat(f)===1}function A(f){return typeof f=="string"&&f.indexOf("%")!=-1}function Z(f){return f.length==1?"0"+f:""+f}function de(f){return f<=1&&(f=f*100+"%"),f}function X(f){return re.round(parseFloat(f)*255).toString(16)}function ne(f){return h(f)/255}var te=function(){var f="[-\\+]?\\d+%?",b="[-\\+]?\\d*\\.\\d+%?",p="(?:"+b+")|(?:"+f+")",W="[\\s|\\(]+("+p+")[,|\\s]+("+p+")[,|\\s]+("+p+")\\s*\\)?",Q="[\\s|\\(]+("+p+")[,|\\s]+("+p+")[,|\\s]+("+p+")[,|\\s]+("+p+")\\s*\\)?";return{CSS_UNIT:new RegExp(p),rgb:new RegExp("rgb"+W),rgba:new RegExp("rgba"+Q),hsl:new RegExp("hsl"+W),hsla:new RegExp("hsla"+Q),hsv:new RegExp("hsv"+W),hsva:new RegExp("hsva"+Q),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function z(f){return!!te.CSS_UNIT.exec(f)}function Y(f){f=f.replace(V,"").replace(ce,"").toLowerCase();var b=!1;if(B[f])f=B[f],b=!0;else if(f=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var p;return(p=te.rgb.exec(f))?{r:p[1],g:p[2],b:p[3]}:(p=te.rgba.exec(f))?{r:p[1],g:p[2],b:p[3],a:p[4]}:(p=te.hsl.exec(f))?{h:p[1],s:p[2],l:p[3]}:(p=te.hsla.exec(f))?{h:p[1],s:p[2],l:p[3],a:p[4]}:(p=te.hsv.exec(f))?{h:p[1],s:p[2],v:p[3]}:(p=te.hsva.exec(f))?{h:p[1],s:p[2],v:p[3],a:p[4]}:(p=te.hex8.exec(f))?{r:h(p[1]),g:h(p[2]),b:h(p[3]),a:ne(p[4]),format:b?"name":"hex8"}:(p=te.hex6.exec(f))?{r:h(p[1]),g:h(p[2]),b:h(p[3]),format:b?"name":"hex"}:(p=te.hex4.exec(f))?{r:h(p[1]+""+p[1]),g:h(p[2]+""+p[2]),b:h(p[3]+""+p[3]),a:ne(p[4]+""+p[4]),format:b?"name":"hex8"}:(p=te.hex3.exec(f))?{r:h(p[1]+""+p[1]),g:h(p[2]+""+p[2]),b:h(p[3]+""+p[3]),format:b?"name":"hex"}:!1}function xe(f){var b,p;return f=f||{level:"AA",size:"small"},b=(f.level||"AA").toUpperCase(),p=(f.size||"small").toLowerCase(),b!=="AA"&&b!=="AAA"&&(b="AA"),p!=="small"&&p!=="large"&&(p="small"),{level:b,size:p}}Ye.exports?Ye.exports=N:!(P=function(){return N}.call(Ie,k,Ie,Ye),P!==void 0&&(Ye.exports=P))})(Math)},bT9E:function(Ye,Ie,k){"use strict";k.d(Ie,"a",function(){return re});var P=k("VTBJ");function re(V,ce){var oe=Object(P.a)({},V);return Array.isArray(ce)&&ce.forEach(function(F){delete oe[F]}),oe}},c5Ni:function(Ye,Ie,k){},dejd:function(Ye,Ie,k){},dmUQ:function(Ye,Ie,k){"use strict";var P=k("Ff2n"),re=k("rePB"),V=k("1OyB"),ce=k("vuIU"),oe=k("Ji7U"),F=k("md7G"),R=k("foSv"),T=k("q1tI"),w=k.n(T),N=k("TSYQ"),I=k.n(N),U=k("4IlW");function he(ie,y){var H=Object.keys(ie);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(ie);y&&(D=D.filter(function(g){return Object.getOwnPropertyDescriptor(ie,g).enumerable})),H.push.apply(H,D)}return H}function q(ie){for(var y=1;y<arguments.length;y++){var H=arguments[y]!=null?arguments[y]:{};y%2?he(Object(H),!0).forEach(function(D){Object(re.a)(ie,D,H[D])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ie,Object.getOwnPropertyDescriptors(H)):he(Object(H)).forEach(function(D){Object.defineProperty(ie,D,Object.getOwnPropertyDescriptor(H,D))})}return ie}function _(ie){var y=j();return function(){var D=Object(R.a)(ie),g;if(y){var B=Object(R.a)(this).constructor;g=Reflect.construct(D,arguments,B)}else g=D.apply(this,arguments);return Object(F.a)(this,g)}}function j(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(ie){return!1}}function L(){}function G(ie){ie.preventDefault()}var J=function(y){return y.replace(/[^\w.-]+/g,"")},le=200,ke=600,ye=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ge=function(y){return y!=null},Se=function(y,H){return H===y||typeof H=="number"&&typeof y=="number"&&isNaN(H)&&isNaN(y)},_e=function(ie){Object(oe.a)(H,ie);var y=_(H);function H(D){var g;Object(V.a)(this,H),g=y.call(this,D),g.onKeyDown=function(E){var x=g.props,c=x.onKeyDown,l=x.onPressEnter;if(E.keyCode===U.a.UP){var h=g.getRatio(E);g.up(E,h,null),g.stop()}else if(E.keyCode===U.a.DOWN){var C=g.getRatio(E);g.down(E,C,null),g.stop()}else E.keyCode===U.a.ENTER&&l&&l(E);if(g.recordCursorPosition(),g.lastKeyCode=E.keyCode,c){for(var A=arguments.length,Z=new Array(A>1?A-1:0),de=1;de<A;de++)Z[de-1]=arguments[de];c.apply(void 0,[E].concat(Z))}},g.onKeyUp=function(E){var x=g.props.onKeyUp;if(g.stop(),g.recordCursorPosition(),x){for(var c=arguments.length,l=new Array(c>1?c-1:0),h=1;h<c;h++)l[h-1]=arguments[h];x.apply(void 0,[E].concat(l))}},g.onChange=function(E){var x=g.props.onChange;g.state.focused&&(g.inputting=!0),g.rawInput=g.props.parser(g.getValueFromEvent(E)),g.setState({inputValue:g.rawInput}),x(g.toNumber(g.rawInput))},g.onMouseUp=function(){var E=g.props.onMouseUp;g.recordCursorPosition(),E&&E.apply(void 0,arguments)},g.onFocus=function(){var E;g.setState({focused:!0}),(E=g.props).onFocus.apply(E,arguments)},g.onBlur=function(){var E=g.props.onBlur;g.inputting=!1,g.setState({focused:!1});var x=g.getCurrentValidValue(g.state.inputValue),c=g.setValue(x,L);if(E){var l=g.input.value,h=g.getInputDisplayValue({focus:!1,value:c});g.input.value=h&&Number(h),E.apply(void 0,arguments),g.input.value=l}},g.getRatio=function(E){var x=1;return E.metaKey||E.ctrlKey?x=.1:E.shiftKey&&(x=10),x},g.getFullNum=function(E){return isNaN(E)?E:/e/i.test(String(E))?Number(E).toFixed(18).replace(/\.?0+$/,""):E},g.getPrecision=function(E){if(ge(g.props.precision))return g.props.precision;var x=String(E);if(x.indexOf("e-")>=0)return parseInt(x.slice(x.indexOf("e-")+2),10);var c=0;return x.indexOf(".")>=0&&(c=x.length-x.indexOf(".")-1),c},g.getInputDisplayValue=function(E){var x=E||g.state,c=x.focused,l=x.inputValue,h=x.value,C;c?C=l:C=g.toPrecisionAsStep(h),C==null&&(C="");var A=g.formatWrapper(C);return ge(g.props.decimalSeparator)&&(A=A.toString().replace(".",g.props.decimalSeparator)),A},g.recordCursorPosition=function(){try{g.cursorStart=g.input.selectionStart,g.cursorEnd=g.input.selectionEnd,g.currentValue=g.input.value,g.cursorBefore=g.input.value.substring(0,g.cursorStart),g.cursorAfter=g.input.value.substring(g.cursorEnd)}catch(E){}},g.restoreByAfter=function(E){if(E===void 0)return!1;var x=g.input.value,c=x.lastIndexOf(E);if(c===-1)return!1;var l=g.cursorBefore.length;return g.lastKeyCode===U.a.DELETE&&g.cursorBefore.charAt(l-1)===E[0]?(g.fixCaret(l,l),!0):c+E.length===x.length?(g.fixCaret(c,c),!0):!1},g.partRestoreByAfter=function(E){return E===void 0?!1:Array.prototype.some.call(E,function(x,c){var l=E.substring(c);return g.restoreByAfter(l)})},g.isNotCompleteNumber=function(E){return isNaN(E)||E===""||E===null||E&&E.toString().indexOf(".")===E.toString().length-1},g.stop=function(){g.autoStepTimer&&clearTimeout(g.autoStepTimer)},g.down=function(E,x,c){g.pressingUpOrDown=!0,g.step("down",E,x,c)},g.up=function(E,x,c){g.pressingUpOrDown=!0,g.step("up",E,x,c)},g.saveInput=function(E){g.input=E};var B=D.value;B===void 0&&(B=D.defaultValue),g.state={focused:D.autoFocus};var S=g.getValidValue(g.toNumber(B));return g.state=q(q({},g.state),{},{inputValue:g.toPrecisionAsStep(S),value:S}),g}return Object(ce.a)(H,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(g){var B=this.props,S=B.value,E=B.onChange,x=B.max,c=B.min,l=this.state.focused;if(g){if(!Se(g.value,S)||!Se(g.max,x)||!Se(g.min,c)){var h=l?S:this.getValidValue(S),C;this.pressingUpOrDown?C=h:this.inputting?C=this.rawInput:C=this.toPrecisionAsStep(h),this.setState({value:h,inputValue:C})}var A="value"in this.props?S:this.state.value;"max"in this.props&&g.max!==x&&typeof A=="number"&&A>x&&E&&E(x),"min"in this.props&&g.min!==c&&typeof A=="number"&&A<c&&E&&E(c)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Z=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===U.a.BACKSPACE?Z=this.cursorStart-1:this.lastKeyCode===U.a.DELETE&&(Z=this.cursorStart):Z=this.input.value.length,this.fixCaret(Z,Z)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case U.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case U.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(de){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(g){var B=g;return B===""?B="":this.isNotCompleteNumber(parseFloat(B))?B=this.state.value:B=this.getValidValue(B),this.toNumber(B)}},{key:"getValueFromEvent",value:function(g){var B=g.target.value.trim().replace(/。/g,".");return ge(this.props.decimalSeparator)&&(B=B.replace(this.props.decimalSeparator,".")),B}},{key:"getValidValue",value:function(g){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,E=parseFloat(g);return isNaN(E)?g:(E<B&&(E=B),E>S&&(E=S),E)}},{key:"setValue",value:function(g,B){var S=this.props.precision,E=this.isNotCompleteNumber(parseFloat(g))?null:parseFloat(g),x=this.state.value,c=x===void 0?null:x,l=this.state.inputValue,h=l===void 0?null:l,C=typeof E=="number"?E.toFixed(S):"".concat(E),A=E!==c||C!=="".concat(h);return"value"in this.props?(h=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:h},B)):this.setState({value:E,inputValue:this.toPrecisionAsStep(g)},B),A&&this.props.onChange(E),E}},{key:"getMaxPrecision",value:function(g){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,S=this.props,E=S.precision,x=S.step;if(ge(E))return E;var c=this.getPrecision(B),l=this.getPrecision(x),h=this.getPrecision(g);return g?Math.max(h,c+l):c+l}},{key:"getPrecisionFactor",value:function(g){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,S=this.getMaxPrecision(g,B);return Math.pow(10,S)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(g){return this.props.formatter?this.props.formatter(g):g}},{key:"toPrecisionAsStep",value:function(g){if(this.isNotCompleteNumber(g)||g==="")return g;var B=Math.abs(this.getMaxPrecision(g));return isNaN(B)?g.toString():Number(g).toFixed(B)}},{key:"toNumber",value:function(g){var B=this.props.precision,S=this.state.focused,E=g&&g.length>16&&S;return this.isNotCompleteNumber(g)||E?g:ge(B)?Math.round(g*Math.pow(10,B))/Math.pow(10,B):Number(g)}},{key:"upStep",value:function(g,B){var S=this.props.step,E=this.getPrecisionFactor(g,B),x=Math.abs(this.getMaxPrecision(g,B)),c=((E*g+E*S*B)/E).toFixed(x);return this.toNumber(c)}},{key:"downStep",value:function(g,B){var S=this.props.step,E=this.getPrecisionFactor(g,B),x=Math.abs(this.getMaxPrecision(g,B)),c=((E*g-E*S*B)/E).toFixed(x);return this.toNumber(c)}},{key:"step",value:function(g,B){var S=this,E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,x=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var c=this.props;if(c.disabled)return;var l=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(l))return;var h=this["".concat(g,"Step")](l,E),C=h>c.max||h<c.min;if(h>c.max?h=c.max:h<c.min&&(h=c.min),this.setValue(h,null),this.setState({focused:!0},function(){S.pressingUpOrDown=!1}),C)return;this.autoStepTimer=setTimeout(function(){S[g](B,E,!0)},x?le:ke)}},{key:"fixCaret",value:function(g,B){if(g===void 0||B===void 0||!this.input||!this.input.value)return;try{var S=this.input.selectionStart,E=this.input.selectionEnd;(g!==S||B!==E)&&this.input.setSelectionRange(g,B)}catch(x){}}},{key:"render",value:function(){var g,B=this.props,S=B.prefixCls,E=B.disabled,x=B.readOnly,c=B.useTouch,l=B.autoComplete,h=B.upHandler,C=B.downHandler,A=B.className,Z=B.max,de=B.min,X=B.style,ne=B.title,te=B.onMouseEnter,z=B.onMouseLeave,Y=B.onMouseOver,xe=B.onMouseOut,f=B.required,b=B.onClick,p=B.tabIndex,W=B.type,Q=B.placeholder,$=B.id,pe=B.inputMode,Ee=B.pattern,Ue=B.step,Re=B.maxLength,Fe=B.autoFocus,We=B.name,et=B.onPaste,ot=B.onInput,yt=Object(P.a)(B,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),ht=this.state,kt=ht.value,gt=ht.focused,At=I()(S,(g={},Object(re.a)(g,A,!!A),Object(re.a)(g,"".concat(S,"-disabled"),E),Object(re.a)(g,"".concat(S,"-focused"),gt),g)),Le={};Object.keys(yt).forEach(function(Je){(Je.substr(0,5)==="data-"||Je.substr(0,5)==="aria-"||Je==="role")&&(Le[Je]=yt[Je])});var Lt=!x&&!E,vt=this.getInputDisplayValue(null),Qe=(kt||kt===0)&&(isNaN(kt)||Number(kt)>=Z),Be=(kt||kt===0)&&(isNaN(kt)||Number(kt)<=de),se=Qe||E||x,Te=Be||E||x,Ne=I()("".concat(S,"-handler"),"".concat(S,"-handler-up"),Object(re.a)({},"".concat(S,"-handler-up-disabled"),se)),Ae=I()("".concat(S,"-handler"),"".concat(S,"-handler-down"),Object(re.a)({},"".concat(S,"-handler-down-disabled"),Te)),Xe=c?{onTouchStart:se?L:this.up,onTouchEnd:this.stop}:{onMouseDown:se?L:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},tt=c?{onTouchStart:Te?L:this.down,onTouchEnd:this.stop}:{onMouseDown:Te?L:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return w.a.createElement("div",{className:At,style:X,title:ne,onMouseEnter:te,onMouseLeave:z,onMouseOver:Y,onMouseOut:xe,onFocus:function(){return null},onBlur:function(){return null}},w.a.createElement("div",{className:"".concat(S,"-handler-wrap")},w.a.createElement("span",Object.assign({unselectable:"on"},Xe,{role:"button","aria-label":"Increase Value","aria-disabled":se,className:Ne}),h||w.a.createElement("span",{unselectable:"on",className:"".concat(S,"-handler-up-inner"),onClick:G})),w.a.createElement("span",Object.assign({unselectable:"on"},tt,{role:"button","aria-label":"Decrease Value","aria-disabled":Te,className:Ae}),C||w.a.createElement("span",{unselectable:"on",className:"".concat(S,"-handler-down-inner"),onClick:G}))),w.a.createElement("div",{className:"".concat(S,"-input-wrap")},w.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":de,"aria-valuemax":Z,"aria-valuenow":kt,required:f,type:W,placeholder:Q,onPaste:et,onClick:b,onMouseUp:this.onMouseUp,className:"".concat(S,"-input"),tabIndex:p,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Lt?this.onKeyDown:L,onKeyUp:Lt?this.onKeyUp:L,autoFocus:Fe,maxLength:Re,readOnly:x,disabled:E,max:Z,min:de,step:Ue,name:We,title:ne,id:$,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(vt),pattern:Ee,inputMode:pe,onInput:ot},Le))))}}]),H}(w.a.Component);_e.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ye,min:-ye,step:1,style:{},onChange:L,onKeyDown:L,onPressEnter:L,onFocus:L,onBlur:L,parser:J,required:!1,autoComplete:"off"};var me=_e,je=Ie.a=me},gkVt:function(Ye,Ie,k){"use strict";k.r(Ie);var P=k("DZo9"),re=k("8z0m"),V=k("+L6B"),ce=k("2/Rp"),oe=k("miYZ"),F=k("tsqr"),R=k("9og8"),T=k("tJVT"),w=k("WmNS"),N=k.n(w),I=k("q1tI"),U=k.n(I),he=k("5NDa"),q=k("5rEg"),_=k("Ot1p"),j=k("ErOA");function L(ie){var y=ie.setIscreate,H=ie.init,D=ie.UpdateItem,g=Object(I.useState)(""),B=Object(T.a)(g,2),S=B[0],E=B[1],x=Object(I.useState)(""),c=Object(T.a)(x,2),l=c[0],h=c[1];Object(I.useEffect)(function(){if(!D)return;E(D&&D.name),h(D&&D.description)},[D]);function C(){return A.apply(this,arguments)}function A(){return A=Object(R.a)(N.a.mark(function X(){var ne;return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(S){z.next=3;break}return F.b.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A"),z.abrupt("return");case 3:if(l){z.next=6;break}return F.b.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),z.abrupt("return");case 6:if(!D){z.next=9;break}return Z(),z.abrupt("return");case 9:return z.next=11,Object(j.a)("/api/hpc_courses.json",{method:"post",body:{name:S,description:l,container_type:window.location.pathname.split("/")[1]}});case 11:ne=z.sent,ne&&(F.b.info("\u521B\u5EFA\u6210\u529F"),y(!1),H("add"));case 13:case"end":return z.stop()}},X)})),A.apply(this,arguments)}function Z(){return de.apply(this,arguments)}function de(){return de=Object(R.a)(N.a.mark(function X(){var ne;return N.a.wrap(function(z){for(;;)switch(z.prev=z.next){case 0:return z.next=2,Object(j.a)("/api/hpc_courses/".concat(D.id,".json"),{method:"put",body:{name:S,description:l,container_type:window.location.pathname.split("/")[1]}});case 2:ne=z.sent,ne&&(F.b.info("\u7F16\u8F91\u6210\u529F"),y(!1),H(""));case 4:case"end":return z.stop()}},X)})),de.apply(this,arguments)}return U.a.createElement("div",null,U.a.createElement(q.a,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:S,maxLength:60,addonAfter:String(S.length)+"/60",onChange:function(ne){return E(ne.target.value)}}),U.a.createElement(_.a,{id:"courseContentMD",defaultValue:l,onChange:function(ne){return h(ne)}}),U.a.createElement("div",{className:"clearfix mt30 mb30"},U.a.createElement(ce.a,{type:"primary",onClick:function(){return C()},className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),U.a.createElement("a",{className:"defalutCancelbtn fl",onClick:function(){return y(!1)}},"\u53D6\u6D88")))}var G=L,J=k("9Bee");function le(ie){var y=ie.CourseItem,H=ie.userId,D=ie.init,g=ie.ItemUpdate,B=ie.setSee,S=ie.UserInfo;function E(){return x.apply(this,arguments)}function x(){return x=Object(R.a)(N.a.mark(function l(){var h;return N.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.next=2,Object(j.a)("/api/hpc_courses/".concat(y.id,".json"),{method:"delete"});case 2:h=A.sent,h&&(F.b.info("\u5220\u9664\u6210\u529F"),D("delete"),B(!1));case 4:case"end":return A.stop()}},l)})),x.apply(this,arguments)}function c(){g(y)}return U.a.createElement("div",null,H===299635||H===301458||S!=null&&S.admin||S!=null&&S.business?U.a.createElement("div",{style:{textAlign:"right"}},U.a.createElement(ce.a,{onClick:function(){return c()}},"\u7F16\u8F91"),U.a.createElement(ce.a,{onClick:function(){return E()},style:{marginLeft:"30px"}},"\u5220\u9664")):null,U.a.createElement("h1",null,y==null?void 0:y.name),U.a.createElement(J.a,{value:y==null?void 0:y.description}))}var ke=le,ye=k("9ivq"),ge=k("m3rI"),Se=k("Ty5D"),_e=k("9kvl");function me(ie){var y,H,D,g,B,S,E,x,c,l=ie.user,h=ie.dispatch,C=Object(I.useState)(1),A=Object(T.a)(C,2),Z=A[0],de=A[1],X=Object(I.useState)(100),ne=Object(T.a)(X,2),te=ne[0],z=ne[1],Y=Object(I.useState)([]),xe=Object(T.a)(Y,2),f=xe[0],b=xe[1],p=Object(I.useState)(!1),W=Object(T.a)(p,2),Q=W[0],$=W[1],pe=Object(I.useState)(!1),Ee=Object(T.a)(pe,2),Ue=Ee[0],Re=Ee[1],Fe=Object(I.useState)(""),We=Object(T.a)(Fe,2),et=We[0],ot=We[1],yt=Object(I.useState)(""),ht=Object(T.a)(yt,2),kt=ht[0],gt=ht[1],At=Object(I.useState)(""),Le=Object(T.a)(At,2),Lt=Le[0],vt=Le[1],Qe=Object(Se.i)(),Be=Qe.itemname,se=Object(I.useState)(""),Te=Object(T.a)(se,2),Ne=Te[0],Ae=Te[1];Object(I.useEffect)(function(){h({type:"globalSetting/headerToggle",payload:!1}),Z&&Xe("")},[Z]);function Xe(st){return tt.apply(this,arguments)}function tt(){return tt=Object(R.a)(N.a.mark(function st(Nt){var qe,un,Ft,It,cn;return N.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(j.a)("/api/hpc_courses.json",{method:"get",params:{page:Z,per_page:te,container_type:window.location.pathname.split("/")[1]}});case 2:if(qe=Et.sent,!qe){Et.next=24;break}if(un=qe.data.hpc_courses.length,b(qe.data.hpc_courses),vt(qe.data.file_url),gt(""),un){Et.next=10;break}return Et.abrupt("return");case 10:if(Ne){Et.next=14;break}Be?(cn=0,qe==null||((Ft=qe.data)===null||Ft===void 0||((It=Ft.hpc_courses)===null||It===void 0))||It.map(function(Kt,fn){var zn;(Be==null?void 0:Be.toLocaleLowerCase())===(Kt==null||((zn=Kt.name)===null||zn===void 0)?void 0:zn.toLocaleLowerCase())&&(cn=fn)}),ot(qe.data.hpc_courses[cn]),Re(!0),Ae(qe.data.hpc_courses[cn].id),(Be==null?void 0:Be.toLocaleLowerCase())==="resources"&&(ot(qe.data.hpc_courses.filter(function(Kt){return Kt.id===15})[0]),Re(!0),Ae(15))):(ot(qe.data.hpc_courses[0]),Re(!0),Ae(qe.data.hpc_courses[0].id)),Et.next=24;break;case 14:if(!(Nt==="delete")){Et.next=23;break}if(!(un===0)){Et.next=18;break}return Re(!1),Et.abrupt("return");case 18:ot(qe.data.hpc_courses[0]),Re(!0),Ae(qe.data.hpc_courses[0].id),Et.next=24;break;case 23:Nt==="add"?(ot(qe.data.hpc_courses[un-1]),Re(!0),Ae(qe.data.hpc_courses[un-1].id)):(ot(qe.data.hpc_courses.filter(function(Kt){return Kt.id===Ne})[0]),Re(!0),Ae(Ne));case 24:case"end":return Et.stop()}},st)})),tt.apply(this,arguments)}function Je(st){$(!1),Re(!0),ot(st),Ae(st.id)}function pt(st){gt(st),$(!0),Re(!1)}function Tt(){gt(""),$(!0),Re(!1)}var zt={name:"file",multiple:!0,action:"/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange:function(Nt){var qe=Nt.file.status;qe!=="uploading",qe==="done"?(F.b.success("".concat(Nt.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")),Xe("")):qe==="error"&&F.b.error("".concat(Nt.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(Nt){var qe=Nt.size/1024/1024<150;return qe||F.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),qe}};return U.a.createElement("div",{style:{marginBottom:"40px"}},U.a.createElement("div",{className:"bannterdiv",style:{background:"url(".concat(ge.a.IMG_SERVER+"/".concat(Lt),")")}}),U.a.createElement("img",{style:{width:"100%"},src:ge.a.IMG_SERVER+"/".concat(Lt)}),U.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},U.a.createElement("div",{style:{flex:"1",marginTop:"17px"}},f&&f.map(function(st,Nt){return U.a.createElement("p",{key:Nt,onClick:function(){return Je(st)},className:Ne===st.id?"menuitemselect":"menuitem task-hide"},st.name)}),(l==null||((y=l.userInfo)===null||y===void 0)?void 0:y.user_id)===299635||(l==null||((H=l.userInfo)===null||H===void 0)?void 0:H.user_id)===301458||l!=null&&(D=l.userInfo)!==null&&D!==void 0&&D.admin||l!=null&&(g=l.userInfo)!==null&&g!==void 0&&g.business?U.a.createElement("p",{onClick:function(){return Tt()},className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},U.a.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),U.a.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},Q?U.a.createElement(G,{UpdateItem:kt,setIscreate:$,init:Xe}):null,Ue?U.a.createElement(ke,{UserInfo:l==null?void 0:l.userInfo,setSee:Re,userId:l==null||((B=l.userInfo)===null||B===void 0)?void 0:B.user_id,ItemUpdate:pt,CourseItem:et,init:Xe}):null)),(l==null||((S=l.userInfo)===null||S===void 0)?void 0:S.user_id)===299635||(l==null||((E=l.userInfo)===null||E===void 0)?void 0:E.user_id)===301458||l!=null&&(x=l.userInfo)!==null&&x!==void 0&&x.admin||l!=null&&(c=l.userInfo)!==null&&c!==void 0&&c.business?U.a.createElement(re.a,zt,U.a.createElement(ce.a,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var je=Ie.default=Object(_e.a)(function(ie){var y=ie.user;return{user:y}})(me)},h78n:function(Ye,Ie,k){"use strict";k.d(Ie,"a",function(){return g});var P=k("q1tI"),re=k.n(P),V=k("TSYQ"),ce=k.n(V),oe={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},F=function(E){var x=E.map(function(){return Object(P.useRef)()}),c=Object(P.useRef)();return Object(P.useEffect)(function(){var l=Date.now(),h=!1;Object.keys(x).forEach(function(C){var A=x[C].current;if(!A)return;h=!0;var Z=A.style;Z.transitionDuration=".3s, .3s, .3s, .06s",c.current&&l-c.current<100&&(Z.transitionDuration="0s, 0s")}),h&&(c.current=Date.now())}),[x]};function R(){return R=Object.assign||function(S){for(var E=1;E<arguments.length;E++){var x=arguments[E];for(var c in x)Object.prototype.hasOwnProperty.call(x,c)&&(S[c]=x[c])}return S},R.apply(this,arguments)}function T(S,E){return he(S)||U(S,E)||N(S,E)||w()}function w(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N(S,E){if(!S)return;if(typeof S=="string")return I(S,E);var x=Object.prototype.toString.call(S).slice(8,-1);if(x==="Object"&&S.constructor&&(x=S.constructor.name),x==="Map"||x==="Set")return Array.from(S);if(x==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(x))return I(S,E)}function I(S,E){(E==null||E>S.length)&&(E=S.length);for(var x=0,c=new Array(E);x<E;x++)c[x]=S[x];return c}function U(S,E){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(S)))return;var x=[],c=!0,l=!1,h=void 0;try{for(var C=S[Symbol.iterator](),A;!(c=(A=C.next()).done)&&!(x.push(A.value),E&&x.length===E);c=!0);}catch(Z){l=!0,h=Z}finally{try{!c&&C.return!=null&&C.return()}finally{if(l)throw h}}return x}function he(S){if(Array.isArray(S))return S}function q(S,E){if(S==null)return{};var x=_(S,E),c,l;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(S);for(l=0;l<h.length;l++){if(c=h[l],E.indexOf(c)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(S,c))continue;x[c]=S[c]}}return x}function _(S,E){if(S==null)return{};var x={},c=Object.keys(S),l,h;for(h=0;h<c.length;h++){if(l=c[h],E.indexOf(l)>=0)continue;x[l]=S[l]}return x}var j=function(E){var x=E.className,c=E.percent,l=E.prefixCls,h=E.strokeColor,C=E.strokeLinecap,A=E.strokeWidth,Z=E.style,de=E.trailColor,X=E.trailWidth,ne=E.transition,te=q(E,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete te.gapPosition;var z=Array.isArray(c)?c:[c],Y=Array.isArray(h)?h:[h],xe=F(z),f=T(xe,1),b=f[0],p=A/2,W=100-A/2,Q="M ".concat(C==="round"?p:0,",").concat(p,`
|
|
L `).concat(C==="round"?W:100,",").concat(p),$="0 0 100 ".concat(A),pe=0;return re.a.createElement("svg",R({className:ce()("".concat(l,"-line"),x),viewBox:$,preserveAspectRatio:"none",style:Z},te),re.a.createElement("path",{className:"".concat(l,"-line-trail"),d:Q,strokeLinecap:C,stroke:de,strokeWidth:X||A,fillOpacity:"0"}),z.map(function(Ee,Ue){var Re={strokeDasharray:"".concat(Ee,"px, 100px"),strokeDashoffset:"-".concat(pe,"px"),transition:ne||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Fe=Y[Ue]||Y[Y.length-1];return pe+=Ee,re.a.createElement("path",{key:Ue,className:"".concat(l,"-line-path"),d:Q,strokeLinecap:C,stroke:Fe,strokeWidth:A,fillOpacity:"0",ref:b[Ue],style:Re})}))};j.defaultProps=oe;var L=j;function G(){return G=Object.assign||function(S){for(var E=1;E<arguments.length;E++){var x=arguments[E];for(var c in x)Object.prototype.hasOwnProperty.call(x,c)&&(S[c]=x[c])}return S},G.apply(this,arguments)}function J(S,E){return Se(S)||ge(S,E)||ke(S,E)||le()}function le(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ke(S,E){if(!S)return;if(typeof S=="string")return ye(S,E);var x=Object.prototype.toString.call(S).slice(8,-1);if(x==="Object"&&S.constructor&&(x=S.constructor.name),x==="Map"||x==="Set")return Array.from(S);if(x==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(x))return ye(S,E)}function ye(S,E){(E==null||E>S.length)&&(E=S.length);for(var x=0,c=new Array(E);x<E;x++)c[x]=S[x];return c}function ge(S,E){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(S)))return;var x=[],c=!0,l=!1,h=void 0;try{for(var C=S[Symbol.iterator](),A;!(c=(A=C.next()).done)&&!(x.push(A.value),E&&x.length===E);c=!0);}catch(Z){l=!0,h=Z}finally{try{!c&&C.return!=null&&C.return()}finally{if(l)throw h}}return x}function Se(S){if(Array.isArray(S))return S}function _e(S,E){if(S==null)return{};var x=me(S,E),c,l;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(S);for(l=0;l<h.length;l++){if(c=h[l],E.indexOf(c)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(S,c))continue;x[c]=S[c]}}return x}function me(S,E){if(S==null)return{};var x={},c=Object.keys(S),l,h;for(h=0;h<c.length;h++){if(l=c[h],E.indexOf(l)>=0)continue;x[l]=S[l]}return x}var je=0;function ie(S){return+S.replace("%","")}function y(S){return Array.isArray(S)?S:[S]}function H(S,E,x,c){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,h=arguments.length>5?arguments[5]:void 0,C=50-c/2,A=0,Z=-C,de=0,X=-2*C;switch(h){case"left":A=-C,Z=0,de=2*C,X=0;break;case"right":A=C,Z=0,de=-2*C,X=0;break;case"bottom":Z=C,X=2*C;break;default:}var ne="M 50,50 m ".concat(A,",").concat(Z,`
|
|
a `).concat(C,",").concat(C," 0 1 1 ").concat(de,",").concat(-X,`
|
|
a `).concat(C,",").concat(C," 0 1 1 ").concat(-de,",").concat(X),te=Math.PI*2*C,z={stroke:x,strokeDasharray:"".concat(E/100*(te-l),"px ").concat(te,"px"),strokeDashoffset:"-".concat(l/2+S/100*(te-l),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ne,pathStyle:z}}var D=function(E){var x=E.prefixCls,c=E.strokeWidth,l=E.trailWidth,h=E.gapDegree,C=E.gapPosition,A=E.trailColor,Z=E.strokeLinecap,de=E.style,X=E.className,ne=E.strokeColor,te=E.percent,z=_e(E,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Y=Object(P.useMemo)(function(){return je+=1,je},[]),xe=H(0,100,A,c,h,C),f=xe.pathString,b=xe.pathStyle,p=y(te),W=y(ne),Q=W.find(function(Re){return Object.prototype.toString.call(Re)==="[object Object]"}),$=F(p),pe=J($,1),Ee=pe[0],Ue=function(){var Fe=0;return p.map(function(We,et){var ot=W[et]||W[W.length-1],yt=Object.prototype.toString.call(ot)==="[object Object]"?"url(#".concat(x,"-gradient-").concat(Y,")"):"",ht=H(Fe,We,ot,c,h,C);return Fe+=We,re.a.createElement("path",{key:et,className:"".concat(x,"-circle-path"),d:ht.pathString,stroke:yt,strokeLinecap:Z,strokeWidth:c,opacity:We===0?0:1,fillOpacity:"0",style:ht.pathStyle,ref:Ee[et]})})};return re.a.createElement("svg",G({className:ce()("".concat(x,"-circle"),X),viewBox:"0 0 100 100",style:de},z),Q&&re.a.createElement("defs",null,re.a.createElement("linearGradient",{id:"".concat(x,"-gradient-").concat(Y),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Q).sort(function(Re,Fe){return ie(Re)-ie(Fe)}).map(function(Re,Fe){return re.a.createElement("stop",{key:Fe,offset:Re,stopColor:Q[Re]})}))),re.a.createElement("path",{className:"".concat(x,"-circle-trail"),d:f,stroke:A,strokeLinecap:Z,strokeWidth:l||c,fillOpacity:"0",style:b}),Ue().reverse())};D.defaultProps=oe;var g=D,B={Line:L,Circle:g}},kSUc:function(Ye,Ie,k){},lZu9:function(Ye,Ie,k){(function(P){P(k("VrN/"),k("1eCo"),k("8EBN"))})(function(P){"use strict";P.defineMode("markdown",function(re,V){var ce=P.getMode(re,"text/html"),oe=ce.name=="null";function F(c){if(P.findModeByName){var l=P.findModeByName(c);l&&(c=l.mime||l.mimes[0])}var h=P.getMode(re,c);return h.name=="null"?null:h}V.highlightFormatting===void 0&&(V.highlightFormatting=!1),V.maxBlockquoteDepth===void 0&&(V.maxBlockquoteDepth=0),V.taskLists===void 0&&(V.taskLists=!1),V.strikethrough===void 0&&(V.strikethrough=!1),V.emoji===void 0&&(V.emoji=!1),V.fencedCodeBlockHighlighting===void 0&&(V.fencedCodeBlockHighlighting=!0),V.fencedCodeBlockDefaultMode===void 0&&(V.fencedCodeBlockDefaultMode="text/plain"),V.xml===void 0&&(V.xml=!0),V.tokenTypeOverrides===void 0&&(V.tokenTypeOverrides={});var R={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 T in R)R.hasOwnProperty(T)&&V.tokenTypeOverrides[T]&&(R[T]=V.tokenTypeOverrides[T]);var w=/^([*\-_])(?:\s*\1){2,}\s*$/,N=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,I=/^\[(x| )\](?=\s)/i,U=V.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,he=/^ {0,3}(?:\={1,}|-{2,})\s*$/,q=/^[^#!\[\]*_\\<>` "'(~:]+/,_=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,j=/^\s*\[[^\]]+?\]:.*$/,L=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,G=" ";function J(c,l,h){return l.f=l.inline=h,h(c,l)}function le(c,l,h){return l.f=l.block=h,h(c,l)}function ke(c){return!c||!/\S/.test(c.string)}function ye(c){if(c.linkTitle=!1,c.linkHref=!1,c.linkText=!1,c.em=!1,c.strong=!1,c.strikethrough=!1,c.quote=0,c.indentedCode=!1,c.f==Se){var l=oe;if(!l){var h=P.innerMode(ce,c.htmlState);l=h.mode.name=="xml"&&h.state.tagStart===null&&!h.state.context&&h.state.tokenize.isInText}l&&(c.f=ie,c.block=ge,c.htmlState=null)}return c.trailingSpace=0,c.trailingSpaceNewLine=!1,c.prevLine=c.thisLine,c.thisLine={stream:null},null}function ge(c,l){var h=c.column()===l.indentation,C=ke(l.prevLine.stream),A=l.indentedCode,Z=l.prevLine.hr,de=l.list!==!1,X=(l.listStack[l.listStack.length-1]||0)+3;l.indentedCode=!1;var ne=l.indentation;if(l.indentationDiff===null&&(l.indentationDiff=l.indentation,de)){for(l.list=null;ne<l.listStack[l.listStack.length-1];)l.listStack.pop(),l.listStack.length?l.indentation=l.listStack[l.listStack.length-1]:l.list=!1;l.list!==!1&&(l.indentationDiff=ne-l.listStack[l.listStack.length-1])}var te=!C&&!Z&&!l.prevLine.header&&(!de||!A)&&!l.prevLine.fencedCodeEnd,z=(l.list===!1||Z||C)&&l.indentation<=X&&c.match(w),Y=null;if(l.indentationDiff>=4&&(A||l.prevLine.fencedCodeEnd||l.prevLine.header||C))return c.skipToEnd(),l.indentedCode=!0,R.code;if(c.eatSpace())return null;if(h&&l.indentation<=X&&(Y=c.match(U))&&Y[1].length<=6)return l.quote=0,l.header=Y[1].length,l.thisLine.header=!0,V.highlightFormatting&&(l.formatting="header"),l.f=l.inline,me(l);if(l.indentation<=X&&c.eat(">"))return l.quote=h?1:l.quote+1,V.highlightFormatting&&(l.formatting="quote"),c.eatSpace(),me(l);if(!z&&!l.setext&&h&&l.indentation<=X&&(Y=c.match(N))){var xe=Y[1]?"ol":"ul";return l.indentation=ne+c.current().length,l.list=!0,l.quote=0,l.listStack.push(l.indentation),l.em=!1,l.strong=!1,l.code=!1,l.strikethrough=!1,V.taskLists&&c.match(I,!1)&&(l.taskList=!0),l.f=l.inline,V.highlightFormatting&&(l.formatting=["list","list-"+xe]),me(l)}else{if(h&&l.indentation<=X&&(Y=c.match(_,!0)))return l.quote=0,l.fencedEndRE=new RegExp(Y[1]+"+ *$"),l.localMode=V.fencedCodeBlockHighlighting&&F(Y[2]||V.fencedCodeBlockDefaultMode),l.localMode&&(l.localState=P.startState(l.localMode)),l.f=l.block=_e,V.highlightFormatting&&(l.formatting="code-block"),l.code=-1,me(l);if(l.setext||(!te||!de)&&!l.quote&&l.list===!1&&!l.code&&!z&&!j.test(c.string)&&(Y=c.lookAhead(1))&&(Y=Y.match(he)))return l.setext?(l.header=l.setext,l.setext=0,c.skipToEnd(),V.highlightFormatting&&(l.formatting="header")):(l.header=Y[0].charAt(0)=="="?1:2,l.setext=l.header),l.thisLine.header=!0,l.f=l.inline,me(l);if(z)return c.skipToEnd(),l.hr=!0,l.thisLine.hr=!0,R.hr;if(c.peek()==="[")return J(c,l,B)}return J(c,l,l.inline)}function Se(c,l){var h=ce.token(c,l.htmlState);if(!oe){var C=P.innerMode(ce,l.htmlState);(C.mode.name=="xml"&&C.state.tagStart===null&&!C.state.context&&C.state.tokenize.isInText||l.md_inside&&c.current().indexOf(">")>-1)&&(l.f=ie,l.block=ge,l.htmlState=null)}return h}function _e(c,l){var h=l.listStack[l.listStack.length-1]||0,C=l.indentation<h,A=h+3;if(l.fencedEndRE&&l.indentation<=A&&(C||c.match(l.fencedEndRE))){V.highlightFormatting&&(l.formatting="code-block");var Z;return C||(Z=me(l)),l.localMode=l.localState=null,l.block=ge,l.f=ie,l.fencedEndRE=null,l.code=0,l.thisLine.fencedCodeEnd=!0,C?le(c,l,l.block):Z}else return l.localMode?l.localMode.token(c,l.localState):(c.skipToEnd(),R.code)}function me(c){var l=[];if(c.formatting){l.push(R.formatting),typeof c.formatting=="string"&&(c.formatting=[c.formatting]);for(var h=0;h<c.formatting.length;h++)l.push(R.formatting+"-"+c.formatting[h]),c.formatting[h]==="header"&&l.push(R.formatting+"-"+c.formatting[h]+"-"+c.header),c.formatting[h]==="quote"&&(!V.maxBlockquoteDepth||V.maxBlockquoteDepth>=c.quote?l.push(R.formatting+"-"+c.formatting[h]+"-"+c.quote):l.push("error"))}if(c.taskOpen)return l.push("meta"),l.length?l.join(" "):null;if(c.taskClosed)return l.push("property"),l.length?l.join(" "):null;if(c.linkHref?l.push(R.linkHref,"url"):(c.strong&&l.push(R.strong),c.em&&l.push(R.em),c.strikethrough&&l.push(R.strikethrough),c.emoji&&l.push(R.emoji),c.linkText&&l.push(R.linkText),c.code&&l.push(R.code),c.image&&l.push(R.image),c.imageAltText&&l.push(R.imageAltText,"link"),c.imageMarker&&l.push(R.imageMarker)),c.header&&l.push(R.header,R.header+"-"+c.header),c.quote&&(l.push(R.quote),!V.maxBlockquoteDepth||V.maxBlockquoteDepth>=c.quote?l.push(R.quote+"-"+c.quote):l.push(R.quote+"-"+V.maxBlockquoteDepth)),c.list!==!1){var C=(c.listStack.length-1)%3;C?C===1?l.push(R.list2):l.push(R.list3):l.push(R.list1)}return c.trailingSpaceNewLine?l.push("trailing-space-new-line"):c.trailingSpace&&l.push("trailing-space-"+(c.trailingSpace%2?"a":"b")),l.length?l.join(" "):null}function je(c,l){return c.match(q,!0)?me(l):void 0}function ie(c,l){var h=l.text(c,l);if(typeof h!="undefined")return h;if(l.list)return l.list=null,me(l);if(l.taskList){var C=c.match(I,!0)[1]===" ";return C?l.taskOpen=!0:l.taskClosed=!0,V.highlightFormatting&&(l.formatting="task"),l.taskList=!1,me(l)}if(l.taskOpen=!1,l.taskClosed=!1,l.header&&c.match(/^#+$/,!0))return V.highlightFormatting&&(l.formatting="header"),me(l);var A=c.next();if(l.linkTitle){l.linkTitle=!1;var Z=A;A==="("&&(Z=")"),Z=(Z+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var de="^\\s*(?:[^"+Z+"\\\\]+|\\\\\\\\|\\\\.)"+Z;if(c.match(new RegExp(de),!0))return R.linkHref}if(A==="`"){var X=l.formatting;V.highlightFormatting&&(l.formatting="code"),c.eatWhile("`");var ne=c.current().length;if(l.code==0&&(!l.quote||ne==1))return l.code=ne,me(l);if(ne==l.code){var te=me(l);return l.code=0,te}else return l.formatting=X,me(l)}else if(l.code)return me(l);if(A==="\\"&&(c.next(),V.highlightFormatting)){var z=me(l),Y=R.formatting+"-escape";return z?z+" "+Y:Y}if(A==="!"&&c.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return l.imageMarker=!0,l.image=!0,V.highlightFormatting&&(l.formatting="image"),me(l);if(A==="["&&l.imageMarker&&c.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return l.imageMarker=!1,l.imageAltText=!0,V.highlightFormatting&&(l.formatting="image"),me(l);if(A==="]"&&l.imageAltText){V.highlightFormatting&&(l.formatting="image");var z=me(l);return l.imageAltText=!1,l.image=!1,l.inline=l.f=H,z}if(A==="["&&!l.image)return l.linkText&&c.match(/^.*?\]/)||(l.linkText=!0,V.highlightFormatting&&(l.formatting="link")),me(l);if(A==="]"&&l.linkText){V.highlightFormatting&&(l.formatting="link");var z=me(l);return l.linkText=!1,l.inline=l.f=c.match(/\(.*?\)| ?\[.*?\]/,!1)?H:ie,z}if(A==="<"&&c.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){l.f=l.inline=y,V.highlightFormatting&&(l.formatting="link");var z=me(l);return z?z+=" ":z="",z+R.linkInline}if(A==="<"&&c.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){l.f=l.inline=y,V.highlightFormatting&&(l.formatting="link");var z=me(l);return z?z+=" ":z="",z+R.linkEmail}if(V.xml&&A==="<"&&c.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var xe=c.string.indexOf(">",c.pos);if(xe!=-1){var f=c.string.substring(c.start,xe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(f)&&(l.md_inside=!0)}return c.backUp(1),l.htmlState=P.startState(ce),le(c,l,Se)}if(V.xml&&A==="<"&&c.match(/^\/\w*?>/))return l.md_inside=!1,"tag";if(A==="*"||A==="_"){for(var b=1,p=c.pos==1?" ":c.string.charAt(c.pos-2);b<3&&c.eat(A);)b++;var W=c.peek()||" ",Q=!/\s/.test(W)&&(!L.test(W)||/\s/.test(p)||L.test(p)),$=!/\s/.test(p)&&(!L.test(p)||/\s/.test(W)||L.test(W)),pe=null,Ee=null;if(b%2&&(!l.em&&Q&&(A==="*"||!$||L.test(p))?pe=!0:l.em==A&&$&&(A==="*"||!Q||L.test(W))&&(pe=!1)),b>1&&(!l.strong&&Q&&(A==="*"||!$||L.test(p))?Ee=!0:l.strong==A&&$&&(A==="*"||!Q||L.test(W))&&(Ee=!1)),Ee!=null||pe!=null){V.highlightFormatting&&(l.formatting=pe==null?"strong":Ee==null?"em":"strong em"),pe===!0&&(l.em=A),Ee===!0&&(l.strong=A);var te=me(l);return pe===!1&&(l.em=!1),Ee===!1&&(l.strong=!1),te}}else if(A===" "&&(c.eat("*")||c.eat("_"))){if(c.peek()===" ")return me(l);c.backUp(1)}if(V.strikethrough){if(A==="~"&&c.eatWhile(A)){if(l.strikethrough){V.highlightFormatting&&(l.formatting="strikethrough");var te=me(l);return l.strikethrough=!1,te}else if(c.match(/^[^\s]/,!1))return l.strikethrough=!0,V.highlightFormatting&&(l.formatting="strikethrough"),me(l)}else if(A===" "&&c.match(/^~~/,!0)){if(c.peek()===" ")return me(l);c.backUp(2)}}if(V.emoji&&A===":"&&c.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){l.emoji=!0,V.highlightFormatting&&(l.formatting="emoji");var Ue=me(l);return l.emoji=!1,Ue}return A===" "&&(c.match(/^ +$/,!1)?l.trailingSpace++:l.trailingSpace&&(l.trailingSpaceNewLine=!0)),me(l)}function y(c,l){var h=c.next();if(h===">"){l.f=l.inline=ie,V.highlightFormatting&&(l.formatting="link");var C=me(l);return C?C+=" ":C="",C+R.linkInline}return c.match(/^[^>]+/,!0),R.linkInline}function H(c,l){if(c.eatSpace())return null;var h=c.next();return h==="("||h==="["?(l.f=l.inline=g(h==="("?")":"]"),V.highlightFormatting&&(l.formatting="link-string"),l.linkHref=!0,me(l)):"error"}var D={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function g(c){return function(l,h){var C=l.next();if(C===c){h.f=h.inline=ie,V.highlightFormatting&&(h.formatting="link-string");var A=me(h);return h.linkHref=!1,A}return l.match(D[c]),h.linkHref=!0,me(h)}}function B(c,l){return c.match(/^([^\]\\]|\\.)*\]:/,!1)?(l.f=S,c.next(),V.highlightFormatting&&(l.formatting="link"),l.linkText=!0,me(l)):J(c,l,ie)}function S(c,l){if(c.match(/^\]:/,!0)){l.f=l.inline=E,V.highlightFormatting&&(l.formatting="link");var h=me(l);return l.linkText=!1,h}return c.match(/^([^\]\\]|\\.)+/,!0),R.linkText}function E(c,l){return c.eatSpace()?null:(c.match(/^[^\s]+/,!0),c.peek()===void 0?l.linkTitle=!0:c.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),l.f=l.inline=ie,R.linkHref+" url")}var x={startState:function(){return{f:ge,prevLine:{stream:null},thisLine:{stream:null},block:ge,htmlState:null,indentation:0,inline:ie,text:je,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(c){return{f:c.f,prevLine:c.prevLine,thisLine:c.thisLine,block:c.block,htmlState:c.htmlState&&P.copyState(ce,c.htmlState),indentation:c.indentation,localMode:c.localMode,localState:c.localMode?P.copyState(c.localMode,c.localState):null,inline:c.inline,text:c.text,formatting:!1,linkText:c.linkText,linkTitle:c.linkTitle,linkHref:c.linkHref,code:c.code,em:c.em,strong:c.strong,strikethrough:c.strikethrough,emoji:c.emoji,header:c.header,setext:c.setext,hr:c.hr,taskList:c.taskList,list:c.list,listStack:c.listStack.slice(0),quote:c.quote,indentedCode:c.indentedCode,trailingSpace:c.trailingSpace,trailingSpaceNewLine:c.trailingSpaceNewLine,md_inside:c.md_inside,fencedEndRE:c.fencedEndRE}},token:function(c,l){if(l.formatting=!1,c!=l.thisLine.stream){if(l.header=0,l.hr=!1,c.match(/^\s*$/,!0))return ye(l),null;if(l.prevLine=l.thisLine,l.thisLine={stream:c},l.taskList=!1,l.trailingSpace=0,l.trailingSpaceNewLine=!1,!l.localState&&(l.f=l.block,l.f!=Se)){var h=c.match(/^\s*/,!0)[0].replace(/\t/g,G).length;if(l.indentation=h,l.indentationDiff=null,h>0)return null}}return l.f(c,l)},innerMode:function(c){return c.block==Se?{state:c.htmlState,mode:ce}:c.localState?{state:c.localState,mode:c.localMode}:{state:c,mode:x}},indent:function(c,l,h){return c.block==Se&&ce.indent?ce.indent(c.htmlState,l,h):c.localState&&c.localMode.indent?c.localMode.indent(c.localState,l,h):P.Pass},blankLine:ye,getType:me,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return x},"xml"),P.defineMIME("text/markdown","markdown"),P.defineMIME("text/x-markdown","markdown")})},osHv:function(Ye,Ie,k){(function(P){P(k("VrN/"))})(function(P){"use strict";var re=P.Pos;function V(L,G){return L.line-G.line||L.ch-G.ch}var ce="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",oe=ce+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",F=new RegExp("<(/?)(["+ce+"]["+oe+"]*)","g");function R(L,G,J,le){this.line=G,this.ch=J,this.cm=L,this.text=L.getLine(G),this.min=le?Math.max(le.from,L.firstLine()):L.firstLine(),this.max=le?Math.min(le.to-1,L.lastLine()):L.lastLine()}function T(L,G){var J=L.cm.getTokenTypeAt(re(L.line,G));return J&&/\btag\b/.test(J)}function w(L){return L.line>=L.max?void 0:(L.ch=0,L.text=L.cm.getLine(++L.line),!0)}function N(L){return L.line<=L.min?void 0:(L.text=L.cm.getLine(--L.line),L.ch=L.text.length,!0)}function I(L){for(;;){var G=L.text.indexOf(">",L.ch);if(G==-1){if(w(L))continue;return}if(!T(L,G+1)){L.ch=G+1;continue}var J=L.text.lastIndexOf("/",G),le=J>-1&&!/\S/.test(L.text.slice(J+1,G));return L.ch=G+1,le?"selfClose":"regular"}}function U(L){for(;;){var G=L.ch?L.text.lastIndexOf("<",L.ch-1):-1;if(G==-1){if(N(L))continue;return}if(!T(L,G+1)){L.ch=G;continue}F.lastIndex=G,L.ch=G;var J=F.exec(L.text);if(J&&J.index==G)return J}}function he(L){for(;;){F.lastIndex=L.ch;var G=F.exec(L.text);if(!G){if(w(L))continue;return}if(!T(L,G.index+1)){L.ch=G.index+1;continue}return L.ch=G.index+G[0].length,G}}function q(L){for(;;){var G=L.ch?L.text.lastIndexOf(">",L.ch-1):-1;if(G==-1){if(N(L))continue;return}if(!T(L,G+1)){L.ch=G;continue}var J=L.text.lastIndexOf("/",G),le=J>-1&&!/\S/.test(L.text.slice(J+1,G));return L.ch=G+1,le?"selfClose":"regular"}}function _(L,G){for(var J=[];;){var le=he(L),ke,ye=L.line,ge=L.ch-(le?le[0].length:0);if(!le||!(ke=I(L)))return;if(ke=="selfClose")continue;if(le[1]){for(var Se=J.length-1;Se>=0;--Se)if(J[Se]==le[2]){J.length=Se;break}if(Se<0&&(!G||G==le[2]))return{tag:le[2],from:re(ye,ge),to:re(L.line,L.ch)}}else J.push(le[2])}}function j(L,G){for(var J=[];;){var le=q(L);if(!le)return;if(le=="selfClose"){U(L);continue}var ke=L.line,ye=L.ch,ge=U(L);if(!ge)return;if(ge[1])J.push(ge[2]);else{for(var Se=J.length-1;Se>=0;--Se)if(J[Se]==ge[2]){J.length=Se;break}if(Se<0&&(!G||G==ge[2]))return{tag:ge[2],from:re(L.line,L.ch),to:re(ke,ye)}}}}P.registerHelper("fold","xml",function(L,G){for(var J=new R(L,G.line,0);;){var le=he(J);if(!le||J.line!=G.line)return;var ke=I(J);if(!ke)return;if(!le[1]&&ke!="selfClose"){var ye=re(J.line,J.ch),ge=_(J,le[2]);return ge&&V(ge.from,ye)>0?{from:ye,to:ge.from}:null}}}),P.findMatchingTag=function(L,G,J){var le=new R(L,G.line,G.ch,J);if(le.text.indexOf(">")==-1&&le.text.indexOf("<")==-1)return;var ke=I(le),ye=ke&&re(le.line,le.ch),ge=ke&&U(le);if(!ke||!ge||V(le,G)>0)return;var Se={from:re(le.line,le.ch),to:ye,tag:ge[2]};return ke=="selfClose"?{open:Se,close:null,at:"open"}:ge[1]?{open:j(le,ge[2]),close:Se,at:"close"}:(le=new R(L,ye.line,ye.ch,J),{open:Se,close:_(le,ge[2]),at:"open"})},P.findEnclosingTag=function(L,G,J,le){for(var ke=new R(L,G.line,G.ch,J);;){var ye=j(ke,le);if(!ye)break;var ge=new R(L,G.line,G.ch,J),Se=_(ge,ye.tag);if(Se)return{open:ye,close:Se}}},P.scanForClosingTag=function(L,G,J,le){var ke=new R(L,G.line,G.ch,le?{from:0,to:le}:null);return _(ke,J)}})},"p77/":function(Ye,Ie,k){}}]);
|