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.
116 lines
384 KiB
116 lines
384 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[41,7,13],{"+NIl":function(ft,Ye,x){(function(K){K(x("VrN/"))})(function(K){"use strict";K.defineMode("stex",function(Ce,oe){"use strict";function Se(te,F){te.cmdState.push(F)}function ge(te){return te.cmdState.length>0?te.cmdState[te.cmdState.length-1]:null}function ee(te){var F=te.cmdState.pop();F&&F.closeBracket()}function L(te){for(var F=te.cmdState,z=F.length-1;z>=0;z--){var j=F[z];if(j.name=="DEFAULT")continue;return j}return{styleIdentifier:function(){return null}}}function W(te,F,z){return function(){this.name=te,this.bracketNo=0,this.style=F,this.styles=z,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var P={};P.importmodule=W("importmodule","tag",["string","builtin"]),P.documentclass=W("documentclass","tag",["","atom"]),P.usepackage=W("usepackage","tag",["atom"]),P.begin=W("begin","tag",["atom"]),P.end=W("end","tag",["atom"]),P.label=W("label","tag",["atom"]),P.ref=W("ref","tag",["atom"]),P.eqref=W("eqref","tag",["atom"]),P.cite=W("cite","tag",["atom"]),P.bibitem=W("bibitem","tag",["atom"]),P.Bibitem=W("Bibitem","tag",["atom"]),P.RBibitem=W("RBibitem","tag",["atom"]),P.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function V(te,F){te.f=F}function N(te,F){var z;if(te.match(/^\\[a-zA-Z@]+/)){var j=te.current().slice(1);return z=P.hasOwnProperty(j)?P[j]:P.DEFAULT,z=new z,Se(F,z),V(F,ve),z.style}if(te.match(/^\\[$&%#{}_]/))return"tag";if(te.match(/^\\[,;!\/\\]/))return"tag";if(te.match("\\["))return V(F,function(ce,Oe){return R(ce,Oe,"\\]")}),"keyword";if(te.match("\\("))return V(F,function(ce,Oe){return R(ce,Oe,"\\)")}),"keyword";if(te.match("$$"))return V(F,function(ce,Oe){return R(ce,Oe,"$$")}),"keyword";if(te.match("$"))return V(F,function(ce,Oe){return R(ce,Oe,"$")}),"keyword";var le=te.next();if(le=="%")return te.skipToEnd(),"comment";if(le=="}"||le=="]"){if(z=ge(F),z)z.closeBracket(le),V(F,ve);else return"error";return"bracket"}else return le=="{"||le=="["?(z=P.DEFAULT,z=new z,Se(F,z),"bracket"):/\d/.test(le)?(te.eatWhile(/[\w.%]/),"atom"):(te.eatWhile(/[\w\-_]/),z=L(F),z.name=="begin"&&(z.argument=te.current()),z.styleIdentifier())}function R(te,F,z){if(te.eatSpace())return null;if(z&&te.match(z))return V(F,N),"keyword";if(te.match(/^\\[a-zA-Z@]+/))return"tag";if(te.match(/^[a-zA-Z]+/))return"variable-2";if(te.match(/^\\[$&%#{}_]/))return"tag";if(te.match(/^\\[,;!\/]/))return"tag";if(te.match(/^[\^_&]/))return"tag";if(te.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(te.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var j=te.next();return j=="{"||j=="}"||j=="["||j=="]"||j=="("||j==")"?"bracket":j=="%"?(te.skipToEnd(),"comment"):"error"}function ve(te,F){var z=te.peek(),j;return z=="{"||z=="["?(j=ge(F),j.openBracket(z),te.eat(z),V(F,N),"bracket"):/[ \t\r]/.test(z)?(te.eat(z),null):(V(F,N),ee(F),N(te,F))}return{startState:function(){var te=oe.inMathMode?function(F,z){return R(F,z)}:N;return{cmdState:[],f:te}},copyState:function(te){return{cmdState:te.cmdState.slice(),f:te.f}},token:function(te,F){return F.f(te,F)},blankLine:function(te){te.f=N,te.cmdState.length=0},lineComment:"%"}}),K.defineMIME("text/x-stex","stex"),K.defineMIME("text/x-latex","stex")})},"19Vz":function(ft,Ye,x){(function(K){K(x("VrN/"))})(function(K){K.defineOption("placeholder","",function(W,P,V){var N=V&&V!=K.Init;if(P&&!N)W.on("blur",ge),W.on("change",ee),W.on("swapDoc",ee),K.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){Se(W)}),ee(W);else if(!P&&N){W.off("blur",ge),W.off("change",ee),W.off("swapDoc",ee),K.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),Ce(W);var R=W.getWrapperElement();R.className=R.className.replace(" CodeMirror-empty","")}P&&!W.hasFocus()&&ge(W)});function Ce(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function oe(W){Ce(W);var P=W.state.placeholder=document.createElement("pre");P.style.cssText="height: 0; overflow: visible",P.style.direction=W.getOption("direction"),P.className="CodeMirror-placeholder CodeMirror-line-like";var V=W.getOption("placeholder");typeof V=="string"&&(V=document.createTextNode(V)),P.appendChild(V),W.display.lineSpace.insertBefore(P,W.display.lineSpace.firstChild)}function Se(W){setTimeout(function(){var P=!1,V=W.getInputField();V.nodeName=="TEXTAREA"?P=!V.value:W.lineCount()==1&&(P=!/[^\u200b]/.test(V.querySelector(".CodeMirror-line").textContent)),P?oe(W):Ce(W)},20)}function ge(W){L(W)&&oe(W)}function ee(W){var P=W.getWrapperElement(),V=L(W);P.className=P.className.replace(" CodeMirror-empty","")+(V?" CodeMirror-empty":""),V?oe(W):Ce(W)}function L(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(ft,Ye,x){(function(K){K(x("VrN/"))})(function(K){"use strict";var Ce={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},oe={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};K.defineMode("xml",function(Se,ge){var ee=Se.indentUnit,L={},W=ge.htmlMode?Ce:oe;for(var P in W)L[P]=W[P];for(var P in ge)L[P]=ge[P];var V,N;function R(v,Q){function H(U){return Q.tokenize=U,U(v,Q)}var w=v.next();if(w=="<")return v.eat("!")?v.eat("[")?v.match("CDATA[")?H(F("atom","]]>")):null:v.match("--")?H(F("comment","-->")):v.match("DOCTYPE",!0,!0)?(v.eatWhile(/[\w\._\-]/),H(z(1))):null:v.eat("?")?(v.eatWhile(/[\w\._\-]/),Q.tokenize=F("meta","?>"),"meta"):(V=v.eat("/")?"closeTag":"openTag",Q.tokenize=ve,"tag bracket");if(w=="&"){var q;return v.eat("#")?v.eat("x")?q=v.eatWhile(/[a-fA-F\d]/)&&v.eat(";"):q=v.eatWhile(/[\d]/)&&v.eat(";"):q=v.eatWhile(/[\w\.\-:]/)&&v.eat(";"),q?"atom":"error"}else return v.eatWhile(/[^&<]/),null}R.isInText=!0;function ve(v,Q){var H=v.next();if(H==">"||H=="/"&&v.eat(">"))return Q.tokenize=R,V=H==">"?"endTag":"selfcloseTag","tag bracket";if(H=="=")return V="equals",null;if(H=="<"){Q.tokenize=R,Q.state=Oe,Q.tagName=Q.tagStart=null;var w=Q.tokenize(v,Q);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(H)?(Q.tokenize=te(H),Q.stringStartCol=v.column(),Q.tokenize(v,Q)):(v.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function te(v){var Q=function(H,w){for(;!H.eol();)if(H.next()==v){w.tokenize=ve;break}return"string"};return Q.isInAttribute=!0,Q}function F(v,Q){return function(H,w){for(;!H.eol();){if(H.match(Q)){w.tokenize=R;break}H.next()}return v}}function z(v){return function(Q,H){for(var w;(w=Q.next())!=null;){if(w=="<")return H.tokenize=z(v+1),H.tokenize(Q,H);if(w==">")if(v==1){H.tokenize=R;break}else return H.tokenize=z(v-1),H.tokenize(Q,H)}return"meta"}}function j(v,Q,H){this.prev=v.context,this.tagName=Q,this.indent=v.indented,this.startOfLine=H,(L.doNotIndent.hasOwnProperty(Q)||v.context&&v.context.noIndent)&&(this.noIndent=!0)}function le(v){v.context&&(v.context=v.context.prev)}function ce(v,Q){for(var H;;){if(!v.context)return;if(H=v.context.tagName,!L.contextGrabbers.hasOwnProperty(H)||!L.contextGrabbers[H].hasOwnProperty(Q))return;le(v)}}function Oe(v,Q,H){return v=="openTag"?(H.tagStart=Q.column(),Xe):v=="closeTag"?Ie:Oe}function Xe(v,Q,H){return v=="word"?(H.tagName=Q.current(),N="tag",xe):L.allowMissingTagName&&v=="endTag"?(N="tag bracket",xe(v,Q,H)):(N="error",Xe)}function Ie(v,Q,H){if(v=="word"){var w=Q.current();return H.context&&H.context.tagName!=w&&L.implicitlyClosed.hasOwnProperty(H.context.tagName)&&le(H),H.context&&H.context.tagName==w||L.matchClosing===!1?(N="tag",De):(N="tag error",Fe)}else return L.allowMissingTagName&&v=="endTag"?(N="tag bracket",De(v,Q,H)):(N="error",Fe)}function De(v,Q,H){return v!="endTag"?(N="error",De):(le(H),Oe)}function Fe(v,Q,H){return N="error",De(v,Q,H)}function xe(v,Q,H){if(v=="word")return N="attribute",we;if(v=="endTag"||v=="selfcloseTag"){var w=H.tagName,q=H.tagStart;return H.tagName=H.tagStart=null,v=="selfcloseTag"||L.autoSelfClosers.hasOwnProperty(w)?ce(H,w):(ce(H,w),H.context=new j(H,w,q==H.indented)),Oe}return N="error",xe}function we(v,Q,H){return v=="equals"?fe:(L.allowMissing||(N="error"),xe(v,Q,H))}function fe(v,Q,H){return v=="string"?ne:v=="word"&&L.allowUnquoted?(N="string",xe):(N="error",xe(v,Q,H))}function ne(v,Q,H){return v=="string"?ne:xe(v,Q,H)}return{startState:function(v){var Q={tokenize:R,state:Oe,indented:v||0,tagName:null,tagStart:null,context:null};return v!=null&&(Q.baseIndent=v),Q},token:function(v,Q){if(!Q.tagName&&v.sol()&&(Q.indented=v.indentation()),v.eatSpace())return null;V=null;var H=Q.tokenize(v,Q);return(H||V)&&H!="comment"&&(N=null,Q.state=Q.state(V||H,v,Q),N&&(H=N=="error"?H+" error":N)),H},indent:function(v,Q,H){var w=v.context;if(v.tokenize.isInAttribute)return v.tagStart==v.indented?v.stringStartCol+1:v.indented+ee;if(w&&w.noIndent)return K.Pass;if(v.tokenize!=ve&&v.tokenize!=R)return H?H.match(/^(\s*)/)[0].length:0;if(v.tagName)return L.multilineTagIndentPastTag!==!1?v.tagStart+v.tagName.length+2:v.tagStart+ee*(L.multilineTagIndentFactor||1);if(L.alignCDATA&&/<!\[CDATA\[/.test(Q))return 0;var q=Q&&/^<(\/)?([\w_:\.-]*)/.exec(Q);if(q&&q[1])for(;w;)if(w.tagName==q[2]){w=w.prev;break}else if(L.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(q)for(;w;){var U=L.contextGrabbers[w.tagName];if(U&&U.hasOwnProperty(q[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+ee:v.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:L.htmlMode?"html":"xml",helperType:L.htmlMode?"html":"xml",skipAttribute:function(v){v.state==fe&&(v.state=xe)},xmlCurrentTag:function(v){return v.tagName?{name:v.tagName,close:v.type=="closeTag"}:null},xmlCurrentContext:function(v){for(var Q=[],H=v.context;H;H=H.prev)H.tagName&&Q.push(H.tagName);return Q.reverse()}}}),K.defineMIME("text/xml","xml"),K.defineMIME("application/xml","xml"),K.mimeModes.hasOwnProperty("text/html")||K.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(ft,Ye,x){"use strict";x.d(Ye,"a",function(){return ce});var K=x("Ty5D"),Ce=x("dI71"),oe=x("cDcd"),Se=x.n(oe),ge=x("YS25"),ee=x("17x9"),L=x.n(ee),W=x("wx14"),P=x("zLVn"),V=x("9R94"),N=function(fe){Object(Ce.a)(ne,fe);function ne(){for(var Q,H=arguments.length,w=new Array(H),q=0;q<H;q++)w[q]=arguments[q];return Q=fe.call.apply(fe,[this].concat(w))||this,Q.history=Object(ge.a)(Q.props),Q}var v=ne.prototype;return v.render=function(){return Se.a.createElement(K.c,{history:this.history,children:this.props.children})},ne}(Se.a.Component),R=function(fe){Object(Ce.a)(ne,fe);function ne(){for(var Q,H=arguments.length,w=new Array(H),q=0;q<H;q++)w[q]=arguments[q];return Q=fe.call.apply(fe,[this].concat(w))||this,Q.history=Object(ge.b)(Q.props),Q}var v=ne.prototype;return v.render=function(){return Se.a.createElement(K.c,{history:this.history,children:this.props.children})},ne}(Se.a.Component),ve=function(ne,v){return typeof ne=="function"?ne(v):ne},te=function(ne,v){return typeof ne=="string"?Object(ge.c)(ne,null,null,v):ne},F=function(ne){return ne},z=Se.a.forwardRef;typeof z=="undefined"&&(z=F);function j(fe){return!!(fe.metaKey||fe.altKey||fe.ctrlKey||fe.shiftKey)}var le=z(function(fe,ne){var v=fe.innerRef,Q=fe.navigate,H=fe.onClick,w=Object(P.a)(fe,["innerRef","navigate","onClick"]),q=w.target,U=Object(W.a)({},w,{onClick:function(E){try{H&&H(E)}catch(c){throw E.preventDefault(),c}!E.defaultPrevented&&E.button===0&&(!q||q==="_self")&&!j(E)&&(E.preventDefault(),Q())}});return F!==z?U.ref=ne||v:U.ref=v,Se.a.createElement("a",U)}),ce=z(function(fe,ne){var v=fe.component,Q=v===void 0?le:v,H=fe.replace,w=fe.to,q=fe.innerRef,U=Object(P.a)(fe,["component","replace","to","innerRef"]);return Se.a.createElement(K.e.Consumer,null,function(T){T||Object(V.a)(!1);var E=T.history,c=te(ve(w,T.location),T.location),l=c?E.createHref(c):"",m=Object(W.a)({},U,{href:l,navigate:function(){var B=ve(w,T.location),ue=H?E.replace:E.push;ue(B)}});return F!==z?m.ref=ne||q:m.innerRef=q,Se.a.createElement(Q,m)})});if(!1)var Oe,Xe;var Ie=function(ne){return ne},De=Se.a.forwardRef;typeof De=="undefined"&&(De=Ie);function Fe(){for(var fe=arguments.length,ne=new Array(fe),v=0;v<fe;v++)ne[v]=arguments[v];return ne.filter(function(Q){return Q}).join(" ")}var xe=De(function(fe,ne){var v=fe["aria-current"],Q=v===void 0?"page":v,H=fe.activeClassName,w=H===void 0?"active":H,q=fe.activeStyle,U=fe.className,T=fe.exact,E=fe.isActive,c=fe.location,l=fe.sensitive,m=fe.strict,_=fe.style,B=fe.to,ue=fe.innerRef,Ae=Object(P.a)(fe,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Se.a.createElement(K.e.Consumer,null,function(de){de||Object(V.a)(!1);var ie=c||de.location,G=te(ve(B,ie),ie),Z=G.pathname,M=Z&&Z.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),J=M?Object(K.f)(ie.pathname,{path:M,exact:T,sensitive:l,strict:m}):null,h=!!(E?E(J,ie):J),C=h?Fe(U,w):U,g=h?Object(W.a)({},_,{},q):_,re=Object(W.a)({"aria-current":h&&Q||null,className:C,style:g,to:G},Ae);return Ie!==De?re.ref=ne||ue:re.innerRef=ue,Se.a.createElement(ce,re)})});if(!1)var we},"7Cbv":function(ft,Ye,x){"use strict";var K=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Ce=new Uint8Array(16);function oe(){if(!K)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return K(Ce)}var Se=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ge(ve){return typeof ve=="string"&&Se.test(ve)}for(var ee=ge,L=[],W=0;W<256;++W)L.push((W+256).toString(16).substr(1));function P(ve){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,F=(L[ve[te+0]]+L[ve[te+1]]+L[ve[te+2]]+L[ve[te+3]]+"-"+L[ve[te+4]]+L[ve[te+5]]+"-"+L[ve[te+6]]+L[ve[te+7]]+"-"+L[ve[te+8]]+L[ve[te+9]]+"-"+L[ve[te+10]]+L[ve[te+11]]+L[ve[te+12]]+L[ve[te+13]]+L[ve[te+14]]+L[ve[te+15]]).toLowerCase();if(!ee(F))throw TypeError("Stringified UUID is invalid");return F}var V=P;function N(ve,te,F){ve=ve||{};var z=ve.random||(ve.rng||oe)();if(z[6]=z[6]&15|64,z[8]=z[8]&63|128,te){F=F||0;for(var j=0;j<16;++j)te[F+j]=z[j];return te}return V(z)}var R=Ye.a=N},"7ahc":function(ft,Ye,x){"use strict";x.d(Ye,"a",function(){return Xe});var K=x("k1fw"),Ce=x("0Owb"),oe=x("+L6B"),Se=x("2/Rp"),ge=x("y8nQ"),ee=x("Vl3Y"),L=x("tJVT"),W=x("OaEy"),P=x("2fM7"),V=x("cDcd"),N=x.n(V),R=x("VrN/"),ve=x.n(R),te=x("p77/"),F=x.n(te),z=x("c5Ni"),j=x.n(z),le=P.a.Option,ce={labelCol:{span:4},wrapperCol:{span:20}},Oe={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"]};Ye.b=function(Ie){var De=Ie.callback,Fe=Ie.onCancel,xe=Object(V.useState)("python"),we=Object(L.a)(xe,2),fe=we[0],ne=we[1];function v(H){ne(Oe[H][1])}function Q(H){De(H)}return N.a.createElement(ee.a,Object(Ce.a)({},ce,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Q}),N.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},N.a.createElement(P.a,{onChange:v},Object.keys(Oe).map(function(H){return N.a.createElement(le,{key:H,value:H},Oe[H][0])}))),N.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},N.a.createElement(Xe,{mode:fe})),N.a.createElement("div",{className:"flex-container flex-end"},N.a.createElement(Se.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),N.a.createElement(Se.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))};function Xe(Ie){var De=Ie.value,Fe=Ie.onChange,xe=Ie.mode,we=Ie.options,fe=we===void 0?{}:we,ne=Object(V.useRef)(),v=Object(V.useState)(),Q=Object(L.a)(v,2),H=Q[0],w=Q[1];return Object(V.useEffect)(function(){if(H){function q(U){var T=U.getValue();Fe&&Fe(T)}return H.on("change",q),function(){H.off("change",q)}}},[H,Fe]),Object(V.useEffect)(function(){H&&H.setOption("mode",xe)},[H,xe]),Object(V.useEffect)(function(){H&&((De!==H.getValue()||De==="")&&setTimeout(function(){H.setValue(De||" ")},300))},[H,De]),Object(V.useEffect)(function(){if(ne.current&&!H){var q=ve.a.fromTextArea(ne.current,Object(K.a)({mode:xe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},fe));w(q)}},[ne.current,H]),N.a.createElement("div",{className:"my-codemirror-container"},N.a.createElement("textarea",{ref:ne}))}},"8EBN":function(ft,Ye,x){(function(K){K(x("VrN/"))})(function(K){"use strict";K.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 Ce=0;Ce<K.modeInfo.length;Ce++){var oe=K.modeInfo[Ce];oe.mimes&&(oe.mime=oe.mimes[0])}K.findModeByMIME=function(Se){Se=Se.toLowerCase();for(var ge=0;ge<K.modeInfo.length;ge++){var ee=K.modeInfo[ge];if(ee.mime==Se)return ee;if(ee.mimes){for(var L=0;L<ee.mimes.length;L++)if(ee.mimes[L]==Se)return ee}}if(/\+xml$/.test(Se))return K.findModeByMIME("application/xml");if(/\+json$/.test(Se))return K.findModeByMIME("application/json")},K.findModeByExtension=function(Se){Se=Se.toLowerCase();for(var ge=0;ge<K.modeInfo.length;ge++){var ee=K.modeInfo[ge];if(ee.ext){for(var L=0;L<ee.ext.length;L++)if(ee.ext[L]==Se)return ee}}},K.findModeByFileName=function(Se){for(var ge=0;ge<K.modeInfo.length;ge++){var ee=K.modeInfo[ge];if(ee.file&&ee.file.test(Se))return ee}var L=Se.lastIndexOf("."),W=L>-1&&Se.substring(L+1,Se.length);if(W)return K.findModeByExtension(W)},K.findModeByName=function(Se){Se=Se.toLowerCase();for(var ge=0;ge<K.modeInfo.length;ge++){var ee=K.modeInfo[ge];if(ee.name.toLowerCase()==Se)return ee;if(ee.alias){for(var L=0;L<ee.alias.length;L++)if(ee.alias[L].toLowerCase()==Se)return ee}}}})},"8hTe":function(ft,Ye,x){ft.exports={button:"button___1wy9m"}},"9Bee":function(ft,Ye,x){"use strict";var K=x("DYRE"),Ce=x("zeV3"),oe=x("+L6B"),Se=x("2/Rp"),ge=x("k1fw"),ee=x("tJVT"),L=x("cDcd"),W=x.n(L),P=x("vg9a"),V=x("DlQD"),N=x.n(V),R=x("rUJ1");function ve(ie,G){var Z=ie.match(/^(\s+)(?:```)/);if(Z===null)return G;var M=Z[1];return G.split(`
|
|
`).map(function(J){var h=J.match(/^\s+/);if(h===null)return J;var C=Object(ee.a)(h,1),g=C[0];return g.length>=M.length?J.slice(M.length):J}).join(`
|
|
`)}var te=[],F=["<ul>"],z=new N.a.Renderer,j=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function le(){te.length=0,F=["<ul>"]}var ce={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Oe(ie,G,Z,M){if(G>=ie.length||ie[G].level<=Z)return G;var J=ie[G];M.push("<li><a href='#"+J.anchor+"'>"+J.text+"</a>"),G++;var h=[];return G=Oe(ie,G,J.level,h),h.length>0&&(M.push("<ul>"),h.forEach(function(C){M.push(C)}),M.push("</ul>")),M.push("</li>"),G=Oe(ie,G,Z,M),G}function Xe(){return Oe(te,0,0,F),F.push("</ul>"),F.join("")}var Ie={heading:function(G){var Z=j.exec(G);if(Z)return{type:"heading",raw:Z[0],depth:Z[1].length,text:Z[2]}},fences:function(G){var Z=this.rules.block.fences.exec(G);if(Z){var M=Z[0],J=ve(M,Z[3]||""),h=Z[2]?Z[2].trim():Z[2];if(["latex","katex","math"].indexOf(h)>=0){var C=xe(),g=J;J=C,we[C]={type:"block",expression:g}}return{type:"code",raw:M,lang:h,text:J}}}},De=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Fe=0,xe=function(){return"__special_katext_id_".concat(Fe++,"__")},we={};function fe(){return we}function ne(){Fe=0,we={}}function v(ie){return ie=ie.replace(De,function(G,Z){var M=xe();return we[M]={type:"inline",expression:Z},M}),ie}var Q=z.listitem;z.listitem=function(ie){return Q(v(ie))};var H=z.paragraph;z.paragraph=function(ie){return H(v(ie))};var w=z.tablecell;z.tablecell=function(ie,G){return w(v(ie),G)},z.code=function(ie,G,Z){var M=(G||"").match(/\S*/)[0];return M?["latex","katex","math"].indexOf(M)>=0?"<p class='editormd-tex'>".concat(ie,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(G,'">').concat(Z?ie:Object(R.escape)(ie,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(Z?ie:Object(R.escape)(ie,!0))+"</code></pre>"},z.heading=function(ie,G,Z){var M=this.options.headerPrefix+Z.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return te.push({anchor:M,level:G,text:ie}),"<h"+G+' id="'+M+'">'+ie+"</h"+G+">"},N.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),N.a.use({tokenizer:Ie,renderer:z});var q=N.a,U=x("SJMd"),T=x("ulZh"),E=x.n(T),c=x("m3rI"),l=x("Oy/b"),m=x("p5ED"),_=x("8hTe"),B=x.n(_),ue=/<pre[^>]*>/g;function Ae(ie){var G=document.createElement("div");return G.innerHTML=ie,G.childNodes.length===0?"":G.childNodes[0].nodeValue}var de=Ye.a=function(ie){var G=ie.value,Z=G===void 0?"":G,M=ie.edit,J=M===void 0?!1:M,h=ie.className,C=ie.showTextOnly,g=ie.showLines,re=ie.replaces,pe=ie.zoomImg,Y=ie.hasMask,se=ie.style,ke=se===void 0?{}:se,Re=ie.stylesPrev,Le=Re===void 0?{}:Re,be=String(Z),Ee=Object(L.useRef)(),Ue=Object(L.useRef)(),Je=Object(L.useState)(""),ze=Object(ee.a)(Je,2),Ve=ze[0],ot=ze[1],rt=Object(L.useState)("office"),Ke=Object(ee.a)(rt,2),he=Ke[0],it=Ke[1],qe=Object(L.useMemo)(function(){try{var O=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,f=/\"\/api\/attachments\/|\"\/attachments\/download\//g,p=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;be=be.replace(O,"("+c.a.API_SERVER+"/api/attachments/").replace(f,'"'+c.a.API_SERVER+"/api/attachments/").replace(p,'"'+c.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(ae){}var b=q(be),k=fe();if(be.match(/\[TOC\]/)&&(b=b.replace("<p>[TOC]</p>",Xe()),le()),b=b.replace(/(__special_katext_id_\d+__)/g,function(ae,Te){var He=k[Te],tt=He.type,et=He.expression;return Object(l.renderToString)(Ae(et)||"",{displayMode:tt==="block",throwOnError:!1,output:"html"})}),b=b.replace(/▁/g,"\u2581\u2581\u2581"),ne(),C){var D=document.createElement("div");return D.innerHTML=b,D.innerText}return setTimeout(function(){return I()},500),b},[be]),ye=Object(L.useRef)();ce.WebkitLineClamp=g,g&&(ke=Object(ge.a)(Object(ge.a)({},ke),ce));function Pe(O){var f=O.target;if(f.tagName.toUpperCase()==="IMG"){if(pe){var p=f.getAttribute("src");ot(p),it("image")}}else if(f.tagName.toUpperCase()==="A"){var b=f.getAttribute("href");if(b.indexOf("office")>-1)O.preventDefault(),ot(b),it("office");else if(b.indexOf("application/pdf")>-1)O.preventDefault(),ot(b),it("pdf");else if(b.indexOf("text/html")>-1)O.preventDefault(),ot(b),it("html");else if(b.startsWith("#")){O.preventDefault();var k=document.getElementById(b.replace("#",""));k&&k.scrollIntoView(!0)}}}var I=function(){var f,p=(f=ye.current)===null||f===void 0?void 0:f.querySelectorAll("video");p==null||p.forEach(function(b){if(b.oncontextmenu=function(){return!1},b.src.indexOf(".m3u8")>-1&&!b.canPlayType("application/vnd.apple.mpegurl")){if(E.a.isSupported()){var k=new E.a;k.loadSource(b.src),k.attachMedia(b)}}})};Object(L.useEffect)(function(){if(ye.current&&qe&&(qe.match(ue)&&window.PR.prettyPrint()),ye.current)return ye.current.addEventListener("click",Pe),function(){ye.current.removeEventListener("click",Pe),ne(),le()}},[qe,ye.current,Pe]);var A=function(f){if(!J)return;f.target.nodeName==="IMG"?(Ee.current.style.display="flex",Ee.current.style.width=f.target.clientWidth+"px",Ee.current.style.height=f.target.clientHeight+"px",Ee.current.style.top=f.target.offsetTop+"px",Ee.current.style.left=f.target.offsetLeft+"px",Ue.current.src=f.target.getAttribute("src")):Ee.current.style.display="none"};return W.a.createElement("div",{style:{position:"relative"}},W.a.createElement("div",{ref:ye,style:Object(ge.a)({},ke),className:"".concat(h||""," markdown-body ").concat(B.a.mdBody),onMouseOver:A,dangerouslySetInnerHTML:{__html:qe}}),W.a.createElement("div",{ref:Ee,className:B.a.button},W.a.createElement(Ce.a,null,W.a.createElement(Se.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),W.a.createElement(Se.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),W.a.createElement("img",{ref:Ue,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),W.a.createElement(m.a,{close:!0,data:Ve,type:Ve!=null&&Ve.length?he:"",style:Object(ge.a)({},Le),onClose:function(){return ot("")}}))}},"9VGf":function(ft,Ye,x){"use strict";x.d(Ye,"a",function(){return oe});var K=x("cDcd"),Ce=x.n(K);function oe(Se,ge){var ee=Object(K.useRef)();Object(K.useEffect)(function(){ee.current=Se}),Object(K.useEffect)(function(){function L(){ee.current()}if(ge!==null){var W=setInterval(L,ge);return function(){return clearInterval(W)}}},[ge])}},Bd2K:function(ft,Ye,x){(function(K){K(x("VrN/"),x("osHv"))})(function(K){K.defineOption("autoCloseTags",!1,function(P,V,N){if(N!=K.Init&&N&&P.removeKeyMap("autoCloseTags"),!V)return;var R={name:"autoCloseTags"};(typeof V!="object"||V.whenClosing!==!1)&&(R["'/'"]=function(ve){return ee(ve)}),(typeof V!="object"||V.whenOpening!==!1)&&(R["'>'"]=function(ve){return Se(ve)}),P.addKeyMap(R)});var Ce=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],oe=["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 Se(P){if(P.getOption("disableInput"))return K.Pass;for(var V=P.listSelections(),N=[],R=P.getOption("autoCloseTags"),ve=0;ve<V.length;ve++){if(!V[ve].empty())return K.Pass;var te=V[ve].head,F=P.getTokenAt(te),z=K.innerMode(P.getMode(),F.state),j=z.state,le=z.mode.xmlCurrentTag&&z.mode.xmlCurrentTag(j),ce=le&&le.name;if(!ce)return K.Pass;var Oe=z.mode.configuration=="html",Xe=typeof R=="object"&&R.dontCloseTags||Oe&&Ce,Ie=typeof R=="object"&&R.indentTags||Oe&&oe;F.end>te.ch&&(ce=ce.slice(0,ce.length-F.end+te.ch));var De=ce.toLowerCase();if(!ce||F.type=="string"&&(F.end!=te.ch||!/[\"\']/.test(F.string.charAt(F.string.length-1))||F.string.length==1)||F.type=="tag"&&le.close||F.string.indexOf("/")==te.ch-F.start-1||Xe&&L(Xe,De)>-1||W(P,z.mode.xmlCurrentContext&&z.mode.xmlCurrentContext(j)||[],ce,te,!0))return K.Pass;var Fe=typeof R=="object"&&R.emptyTags;if(Fe&&L(Fe,ce)>-1){N[ve]={text:"/>",newPos:K.Pos(te.line,te.ch+2)};continue}var xe=Ie&&L(Ie,De)>-1;N[ve]={indent:xe,text:">"+(xe?`
|
|
|
|
`:"")+"</"+ce+">",newPos:xe?K.Pos(te.line+1,0):K.Pos(te.line,te.ch+1)}}for(var we=typeof R=="object"&&R.dontIndentOnAutoClose,ve=V.length-1;ve>=0;ve--){var fe=N[ve];P.replaceRange(fe.text,V[ve].head,V[ve].anchor,"+insert");var ne=P.listSelections().slice(0);ne[ve]={head:fe.newPos,anchor:fe.newPos},P.setSelections(ne),!we&&fe.indent&&(P.indentLine(fe.newPos.line,null,!0),P.indentLine(fe.newPos.line+1,null,!0))}}function ge(P,V){for(var N=P.listSelections(),R=[],ve=V?"/":"</",te=P.getOption("autoCloseTags"),F=typeof te=="object"&&te.dontIndentOnSlash,z=0;z<N.length;z++){if(!N[z].empty())return K.Pass;var j=N[z].head,le=P.getTokenAt(j),ce=K.innerMode(P.getMode(),le.state),Oe=ce.state;if(V&&(le.type=="string"||le.string.charAt(0)!="<"||le.start!=j.ch-1))return K.Pass;var Xe,Ie=ce.mode.name!="xml"&&P.getMode().name=="htmlmixed";if(Ie&&ce.mode.name=="javascript")Xe=ve+"script";else if(Ie&&ce.mode.name=="css")Xe=ve+"style";else{var De=ce.mode.xmlCurrentContext&&ce.mode.xmlCurrentContext(Oe);if(!De||De.length&&W(P,De,De[De.length-1],j))return K.Pass;Xe=ve+De[De.length-1]}P.getLine(j.line).charAt(le.end)!=">"&&(Xe+=">"),R[z]=Xe}if(P.replaceSelections(R),N=P.listSelections(),!F)for(var z=0;z<N.length;z++)(z==N.length-1||N[z].head.line<N[z+1].head.line)&&P.indentLine(N[z].head.line)}function ee(P){return P.getOption("disableInput")?K.Pass:ge(P,!0)}K.commands.closeTag=function(P){return ge(P)};function L(P,V){if(P.indexOf)return P.indexOf(V);for(var N=0,R=P.length;N<R;++N)if(P[N]==V)return N;return-1}function W(P,V,N,R,ve){if(!K.scanForClosingTag)return!1;var te=Math.min(P.lastLine()+1,R.line+500),F=K.scanForClosingTag(P,R,null,te);if(!F||F.tag!=N)return!1;for(var z=ve?1:0,j=V.length-1;j>=0&&V[j]==N;j--)++z;R=F.to;for(var j=1;j<z;j++){var le=K.scanForClosingTag(P,R,null,te);if(!le||le.tag!=N)return!1;R=le.to}return!0}})},BjJ7:function(ft,Ye,x){"use strict";x.d(Ye,"d",function(){return Ce}),x.d(Ye,"c",function(){return oe}),x.d(Ye,"e",function(){return Se}),x.d(Ye,"b",function(){return ge}),x.d(Ye,"a",function(){return L});var K=x("m3rI");function Ce(W){var P=!0;if(W.length>0){for(var V=0;V<W.length;V++)if(W[V].compile_success==0||!W[V].compile_success){P=!1;break}}else P=!1;return P}function oe(W){for(var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",V=[],N=0;N<W.length;N++){var R=W[N],ve=P?"".concat(P,"/").concat(R.name):"".concat(R.name);V.push({title:R.name,isLeaf:!(R.type==="tree"),key:ve})}return V}function Se(W,P,V){for(var N=0;N<W.length;N++){var R=W[N];if(R.key===P){R.children=V;break}R.children&&Se(R.children,P,V)}return W}function ge(W,P,V){var N;return function(){var R=this,ve=arguments,te=function(){N=null,V||W.apply(R,ve)},F=V&&!N;clearTimeout(N),N=setTimeout(te,P),F&&W.apply(R,ve)}}var ee=!0,L=K.a.API_SERVER},"C+DQ":function(ft,Ye,x){},DlQD:function(ft,Ye,x){(function(K,Ce){ft.exports=Ce()})(this,function(){"use strict";function K(I,A){for(var O=0;O<A.length;O++){var f=A[O];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(I,f.key,f)}}function Ce(I,A,O){return A&&K(I.prototype,A),O&&K(I,O),I}function oe(I,A){if(!I)return;if(typeof I=="string")return Se(I,A);var O=Object.prototype.toString.call(I).slice(8,-1);if(O==="Object"&&I.constructor&&(O=I.constructor.name),O==="Map"||O==="Set")return Array.from(I);if(O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O))return Se(I,A)}function Se(I,A){(A==null||A>I.length)&&(A=I.length);for(var O=0,f=new Array(A);O<A;O++)f[O]=I[O];return f}function ge(I,A){var O;if(typeof Symbol=="undefined"||I[Symbol.iterator]==null){if(Array.isArray(I)||(O=oe(I))||A&&I&&typeof I.length=="number"){O&&(I=O);var f=0;return function(){return f>=I.length?{done:!0}:{done:!1,value:I[f++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return O=I[Symbol.iterator](),O.next.bind(O)}function ee(I,A){return A={exports:{}},I(A,A.exports),A.exports}var L=ee(function(I){function A(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function O(f){I.exports.defaults=f}I.exports={defaults:A(),getDefaults:A,changeDefaults:O}}),W=L.defaults,P=L.getDefaults,V=L.changeDefaults,N=/[&<>"']/,R=/[&<>"']/g,ve=/[<>"']|&(?!#?\w+;)/,te=/[<>"']|&(?!#?\w+;)/g,F={"&":"&","<":"<",">":">",'"':""","'":"'"},z=function(A){return F[A]};function j(I,A){if(A){if(N.test(I))return I.replace(R,z)}else if(ve.test(I))return I.replace(te,z);return I}var le=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ce(I){return I.replace(le,function(A,O){return O=O.toLowerCase(),O==="colon"?":":O.charAt(0)==="#"?O.charAt(1)==="x"?String.fromCharCode(parseInt(O.substring(2),16)):String.fromCharCode(+O.substring(1)):""})}var Oe=/(^|[^\[])\^/g;function Xe(I,A){I=I.source||I,A=A||"";var O={replace:function(p,b){return b=b.source||b,b=b.replace(Oe,"$1"),I=I.replace(p,b),O},getRegex:function(){return new RegExp(I,A)}};return O}var Ie=/[^\w:]/g,De=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Fe(I,A,O){if(I){var f;try{f=decodeURIComponent(ce(O)).replace(Ie,"").toLowerCase()}catch(p){return null}if(f.indexOf("javascript:")===0||f.indexOf("vbscript:")===0||f.indexOf("data:")===0)return null}A&&!De.test(O)&&(O=v(A,O));try{O=encodeURI(O).replace(/%25/g,"%")}catch(p){return null}return O}var xe={},we=/^[^:]+:\/*[^/]*$/,fe=/^([^:]+:)[\s\S]*$/,ne=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(I,A){xe[" "+I]||(we.test(I)?xe[" "+I]=I+"/":xe[" "+I]=q(I,"/",!0)),I=xe[" "+I];var O=I.indexOf(":")===-1;return A.substring(0,2)==="//"?O?A:I.replace(fe,"$1")+A:A.charAt(0)==="/"?O?A:I.replace(ne,"$1")+A:I+A}var Q={exec:function(){}};function H(I){for(var A=1,O,f;A<arguments.length;A++){O=arguments[A];for(f in O)Object.prototype.hasOwnProperty.call(O,f)&&(I[f]=O[f])}return I}function w(I,A){var O=I.replace(/\|/g,function(b,k,D){for(var ae=!1,Te=k;--Te>=0&&D[Te]==="\\";)ae=!ae;return ae?"|":" |"}),f=O.split(/ \|/),p=0;if(f.length>A)f.splice(A);else for(;f.length<A;)f.push("");for(;p<f.length;p++)f[p]=f[p].trim().replace(/\\\|/g,"|");return f}function q(I,A,O){var f=I.length;if(f===0)return"";for(var p=0;p<f;){var b=I.charAt(f-p-1);if(b===A&&!O)p++;else if(b!==A&&O)p++;else break}return I.substr(0,f-p)}function U(I,A){if(I.indexOf(A[1])===-1)return-1;for(var O=I.length,f=0,p=0;p<O;p++)if(I[p]==="\\")p++;else if(I[p]===A[0])f++;else if(I[p]===A[1]&&(f--,f<0))return p;return-1}function T(I){I&&I.sanitize&&!I.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var E={escape:j,unescape:ce,edit:Xe,cleanUrl:Fe,resolveUrl:v,noopTest:Q,merge:H,splitCells:w,rtrim:q,findClosingBracket:U,checkSanitizeDeprecation:T},c=L.defaults,l=E.rtrim,m=E.splitCells,_=E.escape,B=E.findClosingBracket;function ue(I,A,O){var f=A.href,p=A.title?_(A.title):null,b=I[1].replace(/\\([\[\]])/g,"$1");return I[0].charAt(0)!=="!"?{type:"link",raw:O,href:f,title:p,text:b}:{type:"image",raw:O,href:f,title:p,text:_(b)}}function Ae(I,A){var O=I.match(/^(\s+)(?:```)/);if(O===null)return A;var f=O[1];return A.split(`
|
|
`).map(function(p){var b=p.match(/^\s+/);if(b===null)return p;var k=b[0];return k.length>=f.length?p.slice(f.length):p}).join(`
|
|
`)}var de=function(){function I(O){this.options=O||c}var A=I.prototype;return A.space=function(f){var p=this.rules.block.newline.exec(f);if(p)return p[0].length>1?{type:"space",raw:p[0]}:{raw:`
|
|
`}},A.code=function(f,p){var b=this.rules.block.code.exec(f);if(b){var k=p[p.length-1];if(k&&k.type==="paragraph")return{raw:b[0],text:b[0].trimRight()};var D=b[0].replace(/^ {4}/gm,"");return{type:"code",raw:b[0],codeBlockStyle:"indented",text:this.options.pedantic?D:l(D,`
|
|
`)}}},A.fences=function(f){var p=this.rules.block.fences.exec(f);if(p){var b=p[0],k=Ae(b,p[3]||"");return{type:"code",raw:b,lang:p[2]?p[2].trim():p[2],text:k}}},A.heading=function(f){var p=this.rules.block.heading.exec(f);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},A.nptable=function(f){var p=this.rules.block.nptable.exec(f);if(p){var b={type:"table",header:m(p[1].replace(/^ *| *\| *$/g,"")),align:p[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:p[3]?p[3].replace(/\n$/,"").split(`
|
|
`):[],raw:p[0]};if(b.header.length===b.align.length){var k=b.align.length,D;for(D=0;D<k;D++)/^ *-+: *$/.test(b.align[D])?b.align[D]="right":/^ *:-+: *$/.test(b.align[D])?b.align[D]="center":/^ *:-+ *$/.test(b.align[D])?b.align[D]="left":b.align[D]=null;for(k=b.cells.length,D=0;D<k;D++)b.cells[D]=m(b.cells[D],b.header.length);return b}}},A.hr=function(f){var p=this.rules.block.hr.exec(f);if(p)return{type:"hr",raw:p[0]}},A.blockquote=function(f){var p=this.rules.block.blockquote.exec(f);if(p){var b=p[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:p[0],text:b}}},A.list=function(f){var p=this.rules.block.list.exec(f);if(p){for(var b=p[0],k=p[2],D=k.length>1,ae=k[k.length-1]===")",Te={type:"list",raw:b,ordered:D,start:D?+k.slice(0,-1):"",loose:!1,items:[]},He=p[0].match(this.rules.block.item),tt=!1,et,kt,ht,st,Tt,bt,Ut,jt=He.length,yt=0;yt<jt;yt++)et=He[yt],b=et,kt=et.length,et=et.replace(/^ *([*+-]|\d+[.)]) */,""),~et.indexOf(`
|
|
`)&&(kt-=et.length,et=this.options.pedantic?et.replace(/^ {1,4}/gm,""):et.replace(new RegExp("^ {1,"+kt+"}","gm"),"")),yt!==jt-1&&(ht=this.rules.block.bullet.exec(He[yt+1])[0],(D?ht.length===1||!ae&&ht[ht.length-1]===")":ht.length>1||this.options.smartLists&&ht!==k)&&(st=He.slice(yt+1).join(`
|
|
`),Te.raw=Te.raw.substring(0,Te.raw.length-st.length),yt=jt-1)),Tt=tt||/\n\n(?!\s*$)/.test(et),yt!==jt-1&&(tt=et.charAt(et.length-1)===`
|
|
`,Tt||(Tt=tt)),Tt&&(Te.loose=!0),bt=/^\[[ xX]\] /.test(et),Ut=void 0,bt&&(Ut=et[1]!==" ",et=et.replace(/^\[[ xX]\] +/,"")),Te.items.push({type:"list_item",raw:b,task:bt,checked:Ut,loose:Tt,text:et});return Te}},A.html=function(f){var p=this.rules.block.html.exec(f);if(p)return{type:this.options.sanitize?"paragraph":"html",raw:p[0],pre:!this.options.sanitizer&&(p[1]==="pre"||p[1]==="script"||p[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(p[0]):_(p[0]):p[0]}},A.def=function(f){var p=this.rules.block.def.exec(f);if(p){p[3]&&(p[3]=p[3].substring(1,p[3].length-1));var b=p[1].toLowerCase().replace(/\s+/g," ");return{tag:b,raw:p[0],href:p[2],title:p[3]}}},A.table=function(f){var p=this.rules.block.table.exec(f);if(p){var b={type:"table",header:m(p[1].replace(/^ *| *\| *$/g,"")),align:p[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:p[3]?p[3].replace(/\n$/,"").split(`
|
|
`):[]};if(b.header.length===b.align.length){b.raw=p[0];var k=b.align.length,D;for(D=0;D<k;D++)/^ *-+: *$/.test(b.align[D])?b.align[D]="right":/^ *:-+: *$/.test(b.align[D])?b.align[D]="center":/^ *:-+ *$/.test(b.align[D])?b.align[D]="left":b.align[D]=null;for(k=b.cells.length,D=0;D<k;D++)b.cells[D]=m(b.cells[D].replace(/^ *\| *| *\| *$/g,""),b.header.length);return b}}},A.lheading=function(f){var p=this.rules.block.lheading.exec(f);if(p)return{type:"heading",raw:p[0],depth:p[2].charAt(0)==="="?1:2,text:p[1]}},A.paragraph=function(f){var p=this.rules.block.paragraph.exec(f);if(p)return{type:"paragraph",raw:p[0],text:p[1].charAt(p[1].length-1)===`
|
|
`?p[1].slice(0,-1):p[1]}},A.text=function(f,p){var b=this.rules.block.text.exec(f);if(b){var k=p[p.length-1];return k&&k.type==="text"?{raw:b[0],text:b[0]}:{type:"text",raw:b[0],text:b[0]}}},A.escape=function(f){var p=this.rules.inline.escape.exec(f);if(p)return{type:"escape",raw:p[0],text:_(p[1])}},A.tag=function(f,p,b){var k=this.rules.inline.tag.exec(f);if(k)return!p&&/^<a /i.test(k[0])?p=!0:p&&/^<\/a>/i.test(k[0])&&(p=!1),!b&&/^<(pre|code|kbd|script)(\s|>)/i.test(k[0])?b=!0:b&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(k[0])&&(b=!1),{type:this.options.sanitize?"text":"html",raw:k[0],inLink:p,inRawBlock:b,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(k[0]):_(k[0]):k[0]}},A.link=function(f){var p=this.rules.inline.link.exec(f);if(p){var b=B(p[2],"()");if(b>-1){var k=p[0].indexOf("!")===0?5:4,D=k+p[1].length+b;p[2]=p[2].substring(0,b),p[0]=p[0].substring(0,D).trim(),p[3]=""}var ae=p[2],Te="";if(this.options.pedantic){var He=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ae);He?(ae=He[1],Te=He[3]):Te=""}else Te=p[3]?p[3].slice(1,-1):"";ae=ae.trim().replace(/^<([\s\S]*)>$/,"$1");var tt=ue(p,{href:ae&&ae.replace(this.rules.inline._escapes,"$1"),title:Te&&Te.replace(this.rules.inline._escapes,"$1")},p[0]);return tt}},A.reflink=function(f,p){var b;if((b=this.rules.inline.reflink.exec(f))||(b=this.rules.inline.nolink.exec(f))){var k=(b[2]||b[1]).replace(/\s+/g," ");if(k=p[k.toLowerCase()],!k||!k.href){var D=b[0].charAt(0);return{type:"text",raw:D,text:D}}var ae=ue(b,k,b[0]);return ae}},A.strong=function(f,p,b){b===void 0&&(b="");var k=this.rules.inline.strong.start.exec(f);if(k&&(!k[1]||k[1]&&(b===""||this.rules.inline.punctuation.exec(b)))){p=p.slice(-1*f.length);var D=k[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;D.lastIndex=0;for(var ae;(k=D.exec(p))!=null;)if(ae=this.rules.inline.strong.middle.exec(p.slice(0,k.index+3)),ae)return{type:"strong",raw:f.slice(0,ae[0].length),text:f.slice(2,ae[0].length-2)}}},A.em=function(f,p,b){b===void 0&&(b="");var k=this.rules.inline.em.start.exec(f);if(k&&(!k[1]||k[1]&&(b===""||this.rules.inline.punctuation.exec(b)))){p=p.slice(-1*f.length);var D=k[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;D.lastIndex=0;for(var ae;(k=D.exec(p))!=null;)if(ae=this.rules.inline.em.middle.exec(p.slice(0,k.index+2)),ae)return{type:"em",raw:f.slice(0,ae[0].length),text:f.slice(1,ae[0].length-1)}}},A.codespan=function(f){var p=this.rules.inline.code.exec(f);if(p){var b=p[2].replace(/\n/g," "),k=/[^ ]/.test(b),D=b.startsWith(" ")&&b.endsWith(" ");return k&&D&&(b=b.substring(1,b.length-1)),b=_(b,!0),{type:"codespan",raw:p[0],text:b}}},A.br=function(f){var p=this.rules.inline.br.exec(f);if(p)return{type:"br",raw:p[0]}},A.del=function(f){var p=this.rules.inline.del.exec(f);if(p)return{type:"del",raw:p[0],text:p[1]}},A.autolink=function(f,p){var b=this.rules.inline.autolink.exec(f);if(b){var k,D;return b[2]==="@"?(k=_(this.options.mangle?p(b[1]):b[1]),D="mailto:"+k):(k=_(b[1]),D=k),{type:"link",raw:b[0],text:k,href:D,tokens:[{type:"text",raw:k,text:k}]}}},A.url=function(f,p){var b;if(b=this.rules.inline.url.exec(f)){var k,D;if(b[2]==="@")k=_(this.options.mangle?p(b[0]):b[0]),D="mailto:"+k;else{var ae;do ae=b[0],b[0]=this.rules.inline._backpedal.exec(b[0])[0];while(ae!==b[0]);k=_(b[0]),b[1]==="www."?D="http://"+k:D=k}return{type:"link",raw:b[0],text:k,href:D,tokens:[{type:"text",raw:k,text:k}]}}},A.inlineText=function(f,p,b){var k=this.rules.inline.text.exec(f);if(k){var D;return p?D=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(k[0]):_(k[0]):k[0]:D=_(this.options.smartypants?b(k[0]):k[0]),{type:"text",raw:k[0],text:D}}},I}(),ie=E.noopTest,G=E.edit,Z=E.merge,M={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ie,table:ie,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};M._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,M._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,M.def=G(M.def).replace("label",M._label).replace("title",M._title).getRegex(),M.bullet=/(?:[*+-]|\d{1,9}[.)])/,M.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,M.item=G(M.item,"gm").replace(/bull/g,M.bullet).getRegex(),M.list=G(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex(),M._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",M._comment=/<!--(?!-?>)[\s\S]*?-->/,M.html=G(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),M.paragraph=G(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",M._tag).getRegex(),M.blockquote=G(M.blockquote).replace("paragraph",M.paragraph).getRegex(),M.normal=Z({},M),M.gfm=Z({},M.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),M.gfm.nptable=G(M.gfm.nptable).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",M._tag).getRegex(),M.gfm.table=G(M.gfm.table).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",M._tag).getRegex(),M.pedantic=Z({},M.normal,{html:G(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",M._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ie,paragraph:G(M.normal._paragraph).replace("hr",M.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",M.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var J={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ie,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ie,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};J._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",J.punctuation=G(J.punctuation).replace(/punctuation/g,J._punctuation).getRegex(),J._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",J._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",J.em.start=G(J.em.start).replace(/punctuation/g,J._punctuation).getRegex(),J.em.middle=G(J.em.middle).replace(/punctuation/g,J._punctuation).replace(/overlapSkip/g,J._overlapSkip).getRegex(),J.em.endAst=G(J.em.endAst,"g").replace(/punctuation/g,J._punctuation).getRegex(),J.em.endUnd=G(J.em.endUnd,"g").replace(/punctuation/g,J._punctuation).getRegex(),J.strong.start=G(J.strong.start).replace(/punctuation/g,J._punctuation).getRegex(),J.strong.middle=G(J.strong.middle).replace(/punctuation/g,J._punctuation).replace(/blockSkip/g,J._blockSkip).getRegex(),J.strong.endAst=G(J.strong.endAst,"g").replace(/punctuation/g,J._punctuation).getRegex(),J.strong.endUnd=G(J.strong.endUnd,"g").replace(/punctuation/g,J._punctuation).getRegex(),J.blockSkip=G(J._blockSkip,"g").getRegex(),J.overlapSkip=G(J._overlapSkip,"g").getRegex(),J._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,J._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,J._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,J.autolink=G(J.autolink).replace("scheme",J._scheme).replace("email",J._email).getRegex(),J._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,J.tag=G(J.tag).replace("comment",M._comment).replace("attribute",J._attribute).getRegex(),J._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,J._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,J._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,J.link=G(J.link).replace("label",J._label).replace("href",J._href).replace("title",J._title).getRegex(),J.reflink=G(J.reflink).replace("label",J._label).getRegex(),J.reflinkSearch=G(J.reflinkSearch,"g").replace("reflink",J.reflink).replace("nolink",J.nolink).getRegex(),J.normal=Z({},J),J.pedantic=Z({},J.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:G(/^!?\[(label)\]\((.*?)\)/).replace("label",J._label).getRegex(),reflink:G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",J._label).getRegex()}),J.gfm=Z({},J.normal,{escape:G(J.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),J.gfm.url=G(J.gfm.url,"i").replace("email",J.gfm._extended_email).getRegex(),J.breaks=Z({},J.gfm,{br:G(J.br).replace("{2,}","*").getRegex(),text:G(J.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var h={block:M,inline:J},C=L.defaults,g=h.block,re=h.inline;function pe(I){return I.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Y(I){var A="",O,f,p=I.length;for(O=0;O<p;O++)f=I.charCodeAt(O),Math.random()>.5&&(f="x"+f.toString(16)),A+="&#"+f+";";return A}var se=function(){function I(O){this.tokens=[],this.tokens.links=Object.create(null),this.options=O||C,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var f={block:g.normal,inline:re.normal};this.options.pedantic?(f.block=g.pedantic,f.inline=re.pedantic):this.options.gfm&&(f.block=g.gfm,this.options.breaks?f.inline=re.breaks:f.inline=re.gfm),this.tokenizer.rules=f}I.lex=function(f,p){var b=new I(p);return b.lex(f)};var A=I.prototype;return A.lex=function(f){return f=f.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(f,this.tokens,!0),this.inline(this.tokens),this.tokens},A.blockTokens=function(f,p,b){p===void 0&&(p=[]),b===void 0&&(b=!0),f=f.replace(/^ +$/gm,"");for(var k,D,ae,Te;f;){if(k=this.tokenizer.space(f)){f=f.substring(k.raw.length),k.type&&p.push(k);continue}if(k=this.tokenizer.code(f,p)){f=f.substring(k.raw.length),k.type?p.push(k):(Te=p[p.length-1],Te.raw+=`
|
|
`+k.raw,Te.text+=`
|
|
`+k.text);continue}if(k=this.tokenizer.fences(f)){f=f.substring(k.raw.length),p.push(k);continue}if(k=this.tokenizer.heading(f)){f=f.substring(k.raw.length),p.push(k);continue}if(k=this.tokenizer.nptable(f)){f=f.substring(k.raw.length),p.push(k);continue}if(k=this.tokenizer.hr(f)){f=f.substring(k.raw.length),p.push(k);continue}if(k=this.tokenizer.blockquote(f)){f=f.substring(k.raw.length),k.tokens=this.blockTokens(k.text,[],b),p.push(k);continue}if(k=this.tokenizer.list(f)){for(f=f.substring(k.raw.length),ae=k.items.length,D=0;D<ae;D++)k.items[D].tokens=this.blockTokens(k.items[D].text,[],!1);p.push(k);continue}if(k=this.tokenizer.html(f)){f=f.substring(k.raw.length),p.push(k);continue}if(b&&(k=this.tokenizer.def(f))){f=f.substring(k.raw.length),this.tokens.links[k.tag]||(this.tokens.links[k.tag]={href:k.href,title:k.title});continue}if(k=this.tokenizer.table(f)){f=f.substring(k.raw.length),p.push(k);continue}if(k=this.tokenizer.lheading(f)){f=f.substring(k.raw.length),p.push(k);continue}if(b&&(k=this.tokenizer.paragraph(f))){f=f.substring(k.raw.length),p.push(k);continue}if(k=this.tokenizer.text(f,p)){f=f.substring(k.raw.length),k.type?p.push(k):(Te=p[p.length-1],Te.raw+=`
|
|
`+k.raw,Te.text+=`
|
|
`+k.text);continue}if(f){var He="Infinite loop on byte: "+f.charCodeAt(0);if(this.options.silent){console.error(He);break}else throw new Error(He)}}return p},A.inline=function(f){var p,b,k,D,ae,Te,He=f.length;for(p=0;p<He;p++){Te=f[p];switch(Te.type){case"paragraph":case"text":case"heading":{Te.tokens=[],this.inlineTokens(Te.text,Te.tokens);break}case"table":{for(Te.tokens={header:[],cells:[]},D=Te.header.length,b=0;b<D;b++)Te.tokens.header[b]=[],this.inlineTokens(Te.header[b],Te.tokens.header[b]);for(D=Te.cells.length,b=0;b<D;b++)for(ae=Te.cells[b],Te.tokens.cells[b]=[],k=0;k<ae.length;k++)Te.tokens.cells[b][k]=[],this.inlineTokens(ae[k],Te.tokens.cells[b][k]);break}case"blockquote":{this.inline(Te.tokens);break}case"list":{for(D=Te.items.length,b=0;b<D;b++)this.inline(Te.items[b].tokens);break}}}return f},A.inlineTokens=function(f,p,b,k,D){p===void 0&&(p=[]),b===void 0&&(b=!1),k===void 0&&(k=!1),D===void 0&&(D="");var ae,Te=f,He;if(this.tokens.links){var tt=Object.keys(this.tokens.links);if(tt.length>0)for(;(He=this.tokenizer.rules.inline.reflinkSearch.exec(Te))!=null;)tt.includes(He[0].slice(He[0].lastIndexOf("[")+1,-1))&&(Te=Te.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(He=this.tokenizer.rules.inline.blockSkip.exec(Te))!=null;)Te=Te.slice(0,He.index)+"["+"a".repeat(He[0].length-2)+"]"+Te.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;f;){if(ae=this.tokenizer.escape(f)){f=f.substring(ae.raw.length),p.push(ae);continue}if(ae=this.tokenizer.tag(f,b,k)){f=f.substring(ae.raw.length),b=ae.inLink,k=ae.inRawBlock,p.push(ae);continue}if(ae=this.tokenizer.link(f)){f=f.substring(ae.raw.length),ae.type==="link"&&(ae.tokens=this.inlineTokens(ae.text,[],!0,k)),p.push(ae);continue}if(ae=this.tokenizer.reflink(f,this.tokens.links)){f=f.substring(ae.raw.length),ae.type==="link"&&(ae.tokens=this.inlineTokens(ae.text,[],!0,k)),p.push(ae);continue}if(ae=this.tokenizer.strong(f,Te,D)){f=f.substring(ae.raw.length),ae.tokens=this.inlineTokens(ae.text,[],b,k),p.push(ae);continue}if(ae=this.tokenizer.em(f,Te,D)){f=f.substring(ae.raw.length),ae.tokens=this.inlineTokens(ae.text,[],b,k),p.push(ae);continue}if(ae=this.tokenizer.codespan(f)){f=f.substring(ae.raw.length),p.push(ae);continue}if(ae=this.tokenizer.br(f)){f=f.substring(ae.raw.length),p.push(ae);continue}if(ae=this.tokenizer.del(f)){f=f.substring(ae.raw.length),ae.tokens=this.inlineTokens(ae.text,[],b,k),p.push(ae);continue}if(ae=this.tokenizer.autolink(f,Y)){f=f.substring(ae.raw.length),p.push(ae);continue}if(!b&&(ae=this.tokenizer.url(f,Y))){f=f.substring(ae.raw.length),p.push(ae);continue}if(ae=this.tokenizer.inlineText(f,k,pe)){f=f.substring(ae.raw.length),D=ae.raw.slice(-1),p.push(ae);continue}if(f){var et="Infinite loop on byte: "+f.charCodeAt(0);if(this.options.silent){console.error(et);break}else throw new Error(et)}}return p},Ce(I,null,[{key:"rules",get:function(){return{block:g,inline:re}}}]),I}(),ke=L.defaults,Re=E.cleanUrl,Le=E.escape,be=function(){function I(O){this.options=O||ke}var A=I.prototype;return A.code=function(f,p,b){var k=(p||"").match(/\S*/)[0];if(this.options.highlight){var D=this.options.highlight(f,k);D!=null&&D!==f&&(b=!0,f=D)}return k?'<pre><code class="'+this.options.langPrefix+Le(k,!0)+'">'+(b?f:Le(f,!0))+`</code></pre>
|
|
`:"<pre><code>"+(b?f:Le(f,!0))+`</code></pre>
|
|
`},A.blockquote=function(f){return`<blockquote>
|
|
`+f+`</blockquote>
|
|
`},A.html=function(f){return f},A.heading=function(f,p,b,k){return this.options.headerIds?"<h"+p+' id="'+this.options.headerPrefix+k.slug(b)+'">'+f+"</h"+p+`>
|
|
`:"<h"+p+">"+f+"</h"+p+`>
|
|
`},A.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},A.list=function(f,p,b){var k=p?"ol":"ul",D=p&&b!==1?' start="'+b+'"':"";return"<"+k+D+`>
|
|
`+f+"</"+k+`>
|
|
`},A.listitem=function(f){return"<li>"+f+`</li>
|
|
`},A.checkbox=function(f){return"<input "+(f?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},A.paragraph=function(f){return"<p>"+f+`</p>
|
|
`},A.table=function(f,p){return p&&(p="<tbody>"+p+"</tbody>"),`<table>
|
|
<thead>
|
|
`+f+`</thead>
|
|
`+p+`</table>
|
|
`},A.tablerow=function(f){return`<tr>
|
|
`+f+`</tr>
|
|
`},A.tablecell=function(f,p){var b=p.header?"th":"td",k=p.align?"<"+b+' align="'+p.align+'">':"<"+b+">";return k+f+"</"+b+`>
|
|
`},A.strong=function(f){return"<strong>"+f+"</strong>"},A.em=function(f){return"<em>"+f+"</em>"},A.codespan=function(f){return"<code>"+f+"</code>"},A.br=function(){return this.options.xhtml?"<br/>":"<br>"},A.del=function(f){return"<del>"+f+"</del>"},A.link=function(f,p,b){if(f=Re(this.options.sanitize,this.options.baseUrl,f),f===null)return b;var k='<a href="'+Le(f)+'"';return p&&(k+=' title="'+p+'"'),k+=">"+b+"</a>",k},A.image=function(f,p,b){if(f=Re(this.options.sanitize,this.options.baseUrl,f),f===null)return b;var k='<img src="'+f+'" alt="'+b+'"';return p&&(k+=' title="'+p+'"'),k+=this.options.xhtml?"/>":">",k},A.text=function(f){return f},I}(),Ee=function(){function I(){}var A=I.prototype;return A.strong=function(f){return f},A.em=function(f){return f},A.codespan=function(f){return f},A.del=function(f){return f},A.html=function(f){return f},A.text=function(f){return f},A.link=function(f,p,b){return""+b},A.image=function(f,p,b){return""+b},A.br=function(){return""},I}(),Ue=function(){function I(){this.seen={}}var A=I.prototype;return A.slug=function(f){var p=f.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(p)){var b=p;do this.seen[b]++,p=b+"-"+this.seen[b];while(this.seen.hasOwnProperty(p))}return this.seen[p]=0,p},I}(),Je=L.defaults,ze=E.unescape,Ve=function(){function I(O){this.options=O||Je,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ee,this.slugger=new Ue}I.parse=function(f,p){var b=new I(p);return b.parse(f)};var A=I.prototype;return A.parse=function(f,p){p===void 0&&(p=!0);var b="",k,D,ae,Te,He,tt,et,kt,ht,st,Tt,bt,Ut,jt,yt,Tn,Mn,un,gn=f.length;for(k=0;k<gn;k++){st=f[k];switch(st.type){case"space":continue;case"hr":{b+=this.renderer.hr();continue}case"heading":{b+=this.renderer.heading(this.parseInline(st.tokens),st.depth,ze(this.parseInline(st.tokens,this.textRenderer)),this.slugger);continue}case"code":{b+=this.renderer.code(st.text,st.lang,st.escaped);continue}case"table":{for(kt="",et="",Te=st.header.length,D=0;D<Te;D++)et+=this.renderer.tablecell(this.parseInline(st.tokens.header[D]),{header:!0,align:st.align[D]});for(kt+=this.renderer.tablerow(et),ht="",Te=st.cells.length,D=0;D<Te;D++){for(tt=st.tokens.cells[D],et="",He=tt.length,ae=0;ae<He;ae++)et+=this.renderer.tablecell(this.parseInline(tt[ae]),{header:!1,align:st.align[ae]});ht+=this.renderer.tablerow(et)}b+=this.renderer.table(kt,ht);continue}case"blockquote":{ht=this.parse(st.tokens),b+=this.renderer.blockquote(ht);continue}case"list":{for(Tt=st.ordered,bt=st.start,Ut=st.loose,Te=st.items.length,ht="",D=0;D<Te;D++)yt=st.items[D],Tn=yt.checked,Mn=yt.task,jt="",yt.task&&(un=this.renderer.checkbox(Tn),Ut?yt.tokens.length>0&&yt.tokens[0].type==="text"?(yt.tokens[0].text=un+" "+yt.tokens[0].text,yt.tokens[0].tokens&&yt.tokens[0].tokens.length>0&&yt.tokens[0].tokens[0].type==="text"&&(yt.tokens[0].tokens[0].text=un+" "+yt.tokens[0].tokens[0].text)):yt.tokens.unshift({type:"text",text:un}):jt+=un),jt+=this.parse(yt.tokens,Ut),ht+=this.renderer.listitem(jt,Mn,Tn);b+=this.renderer.list(ht,Tt,bt);continue}case"html":{b+=this.renderer.html(st.text);continue}case"paragraph":{b+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(ht=st.tokens?this.parseInline(st.tokens):st.text;k+1<gn&&f[k+1].type==="text";)st=f[++k],ht+=`
|
|
`+(st.tokens?this.parseInline(st.tokens):st.text);b+=p?this.renderer.paragraph(ht):ht;continue}default:{var hn='Token with "'+st.type+'" type was not found.';if(this.options.silent){console.error(hn);return}else throw new Error(hn)}}}return b},A.parseInline=function(f,p){p=p||this.renderer;var b="",k,D,ae=f.length;for(k=0;k<ae;k++){D=f[k];switch(D.type){case"escape":{b+=p.text(D.text);break}case"html":{b+=p.html(D.text);break}case"link":{b+=p.link(D.href,D.title,this.parseInline(D.tokens,p));break}case"image":{b+=p.image(D.href,D.title,D.text);break}case"strong":{b+=p.strong(this.parseInline(D.tokens,p));break}case"em":{b+=p.em(this.parseInline(D.tokens,p));break}case"codespan":{b+=p.codespan(D.text);break}case"br":{b+=p.br();break}case"del":{b+=p.del(this.parseInline(D.tokens,p));break}case"text":{b+=p.text(D.text);break}default:{var Te='Token with "'+D.type+'" type was not found.';if(this.options.silent){console.error(Te);return}else throw new Error(Te)}}}return b},I}(),ot=E.merge,rt=E.checkSanitizeDeprecation,Ke=E.escape,he=L.getDefaults,it=L.changeDefaults,qe=L.defaults;function ye(I,A,O){if(typeof I=="undefined"||I===null)throw new Error("marked(): input parameter is undefined or null");if(typeof I!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(I)+", string expected");if(typeof A=="function"&&(O=A,A=null),A=ot({},ye.defaults,A||{}),rt(A),O){var f=A.highlight,p;try{p=se.lex(I,A)}catch(ae){return O(ae)}var b=function(Te){var He;if(!Te)try{He=Ve.parse(p,A)}catch(tt){Te=tt}return A.highlight=f,Te?O(Te):O(null,He)};if(!f||f.length<3)return b();if(delete A.highlight,!p.length)return b();var k=0;ye.walkTokens(p,function(ae){ae.type==="code"&&(k++,setTimeout(function(){f(ae.text,ae.lang,function(Te,He){if(Te)return b(Te);He!=null&&He!==ae.text&&(ae.text=He,ae.escaped=!0),k--,k===0&&b()})},0))}),k===0&&b();return}try{var D=se.lex(I,A);return A.walkTokens&&ye.walkTokens(D,A.walkTokens),Ve.parse(D,A)}catch(ae){if(ae.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,A.silent)return"<p>An error occurred:</p><pre>"+Ke(ae.message+"",!0)+"</pre>";throw ae}}ye.options=ye.setOptions=function(I){return ot(ye.defaults,I),it(ye.defaults),ye},ye.getDefaults=he,ye.defaults=qe,ye.use=function(I){var A=ot({},I);if(I.renderer&&function(){var f=ye.defaults.renderer||new be,p=function(D){var ae=f[D];f[D]=function(){for(var Te=arguments.length,He=new Array(Te),tt=0;tt<Te;tt++)He[tt]=arguments[tt];var et=I.renderer[D].apply(f,He);return et===!1&&(et=ae.apply(f,He)),et}};for(var b in I.renderer)p(b);A.renderer=f}(),I.tokenizer&&function(){var f=ye.defaults.tokenizer||new de,p=function(D){var ae=f[D];f[D]=function(){for(var Te=arguments.length,He=new Array(Te),tt=0;tt<Te;tt++)He[tt]=arguments[tt];var et=I.tokenizer[D].apply(f,He);return et===!1&&(et=ae.apply(f,He)),et}};for(var b in I.tokenizer)p(b);A.tokenizer=f}(),I.walkTokens){var O=ye.defaults.walkTokens;A.walkTokens=function(f){I.walkTokens(f),O&&O(f)}}ye.setOptions(A)},ye.walkTokens=function(I,A){for(var O=ge(I),f;!(f=O()).done;){var p=f.value;A(p);switch(p.type){case"table":{for(var b=ge(p.tokens.header),k;!(k=b()).done;){var D=k.value;ye.walkTokens(D,A)}for(var ae=ge(p.tokens.cells),Te;!(Te=ae()).done;)for(var He=Te.value,tt=ge(He),et;!(et=tt()).done;){var kt=et.value;ye.walkTokens(kt,A)}break}case"list":{ye.walkTokens(p.items,A);break}default:p.tokens&&ye.walkTokens(p.tokens,A)}}},ye.Parser=Ve,ye.parser=Ve.parse,ye.Renderer=be,ye.TextRenderer=Ee,ye.Lexer=se,ye.lexer=se.lex,ye.Tokenizer=de,ye.Slugger=Ue,ye.parse=ye;var Pe=ye;return Pe})},ELLl:function(ft,Ye,x){(function(K){K(x("VrN/"))})(function(K){var Ce={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},oe=K.Pos;K.defineOption("autoCloseBrackets",!1,function(F,z,j){j&&j!=K.Init&&(F.removeKeyMap(ge),F.state.closeBrackets=null),z&&(ee(Se(z,"pairs")),F.state.closeBrackets=z,F.addKeyMap(ge))});function Se(F,z){return z=="pairs"&&typeof F=="string"?F:typeof F=="object"&&F[z]!=null?F[z]:Ce[z]}var ge={Backspace:P,Enter:V};function ee(F){for(var z=0;z<F.length;z++){var j=F.charAt(z),le="'"+j+"'";ge[le]||(ge[le]=L(j))}}ee(Ce.pairs+"`");function L(F){return function(z){return R(z,F)}}function W(F){var z=F.state.closeBrackets;if(!z||z.override)return z;var j=F.getModeAt(F.getCursor());return j.closeBrackets||z}function P(F){var z=W(F);if(!z||F.getOption("disableInput"))return K.Pass;for(var j=Se(z,"pairs"),le=F.listSelections(),ce=0;ce<le.length;ce++){if(!le[ce].empty())return K.Pass;var Oe=ve(F,le[ce].head);if(!Oe||j.indexOf(Oe)%2!=0)return K.Pass}for(var ce=le.length-1;ce>=0;ce--){var Xe=le[ce].head;F.replaceRange("",oe(Xe.line,Xe.ch-1),oe(Xe.line,Xe.ch+1),"+delete")}}function V(F){var z=W(F),j=z&&Se(z,"explode");if(!j||F.getOption("disableInput"))return K.Pass;for(var le=F.listSelections(),ce=0;ce<le.length;ce++){if(!le[ce].empty())return K.Pass;var Oe=ve(F,le[ce].head);if(!Oe||j.indexOf(Oe)%2!=0)return K.Pass}F.operation(function(){var Xe=F.lineSeparator()||`
|
|
`;F.replaceSelection(Xe+Xe,null),F.execCommand("goCharLeft"),le=F.listSelections();for(var Ie=0;Ie<le.length;Ie++){var De=le[Ie].head.line;F.indentLine(De,null,!0),F.indentLine(De+1,null,!0)}})}function N(F){var z=K.cmpPos(F.anchor,F.head)>0;return{anchor:new oe(F.anchor.line,F.anchor.ch+(z?-1:1)),head:new oe(F.head.line,F.head.ch+(z?1:-1))}}function R(F,z){var j=W(F);if(!j||F.getOption("disableInput"))return K.Pass;var le=Se(j,"pairs"),ce=le.indexOf(z);if(ce==-1)return K.Pass;for(var Oe=Se(j,"closeBefore"),Xe=Se(j,"triples"),Ie=le.charAt(ce+1)==z,De=F.listSelections(),Fe=ce%2==0,xe,we=0;we<De.length;we++){var fe=De[we],ne=fe.head,v,Q=F.getRange(ne,oe(ne.line,ne.ch+1));if(Fe&&!fe.empty())v="surround";else if((Ie||!Fe)&&Q==z)Ie&&te(F,ne)?v="both":Xe.indexOf(z)>=0&&F.getRange(ne,oe(ne.line,ne.ch+3))==z+z+z?v="skipThree":v="skip";else if(Ie&&ne.ch>1&&Xe.indexOf(z)>=0&&F.getRange(oe(ne.line,ne.ch-2),ne)==z+z){if(ne.ch>2&&/\bstring/.test(F.getTokenTypeAt(oe(ne.line,ne.ch-2))))return K.Pass;v="addFour"}else if(Ie){var H=ne.ch==0?" ":F.getRange(oe(ne.line,ne.ch-1),ne);if(!K.isWordChar(Q)&&H!=z&&!K.isWordChar(H))v="both";else return K.Pass}else if(Fe&&(Q.length===0||/\s/.test(Q)||Oe.indexOf(Q)>-1))v="both";else return K.Pass;if(!xe)xe=v;else if(xe!=v)return K.Pass}var w=ce%2?le.charAt(ce-1):z,q=ce%2?z:le.charAt(ce+1);F.operation(function(){if(xe=="skip")F.execCommand("goCharRight");else if(xe=="skipThree")for(var U=0;U<3;U++)F.execCommand("goCharRight");else if(xe=="surround"){for(var T=F.getSelections(),U=0;U<T.length;U++)T[U]=w+T[U]+q;F.replaceSelections(T,"around"),T=F.listSelections().slice();for(var U=0;U<T.length;U++)T[U]=N(T[U]);F.setSelections(T)}else xe=="both"?(F.replaceSelection(w+q,null),F.triggerElectric(w+q),F.execCommand("goCharLeft")):xe=="addFour"&&(F.replaceSelection(w+w+w+w,"before"),F.execCommand("goCharRight"))})}function ve(F,z){var j=F.getRange(oe(z.line,z.ch-1),oe(z.line,z.ch+1));return j.length==2?j:null}function te(F,z){var j=F.getTokenAt(oe(z.line,z.ch+1));return/\bstring/.test(j.type)&&j.start==z.ch&&(z.ch==0||!/\bstring/.test(F.getTokenTypeAt(z)))}})},GfqC:function(ft,Ye,x){"use strict";var K=x("cDcd"),Ce=x.n(K),oe=x("TSYQ"),Se=x.n(oe);function ge(E,c){var l="cannot "+E.method+" "+E.action+" "+c.status+"'",m=new Error(l);return m.status=c.status,m.method=E.method,m.url=E.action,m}function ee(E){var c=E.responseText||E.response;if(!c)return c;try{return JSON.parse(c)}catch(l){return c}}function L(E){var c=new XMLHttpRequest;E.onProgress&&c.upload&&(c.upload.onprogress=function(B){B.total>0&&(B.percent=B.loaded/B.total*100),E.onProgress(B)});var l=new FormData;E.data&&Object.keys(E.data).forEach(function(_){var B=E.data[_];if(Array.isArray(B)){B.forEach(function(ue){l.append(_+"[]",ue)});return}l.append(_,E.data[_])}),E.file instanceof Blob?l.append(E.filename,E.file,E.file.name):l.append(E.filename,E.file),c.onerror=function(B){E.onError(B)},c.onload=function(){return c.status<200||c.status>=300?E.onError(ge(E,c),ee(c)):E.onSuccess(ee(c),c)},c.open(E.method,E.action,!0),E.withCredentials&&"withCredentials"in c&&(c.withCredentials=!0);var m=E.headers||{};return m["X-Requested-With"]!==null&&c.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(m).forEach(function(_){m[_]!==null&&c.setRequestHeader(_,m[_])}),c.send(l),{abort:function(){c.abort()}}}var W=+new Date,P=0;function V(){return"rc-upload-"+W+"-"+ ++P}function N(E,c){return E.indexOf(c,E.length-c.length)!==-1}var R=function(E,c){if(E&&c){var l=Array.isArray(c)?c:c.split(","),m=E.name||"",_=E.type||"",B=_.replace(/\/.*$/,"");return l.some(function(ue){var Ae=ue.trim();return Ae.charAt(0)==="."?N(m.toLowerCase(),Ae.toLowerCase()):/\/\*$/.test(Ae)?B===Ae.replace(/\/.*$/,""):_===Ae})}return!0};function ve(E,c){var l=E.createReader(),m=[];function _(){l.readEntries(function(B){var ue=Array.prototype.slice.apply(B);m=m.concat(ue);var Ae=!ue.length;Ae?c(m):_()})}_()}var te=function(c,l,m){var _=function B(ue,Ae){Ae=Ae||"",ue.isFile?ue.file(function(de){m(de)&&(ue.fullPath&&!de.webkitRelativePath&&(Object.defineProperties(de,{webkitRelativePath:{writable:!0}}),de.webkitRelativePath=ue.fullPath.replace(/^\//,""),Object.defineProperties(de,{webkitRelativePath:{writable:!1}})),l([de]))}):ue.isDirectory&&ve(ue,function(de){de.forEach(function(ie){B(ie,""+Ae+ue.name+"/")})})};c.forEach(function(B){_(B.webkitGetAsEntry())})},F=te,z=Object.assign||function(E){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var m in l)Object.prototype.hasOwnProperty.call(l,m)&&(E[m]=l[m])}return E},j=function(){function E(c,l){var m=[],_=!0,B=!1,ue=void 0;try{for(var Ae=c[Symbol.iterator](),de;!(_=(de=Ae.next()).done)&&!(m.push(de.value),l&&m.length===l);_=!0);}catch(ie){B=!0,ue=ie}finally{try{!_&&Ae.return&&Ae.return()}finally{if(B)throw ue}}return m}return function(c,l){if(Array.isArray(c))return c;if(Symbol.iterator in Object(c))return E(c,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),le=function(){function E(c,l){for(var m=0;m<l.length;m++){var _=l[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(c,_.key,_)}}return function(c,l,m){return l&&E(c.prototype,l),m&&E(c,m),c}}();function ce(E,c,l){return c in E?Object.defineProperty(E,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):E[c]=l,E}function Oe(E,c){var l={};for(var m in E){if(c.indexOf(m)>=0)continue;if(!Object.prototype.hasOwnProperty.call(E,m))continue;l[m]=E[m]}return l}function Xe(E,c){if(!(E instanceof c))throw new TypeError("Cannot call a class as a function")}function Ie(E,c){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:E}function De(E,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);E.prototype=Object.create(c&&c.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(E,c):E.__proto__=c)}var Fe=function(c){return Object.keys(c).reduce(function(l,m){return(m.substr(0,5)==="data-"||m.substr(0,5)==="aria-"||m==="role")&&(l[m]=c[m]),l},{})},xe=function(E){De(c,E);function c(){var l,m,_,B;Xe(this,c);for(var ue=arguments.length,Ae=Array(ue),de=0;de<ue;de++)Ae[de]=arguments[de];return B=(m=(_=Ie(this,(l=c.__proto__||Object.getPrototypeOf(c)).call.apply(l,[this].concat(Ae))),_),_.state={uid:V()},_.reqs={},_.onChange=function(ie){var G=ie.target.files;_.uploadFiles(G),_.reset()},_.onClick=function(ie){var G=_.fileInput;if(!G)return;var Z=_.props,M=Z.children,J=Z.onClick;M&&M.type==="button"&&(G.parentNode.focus(),G.parentNode.querySelector("button").blur()),G.click(),J&&J(ie)},_.onKeyDown=function(ie){ie.key==="Enter"&&_.onClick()},_.onFileDrop=function(ie){var G=_.props.multiple;if(ie.preventDefault(),ie.type==="dragover")return;if(_.props.directory)F(Array.prototype.slice.call(ie.dataTransfer.items),_.uploadFiles,function(M){return R(M,_.props.accept)});else{var Z=Array.prototype.slice.call(ie.dataTransfer.files).filter(function(M){return R(M,_.props.accept)});G===!1&&(Z=Z.slice(0,1)),_.uploadFiles(Z)}},_.uploadFiles=function(ie){var G=Array.prototype.slice.call(ie);G.map(function(Z){return Z.uid=V(),Z}).forEach(function(Z){_.upload(Z,G)})},_.saveFileInput=function(ie){_.fileInput=ie},m),Ie(_,B)}return le(c,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(m,_){var B=this,ue=this.props;if(!ue.beforeUpload)return setTimeout(function(){return B.post(m)},0);var Ae=ue.beforeUpload(m,_);Ae&&Ae.then?Ae.then(function(de){var ie=Object.prototype.toString.call(de);return ie==="[object File]"||ie==="[object Blob]"?B.post(de):B.post(m)}).catch(function(de){console.log(de)}):Ae!==!1&&setTimeout(function(){return B.post(m)},0);return}},{key:"post",value:function(m){var _=this;if(!this._isMounted)return;var B=this.props,ue=B.onStart,Ae=B.onProgress,de=B.transformFile,ie=de===void 0?function(G){return G}:de;new Promise(function(G){var Z=B.action;return typeof Z=="function"&&(Z=Z(m)),G(Z)}).then(function(G){var Z=m.uid,M=B.customRequest||L,J=Promise.resolve(ie(m)).then(function(h){var C=B.data;return typeof C=="function"&&(C=C(h)),Promise.all([h,C])}).catch(function(h){console.error(h)});J.then(function(h){var C=j(h,2),g=C[0],re=C[1],pe={action:G,filename:B.name,data:re,file:g,headers:B.headers,withCredentials:B.withCredentials,method:B.method||"post",onProgress:Ae?function(Y){Ae(Y,m)}:null,onSuccess:function(se,ke){delete _.reqs[Z],B.onSuccess(se,m,ke)},onError:function(se,ke){delete _.reqs[Z],B.onError(se,ke,m)}};ue(m),_.reqs[Z]=M(pe)})})}},{key:"reset",value:function(){this.setState({uid:V()})}},{key:"abort",value:function(m){var _=this.reqs;if(m){var B=m;m&&m.uid&&(B=m.uid),_[B]&&_[B].abort&&_[B].abort(),delete _[B]}else Object.keys(_).forEach(function(ue){_[ue]&&_[ue].abort&&_[ue].abort(),delete _[ue]})}},{key:"render",value:function(){var m,_=this.props,B=_.component,ue=_.prefixCls,Ae=_.className,de=_.disabled,ie=_.id,G=_.style,Z=_.multiple,M=_.accept,J=_.children,h=_.directory,C=_.openFileDialogOnClick,g=_.onMouseEnter,re=_.onMouseLeave,pe=Oe(_,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Y=Se()((m={},ce(m,ue,!0),ce(m,ue+"-disabled",de),ce(m,Ae,Ae),m)),se=de?{}:{onClick:C?this.onClick:function(){},onKeyDown:C?this.onKeyDown:function(){},onMouseEnter:g,onMouseLeave:re,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Ce.a.createElement(B,z({},se,{className:Y,role:"button",style:G}),Ce.a.createElement("input",z({},Fe(pe),{id:ie,type:"file",ref:this.saveFileInput,onClick:function(Re){return Re.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:M,directory:h?"directory":null,webkitdirectory:h?"webkitdirectory":null,multiple:Z,onChange:this.onChange})),J)}}]),c}(K.Component),we=xe,fe=Object.assign||function(E){for(var c=1;c<arguments.length;c++){var l=arguments[c];for(var m in l)Object.prototype.hasOwnProperty.call(l,m)&&(E[m]=l[m])}return E},ne=function(){function E(c,l){for(var m=0;m<l.length;m++){var _=l[m];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(c,_.key,_)}}return function(c,l,m){return l&&E(c.prototype,l),m&&E(c,m),c}}();function v(E,c){if(!(E instanceof c))throw new TypeError("Cannot call a class as a function")}function Q(E,c){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:E}function H(E,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);E.prototype=Object.create(c&&c.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(E,c):E.__proto__=c)}function w(){}var q=function(E){H(c,E);function c(){var l,m,_,B;v(this,c);for(var ue=arguments.length,Ae=Array(ue),de=0;de<ue;de++)Ae[de]=arguments[de];return B=(m=(_=Q(this,(l=c.__proto__||Object.getPrototypeOf(c)).call.apply(l,[this].concat(Ae))),_),_.saveUploader=function(ie){_.uploader=ie},m),Q(_,B)}return ne(c,[{key:"abort",value:function(m){this.uploader.abort(m)}},{key:"render",value:function(){return Ce.a.createElement(we,fe({},this.props,{ref:this.saveUploader}))}}]),c}(K.Component);q.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:w,onError:w,onSuccess:w,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var U=q,T=Ye.a=U},Gytx:function(ft,Ye){ft.exports=function(K,Ce,oe,Se){var ge=oe?oe.call(Se,K,Ce):void 0;if(ge!==void 0)return!!ge;if(K===Ce)return!0;if(typeof K!="object"||!K||typeof Ce!="object"||!Ce)return!1;var ee=Object.keys(K),L=Object.keys(Ce);if(ee.length!==L.length)return!1;for(var W=Object.prototype.hasOwnProperty.bind(Ce),P=0;P<ee.length;P++){var V=ee[P];if(!W(V))return!1;var N=K[V],R=Ce[V];if(ge=oe?oe.call(Se,N,R,V):void 0,ge===!1||ge===void 0&&N!==R)return!1}return!0}},HmJG:function(ft,Ye,x){},LdHM:function(ft,Ye,x){"use strict";x.d(Ye,"b",function(){return Oe}),x.d(Ye,"a",function(){return Ie});var K=x("1OyB"),Ce=x("vuIU"),oe=x("Ji7U"),Se=x("LK+K"),ge=x("cDcd"),ee=x("rePB"),L=x("Ff2n"),W=x("ODXe"),P=x("4IlW"),V=x("bX4T"),N=x("YrtM"),R=x("TSYQ"),ve=x.n(R),te=x("+nKL"),F=x("8OUc"),z=function(m,_){var B=m.prefixCls,ue=m.id,Ae=m.flattenOptions,de=m.childrenAsData,ie=m.values,G=m.searchValue,Z=m.multiple,M=m.defaultActiveFirstOption,J=m.height,h=m.itemHeight,C=m.notFoundContent,g=m.open,re=m.menuItemSelectedIcon,pe=m.virtual,Y=m.onSelect,se=m.onToggleOpen,ke=m.onActiveValue,Re=m.onScroll,Le=m.onMouseEnter,be="".concat(B,"-item"),Ee=Object(N.a)(function(){return Ae},[g,Ae],function(Pe,I){return I[0]&&Pe[1]!==I[1]}),Ue=ge.useRef(null),Je=function(I){I.preventDefault()},ze=function(I){Ue.current&&Ue.current.scrollTo({index:I})},Ve=function(I){for(var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,O=Ee.length,f=0;f<O;f+=1){var p=(I+f*A+O)%O,b=Ee[p],k=b.group,D=b.data;if(!k&&!D.disabled)return p}return-1},ot=ge.useState(function(){return Ve(0)}),rt=Object(W.a)(ot,2),Ke=rt[0],he=rt[1],it=function(I){he(I);var A=Ee[I];if(!A){ke(null,-1);return}ke(A.data.value,I)};ge.useEffect(function(){it(M!==!1?Ve(0):-1)},[Ee.length,G]),ge.useEffect(function(){var Pe=setTimeout(function(){if(!Z&&g&&ie.size===1){var I=Array.from(ie)[0],A=Ee.findIndex(function(O){var f=O.data;return f.value===I});it(A),ze(A)}});return function(){return clearTimeout(Pe)}},[g]);var qe=function(I){I!==void 0&&Y(I,{selected:!ie.has(I)}),Z||se(!1)};if(ge.useImperativeHandle(_,function(){return{onKeyDown:function(I){var A=I.which;switch(A){case P.a.UP:case P.a.DOWN:{var O=0;if(A===P.a.UP?O=-1:A===P.a.DOWN&&(O=1),O!==0){var f=Ve(Ke+O,O);ze(f),it(f)}break}case P.a.ENTER:{var p=Ee[Ke];p&&!p.data.disabled?qe(p.data.value):qe(void 0),g&&I.preventDefault();break}case P.a.ESC:se(!1)}},onKeyUp:function(){},scrollTo:function(I){ze(I)}}}),Ee.length===0)return ge.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),className:"".concat(be,"-empty"),onMouseDown:Je},C);function ye(Pe){var I=Ee[Pe];if(!I)return null;var A=I.data||{},O=A.value,f=A.label,p=A.children,b=Object(V.a)(A,!0),k=de?p:f;return I?ge.createElement("div",Object.assign({"aria-label":typeof k=="string"?k:null},b,{key:Pe,role:"option",id:"".concat(ue,"_list_").concat(Pe),"aria-selected":ie.has(O)}),O):null}return ge.createElement(ge.Fragment,null,ge.createElement("div",{role:"listbox",id:"".concat(ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},ye(Ke-1),ye(Ke),ye(Ke+1)),ge.createElement(te.a,{itemKey:"key",ref:Ue,data:Ee,height:J,itemHeight:h,fullHeight:!1,onMouseDown:Je,onScroll:Re,virtual:pe,onMouseEnter:Le},function(Pe,I){var A,O=Pe.group,f=Pe.groupOption,p=Pe.data,b=p.label,k=p.key;if(O)return ge.createElement("div",{className:ve()(be,"".concat(be,"-group"))},b!==void 0?b:k);var D=p.disabled,ae=p.value,Te=p.title,He=p.children,tt=p.style,et=p.className,kt=Object(L.a)(p,["disabled","value","title","children","style","className"]),ht=ie.has(ae),st="".concat(be,"-option"),Tt=ve()(be,st,et,(A={},Object(ee.a)(A,"".concat(st,"-grouped"),f),Object(ee.a)(A,"".concat(st,"-active"),Ke===I&&!D),Object(ee.a)(A,"".concat(st,"-disabled"),D),Object(ee.a)(A,"".concat(st,"-selected"),ht),A)),bt=de?He:b,Ut=!re||typeof re=="function"||ht;return ge.createElement("div",Object.assign({},kt,{"aria-selected":ht,className:Tt,title:Te,onMouseMove:function(){if(Ke===I||D)return;it(I)},onClick:function(){D||qe(ae)},style:tt}),ge.createElement("div",{className:"".concat(st,"-content")},bt||ae),ge.isValidElement(re)||ht,Ut&&ge.createElement(F.a,{className:"".concat(be,"-option-state"),customizeIcon:re,customizeIconProps:{isSelected:ht}},ht?"\u2713":null))}))},j=ge.forwardRef(z);j.displayName="OptionList";var le=j,ce=function(){return null};ce.isSelectOption=!0;var Oe=ce,Xe=function(){return null};Xe.isSelectOptGroup=!0;var Ie=Xe,De=x("VTBJ"),Fe=x("Zm9Q");function xe(l){var m=l.key,_=l.props,B=_.children,ue=_.value,Ae=Object(L.a)(_,["children","value"]);return Object(De.a)({key:m,value:ue!==void 0?ue:m,children:B},Ae)}function we(l){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Fe.a)(l).map(function(_,B){if(!ge.isValidElement(_)||!_.type)return null;var ue=_.type.isSelectOptGroup,Ae=_.key,de=_.props,ie=de.children,G=Object(L.a)(de,["children"]);return m||!ue?xe(_):Object(De.a)(Object(De.a)({key:"__RC_SELECT_GRP__".concat(Ae===null?B:Ae,"__"),label:Ae},G),{},{options:we(ie)})}).filter(function(_){return _})}var fe=x("2Qr1"),ne=x("qNPg"),v=x("U8pU"),Q=x("Kwbf"),H=x("WKfj");function w(l){var m=l.mode,_=l.options,B=l.children,ue=l.backfill,Ae=l.allowClear,de=l.placeholder,ie=l.getInputElement,G=l.showSearch,Z=l.onSearch,M=l.defaultOpen,J=l.autoFocus,h=l.labelInValue,C=l.value,g=l.inputValue,re=l.optionLabelProp,pe=m==="multiple"||m==="tags",Y=G!==void 0?G:pe||m==="combobox",se=_||we(B);if(Object(Q.a)(m!=="tags"||se.every(function(be){return!be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),m==="tags"||m==="combobox"){var ke=se.some(function(be){return be.options?be.options.some(function(Ee){return typeof("value"in Ee?Ee.value:Ee.key)=="number"}):typeof("value"in be?be.value:be.key)=="number"});Object(Q.a)(!ke,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(Q.a)(m!=="combobox"||!re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(Q.a)(m==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(Q.a)(m==="combobox"||!ie,"`getInputElement` only work with `combobox` mode."),Object(Q.b)(m!=="combobox"||!ie||!Ae||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Z&&!Y&&m!=="combobox"&&m!=="tags"&&Object(Q.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(Q.b)(!M||J,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),C!=null){var Re=Object(H.d)(C);Object(Q.a)(!h||Re.every(function(be){return Object(v.a)(be)==="object"&&("key"in be||"value"in be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(Q.a)(!pe||Array.isArray(C),"`value` should be array when `mode` is `multiple` or `tags`")}if(B){var Le=null;Object(Fe.a)(B).some(function(be){if(!ge.isValidElement(be)||!be.type)return!1;var Ee=be.type;if(Ee.isSelectOption)return!1;if(Ee.isSelectOptGroup){var Ue=Object(Fe.a)(be.props.children).every(function(Je){return!ge.isValidElement(Je)||!be.type||Je.type.isSelectOption?!0:(Le=Je.type,!1)});return!Ue}return Le=Ee,!0}),Le&&Object(Q.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Le.displayName||Le.name||Le,"`.")),Object(Q.a)(g===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var q=w,U=Object(ne.a)({prefixCls:"rc-select",components:{optionList:le},convertChildrenToData:we,flattenOptions:fe.d,getLabeledValue:fe.e,filterOptions:fe.b,isValueDisabled:fe.g,findValueOption:fe.c,warningProps:q,fillOptionsWithMissingValue:fe.a}),T=function(l){Object(oe.a)(_,l);var m=Object(Se.a)(_);function _(){var B;return Object(K.a)(this,_),B=m.apply(this,arguments),B.selectRef=ge.createRef(),B.focus=function(){B.selectRef.current.focus()},B.blur=function(){B.selectRef.current.blur()},B}return Object(Ce.a)(_,[{key:"render",value:function(){return ge.createElement(U,Object.assign({ref:this.selectRef},this.props))}}]),_}(ge.Component);T.Option=Oe,T.OptGroup=Ie;var E=T,c=Ye.c=E},M8RZ:function(ft,Ye,x){"use strict";x.d(Ye,"a",function(){return P});var K=x("fWQN"),Ce=x("mtLc"),oe=x("yKVA"),Se=x("879j"),ge=x("cDcd"),ee=x.n(ge),L=x("faye"),W=x.n(L),P=function(V){Object(oe.a)(R,V);var N=Object(Se.a)(R);function R(ve){var te;Object(K.a)(this,R),te=N.call(this,ve);var F=window.document;return te.node=F.createElement("div"),F.body.appendChild(te.node),te}return Object(Ce.a)(R,[{key:"render",value:function(){var te=this.props.children;return Object(L.createPortal)(te,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),R}(ee.a.Component)},Ot1p:function(ft,Ye,x){"use strict";var K=x("2qtc"),Ce=x("kLXV"),oe=x("rAM+"),Se=x("miYZ"),ge=x("tsqr"),ee=x("9og8"),L=x("tJVT"),W=x("jrin"),P=x("WmNS"),V=x.n(P),N=x("cDcd"),R=x.n(N),ve=x("VrN/"),te=x.n(ve),F=x("bdgK"),z=x("p77/"),j=x("Bd2K"),le=x("ELLl"),ce=x("19Vz"),Oe=x("lZu9"),Xe=x("+NIl"),Ie=x("kSUc"),De=x("9Bee"),Fe=function(D){var ae=D.value,Te=ae===void 0?"":ae,He=D.className,tt=D.showTextOnly,et=D.showLines,kt=D.style,ht=kt===void 0?{}:kt,st=Object(N.useMemo)(function(){return""},[Te]);return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{dangerouslySetInnerHTML:{__html:st}}))},xe=x("0Owb"),we=x("dejd"),fe=x("C+DQ"),ne=x("1vsH"),v=x("m3rI"),Q=[{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 H(D){var ae=D.onActionCallback,Te=D.title,He=D.icon,tt=D.actionName,et=D.className,kt=et===void 0?"":et,ht=D.children;function st(){ae(tt)}return R.a.createElement("a",{title:Te,className:kt,onClick:st},R.a.createElement("i",{className:"md-iconfont ".concat(He)}),ht)}var w=function(D){var ae=D.watch,Te=D.showNullButton,He=D.onActionCallback,tt=D.fullScreen,et=D.insertTemp,kt=D.hidetoolBar,ht=D.uuid,st=D.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(ne.n)("_educoder_session_login"),"&_educoder_session=").concat(Object(ne.n)("_educoder_session"),"&key=").concat(ht,"&api=").concat(encodeURIComponent(v.a.PROXY_SERVER)));var Tt=[].concat(Q,[{title:"".concat(ae?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(ae?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return R.a.createElement("ul",{className:"markdown-toolbar-container"},!kt&&Tt.map(function(bt,Ut){return R.a.createElement("li",{key:Ut},bt.actionName?R.a.createElement(H,Object(xe.a)({},bt,{onActionCallback:He})):R.a.createElement("span",{className:"v-line"}))}),Te?R.a.createElement("li",null,R.a.createElement(H,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:He},R.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,et&&R.a.createElement("li",null,R.a.createElement(H,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(et),onActionCallback:He},R.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),R.a.createElement("li",{className:"btn-full-screen"},R.a.createElement(H,{icon:"".concat(tt?"icon-shrink":"icon-enlarge"),title:tt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:He})))},q=x("M8RZ"),U=x("+L6B"),T=x("2/Rp"),E=x("y8nQ"),c=x("Vl3Y"),l=x("5NDa"),m=x("5rEg"),_={labelCol:{span:4},wrapperCol:{span:20}},B=function(D){var ae=D.callback,Te=D.onCancel;function He(tt){ae(tt)}return R.a.createElement(c.a,Object(xe.a)({},_,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:He}),R.a.createElement(c.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},R.a.createElement(m.a,null)),R.a.createElement(c.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},R.a.createElement(m.a,null)),R.a.createElement("div",{className:"flex-container flex-end"},R.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(T.a,{type:"ghost",onClick:Te},"\u53D6\u6D88")))},ue=x("7ahc"),Ae=x("HmJG"),de=x("BjJ7"),ie=c.a.useForm,G={width:280,marginRight:10},Z={labelCol:{span:5},wrapperCol:{span:19}},M=function(D){var ae=D.callback,Te=D.onCancel,He=ie(),tt=Object(L.a)(He,1),et=tt[0];function kt(Tt){ae(Tt)}function ht(Tt,bt){if(Tt.status===-1){ge.b.error(Tt.message);return}et.setFieldsValue({src:"/api/attachments/".concat(Tt.id),type:bt.type})}function st(Tt){var bt=Tt.target.files[0];h(bt,ht)}return R.a.createElement(c.a,Object(xe.a)({form:et},Z,{className:"upload-image-panel",onFinish:kt}),R.a.createElement(c.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},R.a.createElement("div",{className:"flex-container"},R.a.createElement(c.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},R.a.createElement(m.a,{style:G})),R.a.createElement(J,{onFileChange:st}))),R.a.createElement(c.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},R.a.createElement(m.a,{style:{width:264}})),R.a.createElement(c.a.Item,{style:{textAlign:"right"}},R.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(T.a,{type:"ghost",onClick:Te},"\u53D6\u6D88")))};function J(D){var ae=D.onFileChange;return R.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",R.a.createElement("input",{type:"file",onChange:ae}))}function h(D,ae){if(!D)throw new String("\u6CA1\u6709\u6587\u4EF6");var Te=new FormData;Te.append("editormd-image-file",D),Te.append("file_param_name","editormd-image-file"),Te.append("byxhr","true");var He=new window.XMLHttpRequest;He.withCredentials=!0,He.addEventListener("load",function(tt){ae(JSON.parse(tt.target.responseText),D)},!1),He.addEventListener("error",function(tt){console.error(tt)},!1),He.open("POST","".concat(de.a,"/api/attachments.json")),He.send(Te)}var C=x("giR+"),g=x("fyUT"),re=x("7Kak"),pe=x("9yH6"),Y=pe.a.Group,se={margin:"0 8px"},ke=function(D){var ae=D.callback,Te=D.onCancel;function He(tt){ae(tt)}return R.a.createElement(c.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:He},R.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},R.a.createElement("span",{style:se},"\u5355\u5143\u683C\u6570\uFF1A"),R.a.createElement("span",{style:se},"\u884C\u6570"),R.a.createElement(c.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},R.a.createElement(g.a,null)),R.a.createElement("span",{style:se},"\u5217\u6570"),R.a.createElement(c.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},R.a.createElement(g.a,null))),R.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},R.a.createElement("span",{style:se},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),R.a.createElement(c.a.Item,{name:"align"},R.a.createElement(Y,null,R.a.createElement(pe.a,{value:"default"},R.a.createElement("i",{className:"fa fa-align-justify"})),R.a.createElement(pe.a,{value:"left"},R.a.createElement("i",{className:"fa fa-align-left"})),R.a.createElement(pe.a,{value:"center"},R.a.createElement("i",{className:"fa fa-align-center"})),R.a.createElement(pe.a,{value:"right"},R.a.createElement("i",{className:"fa fa-align-right"}))))),R.a.createElement("div",{className:"flex-container flex-end"},R.a.createElement(T.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),R.a.createElement(T.a,{type:"ghost",onClick:Te},"\u53D6\u6D88")))},Re=x("ErOA"),Le=x("7Cbv"),be="link",Ee="upload-image",Ue="code-block",Je="add-table",ze="------------",Ve={default:ze,left:":".concat(ze),center:":".concat(ze,":"),right:"".concat(ze,":")},ot=x("9VGf"),rt,Ke;function he(){}var it=0,qe=1e4,ye="\u2581",Pe=`
|
|
**\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 I(D){return/^\d+$/.test(D)?"".concat(D,"px"):D}var A=navigator.platform.toUpperCase().indexOf("MAC")>=0,O=A?"Cmd":"Ctrl",f=["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"],p=(rt={},Object(W.a)(rt,O+"-B","bold"),Object(W.a)(rt,O+"-I","italic"),rt),b=(Ke={},Object(W.a)(Ke,be,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(Ke,Ue,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(Ke,Ee,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(Ke,Je,"\u6DFB\u52A0\u8868\u683C"),Ke),k=Ye.a=function(D){var ae=D.defaultValue,Te=ae===void 0?"":ae,He=D.onChange,tt=D.width,et=tt===void 0?"100%":tt,kt=D.height,ht=kt===void 0?400:kt,st=D.miniToolbar,Tt=st===void 0?!1:st,bt=D.isFocus,Ut=bt===void 0?!1:bt,jt=D.watch,yt=D.insertTemp,Tn=D.mode,Mn=Tn===void 0?"markdown":Tn,un=D.id,gn=un===void 0?"markdown-editor-id":un,hn=D.showResizeBar,ia=hn===void 0?!1:hn,_n=D.noStorage,zr=_n===void 0?!1:_n,Hr=D.showNullButton,Rt=Hr===void 0?!1:Hr,Ze=D.hidetoolBar,Dn=Ze===void 0?!1:Ze,pr=D.fullScreen,Zt=pr===void 0?!1:pr,wt=D.onBlur,vn=D.onCMBeforeChange,Pn=D.onFullScreen,mr=D.className,Me=mr===void 0?"":mr,ut=D.disablePaste,Xr=ut===void 0?!1:ut,gr=D.placeholder,vr=gr===void 0?"":gr,Zn=D.values,br=Zn===void 0?"":Zn,dt=Object(N.useState)(null),Ti=Object(L.a)(dt,2),Ne=Ti[0],yr=Ti[1],pn=Object(N.useState)(Te),Gr=Object(L.a)(pn,2),Qn=Gr[0],bn=Gr[1],Kr=Object(N.useState)(jt),Vr=Object(L.a)(Kr,2),yn=Vr[0],$r=Vr[1],_i=Object(N.useState)(Zt),Yr=Object(L.a)(_i,2),xn=Yr[0],Ai=Yr[1],aa=Object(N.useState)(""),Jr=Object(L.a)(aa,2),Yt=Jr[0],zn=Jr[1],oa=Object(N.useState)(0),er=Object(L.a)(oa,2),wn=er[0],qr=er[1],sa=Object(N.useState)(ht),Oi=Object(L.a)(sa,2),Li=Oi[0],xr=Oi[1],Ri=Object(N.useState)(!1),Mi=Object(L.a)(Ri,2),la=Mi[0],wr=Mi[1],tr=Object(N.useRef)(Object(Le.a)()),nr=Object(N.useRef)(!1),Er=Object(N.useRef)(),Nn=Object(N.useRef)(),jn=Object(N.useRef)(),In=Object(N.useRef)(),Cr=Object(N.useRef)(),Di=function(){var Qe=Object(ee.a)(V.a.mark(function ct(){var at,mt;return V.a.wrap(function(_t){for(;;)switch(_t.prev=_t.next){case 0:return _t.next=2,Object(Re.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:tr.current}});case 2:mt=_t.sent,mt!=null&&(at=mt.attachments)!==null&&at!==void 0&&at.length&&(console.log("cm:",Ne,Nn),mt.attachments.map(function(vt){vt.content_type.indexOf("image")>-1?Ne.replaceSelection(".concat(vt.content_type,")")):vt.content_type.indexOf("video")>-1?Ne.replaceSelection('<video width="100%" controls src="'.concat(v.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):vt.content_type.indexOf("pdf")>-1?Ne.replaceSelection('<a href="'.concat(v.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,'&disposition=inline" target="_blank">').concat(vt.name,"</a>")):Ne.replaceSelection("[".concat(vt.name,"](").concat(v.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}));case 4:case"end":return _t.stop()}},ct)}));return function(){return Qe.apply(this,arguments)}}();Object(N.useEffect)(function(){bn(br),Ne==null||Ne.setValue(br)},[br]),Object(N.useEffect)(function(){Pn==null||Pn(xn)},[xn]),Object(N.useEffect)(function(){if(Nn.current){var Qe=te.a.fromTextArea(Nn.current,{mode:Mn,lineNumbers:!Tt,lineWrapping:!0,value:Te,autoCloseTags:!0,autoCloseBrackets:!0});Ut&&Qe.focus();function ct(at,mt){if(Xr){mt.preventDefault();return}var xt=mt.clipboardData;if(xt){var _t=xt.types.toString(),vt=xt.items;if(_t==="Files"||xt.types.indexOf("Files")>-1){if(mt.preventDefault(),Mn=="stex")return;try{var It,Qt=vt[1];((It=vt[0])===null||It===void 0?void 0:It.kind)==="file"&&(Qt=vt[0]);var gt=Qt.getAsFile(),Fn=gt.name.split(".").pop();h(gt,function(Et){if(Et.id){var en,Kt,mn;(gt==null||((en=gt.type)===null||en===void 0)?void 0:en.indexOf("image"))>-1?Qe.replaceSelection(".concat(Et.content_type,")")):(gt==null||((Kt=gt.type)===null||Kt===void 0)?void 0:Kt.indexOf("video"))>-1?Qe.replaceSelection('<video width="100%" controls src="'.concat(v.a.API_SERVER,"/api/attachments/").concat(Et.id,'"></video>')):(gt==null||((mn=gt.type)===null||mn===void 0)?void 0:mn.indexOf("pdf"))>-1?Qe.replaceSelection('<a href="'.concat(v.a.API_SERVER,"/api/attachments/").concat(Et.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):f.includes(Fn)?Qe.replaceSelection('<a href="'.concat(v.a.API_SERVER,"/api/attachments/").concat(Et.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):Qe.replaceSelection("[".concat(gt.name,"](").concat(v.a.API_SERVER,"/api/attachments/").concat(Et.id,"?type=").concat(Et.content_type,")"))}else(Et==null?void 0:Et.status)===401&&(document.location.href="/user/login")})}catch(Et){ge.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Qe.on("paste",ct),Qe.on("dragleave",function(at,mt){jn.current.classList.remove("mouse-hover-md")}),Qe.on("dragover",function(at,mt){jn.current.classList.add("mouse-hover-md")}),Qe.on("drop",function(at,mt){jn.current.classList.add("mouse-hover-md");var xt;if(xt=mt.dataTransfer.files,xt.length>0){mt.preventDefault(),mt.stopPropagation();for(var _t=function(Qt){var gt=xt[Qt],Fn=gt.name.split(".").pop();h(gt,function(Et){if(Et.id){var en,Kt,mn;(gt==null||((en=gt.type)===null||en===void 0)?void 0:en.indexOf("image"))>-1?Qe.replaceSelection(".concat(Et.content_type,")")):(gt==null||((Kt=gt.type)===null||Kt===void 0)?void 0:Kt.indexOf("video"))>-1?Qe.replaceSelection('<video width="100%" controls src="'.concat(v.a.API_SERVER,"/api/attachments/").concat(Et.id,'"></video>')):(gt==null||((mn=gt.type)===null||mn===void 0)?void 0:mn.indexOf("pdf"))>-1?Qe.replaceSelection('<a href="'.concat(v.a.API_SERVER,"/api/attachments/").concat(Et.id,"?type=").concat(gt.type,'&disposition=inline" target="_blank">').concat(gt.name,"</a>")):f.includes(Fn)?Qe.replaceSelection('<a href="'.concat(v.a.API_SERVER,"/api/attachments/").concat(Et.id,'?type=office&disposition=inline" target="_blank">').concat(gt.name,"</a>")):Qe.replaceSelection("[".concat(gt.name,"](").concat(v.a.API_SERVER,"/api/attachments/").concat(Et.id,"?type=").concat(Et.content_type,")"))}else(Et==null?void 0:Et.status)===401&&(document.location.href="/user/login")})},vt=0;vt<xt.length;vt++)_t(vt)}}),yr(Qe),function(){Qe.off("paste",ct)}}},[]);var cn=Object(N.useCallback)(function(){if(jn.current)try{}catch(Qe){console.log(Qe,"---- to set md editor body height")}},[Li,jn,xn]);Object(N.useEffect)(function(){function Qe(){var at=new F.default(function(mt){var xt=Object(oe.a)(mt),_t;try{for(xt.s();!(_t=xt.n()).done;){var vt=_t.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&(cn(),Ne.setSize("100%","100%"),Ne.refresh())}}catch(It){xt.e(It)}finally{xt.f()}});return at.observe(Nn.current.parentElement),at}if(Ne){var ct=Qe();return function(){ct.unobserve(Nn.current.parentElement)}}},[Ne,cn]),Object(N.useEffect)(function(){if(Ne){for(var Qe=[],ct=function(){var vt=mt[at];xt=Object(L.a)(vt,2);var It=xt[0],Qt=xt[1],gt=Object(W.a)({},It,function(){Pi(Qt)});Qe.push(gt),Ne.addKeyMap(gt)},at=0,mt=Object.entries(p);at<mt.length;at++){var xt;ct()}return Er.current=setInterval(function(){nr.current&&Di()},4e3),function(){clearInterval(Er.current);var _t=Object(oe.a)(Qe),vt;try{for(_t.s();!(vt=_t.n()).done;){var It=vt.value;Ne.removeKeyMap(It)}}catch(Qt){_t.e(Qt)}finally{_t.f()}}}},[Ne]),Object(N.useEffect)(function(){Zt!==xn&&Ai(Zt)},[Zt]),Object(ot.a)(function(){if(!zr&&wn>0){var Qe=new Date().getTime(),ct=window.sessionStorage.getItem(gn);Qe>=wn+qe&&(!ct||ct!==Qn)&&(window.sessionStorage.setItem(gn,Qn),wr(!0))}},qe),Object(N.useEffect)(function(){$r(jt)},[Ne,jt]),Object(N.useEffect)(function(){Ne&&(Ut&&Ne.focus())},[Ne,Ut]),Object(N.useEffect)(function(){if(yn&&Ne){var Qe=Ne.getScrollerElement();function ct(at){var mt=at.target;if(Cr.current){var xt=mt.scrollTop/mt.scrollHeight;Cr.current.scrollTop=Cr.current.scrollHeight*xt}}return Qe.addEventListener("scroll",ct),function(){Qe.removeEventListener("scroll",ct)}}},[Ne,yn]),Object(N.useEffect)(function(){if(Ne&&vn){function Qe(ct,at){vn(ct,at)}return Ne.on("beforeChange",Qe),function(){Ne.off("beforeChange",Qe)}}},[Ne,vn]),Object(N.useEffect)(function(){if(Ne&&wt){function Qe(){wt(Ne.getValue())}return Ne.on("blur",Qe),function(){Ne.off("blur",Qe)}}},[Ne,wt]),Object(N.useEffect)(function(){if(Ne){function Qe(ct){var at=ct.getValue();bn(at),qr(new Date().getTime()),ct.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),He&&He(at)}return Ne.on("change",Qe),function(){Ne.off("change",Qe)}}},[Ne,He]),Object(N.useEffect)(function(){Ne&&(Te==null?(Ne.setValue(""),bn("")):Te!==Ne.getValue()&&(Ne.setValue(Te),bn(Te),Ne.setCursor(Ne.lineCount(),0)))},[Ne,Te]);var Pi=Object(N.useCallback)(function(Qe){var ct=Ne.getCursor(),at=Ne.getSelection(),mt=at.split(`
|
|
`);switch(Qe){case"bold":return Ne.replaceSelection("**"+at+"**"),at===""&&Ne.setCursor(ct.line,ct.ch+2),Ne.focus();case"italic":return Ne.replaceSelection("*"+at+"*"),at===""&&Ne.setCursor(ct.line,ct.ch+1),Ne.focus();case"code":return Ne.replaceSelection("`"+at+"`"),at===""&&Ne.setCursor(ct.line,ct.ch+1),Ne.focus();case"inline-latex":return Ne.replaceSelection("`$$"+at+"$$`"),at===""&&Ne.setCursor(ct.line,ct.ch+3),Ne.focus();case"latex":return Ne.replaceSelection("```latex\n"+at+"\n```"),Ne.setCursor(ct.line+1,at.length+1),Ne.focus();case"line-break":return Ne.replaceSelection(`<br/>
|
|
`),Ne.focus();case"list-ul":return at===""?Ne.replaceSelection("- "+at):Ne.replaceSelection(mt.map(function(xt){return xt===""?"":"- ".concat(xt)}).join(`
|
|
`)),Ne.focus();case"list-ol":return at===""?Ne.replaceSelection("1. "+at):Ne.replaceSelection(mt.map(function(xt,_t){return xt===""?"":"".concat(_t+1,". ").concat(xt)}).join(`
|
|
`)),Ne.focus();case"add-null-ch":return at===""&&Ne.setCursor(ct.line,ct.ch+1),Ne.replaceSelection(ye),Ne.focus();case"inster-template-1":return at===""&&Ne.setCursor(ct.line,ct.ch),Ne.replaceSelection(Pe),Ne.focus();case"eraser":return Ne.setValue(""),Ne.focus();case"trigger-watch":return $r(!yn),Ne.focus();case"trigger-full-screen":return Ai(!xn),Ne.focus();case be:zn(be);return;case Ue:zn(Ue);return;case Ee:zn(Ee);return;case Je:zn(Je);return;default:throw new Error}},[Ne,yn,xn]),kr=Object(N.useCallback)(function(Qe){zn("");switch(Yt){case be:var ct=Qe.title,at=Qe.link;return Ne.replaceSelection("[".concat(ct,"](").concat(at,")")),Ne.focus();case Ue:var mt=Qe.language,xt=Qe.content;return Ne.replaceSelection(["```"+mt,xt,"```"].join(`
|
|
`)),Ne.focus();case Ee:var _t=Qe.src,vt=Qe.alt;return vt?Ne.replaceSelection(".concat(_t,' "').concat(vt,'" )')):Ne.replaceSelection("")),Ne.focus();case Je:for(var It=Qe.row,Qt=Qe.col,gt=Qe.align,Fn=`
|
|
`,Et=0;Et<It;Et++){for(var en=[],Kt=[],mn=0;mn<Qt;mn++)Et===1&&Kt.push(Ve[gt]),en.push(" ");Et===1&&(Fn+="| ".concat(Kt.join(" | "),` |
|
|
`)),Fn+="| ".concat(en.join(Qt===1?"":" | "),` |
|
|
`)}return Ne.replaceSelection(Fn+`
|
|
`),Ne.focus();default:throw new Error}},[Ne,Yt]),Zr=Object(N.useMemo)(function(){switch(Yt){case be:return R.a.createElement(B,{callback:kr,onCancel:Hn});case Ue:return R.a.createElement(ue.b,{callback:kr,onCancel:Hn});case Ee:return R.a.createElement(M,{callback:kr,onCancel:Hn});case Je:return R.a.createElement(ke,{callback:kr,onCancel:Hn});default:return null}},[Yt]);function Hn(){zn("")}Object(N.useEffect)(function(){if(In.current){var Qe=In.current,ct=!1,at=0;function mt(vt){ct=!0,at=vt.pageY}function xt(){ct=!1}function _t(vt){if(ct){var It=vt.pageY-at;It<0&&(It=0),It>300&&(It=300);var Qt=ht+It+"px";xr(Qt)}}return Qe.addEventListener("mousedown",mt),document.addEventListener("mousemove",_t),document.addEventListener("mouseup",xt),function(){Qe.removeEventListener("mousedown",mt),document.removeEventListener("mousemove",_t),document.removeEventListener("mouseup",xt)}}},[Ne,In]),Object(N.useEffect)(function(){xr(ht)},[ht]);var An=I(et),Qr=I(Li),En={width:An,height:Qr},ei=Object(N.useMemo)(function(){if(wn){var Qe=new Date(wn),ct=Qe.getHours(),at=Qe.getMinutes(),mt=Qe.getSeconds();return ct=ct<10?"0"+ct:ct,at=at<10?"0"+at:at,mt=mt<10?"0"+mt:mt,"".concat(ct,":").concat(at,":").concat(mt)}return 0},[wn]);function Ni(){window.sessionStorage.removeItem(gn),wr(!1),qr(0)}function rr(){wr(!1),qr(0),Ne.setValue(window.sessionStorage.getItem(gn))}function ua(Qe,ct){var at=Ne.getValue();at=at.replace(Qe,ct),bn(at),Ne==null||Ne.setValue(at)}return R.a.createElement(N.Fragment,null,R.a.createElement("div",{className:"markdown-editor-wrapper",ref:jn},R.a.createElement("div",{className:"markdown-editor-container ".concat(Me," ").concat(yn?"on-preview":""," ").concat(Tt?"mini":""," ").concat(xn?"full-screen":""),style:En},R.a.createElement(w,{insertTemp:yt,watch:yn,fullScreen:xn,showNullButton:Rt,onActionCallback:Pi,hidetoolBar:Dn,uuid:tr.current,setOpenPhones:function(){nr.current=!0}}),R.a.createElement("div",{className:"markdown-editor-body"},R.a.createElement("div",{className:"codemirror-container"},R.a.createElement("textarea",{ref:Nn,placeholder:vr})),yn?R.a.createElement("div",{ref:Cr,className:"preview-container"},Mn==="stex"&&R.a.createElement(Fe,{value:Qn}),Mn!=="stex"&&R.a.createElement(De.a,{edit:!0,value:Qn,replaces:ua})):null))),ia?R.a.createElement("a",{ref:In,className:"editor-resize"}):null,R.a.createElement(q.a,null,b[Yt]?R.a.createElement(Ce.a,{centered:!0,title:b[Yt],visible:!0,onCancel:Hn,footer:null,className:"markdown-popup-form"},Zr):null))}},SJMd:function(ft,Ye){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var x,K,Ce,oe=!1,Se,ge;window.PR_SHOULD_USE_CONTINUATION=!0;var ee,L;(function(){var W=window,P=["break,continue,do,else,for,if,return,while"],V=[P,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],N=[V,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],R=[N,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],ve=[N,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],te=[N,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],F="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",z=[N,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],j="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",le=[P,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],ce=[P,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],Oe=[P,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Xe=[R,te,ve,z,j,le,ce,Oe],Ie=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,De="str",Fe="kwd",xe="com",we="typ",fe="lit",ne="pun",v="pln",Q="tag",H="dec",w="src",q="atn",U="atv",T="nocode",E="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function c(Y){for(var se=0,ke=!1,Re=!1,Le=0,be=Y.length;Le<be;++Le){var Ee=Y[Le];if(Ee.ignoreCase)Re=!0;else if(/[a-z]/i.test(Ee.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ke=!0,Re=!1;break}}var Ue={b:8,t:9,n:10,v:11,f:12,r:13};function Je(Ke){var he=Ke.charCodeAt(0);if(he!==92)return he;var it=Ke.charAt(1);return he=Ue[it],he||("0"<=it&&it<="7"?parseInt(Ke.substring(1),8):it==="u"||it==="x"?parseInt(Ke.substring(2),16):Ke.charCodeAt(1))}function ze(Ke){if(Ke<32)return(Ke<16?"\\x0":"\\x")+Ke.toString(16);var he=String.fromCharCode(Ke);return he==="\\"||he==="-"||he==="]"||he==="^"?"\\"+he:he}function Ve(Ke){var he=Ke.substring(1,Ke.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),it=[],qe=he[0]==="^",ye=["["];qe&&ye.push("^");for(var Pe=qe?1:0,I=he.length;Pe<I;++Pe){var A=he[Pe];if(/\\[bdsw]/i.test(A))ye.push(A);else{var O=Je(A),f;Pe+2<I&&he[Pe+1]==="-"?(f=Je(he[Pe+2]),Pe+=2):f=O,it.push([O,f]),f<65||O>122||(f<65||O>90||it.push([Math.max(65,O)|32,Math.min(f,90)|32]),f<97||O>122||it.push([Math.max(97,O)&~32,Math.min(f,122)&~32]))}}it.sort(function(D,ae){return D[0]-ae[0]||ae[1]-D[1]});for(var p=[],b=[],Pe=0;Pe<it.length;++Pe){var k=it[Pe];k[0]<=b[1]+1?b[1]=Math.max(b[1],k[1]):p.push(b=k)}for(var Pe=0;Pe<p.length;++Pe){var k=p[Pe];ye.push(ze(k[0])),k[1]>k[0]&&(k[1]+1>k[0]&&ye.push("-"),ye.push(ze(k[1])))}return ye.push("]"),ye.join("")}function ot(Ke){for(var he=Ke.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),it=he.length,qe=[],ye=0,Pe=0;ye<it;++ye){var I=he[ye];if(I==="(")++Pe;else if(I.charAt(0)==="\\"){var A=+I.substring(1);A&&(A<=Pe?qe[A]=-1:he[ye]=ze(A))}}for(var ye=1;ye<qe.length;++ye)qe[ye]===-1&&(qe[ye]=++se);for(var ye=0,Pe=0;ye<it;++ye){var I=he[ye];if(I==="(")++Pe,qe[Pe]||(he[ye]="(?:");else if(I.charAt(0)==="\\"){var A=+I.substring(1);A&&A<=Pe&&(he[ye]="\\"+qe[A])}}for(var ye=0;ye<it;++ye)he[ye]==="^"&&he[ye+1]!=="^"&&(he[ye]="");if(Ke.ignoreCase&&ke)for(var ye=0;ye<it;++ye){var I=he[ye],O=I.charAt(0);I.length>=2&&O==="["?he[ye]=Ve(I):O!=="\\"&&(he[ye]=I.replace(/[a-zA-Z]/g,function(b){var k=b.charCodeAt(0);return"["+String.fromCharCode(k&~32,k|32)+"]"}))}return he.join("")}for(var rt=[],Le=0,be=Y.length;Le<be;++Le){var Ee=Y[Le];if(Ee.global||Ee.multiline)throw new Error(""+Ee);rt.push("(?:"+ot(Ee)+")")}return new RegExp(rt.join("|"),Re?"gi":"g")}function l(Y,se){var ke=/(?:^|\s)nocode(?:\s|$)/,Re=[],Le=0,be=[],Ee=0;function Ue(Je){var ze=Je.nodeType;if(ze==1){if(ke.test(Je.className))return;for(var Ve=Je.firstChild;Ve;Ve=Ve.nextSibling)Ue(Ve);var ot=Je.nodeName.toLowerCase();(ot==="br"||ot==="li")&&(Re[Ee]=`
|
|
`,be[Ee<<1]=Le++,be[Ee++<<1|1]=Je)}else if(ze==3||ze==4){var rt=Je.nodeValue;rt.length&&(se?rt=rt.replace(/\r\n?/g,`
|
|
`):rt=rt.replace(/[ \t\r\n]+/g," "),Re[Ee]=rt,be[Ee<<1]=Le,Le+=rt.length,be[Ee++<<1|1]=Je)}}return Ue(Y),{sourceCode:Re.join("").replace(/\n$/,""),spans:be}}function m(Y,se,ke,Re,Le){if(!ke)return;var be={sourceNode:Y,pre:1,langExtension:null,numberLines:null,sourceCode:ke,spans:null,basePos:se,decorations:null};Re(be),Le.push.apply(Le,be.decorations)}var _=/\S/;function B(Y){for(var se=void 0,ke=Y.firstChild;ke;ke=ke.nextSibling){var Re=ke.nodeType;se=Re===1?se?Y:ke:Re===3&&_.test(ke.nodeValue)?Y:se}return se===Y?void 0:se}function ue(Y,se){var ke={},Re;(function(){for(var Ee=Y.concat(se),Ue=[],Je={},ze=0,Ve=Ee.length;ze<Ve;++ze){var ot=Ee[ze],rt=ot[3];if(rt)for(var Ke=rt.length;--Ke>=0;)ke[rt.charAt(Ke)]=ot;var he=ot[1],it=""+he;Je.hasOwnProperty(it)||(Ue.push(he),Je[it]=null)}Ue.push(/[\0-\uffff]/),Re=c(Ue)})();var Le=se.length,be=function(Ee){for(var Ue=Ee.sourceCode,Je=Ee.basePos,ze=Ee.sourceNode,Ve=[Je,v],ot=0,rt=Ue.match(Re)||[],Ke={},he=0,it=rt.length;he<it;++he){var qe=rt[he],ye=Ke[qe],Pe=void 0,I;if(typeof ye=="string")I=!1;else{var A=ke[qe.charAt(0)];if(A)Pe=qe.match(A[1]),ye=A[0];else{for(var O=0;O<Le;++O)if(A=se[O],Pe=qe.match(A[1]),Pe){ye=A[0];break}Pe||(ye=v)}I=ye.length>=5&&ye.substring(0,5)==="lang-",I&&!(Pe&&typeof Pe[1]=="string")&&(I=!1,ye=w),I||(Ke[qe]=ye)}var f=ot;if(ot+=qe.length,!I)Ve.push(Je+f,ye);else{var p=Pe[1],b=qe.indexOf(p),k=b+p.length;Pe[2]&&(k=qe.length-Pe[2].length,b=k-p.length);var D=ye.substring(5);m(ze,Je+f,qe.substring(0,b),be,Ve),m(ze,Je+f+b,p,J(D,p),Ve),m(ze,Je+f+k,qe.substring(k),be,Ve)}}Ee.decorations=Ve};return be}function Ae(Y){var se=[],ke=[];Y.tripleQuotedStrings?se.push([De,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Y.multiLineStrings?se.push([De,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):se.push([De,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Y.verbatimStrings&&ke.push([De,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Re=Y.hashComments;Re&&(Y.cStyleComments?(Re>1?se.push([xe,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):se.push([xe,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ke.push([De,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):se.push([xe,/^#[^\r\n]*/,null,"#"])),Y.cStyleComments&&(ke.push([xe,/^\/\/[^\r\n]*/,null]),ke.push([xe,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Le=Y.regexLiterals;if(Le){var be=Le>1?"":`
|
|
\r`,Ee=be?".":"[\\S\\s]",Ue="/(?=[^/*"+be+"])(?:[^/\\x5B\\x5C"+be+"]|\\x5C"+Ee+"|\\x5B(?:[^\\x5C\\x5D"+be+"]|\\x5C"+Ee+")*(?:\\x5D|$))+/";ke.push(["lang-regex",RegExp("^"+E+"("+Ue+")")])}var Je=Y.types;Je&&ke.push([we,Je]);var ze=(""+Y.keywords).replace(/^ | $/g,"");ze.length&&ke.push([Fe,new RegExp("^(?:"+ze.replace(/[\s,]+/g,"|")+")\\b"),null]),se.push([v,/^\s+/,null,` \r
|
|
\xA0`]);var Ve="^.[^\\s\\w.$@'\"`/\\\\]*";return Y.regexLiterals&&(Ve+="(?!s*/)"),ke.push([fe,/^@[a-z_$][a-z_$@0-9]*/i,null],[we,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[v,/^[a-z_$][a-z_$@0-9]*/i,null],[fe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[v,/^\\[\s\S]?/,null],[ne,new RegExp(Ve),null]),ue(se,ke)}var de=Ae({keywords:Xe,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ie(Y,se,ke){for(var Re=/(?:^|\s)nocode(?:\s|$)/,Le=/\r\n?|\n/,be=Y.ownerDocument,Ee=be.createElement("li");Y.firstChild;)Ee.appendChild(Y.firstChild);var Ue=[Ee];function Je(he){var it=he.nodeType;if(it==1&&!Re.test(he.className))if(he.nodeName==="br")ze(he),he.parentNode&&he.parentNode.removeChild(he);else for(var qe=he.firstChild;qe;qe=qe.nextSibling)Je(qe);else if((it==3||it==4)&&ke){var ye=he.nodeValue,Pe=ye.match(Le);if(Pe){var I=ye.substring(0,Pe.index);he.nodeValue=I;var A=ye.substring(Pe.index+Pe[0].length);if(A){var O=he.parentNode;O.insertBefore(be.createTextNode(A),he.nextSibling)}ze(he),I||he.parentNode.removeChild(he)}}}function ze(he){for(;!he.nextSibling;)if(he=he.parentNode,!he)return;function it(Pe,I){var A=I?Pe.cloneNode(!1):Pe,O=Pe.parentNode;if(O){var f=it(O,1),p=Pe.nextSibling;f.appendChild(A);for(var b=p;b;b=p)p=b.nextSibling,f.appendChild(b)}return A}for(var qe=it(he.nextSibling,0),ye;(ye=qe.parentNode)&&ye.nodeType===1;)qe=ye;Ue.push(qe)}for(var Ve=0;Ve<Ue.length;++Ve)Je(Ue[Ve]);se===(se|0)&&Ue[0].setAttribute("value",se);var ot=be.createElement("ol");ot.className="linenums";for(var rt=Math.max(0,se-1|0)||0,Ve=0,Ke=Ue.length;Ve<Ke;++Ve)Ee=Ue[Ve],Ee.className="L"+(Ve+rt)%10,Ee.firstChild||Ee.appendChild(be.createTextNode("\xA0")),ot.appendChild(Ee);Y.appendChild(ot)}function G(Y){var se=/\bMSIE\s(\d+)/.exec(navigator.userAgent);se=se&&+se[1]<=8;var ke=/\n/g,Re=Y.sourceCode,Le=Re.length,be=0,Ee=Y.spans,Ue=Ee.length,Je=0,ze=Y.decorations,Ve=ze.length,ot=0;ze[Ve]=Le;var rt,Ke;for(Ke=rt=0;Ke<Ve;)ze[Ke]!==ze[Ke+2]?(ze[rt++]=ze[Ke++],ze[rt++]=ze[Ke++]):Ke+=2;for(Ve=rt,Ke=rt=0;Ke<Ve;){for(var he=ze[Ke],it=ze[Ke+1],qe=Ke+2;qe+2<=Ve&&ze[qe+1]===it;)qe+=2;ze[rt++]=he,ze[rt++]=it,Ke=qe}Ve=ze.length=rt;var ye=Y.sourceNode,Pe="";ye&&(Pe=ye.style.display,ye.style.display="none");try{for(var I=null;Je<Ue;){var A=Ee[Je],O=Ee[Je+2]||Le,f=ze[ot+2]||Le,qe=Math.min(O,f),p=Ee[Je+1],b;if(p.nodeType!==1&&(b=Re.substring(be,qe))){se&&(b=b.replace(ke,"\r")),p.nodeValue=b;var k=p.ownerDocument,D=k.createElement("span");D.className=ze[ot+1];var ae=p.parentNode;ae.replaceChild(D,p),D.appendChild(p),be<O&&(Ee[Je+1]=p=k.createTextNode(Re.substring(qe,O)),ae.insertBefore(p,D.nextSibling))}be=qe,be>=O&&(Je+=2),be>=f&&(ot+=2)}}finally{ye&&(ye.style.display=Pe)}}var Z={};function M(Y,se){for(var ke=se.length;--ke>=0;){var Re=se[ke];Z.hasOwnProperty(Re)?W.console&&console.warn("cannot override language handler %s",Re):Z[Re]=Y}}function J(Y,se){return Y&&Z.hasOwnProperty(Y)||(Y=/^\s*</.test(se)?"default-markup":"default-code"),Z[Y]}M(de,["default-code"]),M(ue([],[[v,/^[^<?]+/],[H,/^<!\w[^>]*(?:>|$)/],[xe,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ne,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),M(ue([[v,/^[\s]+/,null,` \r
|
|
`],[U,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Q,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[q,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ne,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),M(ue([],[[U,/^[\s\S]+/]]),["uq.val"]),M(Ae({keywords:R,hashComments:!0,cStyleComments:!0,types:Ie}),["c","cc","cpp","cxx","cyc","m"]),M(Ae({keywords:"null,true,false"}),["json"]),M(Ae({keywords:te,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Ie}),["cs"]),M(Ae({keywords:ve,cStyleComments:!0}),["java"]),M(Ae({keywords:Oe,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),M(Ae({keywords:le,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),M(Ae({keywords:j,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),M(Ae({keywords:ce,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),M(Ae({keywords:z,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),M(Ae({keywords:F,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),M(ue([],[[De,/^[\s\S]+/]]),["regex"]);function h(Y){var se=Y.langExtension;try{var ke=l(Y.sourceNode,Y.pre),Re=ke.sourceCode;Y.sourceCode=Re,Y.spans=ke.spans,Y.basePos=0,J(se,Re)(Y),G(Y)}catch(Le){W.console&&console.log(Le&&Le.stack||Le)}}function C(Y,se,ke){var Re=ke||!1,Le=se||null,be=document.createElement("div");be.innerHTML="<pre>"+Y+"</pre>",be=be.firstChild,Re&&ie(be,Re,!0);var Ee={langExtension:Le,numberLines:Re,sourceNode:be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return h(Ee),be.innerHTML}function g(Y,se){var ke=se||document.body,Re=ke.ownerDocument||document;function Le(A){return ke.getElementsByTagName(A)}for(var be=[Le("pre"),Le("code"),Le("xmp")],Ee=[],Ue=0;Ue<be.length;++Ue)for(var Je=0,ze=be[Ue].length;Je<ze;++Je)Ee.push(be[Ue][Je]);be=null;var Ve=Date;Ve.now||(Ve={now:function(){return+new Date}});var ot=0,rt=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ke=/\bprettyprint\b/,he=/\bprettyprinted\b/,it=/pre|xmp/i,qe=/^code$/i,ye=/^(?:pre|code|xmp)$/i,Pe={};function I(){for(var A=W.PR_SHOULD_USE_CONTINUATION?Ve.now()+250:Infinity;ot<Ee.length&&Ve.now()<A;ot++){for(var O=Ee[ot],f=Pe,p=O;p=p.previousSibling;){var b=p.nodeType,k=(b===7||b===8)&&p.nodeValue;if(k?!/^\??prettify\b/.test(k):b!==3||/\S/.test(p.nodeValue))break;if(k){f={},k.replace(/\b(\w+)=([\w:.%+-]+)/g,function(jt,yt,Tn){f[yt]=Tn});break}}var D=O.className;if((f!==Pe||Ke.test(D))&&!he.test(D)){for(var ae=!1,Te=O.parentNode;Te;Te=Te.parentNode){var He=Te.tagName;if(ye.test(He)&&Te.className&&Ke.test(Te.className)){ae=!0;break}}if(!ae){O.className+=" prettyprinted";var tt=f.lang;if(!tt){tt=D.match(rt);var et;!tt&&(et=B(O))&&qe.test(et.tagName)&&(tt=et.className.match(rt)),tt&&(tt=tt[1])}var kt;if(it.test(O.tagName))kt=1;else{var ht=O.currentStyle,st=Re.defaultView,Tt=ht?ht.whiteSpace:st&&st.getComputedStyle?st.getComputedStyle(O,null).getPropertyValue("white-space"):0;kt=Tt&&Tt.substring(0,3)==="pre"}var bt=f.linenums;(bt=bt==="true"||+bt)||(bt=D.match(/\blinenums\b(?::(\d+))?/),bt=bt?bt[1]&&bt[1].length?+bt[1]:!0:!1),bt&&ie(O,bt,kt);var Ut={langExtension:tt,sourceNode:O,numberLines:bt,pre:kt,sourceCode:null,basePos:null,spans:null,decorations:null};h(Ut)}}}ot<Ee.length?W.setTimeout(I,250):typeof Y=="function"&&Y()}I()}var re=W.PR={createSimpleLexer:ue,registerLangHandler:M,sourceDecorator:Ae,PR_ATTRIB_NAME:q,PR_ATTRIB_VALUE:U,PR_COMMENT:xe,PR_DECLARATION:H,PR_KEYWORD:Fe,PR_LITERAL:fe,PR_NOCODE:T,PR_PLAIN:v,PR_PUNCTUATION:ne,PR_SOURCE:w,PR_STRING:De,PR_TAG:Q,PR_TYPE:we,prettyPrintOne:oe?W.prettyPrintOne=C:ee=C,prettyPrint:L=oe?W.prettyPrint=g:L=g},pe=W.define;typeof pe=="function"&&pe.amd&&pe("google-code-prettify",[],function(){return re})})()},"VrN/":function(ft,Ye,x){(function(K,Ce){ft.exports=Ce()})(this,function(){"use strict";var K=navigator.userAgent,Ce=navigator.platform,oe=/gecko\/\d/i.test(K),Se=/MSIE \d/.test(K),ge=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(K),ee=/Edge\/(\d+)/.exec(K),L=Se||ge||ee,W=L&&(Se?document.documentMode||6:+(ee||ge)[1]),P=!ee&&/WebKit\//.test(K),V=P&&/Qt\/\d+\.\d+/.test(K),N=!ee&&/Chrome\//.test(K),R=/Opera\//.test(K),ve=/Apple Computer/.test(navigator.vendor),te=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(K),F=/PhantomJS/.test(K),z=!ee&&/AppleWebKit/.test(K)&&/Mobile\/\w+/.test(K),j=/Android/.test(K),le=z||j||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(K),ce=z||/Mac/.test(Ce),Oe=/\bCrOS\b/.test(K),Xe=/win/i.test(Ce),Ie=R&&K.match(/Version\/(\d*\.\d*)/);Ie&&(Ie=Number(Ie[1])),Ie&&Ie>=15&&(R=!1,P=!0);var De=ce&&(V||R&&(Ie==null||Ie<12.11)),Fe=oe||L&&W>=9;function xe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var we=function(e,t){var r=e.className,n=xe(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 fe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ne(e,t){return fe(e).appendChild(t)}function v(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 Q(e,t,r,n){var i=v(e,t,r,n);return i.setAttribute("role","presentation"),i}var H;document.createRange?H=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:H=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 w(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 q(){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 U(e,t){var r=e.className;xe(t).test(r)||(e.className+=(r?" ":"")+t)}function T(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!xe(r[n]).test(t)&&(t+=" "+r[n]);return t}var E=function(e){e.select()};z?E=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:L&&(E=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 m(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 _=function(){this.id=null,this.f=null,this.time=0,this.handler=c(this.onTimeout,this)};_.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},_.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 B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var ue=50,Ae={toString:function(){return"CodeMirror.Pass"}},de={scroll:!1},ie={origin:"*mouse"},G={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 M=[""];function J(e){for(;M.length<=e;)M.push(h(M)+" ");return M[e]}function h(e){return e[e.length-1]}function C(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function g(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function re(){}function pe(e,t){var r;return Object.create?r=Object.create(e):(re.prototype=e,r=new re),t&&l(t,r),r}var Y=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function se(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Y.test(e))}function ke(e,t){return t?t.source.indexOf("\\w")>-1&&se(e)?!0:t.test(e):se(e)}function Re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Le=/[\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 be(e){return e.charCodeAt(0)>=768&&Le.test(e)}function Ee(e,t,r){for(;(r<0?t>0:t<e.length)&&be(e.charAt(t));)t+=r;return t}function Ue(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 Je(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 ze=null;function Ve(e,t,r){var n;ze=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:ze=i),a.from==t&&(a.from!=a.to&&r!="before"?n=i:ze=i)}return n!=null?n:ze}var ot=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,y,S){this.level=d,this.from=y,this.to=S}return function(d,y){var S=y=="ltr"?"L":"R";if(d.length==0||y=="ltr"&&!n.test(d))return!1;for(var $=d.length,X=[],me=0;me<$;++me)X.push(r(d.charCodeAt(me)));for(var _e=0,je=S;_e<$;++_e){var Be=X[_e];Be=="m"?X[_e]=je:je=Be}for(var Ge=0,We=S;Ge<$;++Ge){var $e=X[Ge];$e=="1"&&We=="r"?X[Ge]="n":a.test($e)&&(We=$e,$e=="r"&&(X[Ge]="R"))}for(var lt=1,nt=X[0];lt<$-1;++lt){var pt=X[lt];pt=="+"&&nt=="1"&&X[lt+1]=="1"?X[lt]="1":pt==","&&nt==X[lt+1]&&(nt=="1"||nt=="n")&&(X[lt]=nt),nt=pt}for(var At=0;At<$;++At){var zt=X[At];if(zt==",")X[At]="N";else if(zt=="%"){var Lt=void 0;for(Lt=At+1;Lt<$&&X[Lt]=="%";++Lt);for(var ln=At&&X[At-1]=="!"||Lt<$&&X[Lt]=="1"?"1":"N",rn=At;rn<Lt;++rn)X[rn]=ln;At=Lt-1}}for(var Pt=0,an=S;Pt<$;++Pt){var Gt=X[Pt];an=="L"&&Gt=="1"?X[Pt]="L":a.test(Gt)&&(an=Gt)}for(var Ft=0;Ft<$;++Ft)if(i.test(X[Ft])){var Nt=void 0;for(Nt=Ft+1;Nt<$&&i.test(X[Nt]);++Nt);for(var Mt=(Ft?X[Ft-1]:S)=="L",on=(Nt<$?X[Nt]:S)=="L",Br=Mt==on?Mt?"L":"R":S,qn=Ft;qn<Nt;++qn)X[qn]=Br;Ft=Nt-1}for(var $t=[],Rn,Ht=0;Ht<$;)if(o.test(X[Ht])){var Ka=Ht;for(++Ht;Ht<$&&o.test(X[Ht]);++Ht);$t.push(new u(0,Ka,Ht))}else{var Wn=Ht,fr=$t.length,hr=y=="rtl"?1:0;for(++Ht;Ht<$&&X[Ht]!="L";++Ht);for(var qt=Wn;qt<Ht;)if(s.test(X[qt])){Wn<qt&&($t.splice(fr,0,new u(1,Wn,qt)),fr+=hr);var Wr=qt;for(++qt;qt<Ht&&s.test(X[qt]);++qt);$t.splice(fr,0,new u(2,Wr,qt)),fr+=hr,Wn=qt}else++qt;Wn<Ht&&$t.splice(fr,0,new u(1,Wn,Ht))}return y=="ltr"&&($t[0].level==1&&(Rn=d.match(/^\s+/))&&($t[0].from=Rn[0].length,$t.unshift(new u(0,0,Rn[0].length))),h($t).level==1&&(Rn=d.match(/\s+$/))&&(h($t).to-=Rn[0].length,$t.push(new u(0,$-Rn[0].length,$)))),y=="rtl"?$t.reverse():$t}}();function rt(e,t){var r=e.order;return r==null&&(r=e.order=ot(e.text,t)),r}var Ke=[],he=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]||Ke).concat(r)}};function it(e,t){return e._handlers&&e._handlers[t]||Ke}function qe(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=B(i,r);a>-1&&(n[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function ye(e,t){var r=it(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 Pe(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ye(e,r||t.type,e,t),b(t)||t.codemirrorIgnore}function I(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)B(r,t[n])==-1&&r.push(t[n])}function A(e,t){return it(e,t).length>0}function O(e){e.prototype.on=function(t,r){he(this,t,r)},e.prototype.off=function(t,r){qe(this,t,r)}}function f(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function p(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function b(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function k(e){f(e),p(e)}function D(e){return e.target||e.srcElement}function ae(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ce&&e.ctrlKey&&t==1&&(t=3),t}var Te=function(){if(L&&W<9)return!1;var e=v("div");return"draggable"in e||"dragDrop"in e}(),He;function tt(e){if(He==null){var t=v("span","\u200B");ne(e,v("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(He=t.offsetWidth<=1&&t.offsetHeight>2&&!(L&&W<8))}var r=He?v("span","\u200B"):v("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var et;function kt(e){if(et!=null)return et;var t=ne(e,document.createTextNode("A\u062EA")),r=H(t,0,1).getBoundingClientRect(),n=H(t,1,2).getBoundingClientRect();return fe(e),!r||r.left==r.right?!1:et=n.right-r.right<3}var ht=`
|
|
|
|
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/)},st=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},Tt=function(){var e=v("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),bt=null;function Ut(e){if(bt!=null)return bt;var t=ne(e,v("span","x")),r=t.getBoundingClientRect(),n=H(t,0,1).getBoundingClientRect();return bt=Math.abs(r.left-n.left)>1}var jt={},yt={};function Tn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),jt[e]=t}function Mn(e,t){yt[e]=t}function un(e){if(typeof e=="string"&&yt.hasOwnProperty(e))e=yt[e];else if(e&&typeof e.name=="string"&&yt.hasOwnProperty(e.name)){var t=yt[e.name];typeof t=="string"&&(t={name:t}),e=pe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return un("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return un("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gn(e,t){t=un(t);var r=jt[t.name];if(!r)return gn(e,"text/plain");var n=r(e,t);if(hn.hasOwnProperty(t.name)){var i=hn[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 hn={};function ia(e,t){var r=hn.hasOwnProperty(e)?hn[e]:hn[e]={};l(t,r)}function _n(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 zr(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 Hr(e,t,r){return e.startState?e.startState(t,r):!0}var Rt=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};Rt.prototype.eol=function(){return this.pos>=this.string.length},Rt.prototype.sol=function(){return this.pos==this.lineStart},Rt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Rt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Rt.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},Rt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Rt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Rt.prototype.skipToEnd=function(){this.pos=this.string.length},Rt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Rt.prototype.backUp=function(e){this.pos-=e},Rt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=m(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?m(this.string,this.lineStart,this.tabSize):0)},Rt.prototype.indentation=function(){return m(this.string,null,this.tabSize)-(this.lineStart?m(this.string,this.lineStart,this.tabSize):0)},Rt.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)}},Rt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Rt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Rt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Rt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ze(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 Dn(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 pr(e,t,r){var n=[];return e.iter(t,r,function(i){n.push(i.text)}),n}function Zt(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function wt(e){if(e.parent==null)return null;for(var t=e.parent,r=B(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 vn(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 Pn(e,t){return t>=e.first&&t<e.first+e.size}function mr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Me(e,t,r){if(r===void 0&&(r=null),!(this instanceof Me))return new Me(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ut(e,t){return e.line-t.line||e.ch-t.ch}function Xr(e,t){return e.sticky==t.sticky&&ut(e,t)==0}function gr(e){return Me(e.line,e.ch)}function vr(e,t){return ut(e,t)<0?t:e}function Zn(e,t){return ut(e,t)<0?e:t}function br(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function dt(e,t){if(t.line<e.first)return Me(e.first,0);var r=e.first+e.size-1;return t.line>r?Me(r,Ze(e,r).text.length):Ti(t,Ze(e,t.line).text.length)}function Ti(e,t){var r=e.ch;return r==null||r>t?Me(e.line,t):r<0?Me(e.line,0):e}function Ne(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=dt(e,t[n]);return r}var yr=function(e,t){this.state=e,this.lookAhead=t},pn=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};pn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pn.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}},pn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pn.fromSaved=function(e,t,r){return t instanceof yr?new pn(e,_n(e.mode,t.state),r,t.lookAhead):new pn(e,_n(e.mode,t),r)},pn.prototype.save=function(e){var t=e!==!1?_n(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new yr(t,this.maxLookAhead):t};function Gr(e,t,r,n){var i=[e.state.modeGen],a={};xn(e,t.text,e.doc.mode,r,function(d,y){return i.push(d,y)},a,n);for(var o=r.state,s=function(d){r.baseTokens=i;var y=e.state.overlays[d],S=1,$=0;r.state=!0,xn(e,t.text,y.mode,r,function(X,me){for(var _e=S;$<X;){var je=i[S];je>X&&i.splice(S,1,X,i[S+1],je),S+=2,$=Math.min(X,je)}if(!me)return;if(y.opaque)i.splice(_e,S-_e,X,"overlay "+me),S=_e+2;else for(;_e<S;_e+=2){var Be=i[_e+1];i[_e+1]=(Be?Be+" ":"")+"overlay "+me}},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 Qn(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=bn(e,wt(t)),i=t.text.length>e.options.maxHighlightLength&&_n(e.doc.mode,n.state),a=Gr(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 bn(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new pn(n,!0,t);var a=Ai(e,t,r),o=a>n.first&&Ze(n,a-1).stateAfter,s=o?pn.fromSaved(n,o,a):new pn(n,Hr(n.mode),a);return n.iter(a,t,function(u){Kr(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 Kr(e,t,r,n){var i=e.doc.mode,a=new Rt(t,e.options.tabSize,r);for(a.start=a.pos=n||0,t==""&&Vr(i,r.state);!a.eol();)yn(i,a,r.state),a.start=a.pos}function Vr(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=zr(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function yn(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=zr(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 $r=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function _i(e,t,r,n){var i=e.doc,a=i.mode,o;t=dt(i,t);var s=Ze(i,t.line),u=bn(e,t.line,r),d=new Rt(s.text,e.options.tabSize,u),y;for(n&&(y=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,o=yn(a,d,u.state),n&&y.push(new $r(d,o,_n(i.mode,u.state)));return n?y:new $r(d,o,u.state)}function Yr(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 xn(e,t,r,n,i,a,o){var s=r.flattenSpans;s==null&&(s=e.options.flattenSpans);var u=0,d=null,y=new Rt(t,e.options.tabSize,n),S,$=e.options.addModeClass&&[null];for(t==""&&Yr(Vr(r,n.state),a);!y.eol();){if(y.pos>e.options.maxHighlightLength?(s=!1,o&&Kr(e,t,n,y.pos),y.pos=t.length,S=null):S=Yr(yn(r,y,n.state,$),a),$){var X=$[0].name;X&&(S="m-"+(S?X+" "+S:X))}if(!s||d!=S){for(;u<y.start;)u=Math.min(y.start,u+5e3),i(u,d);d=S}y.start=y.pos}for(;u<y.pos;){var me=Math.min(y.pos,u+5e3);i(me,d),u=me}}function Ai(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=Ze(a,s-1),d=u.stateAfter;if(d&&(!r||s+(d instanceof yr?d.lookAhead:0)<=a.modeFrontier))return s;var y=m(u.text,null,e.options.tabSize);(i==null||n>y)&&(i=s-1,n=y)}return i}function aa(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=Ze(e,n).stateAfter;if(i&&(!(i instanceof yr)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Jr=!1,Yt=!1;function zn(){Jr=!0}function oa(){Yt=!0}function er(e,t,r){this.marker=e,this.from=t,this.to=r}function wn(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function qr(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function sa(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Oi(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 er(o,a.from,u?null:a.to))}}return n}function Li(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 er(o,u?null:a.from-t,a.to==null?null:a.to-t))}}return n}function xr(e,t){if(t.full)return null;var r=Pn(e,t.from.line)&&Ze(e,t.from.line).markedSpans,n=Pn(e,t.to.line)&&Ze(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,a=t.to.ch,o=ut(t.from,t.to)==0,s=Oi(r,i,o),u=Li(n,a,o),d=t.text.length==1,y=h(t.text).length+(d?i:0);if(s)for(var S=0;S<s.length;++S){var $=s[S];if($.to==null){var X=wn(u,$.marker);X?d&&($.to=X.to==null?null:X.to+y):$.to=i}}if(u)for(var me=0;me<u.length;++me){var _e=u[me];if(_e.to!=null&&(_e.to+=y),_e.from==null){var je=wn(s,_e.marker);je||(_e.from=y,d&&(s||(s=[])).push(_e))}else _e.from+=y,d&&(s||(s=[])).push(_e)}s&&(s=Ri(s)),u&&u!=s&&(u=Ri(u));var Be=[s];if(!d){var Ge=t.text.length-2,We;if(Ge>0&&s)for(var $e=0;$e<s.length;++$e)s[$e].to==null&&(We||(We=[])).push(new er(s[$e].marker,null,null));for(var lt=0;lt<Ge;++lt)Be.push(We);Be.push(u)}return Be}function Ri(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 Mi(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(X){if(X.markedSpans)for(var me=0;me<X.markedSpans.length;++me){var _e=X.markedSpans[me].marker;_e.readOnly&&(!n||B(n,_e)==-1)&&(n||(n=[])).push(_e)}}),!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(ut(d.to,s.from)<0||ut(d.from,s.to)>0)continue;var y=[u,1],S=ut(d.from,s.from),$=ut(d.to,s.to);(S<0||!o.inclusiveLeft&&!S)&&y.push({from:d.from,to:s.from}),($>0||!o.inclusiveRight&&!$)&&y.push({from:s.to,to:d.to}),i.splice.apply(i,y),u+=y.length-3}return i}function la(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 wr(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function tr(e){return e.inclusiveLeft?-1:0}function nr(e){return e.inclusiveRight?1:0}function Er(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),i=t.find(),a=ut(n.from,i.from)||tr(e)-tr(t);if(a)return-a;var o=ut(n.to,i.to)||nr(e)-nr(t);return o||t.id-e.id}function Nn(e,t){var r=Yt&&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||Er(n,i.marker)<0)&&(n=i.marker);return n}function jn(e){return Nn(e,!0)}function In(e){return Nn(e,!1)}function Cr(e,t){var r=Yt&&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||Er(n,a.marker)<0)&&(n=a.marker)}return n}function Di(e,t,r,n,i){var a=Ze(e,t),o=Yt&&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),y=ut(d.from,r)||tr(u.marker)-tr(i),S=ut(d.to,n)||nr(u.marker)-nr(i);if(y>=0&&S<=0||y<=0&&S>=0)continue;if(y<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?ut(d.to,r)>=0:ut(d.to,r)>0)||y>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?ut(d.from,n)<=0:ut(d.from,n)<0))return!0}}function cn(e){for(var t;t=jn(e);)e=t.find(-1,!0).line;return e}function Pi(e){for(var t;t=In(e);)e=t.find(1,!0).line;return e}function kr(e){for(var t,r;t=In(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Zr(e,t){var r=Ze(e,t),n=cn(r);return r==n?t:wt(n)}function Hn(e,t){if(t>e.lastLine())return t;var r=Ze(e,t),n;if(!An(e,r))return t;for(;n=In(r);)r=n.find(1,!0).line;return wt(r)+1}function An(e,t){var r=Yt&&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&&Qr(e,t,n))return!0}}function Qr(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return Qr(e,n.line,wn(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)&&Qr(e,t,i))return!0}function En(e){e=cn(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 ei(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=jn(n);){var i=r.find(0,!0);n=i.from.line,t+=i.from.ch-i.to.ch}for(n=e;r=In(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 Ni(e){var t=e.display,r=e.doc;t.maxLine=Ze(r,r.first),t.maxLineLength=ei(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var i=ei(n);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var rr=function(e,t,r){this.text=e,wr(this,t),this.height=r?r(this):1};rr.prototype.lineNo=function(){return wt(this)},O(rr);function ua(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),la(e),wr(e,r);var i=n?n(e):1;i!=e.height&&Zt(e,i)}function Qe(e){e.parent=null,la(e)}var ct={},at={};function mt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?at:ct;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function xt(e,t){var r=Q("span",null,null,P?"padding-right: .1px":null),n={pre:Q("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=vt,kt(e.display.measure)&&(o=rt(a,e.doc.direction))&&(n.addToken=Qt(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&wt(a);Fn(a,n,Qn(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=T(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=T(a.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(tt(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(P){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 ye(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=T(n.pre.className,n.textClass||"")),n}function _t(e){var t=v("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function vt(e,t,r,n,i,a,o){if(!t)return;var s=e.splitSpaces?It(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,y;if(!u.test(t))e.col+=t.length,y=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,y),L&&W<9&&(d=!0),e.pos+=t.length;else{y=document.createDocumentFragment();for(var S=0;;){u.lastIndex=S;var $=u.exec(t),X=$?$.index-S:t.length-S;if(X){var me=document.createTextNode(s.slice(S,S+X));L&&W<9?y.appendChild(v("span",[me])):y.appendChild(me),e.map.push(e.pos,e.pos+X,me),e.col+=X,e.pos+=X}if(!$)break;S+=X+1;var _e=void 0;if($[0]==" "){var je=e.cm.options.tabSize,Be=je-e.col%je;_e=y.appendChild(v("span",J(Be),"cm-tab")),_e.setAttribute("role","presentation"),_e.setAttribute("cm-text"," "),e.col+=Be}else $[0]=="\r"||$[0]==`
|
|
`?(_e=y.appendChild(v("span",$[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),_e.setAttribute("cm-text",$[0]),e.col+=1):(_e=e.cm.options.specialCharPlaceholder($[0]),_e.setAttribute("cm-text",$[0]),L&&W<9?y.appendChild(v("span",[_e])):y.appendChild(_e),e.col+=1);e.map.push(e.pos,e.pos+1,_e),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,r||n||i||d||a||o){var Ge=r||"";n&&(Ge+=n),i&&(Ge+=i);var We=v("span",[y],Ge,a);if(o)for(var $e in o)o.hasOwnProperty($e)&&$e!="style"&&$e!="class"&&We.setAttribute($e,o[$e]);return e.content.appendChild(We)}e.content.appendChild(y)}function It(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 Qt(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,y=d+n.length;;){for(var S=void 0,$=0;$<t.length&&!(S=t[$],S.to>d&&S.from<=d);$++);if(S.to>=y)return e(r,n,i,a,o,s,u);e(r,n.slice(0,S.to-d),i,a,null,s,u),a=null,n=n.slice(S.to-d),d=S.to}}}function gt(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 Fn(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]),mt(r[o+1],t.cm.options));return}for(var s=i.length,u=0,d=1,y="",S,$,X=0,me,_e,je,Be,Ge;;){if(X==u){me=_e=je=$="",Ge=null,Be=null,X=Infinity;for(var We=[],$e=void 0,lt=0;lt<n.length;++lt){var nt=n[lt],pt=nt.marker;if(pt.type=="bookmark"&&nt.from==u&&pt.widgetNode)We.push(pt);else if(nt.from<=u&&(nt.to==null||nt.to>u||pt.collapsed&&nt.to==u&&nt.from==u)){if(nt.to!=null&&nt.to!=u&&X>nt.to&&(X=nt.to,_e=""),pt.className&&(me+=" "+pt.className),pt.css&&($=($?$+";":"")+pt.css),pt.startStyle&&nt.from==u&&(je+=" "+pt.startStyle),pt.endStyle&&nt.to==X&&($e||($e=[])).push(pt.endStyle,nt.to),pt.title&&((Ge||(Ge={})).title=pt.title),pt.attributes)for(var At in pt.attributes)(Ge||(Ge={}))[At]=pt.attributes[At];pt.collapsed&&(!Be||Er(Be.marker,pt)<0)&&(Be=nt)}else nt.from>u&&X>nt.from&&(X=nt.from)}if($e)for(var zt=0;zt<$e.length;zt+=2)$e[zt+1]==X&&(_e+=" "+$e[zt]);if(!Be||Be.from==u)for(var Lt=0;Lt<We.length;++Lt)gt(t,0,We[Lt]);if(Be&&(Be.from||0)==u){if(gt(t,(Be.to==null?s+1:Be.to)-u,Be.marker,Be.from==null),Be.to==null)return;Be.to==u&&(Be=!1)}}if(u>=s)break;for(var ln=Math.min(s,X);;){if(y){var rn=u+y.length;if(!Be){var Pt=rn>ln?y.slice(0,ln-u):y;t.addToken(t,Pt,S?S+me:me,je,u+Pt.length==X?_e:"",$,Ge)}if(rn>=ln){y=y.slice(ln-u),u=ln;break}u=rn,je=""}y=i.slice(a,a=r[d++]),S=mt(r[d++],t.cm.options)}}}function Et(e,t,r){this.line=t,this.rest=kr(t),this.size=this.rest?wt(h(this.rest))-r+1:1,this.node=this.text=null,this.hidden=An(e,t)}function en(e,t,r){for(var n=[],i,a=t;a<r;a=i){var o=new Et(e.doc,Ze(e.doc,a),a);i=a+o.size,n.push(o)}return n}var Kt=null;function mn(e){Kt?Kt.ops.push(e):e.ownsGroup=Kt={ops:[e],delayedCallbacks:[]}}function Ls(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 Rs(e,t){var r=e.ownsGroup;if(!r)return;try{Ls(r)}finally{Kt=null,t(r)}}var ti=null;function Xt(e,t){var r=it(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),i;Kt?i=Kt.delayedCallbacks:ti?i=ti:(i=ti=[],setTimeout(Ms,0));for(var a=function(s){i.push(function(){return r[s].apply(null,n)})},o=0;o<r.length;++o)a(o)}function Ms(){var e=ti;ti=null;for(var t=0;t<e.length;++t)e[t]()}function $a(e,t,r,n){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Ps(e,t):a=="gutter"?Ja(e,t,r,n):a=="class"?ca(e,t):a=="widget"&&Ns(e,t,n)}t.changes=null}function ni(e){return e.node==e.text&&(e.node=v("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),L&&W<8&&(e.node.style.zIndex=2)),e.node}function Ds(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=ni(t);t.background=n.insertBefore(v("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Ya(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):xt(e,t)}function Ps(e,t){var r=t.text.className,n=Ya(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,ca(e,t)):r&&(t.text.className=r)}function ca(e,t){Ds(e,t),t.line.wrapClass?ni(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 Ja(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=ni(t);t.gutterBackground=v("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=ni(t),s=t.gutter=v("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(v("div",mr(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,y=a.hasOwnProperty(d)&&a[d];y&&s.appendChild(v("div",[y],"CodeMirror-gutter-elt","left: "+n.gutterLeft[d]+"px; width: "+n.gutterWidth[d]+"px"))}}}function Ns(e,t,r){t.alignable&&(t.alignable=null);for(var n=xe("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);qa(e,t,r)}function js(e,t,r,n){var i=Ya(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),ca(e,t),Ja(e,t,r,n),qa(e,t,n),t.node}function qa(e,t,r){if(Za(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Za(e,t.rest[n],t,r,!1)}function Za(e,t,r,n,i){if(!t.widgets)return;for(var a=ni(r),o=0,s=t.widgets;o<s.length;++o){var u=s[o],d=v("div",[u.node],"CodeMirror-linewidget"+(u.className?" "+u.className:""));u.handleMouseEvents||d.setAttribute("cm-ignore-events","true"),Is(u,d,r,n),e.display.input.setUneditable(d),i&&u.above?a.insertBefore(d,r.gutter||r.text):a.appendChild(d),Xt(u,"redraw")}}function Is(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 ri(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(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;"),ne(t.display.measure,v("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Un(e,t){for(var r=D(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 ji(e){return e.lineSpace.offsetTop}function da(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Qa(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=ne(e.measure,v("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 On(e){return ue-e.display.nativeBarWidth}function ir(e){return e.display.scroller.clientWidth-On(e)-e.display.barWidth}function fa(e){return e.display.scroller.clientHeight-On(e)-e.display.barHeight}function Fs(e,t,r){var n=e.options.lineWrapping,i=n&&ir(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 eo(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(wt(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Us(e,t){t=cn(t);var r=wt(t),n=e.display.externalMeasured=new Et(e.doc,t,r);n.lineN=r;var i=n.built=xt(e,n);return n.text=i.pre,ne(e.display.lineMeasure,i.pre),n}function to(e,t,r,n){return Ln(e,Sr(e,t),r,n)}function ha(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[sr(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function Sr(e,t){var r=wt(t),n=ha(e,r);n&&!n.text?n=null:n&&n.changes&&($a(e,n,r,ya(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var i=eo(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Ln(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||(Fs(e,t.view,t.rect),t.hasHeights=!0),o=Ws(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 no={left:0,right:0,top:0,bottom:0};function ro(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 Bs(e,t){var r=no;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 Ws(e,t,r,n){var i=ro(t.map,r,n),a=i.node,o=i.start,s=i.end,u=i.collapse,d;if(a.nodeType==3){for(var y=0;y<4;y++){for(;o&&be(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+s<i.coverEnd&&be(t.line.text.charAt(i.coverStart+s));)++s;if(L&&W<9&&o==0&&s==i.coverEnd-i.coverStart?d=a.parentNode.getBoundingClientRect():d=Bs(H(a,o,s).getClientRects(),n),d.left||d.right||o==0)break;s=o,o=o-1,u="right"}L&&W<11&&(d=zs(e.display.measure,d))}else{o>0&&(u=n="right");var S;e.options.lineWrapping&&(S=a.getClientRects()).length>1?d=S[n=="right"?S.length-1:0]:d=a.getBoundingClientRect()}if(L&&W<9&&!o&&(!d||!d.left&&!d.right)){var $=a.parentNode.getClientRects()[0];$?d={left:$.left,right:$.left+_r(e.display),top:$.top,bottom:$.bottom}:d=no}for(var X=d.top-t.rect.top,me=d.bottom-t.rect.top,_e=(X+me)/2,je=t.view.measure.heights,Be=0;Be<je.length-1&&!(_e<je[Be]);Be++);var Ge=Be?je[Be-1]:0,We=je[Be],$e={left:(u=="right"?d.right:d.left)-t.rect.left,right:(u=="left"?d.left:d.right)-t.rect.left,top:Ge,bottom:We};return!d.left&&!d.right&&($e.bogus=!0),e.options.singleCursorHeightPerLine||($e.rtop=X,$e.rbottom=me),$e}function zs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ut(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 io(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 ao(e){e.display.externalMeasure=null,fe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)io(e.display.view[t])}function ii(e){ao(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function oo(){return N&&j?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function so(){return N&&j?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function pa(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=ri(e.widgets[r]));return t}function Ii(e,t,r,n,i){if(!i){var a=pa(t);r.top+=a,r.bottom+=a}if(n=="line")return r;n||(n="local");var o=En(t);if(n=="local"?o+=ji(e.display):o-=e.display.viewOffset,n=="page"||n=="window"){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(n=="window"?0:so());var u=s.left+(n=="window"?0:oo());r.left+=u,r.right+=u}return r.top+=o,r.bottom+=o,r}function lo(e,t,r){if(r=="div")return t;var n=t.left,i=t.top;if(r=="page")n-=oo(),i-=so();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 ma(e,t,r,n,i){return n||(n=Ze(e.doc,t.line)),Ii(e,n,to(e,n,t.ch,i),r)}function Cn(e,t,r,n,i,a){n=n||Ze(e.doc,t.line),i||(i=Sr(e,n));function o(me,_e){var je=Ln(e,i,me,_e?"right":"left",a);return _e?je.left=je.right:je.right=je.left,Ii(e,n,je,r)}var s=rt(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 y(me,_e,je){var Be=s[_e],Ge=Be.level==1;return o(je?me-1:me,Ge!=je)}var S=Ve(s,u,d),$=ze,X=y(u,S,d=="before");return $!=null&&(X.other=y(u,$,d!="before")),X}function uo(e,t){var r=0;t=dt(e.doc,t),e.options.lineWrapping||(r=_r(e.display)*t.ch);var n=Ze(e.doc,t.line),i=En(n)+ji(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function ga(e,t,r,n,i){var a=Me(e,t,r);return a.xRel=i,n&&(a.outside=n),a}function va(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return ga(n.first,0,null,-1,-1);var i=vn(n,r),a=n.first+n.size-1;if(i>a)return ga(n.first+n.size-1,Ze(n,a).text.length,null,1,1);t<0&&(t=0);for(var o=Ze(n,i);;){var s=Hs(e,o,i,t,r),u=Cr(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=Ze(n,i=d.line)}}function co(e,t,r,n){n-=pa(t);var i=t.text.length,a=Ue(function(o){return Ln(e,r,o-1).bottom<=n},i,0);return i=Ue(function(o){return Ln(e,r,o).top>n},a,i),{begin:a,end:i}}function fo(e,t,r,n){r||(r=Sr(e,t));var i=Ii(e,t,Ln(e,r,n),"line").top;return co(e,t,r,i)}function ba(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Hs(e,t,r,n,i){i-=En(t);var a=Sr(e,t),o=pa(t),s=0,u=t.text.length,d=!0,y=rt(t,e.doc.direction);if(y){var S=(e.options.lineWrapping?Gs:Xs)(e,t,r,a,y,n,i);d=S.level!=1,s=d?S.from:S.to-1,u=d?S.to:S.from-1}var $=null,X=null,me=Ue(function(lt){var nt=Ln(e,a,lt);return nt.top+=o,nt.bottom+=o,ba(nt,n,i,!1)?(nt.top<=i&&nt.left<=n&&($=lt,X=nt),!0):!1},s,u),_e,je,Be=!1;if(X){var Ge=n-X.left<X.right-n,We=Ge==d;me=$+(We?0:1),je=We?"after":"before",_e=Ge?X.left:X.right}else{!d&&(me==u||me==s)&&me++,je=me==0?"after":me==t.text.length?"before":Ln(e,a,me-(d?1:0)).bottom+o<=i==d?"after":"before";var $e=Cn(e,Me(r,me,je),"line",t,a);_e=$e.left,Be=i<$e.top?-1:i>=$e.bottom?1:0}return me=Ee(t.text,me,1),ga(r,me,je,Be,n-_e)}function Xs(e,t,r,n,i,a,o){var s=Ue(function(S){var $=i[S],X=$.level!=1;return ba(Cn(e,Me(r,X?$.to:$.from,X?"before":"after"),"line",t,n),a,o,!0)},0,i.length-1),u=i[s];if(s>0){var d=u.level!=1,y=Cn(e,Me(r,d?u.from:u.to,d?"after":"before"),"line",t,n);ba(y,a,o,!0)&&y.top>o&&(u=i[s-1])}return u}function Gs(e,t,r,n,i,a,o){var s=co(e,t,n,o),u=s.begin,d=s.end;/\s/.test(t.text.charAt(d-1))&&d--;for(var y=null,S=null,$=0;$<i.length;$++){var X=i[$];if(X.from>=d||X.to<=u)continue;var me=X.level!=1,_e=Ln(e,n,me?Math.min(d,X.to)-1:Math.max(u,X.from)).right,je=_e<a?a-_e+1e9:_e-a;(!y||S>je)&&(y=X,S=je)}return y||(y=i[i.length-1]),y.from<u&&(y={from:u,to:y.to,level:y.level}),y.to>d&&(y={from:y.from,to:d,level:y.level}),y}var ar;function Tr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ar==null){ar=v("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ar.appendChild(document.createTextNode("x")),ar.appendChild(v("br"));ar.appendChild(document.createTextNode("x"))}ne(e.measure,ar);var r=ar.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),fe(e.measure),r||1}function _r(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=v("span","xxxxxxxxxx"),r=v("pre",[t],"CodeMirror-line-like");ne(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ya(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:xa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function xa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ho(e){var t=Tr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/_r(e.display)-3);return function(i){if(An(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 wa(e){var t=e.doc,r=ho(e);t.iter(function(n){var i=r(n);i!=n.height&&Zt(n,i)})}function or(e,t,r,n){var i=e.display;if(!r&&D(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(S){return null}var u=va(e,a,o),d;if(n&&u.xRel>0&&(d=Ze(e.doc,u.line).text).length==u.ch){var y=m(d,d.length,e.options.tabSize)-d.length;u=Me(u.line,Math.max(0,Math.round((a-Qa(e.display).left)/_r(e.display))-y))}return u}function sr(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 tn(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)Yt&&Zr(e.doc,t)<i.viewTo&&Gn(e);else if(r<=i.viewFrom)Yt&&Hn(e.doc,r+n)>i.viewFrom?Gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Gn(e);else if(t<=i.viewFrom){var a=Fi(e,r,r+n,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=n):Gn(e)}else if(r>=i.viewTo){var o=Fi(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Gn(e)}else{var s=Fi(e,t,t,-1),u=Fi(e,r,r+n,1);s&&u?(i.view=i.view.slice(0,s.index).concat(en(e,s.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=n):Gn(e)}var d=i.externalMeasured;d&&(r<d.lineN?d.lineN+=n:t<d.lineN+d.size&&(i.externalMeasured=null))}function Xn(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[sr(e,t)];if(a.node==null)return;var o=a.changes||(a.changes=[]);B(o,r)==-1&&o.push(r)}function Gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fi(e,t,r,n){var i=sr(e,t),a,o=e.display.view;if(!Yt||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(;Zr(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=en(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=en(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(sr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(en(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,sr(e,r)))),n.viewTo=r}function po(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 ai(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mo(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)&&go(e,s.head,i),u||Vs(e,s,a)}return n}function go(e,t,r){var n=Cn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(v("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(v("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 Ui(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=Qa(e.display),s=o.left,u=Math.max(n.sizerWidth,ir(e)-n.sizer.offsetLeft)-o.right,d=i.direction=="ltr";function y(We,$e,lt,nt){$e<0&&($e=0),$e=Math.round($e),nt=Math.round(nt),a.appendChild(v("div",null,"CodeMirror-selected","position: absolute; left: "+We+`px;
|
|
top: `+$e+"px; width: "+(lt==null?u-We:lt)+`px;
|
|
height: `+(nt-$e)+"px"))}function S(We,$e,lt){var nt=Ze(i,We),pt=nt.text.length,At,zt;function Lt(Pt,an){return ma(e,Me(We,Pt),"div",nt,an)}function ln(Pt,an,Gt){var Ft=fo(e,nt,null,Pt),Nt=an=="ltr"==(Gt=="after")?"left":"right",Mt=Gt=="after"?Ft.begin:Ft.end-(/\s/.test(nt.text.charAt(Ft.end-1))?2:1);return Lt(Mt,Nt)[Nt]}var rn=rt(nt,i.direction);return Je(rn,$e||0,lt==null?pt:lt,function(Pt,an,Gt,Ft){var Nt=Gt=="ltr",Mt=Lt(Pt,Nt?"left":"right"),on=Lt(an-1,Nt?"right":"left"),Br=$e==null&&Pt==0,qn=lt==null&&an==pt,$t=Ft==0,Rn=!rn||Ft==rn.length-1;if(on.top-Mt.top<=3){var Ht=(d?Br:qn)&&$t,Ka=(d?qn:Br)&&Rn,Wn=Ht?s:(Nt?Mt:on).left,fr=Ka?u:(Nt?on:Mt).right;y(Wn,Mt.top,fr-Wn,Mt.bottom)}else{var hr,qt,Wr,Va;Nt?(hr=d&&Br&&$t?s:Mt.left,qt=d?u:ln(Pt,Gt,"before"),Wr=d?s:ln(an,Gt,"after"),Va=d&&qn&&Rn?u:on.right):(hr=d?ln(Pt,Gt,"before"):s,qt=!d&&Br&&$t?u:Mt.right,Wr=!d&&qn&&Rn?s:on.left,Va=d?ln(an,Gt,"after"):u),y(hr,Mt.top,qt-hr,Mt.bottom),Mt.bottom<on.top&&y(s,Mt.bottom,null,on.top),y(Wr,on.top,Va-Wr,on.bottom)}(!At||Ui(Mt,At)<0)&&(At=Mt),Ui(on,At)<0&&(At=on),(!zt||Ui(Mt,zt)<0)&&(zt=Mt),Ui(on,zt)<0&&(zt=on)}),{start:At,end:zt}}var $=t.from(),X=t.to();if($.line==X.line)S($.line,$.ch,X.ch);else{var me=Ze(i,$.line),_e=Ze(i,X.line),je=cn(me)==cn(_e),Be=S($.line,$.ch,je?me.text.length+1:null).end,Ge=S(X.line,je?0:null,X.ch).start;je&&(Be.top<Ge.top-2?(y(Be.right,Be.top,null,Be.bottom),y(s,Ge.top,Ge.left,Ge.bottom)):y(Be.right,Be.top,Ge.left-Be.right,Be.bottom)),Be.bottom<Ge.top&&y(s,Be.bottom,null,Ge.top)}r.appendChild(a)}function Ea(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()||Ar(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function vo(e){e.state.focused||(e.display.input.focus(),Ca(e))}function bo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ar(e))},100)}function Ca(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ye(e,"focus",e,t),e.state.focused=!0,U(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),P&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ea(e)}function Ar(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ye(e,"blur",e,t),e.state.focused=!1,we(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Bi(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(L&&W<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 y=i.line.height-o;if((y>.005||y<-.005)&&(Zt(i.line,o),yo(i.line),i.rest))for(var S=0;S<i.rest.length;S++)yo(i.rest[S]);if(s>e.display.sizerWidth){var $=Math.ceil(s/_r(e.display));$>e.display.maxLineLength&&(e.display.maxLineLength=$,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function yo(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 Wi(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-ji(e));var i=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,a=vn(t,n),o=vn(t,i);if(r&&r.ensure){var s=r.ensure.from.line,u=r.ensure.to.line;s<a?(a=s,o=vn(t,En(Ze(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=o&&(a=vn(t,En(Ze(t,u))-e.wrapper.clientHeight),o=u)}return{from:a,to:Math.max(o,a+1)}}function $s(e,t){if(Pe(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&&!F){var a=v("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-r.viewOffset-ji(e.display))+`px;
|
|
height: `+(t.bottom-t.top+On(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 Ys(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(t=t.ch?Me(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Me(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,s=Cn(e,t),u=!r||r==t?s:Cn(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=ka(e,i),y=e.doc.scrollTop,S=e.doc.scrollLeft;if(d.scrollTop!=null&&(si(e,d.scrollTop),Math.abs(e.doc.scrollTop-y)>1&&(o=!0)),d.scrollLeft!=null&&(lr(e,d.scrollLeft),Math.abs(e.doc.scrollLeft-S)>1&&(o=!0)),!o)break}return i}function Js(e,t){var r=ka(e,t);r.scrollTop!=null&&si(e,r.scrollTop),r.scrollLeft!=null&&lr(e,r.scrollLeft)}function ka(e,t){var r=e.display,n=Tr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,a=fa(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+da(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 y=Math.min(t.top,(d?s:t.bottom)-a);y!=i&&(o.scrollTop=y)}var S=e.options.fixedGutter?0:r.gutters.offsetWidth,$=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-S,X=ir(e)-r.gutters.offsetWidth,me=t.right-t.left>X;return me&&(t.right=t.left+X),t.left<10?o.scrollLeft=0:t.left<$?o.scrollLeft=Math.max(0,t.left+S-(me?0:10)):t.right>X+$-3&&(o.scrollLeft=t.right+(me?0:10)-X),o}function Sa(e,t){if(t==null)return;zi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Or(e){zi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function oi(e,t,r){(t!=null||r!=null)&&zi(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function qs(e,t){zi(e),e.curOp.scrollToPos=t}function zi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=uo(e,t.from),n=uo(e,t.to);xo(e,r,n,t.margin)}}function xo(e,t,r,n){var i=ka(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});oi(e,i.scrollLeft,i.scrollTop)}function si(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;oe||_a(e,{top:t}),wo(e,t,!0),oe&&_a(e),ci(e,100)}function wo(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 lr(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,To(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function li(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+da(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+On(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var ur=function(e,t,r){this.cm=r;var n=this.vert=v("div",[v("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=v("div",[v("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),he(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),he(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,L&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ur.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}},ur.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ur.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ur.prototype.zeroWidthHack=function(){var e=ce&&!te?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new _,this.disableVert=new _},ur.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)},ur.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ui=function(){};ui.prototype.update=function(){return{bottom:0,right:0}},ui.prototype.setScrollLeft=function(){},ui.prototype.setScrollTop=function(){},ui.prototype.clear=function(){};function Lr(e,t){t||(t=li(e));var r=e.display.barWidth,n=e.display.barHeight;Eo(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Bi(e),Eo(e,li(e)),r=e.display.barWidth,n=e.display.barHeight}function Eo(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 Co={native:ur,null:ui};function ko(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&we(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Co[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(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"?lr(e,t):si(e,t)},e),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)}var Zs=0;function cr(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:++Zs},mn(e.curOp)}function dr(e){var t=e.curOp;t&&Rs(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;Qs(r)})}function Qs(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&&Ni(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 Hi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ta(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Bi(t),e.barMeasure=li(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=to(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+On(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-ir(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&&lr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==q();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Lr(t,e.barMeasure),e.updatedDisplay&&Oa(t,e.barMeasure),e.selectionChanged&&Ea(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&vo(e.cm)}function il(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&So(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&wo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&lr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Ys(t,dt(n,e.scrollToPos.from),dt(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var s=0;s<a.length;++s)a[s].lines.length||ye(a[s],"hide");if(o)for(var u=0;u<o.length;++u)o[u].lines.length&&ye(o[u],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ye(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function sn(e,t){if(e.curOp)return t();cr(e);try{return t()}finally{dr(e)}}function Bt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);cr(e);try{return t.apply(e,arguments)}finally{dr(e)}}}function Jt(e){return function(){if(this.curOp)return e.apply(this,arguments);cr(this);try{return e.apply(this,arguments)}finally{dr(this)}}}function Wt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);cr(t);try{return e.apply(this,arguments)}finally{dr(t)}}}function ci(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=bn(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?_n(t.mode,n.state):null,u=Gr(e,a,n,!0);s&&(n.state=s),a.styles=u.styles;var d=a.styleClasses,y=u.classes;y?a.styleClasses=y:d&&(a.styleClasses=null);for(var S=!o||o.length!=a.styles.length||d!=y&&(!d||!y||d.bgClass!=y.bgClass||d.textClass!=y.textClass),$=0;!S&&$<o.length;++$)S=o[$]!=a.styles[$];S&&i.push(n.line),a.stateAfter=n.save(),n.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Kr(e,a.text,n),a.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ci(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&sn(e,function(){for(var a=0;a<i.length;a++)Xn(e,i[a],"text")})}var Hi=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Wi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=ir(e),this.force=r,this.dims=ya(e),this.events=[]};Hi.prototype.signal=function(e,t){A(e,t)&&this.events.push(arguments)},Hi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ye.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=On(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=On(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=q();if(!t||!w(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&w(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==q())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(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 Ta(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Gn(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&&po(e)==0)return!1;_o(e)&&(Gn(e),t.dims=ya(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)),Yt&&(a=Zr(e.doc,a),o=Hn(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=En(Ze(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=po(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),fe(r.cursorDiv),fe(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ci(e,400)),r.updateLineNumbers=null,!0}function So(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==ir(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+da(e.display)-fa(e),r.top)}),t.visible=Wi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Wi(e.display,e.doc,r));if(!Ta(e,t))break;Bi(e);var i=li(e);ai(e),Lr(e,i),Oa(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 _a(e,t){var r=new Hi(e,t);if(Ta(e,r)){Bi(e),So(e,r);var n=li(e);ai(e),Lr(e,n),Oa(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(me){var _e=me.nextSibling;return P&&ce&&e.display.currentWheelTarget==me?me.style.display="none":me.parentNode.removeChild(me),_e}for(var u=n.view,d=n.viewFrom,y=0;y<u.length;y++){var S=u[y];if(!S.hidden)if(!S.node||S.node.parentNode!=a){var $=js(e,S,d,r);a.insertBefore($,o)}else{for(;o!=S.node;)o=s(o);var X=i&&t!=null&&t<=d&&S.lineNumber;S.changes&&(B(S.changes,"gutter")>-1&&(X=!1),$a(e,S,d,r)),X&&(fe(S.lineNumber),S.lineNumber.appendChild(document.createTextNode(mr(e.options,d)))),o=S.node.nextSibling}d+=S.size}for(;o;)o=s(o)}function Aa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oa(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+On(e)+"px"}function To(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=xa(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 _o(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=mr(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(v("div",[v("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",Aa(e.display),!0}return!1}function La(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 Ao(e){var t=e.gutters,r=e.gutterSpecs;fe(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(v("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",Aa(e)}function di(e){Ao(e.display),tn(e),To(e)}function cl(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=v("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=v("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=Q("div",null,"CodeMirror-code"),i.selectionDiv=v("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=v("div",null,"CodeMirror-cursors"),i.measure=v("div",null,"CodeMirror-measure"),i.lineMeasure=v("div",null,"CodeMirror-measure"),i.lineSpace=Q("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=Q("div",[i.lineSpace],"CodeMirror-lines");i.mover=v("div",[a],null,"position: relative"),i.sizer=v("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=v("div",null,null,"position: absolute; height: "+ue+"px; width: 1px;"),i.gutters=v("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=v("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=v("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),L&&W<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!P&&!(oe&&le)&&(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=La(n.gutters,n.lineNumbers),Ao(i),r.init(i)}var Xi=0,dn=null;L?dn=-.53:oe?dn=15:N?dn=-.7:ve&&(dn=-1/3);function Oo(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=Oo(e);return t.x*=dn,t.y*=dn,t}function Lo(e,t){var r=Oo(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&&ce&&P){e:for(var d=t.target,y=a.view;d!=o;d=d.parentNode)for(var S=0;S<y.length;S++)if(y[S].node==d){e.display.currentWheelTarget=d;break e}}if(n&&!oe&&!R&&dn!=null){i&&u&&si(e,Math.max(0,o.scrollTop+i*dn)),lr(e,Math.max(0,o.scrollLeft+n*dn)),(!i||i&&u)&&f(t),a.wheelStartX=null;return}if(i&&dn!=null){var $=i*dn,X=e.doc.scrollTop,me=X+a.wrapper.clientHeight;$<0?X=Math.max(0,X+$-50):me=Math.min(e.doc.height,me+$+50),_a(e,{top:X,bottom:me})}Xi<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 _e=o.scrollLeft-a.wheelStartX,je=o.scrollTop-a.wheelStartY,Be=je&&a.wheelDY&&je/a.wheelDY||_e&&a.wheelDX&&_e/a.wheelDX;if(a.wheelStartX=a.wheelStartY=null,!Be)return;dn=(dn*Xi+Be)/(Xi+1),++Xi},200)):(a.wheelDX+=n,a.wheelDY+=i))}var fn=function(e,t){this.ranges=e,this.primIndex=t};fn.prototype.primary=function(){return this.ranges[this.primIndex]},fn.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(!Xr(r.anchor,n.anchor)||!Xr(r.head,n.head))return!1}return!0},fn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ct(gr(this.ranges[t].anchor),gr(this.ranges[t].head));return new fn(e,this.primIndex)},fn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},fn.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(ut(t,n.from())>=0&&ut(e,n.to())<=0)return r}return-1};var Ct=function(e,t){this.anchor=e,this.head=t};Ct.prototype.from=function(){return Zn(this.anchor,this.head)},Ct.prototype.to=function(){return vr(this.anchor,this.head)},Ct.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function kn(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function($,X){return ut($.from(),X.from())}),r=B(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],u=ut(s.to(),o.from());if(n&&!o.empty()?u>0:u>=0){var d=Zn(s.from(),o.from()),y=vr(s.to(),o.to()),S=s.empty()?o.from()==o.head:s.from()==s.head;a<=r&&--r,t.splice(--a,2,new Ct(S?y:d,S?d:y))}}return new fn(t,r)}function Kn(e,t){return new fn([new Ct(e,t||e)],0)}function Vn(e){return e.text?Me(e.from.line+e.text.length-1,h(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ro(e,t){if(ut(e,t.from)<0)return e;if(ut(e,t.to)<=0)return Vn(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+=Vn(t).ch-t.to.ch),Me(r,n)}function Ra(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Ct(Ro(i.anchor,t),Ro(i.head,t)))}return kn(e.cm,r,e.sel.primIndex)}function Mo(e,t,r){return e.line==t.line?Me(r.line,e.ch-t.ch+r.ch):Me(r.line+(e.line-t.line),e.ch)}function fl(e,t,r){for(var n=[],i=Me(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],u=Mo(s.from,i,a),d=Mo(Vn(s),i,a);if(i=s.to,a=d,r=="around"){var y=e.sel.ranges[o],S=ut(y.head,y.anchor)<0;n[o]=new Ct(S?d:u,S?u:d)}else n[o]=new Ct(u,u)}return new fn(n,e.sel.primIndex)}function Ma(e){e.doc.mode=gn(e.options,e.doc.modeOption),fi(e)}function fi(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,ci(e,100),e.state.modeGen++,e.curOp&&tn(e)}function Do(e,t){return t.from.ch==0&&t.to.ch==0&&h(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Da(e,t,r,n){function i(Ge){return r?r[Ge]:null}function a(Ge,We,$e){ua(Ge,We,$e,n),Xt(Ge,"change",Ge,t)}function o(Ge,We){for(var $e=[],lt=Ge;lt<We;++lt)$e.push(new rr(d[lt],i(lt),n));return $e}var s=t.from,u=t.to,d=t.text,y=Ze(e,s.line),S=Ze(e,u.line),$=h(d),X=i(d.length-1),me=u.line-s.line;if(t.full)e.insert(0,o(0,d.length)),e.remove(d.length,e.size-d.length);else if(Do(e,t)){var _e=o(0,d.length-1);a(S,S.text,X),me&&e.remove(s.line,me),_e.length&&e.insert(s.line,_e)}else if(y==S)if(d.length==1)a(y,y.text.slice(0,s.ch)+$+y.text.slice(u.ch),X);else{var je=o(1,d.length-1);je.push(new rr($+y.text.slice(u.ch),X,n)),a(y,y.text.slice(0,s.ch)+d[0],i(0)),e.insert(s.line+1,je)}else if(d.length==1)a(y,y.text.slice(0,s.ch)+d[0]+S.text.slice(u.ch),i(0)),e.remove(s.line+1,me);else{a(y,y.text.slice(0,s.ch)+d[0],i(0)),a(S,$+S.text.slice(u.ch),X);var Be=o(1,d.length-1);me>1&&e.remove(s.line+1,me-1),e.insert(s.line+1,Be)}Xt(e,"change",e,t)}function $n(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 Po(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,wa(e),Ma(e),No(e),e.options.lineWrapping||Ni(e),e.options.mode=t.modeOption,tn(e)}function No(e){(e.doc.direction=="rtl"?U:we)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){sn(e,function(){No(e),tn(e)})}function Gi(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 Pa(e,t){var r={from:gr(t.from),to:Vn(t),text:Dn(e,t.from,t.to)};return Fo(e,r,t.from.line,t.to.line+1),$n(e,function(n){return Fo(n,r,t.from.line,t.to.line+1)},!0),r}function jo(e){for(;e.length;){var t=h(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return jo(e.done),h(e.done);if(e.done.length&&!h(e.done).ranges)return h(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),h(e.done)}function Io(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=h(o.changes),ut(t.from,t.to)==0&&ut(t.from,s.to)==0?s.to=Vn(t):o.changes.push(Pa(e,t));else{var u=h(i.done);for((!u||!u.ranges)&&Ki(e.sel,i.done),o={changes:[Pa(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||ye(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,h(i.done),t))?i.done[i.done.length-1]=t:Ki(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=r,n&&n.clearRedo!==!1&&jo(i.undone)}function Ki(e,t){var r=h(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fo(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 Uo(e,t){var r=bl(e,t),n=xr(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 Rr(e,t,r){for(var n=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){n.push(r?fn.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],y=void 0;if(s.push({from:d.from,to:d.to,text:d.text}),t)for(var S in d)(y=S.match(/^spans_(\d+)$/))&&(B(t,Number(y[1]))>-1&&(h(s)[S]=d[S],delete d[S]))}}return n}function Na(e,t,r,n){if(n){var i=e.anchor;if(r){var a=ut(t,i)<0;a!=ut(r,i)<0?(i=t,t=r):a!=ut(t,r)<0&&(t=r)}return new Ct(i,t)}else return new Ct(r||t,t)}function Vi(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Vt(e,new fn([Na(e.sel.primary(),t,r,i)],0),n)}function Bo(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]=Na(e.sel.ranges[a],t[a],null,i);var o=kn(e.cm,n,e.sel.primIndex);Vt(e,o,r)}function ja(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Vt(e,kn(e.cm,i,e.sel.primIndex),n)}function Wo(e,t,r,n){Vt(e,Kn(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 Ct(dt(e,i[a].anchor),dt(e,i[a].head))},origin:r&&r.origin};return ye(e,"beforeSelectionChange",e,n),e.cm&&ye(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?kn(e.cm,n.ranges,n.ranges.length-1):t}function zo(e,t,r){var n=e.history.done,i=h(n);i&&i.ranges?(n[n.length-1]=t,$i(e,t,r)):Vt(e,t,r)}function Vt(e,t,r){$i(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function $i(e,t,r){(A(e,"beforeSelectionChange")||e.cm&&A(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,r));var n=r&&r.bias||(ut(t.primary().head,e.sel.primary().head)<0?-1:1);Ho(e,Go(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&Or(e.cm)}function Ho(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,I(e.cm)),Xt(e,"cursorActivity",e)}function Xo(e){Ho(e,Go(e,e.sel,null,!1))}function Go(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=Yi(e,o.anchor,s&&s.anchor,r,n),d=Yi(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 Ct(u,d))}return i?kn(e.cm,i,t.primIndex):t}function Mr(e,t,r,n,i){var a=Ze(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,y="selectRight"in u?!u.selectRight:u.inclusiveRight;if((s.from==null||(d?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(y?s.to>=t.ch:s.to>t.ch))){if(i&&(ye(u,"beforeCursorEnter"),u.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!u.atomic)continue;if(r){var S=u.find(n<0?1:-1),$=void 0;if((n<0?y:d)&&(S=Ko(e,S,-n,S&&S.line==t.line?a:null)),S&&S.line==t.line&&($=ut(S,r))&&(n<0?$<0:$>0))return Mr(e,S,t,n,i)}var X=u.find(n<0?-1:1);return(n<0?d:y)&&(X=Ko(e,X,n,X.line==t.line?a:null)),X?Mr(e,X,t,n,i):null}}return t}function Yi(e,t,r,n,i){var a=n||1,o=Mr(e,t,r,a,i)||!i&&Mr(e,t,r,a,!0)||Mr(e,t,r,-a,i)||!i&&Mr(e,t,r,-a,!0);return o||(e.cantEdit=!0,Me(e.first,0))}function Ko(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?dt(e,Me(t.line-1)):null:r>0&&t.ch==(n||Ze(e,t.line)).text.length?t.line<e.first+e.size-1?Me(t.line+1,0):null:new Me(t.line,t.ch+r)}function Vo(e){e.setSelection(Me(e.firstLine(),0),Me(e.lastLine()),de)}function $o(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=dt(e,i)),a&&(n.to=dt(e,a)),o&&(n.text=o),s!==void 0&&(n.origin=s)}),ye(e,"beforeChange",e,n),e.cm&&ye(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 Dr(e,t,r){if(e.cm){if(!e.cm.curOp)return Bt(e.cm,Dr)(e,t,r);if(e.cm.state.suppressEdits)return}if((A(e,"beforeChange")||e.cm&&A(e.cm,"beforeChange"))&&(t=$o(e,t,!0),!t))return;var n=Jr&&!r&&Mi(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Yo(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Yo(e,t)}function Yo(e,t){if(t.text.length==1&&t.text[0]==""&&ut(t.from,t.to)==0)return;var r=Ra(e,t);Io(e,t,r,e.cm?e.cm.curOp.id:NaN),hi(e,t,r,xr(e,t));var n=[];$n(e,function(i,a){!a&&B(n,i.history)==-1&&(Qo(i.history,t),n.push(i.history)),hi(i,t,null,xr(i,t))})}function Ji(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(Ki(a,u),r&&!a.equals(e.sel)){Vt(e,a,{clearRedo:!1});return}o=a}else if(n){s.push(a);return}else break;var y=[];Ki(o,u),u.push({changes:y,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var S=A(e,"beforeChange")||e.cm&&A(e.cm,"beforeChange"),$=function(_e){var je=a.changes[_e];if(je.origin=t,S&&!$o(e,je,!1))return s.length=0,{};y.push(Pa(e,je));var Be=_e?Ra(e,je):h(s);hi(e,je,Be,Uo(e,je)),!_e&&e.cm&&e.cm.scrollIntoView({from:je.from,to:Vn(je)});var Ge=[];$n(e,function(We,$e){!$e&&B(Ge,We.history)==-1&&(Qo(We.history,je),Ge.push(We.history)),hi(We,je,null,Uo(We,je))})},X=a.changes.length-1;X>=0;--X){var me=$(X);if(me)return me.v}}function Jo(e,t){if(t==0)return;if(e.first+=t,e.sel=new fn(C(e.sel.ranges,function(i){return new Ct(Me(i.anchor.line+t,i.anchor.ch),Me(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){tn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Xn(e.cm,n,"gutter")}}function hi(e,t,r,n){if(e.cm&&!e.cm.curOp)return Bt(e.cm,hi)(e,t,r,n);if(t.to.line<e.first){Jo(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);Jo(e,i),t={from:Me(e.first,0),to:Me(t.to.line+i,t.to.ch),text:[h(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:Me(a,Ze(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Dn(e,t.from,t.to),r||(r=Ra(e,t)),e.cm?xl(e.cm,t,n):Da(e,t,n),$i(e,r,de),e.cantEdit&&Yi(e,Me(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=wt(cn(Ze(n,a.line))),n.iter(u,o.line+1,function(X){if(X==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&I(e),Da(n,t,r,ho(e)),e.options.lineWrapping||(n.iter(u,a.line+t.text.length,function(X){var me=ei(X);me>i.maxLineLength&&(i.maxLine=X,i.maxLineLength=me,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),aa(n,a.line),ci(e,400);var d=t.text.length-(o.line-a.line)-1;t.full?tn(e):a.line==o.line&&t.text.length==1&&!Do(e.doc,t)?Xn(e,a.line,"text"):tn(e,a.line,o.line+1,d);var y=A(e,"changes"),S=A(e,"change");if(S||y){var $={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};S&&Xt(e,"change",e,$),y&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push($)}e.display.selForContextMenu=null}function Pr(e,t,r,n,i){var a;n||(n=r),ut(n,r)<0&&(a=[n,r],r=a[0],n=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Dr(e,{from:r,to:n,text:t,origin:i})}function qo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Zo(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++)qo(a.ranges[s].anchor,t,r,n),qo(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=Me(d.from.line+n,d.from.ch),d.to=Me(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 Qo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Zo(e.done,r,n,i),Zo(e.undone,r,n,i)}function pi(e,t,r,n){var i=t,a=t;return typeof t=="number"?a=Ze(e,br(e,t)):i=wt(t),i==null?null:(n(a,i)&&e.cm&&Xn(e.cm,i,r),a)}function mi(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}mi.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,Qe(i),Xt(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 gi(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}gi.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 mi))){var s=[];this.collapse(s),this.children=[new mi(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 mi(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 gi(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=B(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new gi(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 vi=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};vi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=wt(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=ri(this);Zt(r,Math.max(0,r.height-a)),e&&(sn(e,function(){es(e,r,-a),Xn(e,n,"widget")}),Xt(e,"lineWidgetCleared",e,this,n))},vi.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=ri(this)-t;if(!i)return;An(this.doc,n)||Zt(n,n.height+i),r&&sn(r,function(){r.curOp.forceUpdate=!0,es(r,n,i),Xt(r,"lineWidgetChanged",r,e,wt(n))})},O(vi);function es(e,t,r){En(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Sa(e,r)}function wl(e,t,r,n){var i=new vi(e,r,n),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),pi(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&&!An(e,o)){var u=En(o)<e.scrollTop;Zt(o,o.height+ri(i)),u&&Sa(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Xt(a,"lineWidgetAdded",a,i,typeof t=="number"?t:wt(t)),i}var ts=0,Yn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ts};Yn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&cr(e),A(this,"clear")){var r=this.find();r&&Xt(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=wn(o.markedSpans,this);e&&!this.collapsed?Xn(e,wt(o),"text"):e&&(s.to!=null&&(i=wt(o)),s.from!=null&&(n=wt(o))),o.markedSpans=qr(o.markedSpans,s),s.from==null&&this.collapsed&&!An(this.doc,o)&&e&&Zt(o,Tr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var d=cn(this.lines[u]),y=ei(d);y>e.display.maxLineLength&&(e.display.maxLine=d,e.display.maxLineLength=y,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&tn(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xo(e.doc)),e&&Xt(e,"markerCleared",e,this,n,i),t&&dr(e),this.parent&&this.parent.clear()},Yn.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=wn(a.markedSpans,this);if(o.from!=null&&(r=Me(t?a:wt(a),o.from),e==-1))return r;if(o.to!=null&&(n=Me(t?a:wt(a),o.to),e==1))return n}return r&&{from:r,to:n}},Yn.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;sn(n,function(){var i=t.line,a=wt(t.line),o=ha(n,a);if(o&&(io(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!An(r.doc,i)&&r.height!=null){var s=r.height;r.height=null;var u=ri(r)-s;u&&Zt(i,i.height+u)}Xt(n,"markerChanged",n,e)})},Yn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||B(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Yn.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},O(Yn);function Nr(e,t,r,n,i){if(n&&n.shared)return El(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Bt(e.cm,Nr)(e,t,r,n,i);var a=new Yn(e,i),o=ut(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=Q("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Di(e,t.line,t,r,a)||t.line!=r.line&&Di(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");oa()}a.addToHistory&&Io(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(S){u&&a.collapsed&&!u.options.lineWrapping&&cn(S)==u.display.maxLine&&(d=!0),a.collapsed&&s!=t.line&&Zt(S,0),sa(S,new er(a,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),a.collapsed&&e.iter(t.line,r.line+1,function(S){An(e,S)&&Zt(S,0)}),a.clearOnEnter&&he(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(zn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++ts,a.atomic=!0),u){if(d&&(u.curOp.updateMaxLine=!0),a.collapsed)tn(u,t.line,r.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var y=t.line;y<=r.line;y++)Xn(u,y,"text");a.atomic&&Xo(u.doc),Xt(u,"markerAdded",u,a)}return a}var bi=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};bi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Xt(this,"clear")},bi.prototype.find=function(e,t){return this.primary.find(e,t)},O(bi);function El(e,t,r,n,i){n=l(n),n.shared=!1;var a=[Nr(e,t,r,n,i)],o=a[0],s=n.widgetNode;return $n(e,function(u){s&&(n.widgetNode=s.cloneNode(!0)),a.push(Nr(u,dt(u,t),dt(u,r),n,i));for(var d=0;d<u.linked.length;++d)if(u.linked[d].isParent)return;o=h(a)}),new bi(a,o)}function ns(e){return e.findMarks(Me(e.first,0),e.clipPos(Me(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(ut(a,o)){var s=Nr(e,a,o,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function kl(e){for(var t=function(n){var i=e[n],a=[i.primary.doc];$n(i.primary.doc,function(u){return a.push(u)});for(var o=0;o<i.markers.length;o++){var s=i.markers[o];B(a,s.doc)==-1&&(s.parent=null,i.markers.splice(o--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,nn=function(e,t,r,n,i){if(!(this instanceof nn))return new nn(e,t,r,n,i);r==null&&(r=0),gi.call(this,[new mi([new rr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=Me(r,0);this.sel=Kn(a),this.history=new Gi(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Da(this,{from:a,to:a,text:e}),Vt(this,Kn(a),de)};nn.prototype=pe(gi.prototype,{constructor:nn,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=pr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Wt(function(e){var t=Me(this.first,0),r=this.first+this.size-1;Dr(this,{from:t,to:Me(r,Ze(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&oi(this.cm,0,0),Vt(this,Kn(t),de)}),replaceRange:function(e,t,r,n){t=dt(this,t),r=r?dt(this,r):t,Pr(this,e,t,r,n)},getRange:function(e,t,r){var n=Dn(this,dt(this,e),dt(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(Pn(this,e))return Ze(this,e)},getLineNumber:function(e){return wt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ze(this,e)),cn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return dt(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:Wt(function(e,t,r){Wo(this,dt(this,typeof e=="number"?Me(e,t||0):e),null,r)}),setSelection:Wt(function(e,t,r){Wo(this,dt(this,e),dt(this,t||e),r)}),extendSelection:Wt(function(e,t,r){Vi(this,dt(this,e),t&&dt(this,t),r)}),extendSelections:Wt(function(e,t){Bo(this,Ne(this,e),t)}),extendSelectionsBy:Wt(function(e,t){var r=C(this.sel.ranges,e);Bo(this,Ne(this,r),t)}),setSelections:Wt(function(e,t,r){if(!e.length)return;for(var n=[],i=0;i<e.length;i++)n[i]=new Ct(dt(this,e[i].anchor),dt(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Vt(this,kn(this.cm,n,t),r)}),addSelection:Wt(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ct(dt(this,e),dt(this,t||e))),Vt(this,kn(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=Dn(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=Dn(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:Wt(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--)Dr(this,n[u]);s?zo(this,s):this.cm&&Or(this.cm)}),undo:Wt(function(){Ji(this,"undo")}),redo:Wt(function(){Ji(this,"redo")}),undoSelection:Wt(function(){Ji(this,"undo",!0)}),redoSelection:Wt(function(){Ji(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 Gi(this.history.maxGeneration),$n(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:Rr(this.history.done),undone:Rr(this.history.undone)}},setHistory:function(e){var t=this.history=new Gi(this.history.maxGeneration);t.done=Rr(e.done.slice(0),null,!0),t.undone=Rr(e.undone.slice(0),null,!0)},setGutterMarker:Wt(function(e,t,r){return pi(this,e,"gutter",function(n){var i=n.gutterMarkers||(n.gutterMarkers={});return i[t]=r,!r&&Re(i)&&(n.gutterMarkers=null),!0})}),clearGutter:Wt(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&pi(t,r,"gutter",function(){return r.gutterMarkers[e]=null,Re(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Pn(this,e))return null;if(t=e,e=Ze(this,e),!e)return null}else if(t=wt(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:Wt(function(e,t,r){return pi(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(xe(r).test(n[i]))return!1;n[i]+=" "+r}return!0})}),removeLineClass:Wt(function(e,t,r){return pi(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(xe(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:Wt(function(e,t,r){return wl(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Nr(this,dt(this,e),dt(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=dt(this,e),Nr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=dt(this,e);var t=[],r=Ze(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=dt(this,e),t=dt(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}),dt(this,Me(r,t))},indexFromPos:function(e){e=dt(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 nn(pr(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 nn(pr(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,ns(this)),n},unlinkDoc:function(e){if(e instanceof Ot&&(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),kl(ns(this));break}if(e.history==this.history){var n=[e.id];$n(e,function(i){return n.push(i.id)},!0),e.history=new Gi(null),e.history.done=Rr(this.history.done,n),e.history.undone=Rr(this.history.undone,n)}},iterLinkedDocs:function(e){$n(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ht(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Wt(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)})}),nn.prototype.eachLine=nn.prototype.iter;var rs=0;function Tl(e){var t=this;if(is(t),Pe(t,e)||Un(t.display,e))return;f(e),L&&(rs=+new Date);var r=or(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&&Bt(t,function(){r=dt(t.doc,r);var X={from:r,to:r,text:t.doc.splitLines(a.filter(function(me){return me!=null}).join(t.doc.lineSeparator())),origin:"paste"};Dr(t.doc,X),zo(t.doc,Kn(dt(t.doc,r),dt(t.doc,Vn(X))))})()},u=function(X,me){if(t.options.allowDropFileTypes&&B(t.options.allowDropFileTypes,X.type)==-1){s();return}var _e=new FileReader;_e.onerror=function(){return s()},_e.onload=function(){var je=_e.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(je)){s();return}a[me]=je,s()},_e.readAsText(X)},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 y=e.dataTransfer.getData("Text");if(y){var S;if(t.state.draggingText&&!t.state.draggingText.copy&&(S=t.listSelections()),$i(t.doc,Kn(r,r)),S)for(var $=0;$<S.length;++$)Pr(t.doc,"",S[$].anchor,S[$].head,"drag");t.replaceSelection(y,"around","paste"),t.display.input.focus()}}catch(X){}}}function _l(e,t){if(L&&(!e.state.draggingText||+new Date-rs<100)){k(t);return}if(Pe(e,t)||Un(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ve){var r=v("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",R&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),R&&r.parentNode.removeChild(r)}}function Al(e,t){var r=or(e,t);if(!r)return;var n=document.createDocumentFragment();go(e,r,n),e.display.dragCursor||(e.display.dragCursor=v("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ne(e.display.dragCursor,n)}function is(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function as(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 os=!1;function Ol(){if(os)return;Ll(),os=!0}function Ll(){var e;he(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,as(Rl)},100))}),he(window,"blur",function(){return as(Ar)})}function Rl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Jn={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"},yi=0;yi<10;yi++)Jn[yi+48]=Jn[yi+96]=String(yi);for(var qi=65;qi<=90;qi++)Jn[qi]=String.fromCharCode(qi);for(var xi=1;xi<=12;xi++)Jn[xi+111]=Jn[xi+63235]="F"+xi;var Bn={};Bn.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"},Bn.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"},Bn.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"},Bn.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"]},Bn.default=ce?Bn.macDefault:Bn.pcDefault;function Ml(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 Dl(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=C(r.split(" "),Ml),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 jr(e,t,r,n){t=Zi(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 jr(e,t.fallthrough,r,n);for(var a=0;a<t.fallthrough.length;a++){var o=jr(e,t.fallthrough[a],r,n);if(o)return o}}}function ss(e){var t=typeof e=="string"?e:Jn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ls(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(De?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(De?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function us(e,t){if(R&&e.keyCode==34&&e.char)return!1;var r=Jn[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),ls(r,e,t))}function Zi(e){return typeof e=="string"?Bn[e]:e}function Ir(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var a=t(r[i]);n.length&&ut(a.from,h(n).to)<=0;){var o=n.pop();if(ut(o.from,a.from)<0){a.from=o.from;break}}n.push(a)}sn(e,function(){for(var s=n.length-1;s>=0;s--)Pr(e.doc,"",n[s].from,n[s].to,"+delete");Or(e)})}function Ia(e,t,r){var n=Ee(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Fa(e,t,r){var n=Ia(e,t.ch,r);return n==null?null:new Me(t.line,n,r<0?"after":"before")}function Ua(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=rt(r,t.doc.direction);if(a){var o=i<0?h(a):a[0],s=i<0==(o.level==1),u=s?"after":"before",d;if(o.level>0||t.doc.direction=="rtl"){var y=Sr(t,r);d=i<0?r.text.length-1:0;var S=Ln(t,y,d).top;d=Ue(function($){return Ln(t,y,$).top==S},i<0==(o.level==1)?o.from:o.to-1,d),u=="before"&&(d=Ia(r,d,1))}else d=i<0?o.to:o.from;return new Me(n,d,u)}}return new Me(n,i<0?r.text.length:0,i<0?"before":"after")}function Pl(e,t,r,n){var i=rt(t,e.doc.direction);if(!i)return Fa(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=Ve(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 Fa(t,r,n);var s=function(Be,Ge){return Ia(t,Be instanceof Me?Be.ch:Be,Ge)},u,d=function(Be){return e.options.lineWrapping?(u=u||Sr(e,t),fo(e,t,u,Be)):{begin:0,end:t.text.length}},y=d(r.sticky=="before"?s(r,-1):r.ch);if(e.doc.direction=="rtl"||o.level==1){var S=o.level==1==n<0,$=s(r,S?1:-1);if($!=null&&(S?$<=o.to&&$<=y.end:$>=o.from&&$>=y.begin)){var X=S?"before":"after";return new Me(r.line,$,X)}}var me=function(Be,Ge,We){for(var $e=function(At,zt){return zt?new Me(r.line,s(At,1),"before"):new Me(r.line,At,"after")};Be>=0&&Be<i.length;Be+=Ge){var lt=i[Be],nt=Ge>0==(lt.level!=1),pt=nt?We.begin:s(We.end,-1);if(lt.from<=pt&&pt<lt.to)return $e(pt,nt);if(pt=nt?lt.from:s(lt.to,-1),We.begin<=pt&&pt<We.end)return $e(pt,nt)}},_e=me(a+n,n,y);if(_e)return _e;var je=n>0?y.end:s(y.begin,-1);return je!=null&&!(n>0&&je==t.text.length)&&(_e=me(n>0?0:i.length-1,n,d(je)),_e)?_e:null}var wi={selectAll:Vo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return Ir(e,function(t){if(t.empty()){var r=Ze(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Me(t.head.line+1,0)}:{from:t.head,to:Me(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ir(e,function(t){return{from:Me(t.from().line,0),to:dt(e.doc,Me(t.to().line+1,0))}})},delLineLeft:function(e){return Ir(e,function(t){return{from:Me(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ir(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 Ir(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(Me(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Me(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return cs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},G)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},G)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?ds(e,t.head):n},G)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"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=m(e.getLine(a.line),a.ch,n);t.push(J(n-o%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return sn(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=Ze(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new Me(i.line,i.ch-1)),i.ch>0)i=new Me(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),Me(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=Ze(e.doc,i.line-1).text;o&&(i=new Me(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),Me(i.line-1,o.length-1),i,"+transpose"))}}r.push(new Ct(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return sn(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);Or(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function cs(e,t){var r=Ze(e.doc,t),n=cn(r);return n!=r&&(t=wt(n)),Ua(!0,e,n,t,1)}function Nl(e,t){var r=Ze(e.doc,t),n=Pi(r);return n!=r&&(t=wt(n)),Ua(!0,e,r,t,-1)}function ds(e,t){var r=cs(e,t.line),n=Ze(e.doc,r.line),i=rt(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 Me(r.line,o?0:a,r.sticky)}return r}function Qi(e,t,r){if(typeof t=="string"&&(t=wi[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)!=Ae}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=jr(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&jr(t,e.options.extraKeys,r,e)||jr(t,e.options.keyMap,r,e)}var Il=new _;function Ei(e,t,r,n){var i=e.state.keySeq;if(i){if(ss(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Il.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),fs(e,i+" "+t,r,n))return!0}return fs(e,t,r,n)}function fs(e,t,r,n){var i=jl(e,t,n);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Xt(e,"keyHandled",e,t,r),(i=="handled"||i=="multi")&&(f(r),Ea(e)),!!i}function hs(e,t){var r=us(t,!0);return r?t.shiftKey&&!e.state.keySeq?Ei(e,"Shift-"+r,t,function(n){return Qi(e,n,!0)})||Ei(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Qi(e,n)}):Ei(e,r,t,function(n){return Qi(e,n)}):!1}function Fl(e,t,r){return Ei(e,"'"+r+"'",t,function(n){return Qi(e,n,!0)})}var Ba=null;function ps(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=q(),Pe(t,e))return;L&&W<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=hs(t,e);R&&(Ba=n?r:null,!n&&r==88&&!Tt&&(ce?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),oe&&!ce&&!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;U(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(we(t,"CodeMirror-crosshair"),qe(document,"keyup",r),qe(document,"mouseover",r))}he(document,"keyup",r),he(document,"mouseover",r)}function ms(e){e.keyCode==16&&(this.doc.sel.shift=!1),Pe(this,e)}function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Un(t.display,e)||Pe(t,e)||e.ctrlKey&&!e.altKey||ce&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(R&&r==Ba){Ba=null,f(e);return}if(R&&(!e.which||e.which<10)&&hs(t,e))return;var i=String.fromCharCode(n==null?r:n);if(i=="\b")return;if(Fl(t,e,i))return;t.display.input.onKeyPress(e)}var Bl=400,Wa=function(e,t,r){this.time=e,this.pos=t,this.button=r};Wa.prototype.compare=function(e,t,r){return this.time+Bl>e&&ut(t,this.pos)==0&&r==this.button};var Ci,ki;function Wl(e,t){var r=+new Date;return ki&&ki.compare(r,e,t)?(Ci=ki=null,"triple"):Ci&&Ci.compare(r,e,t)?(ki=new Wa(r,e,t),Ci=null,"double"):(Ci=new Wa(r,e,t),ki=null,"single")}function vs(e){var t=this,r=t.display;if(Pe(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,Un(r,e)){P||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(za(t,e))return;var n=or(t,e),i=ae(e),a=n?Wl(n,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,i,n,a,e))return;i==1?n?Xl(t,n,a,e):D(e)==r.scroller&&f(e):i==2?(n&&Vi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(Fe?t.display.input.onContextMenu(e):bo(t))}function zl(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,Ei(e,ls(a,i),i,function(o){if(typeof o=="string"&&(o=wi[o]),!o)return!1;var s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=o(e,r)!=Ae}finally{e.state.suppressEdits=!1}return s})}function Hl(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var a=Oe?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=ce?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(ce?r.altKey:r.ctrlKey)),i}function Xl(e,t,r,n){L?setTimeout(c(vo,e),0):e.curOp.focus=q();var i=Hl(e,r,n),a=e.doc.sel,o;e.options.dragDrop&&Te&&!e.isReadOnly()&&r=="single"&&(o=a.contains(t))>-1&&(ut((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(ut(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=Bt(e,function(d){P&&(i.scroller.draggable=!1),e.state.draggingText=!1,qe(i.wrapper.ownerDocument,"mouseup",o),qe(i.wrapper.ownerDocument,"mousemove",s),qe(i.scroller,"dragstart",u),qe(i.scroller,"drop",o),a||(f(d),n.addNew||Vi(e.doc,r,null,null,n.extend),P&&!ve||L&&W==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};P&&(i.scroller.draggable=!0),e.state.draggingText=o,o.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),he(i.wrapper.ownerDocument,"mouseup",o),he(i.wrapper.ownerDocument,"mousemove",s),he(i.scroller,"dragstart",u),he(i.scroller,"drop",o),bo(e),setTimeout(function(){return i.input.focus()},20)}function bs(e,t,r){if(r=="char")return new Ct(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Ct(Me(t.line,0),dt(e.doc,Me(t.line+1,0)));var n=r(e,t);return new Ct(n.from,n.to)}function Kl(e,t,r,n){var i=e.display,a=e.doc;f(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 Ct(r,r)):(o=a.sel.primary(),s=a.sel.primIndex),n.unit=="rectangle")n.addNew||(o=new Ct(r,r)),r=or(e,t,!0,!0),s=-1;else{var y=bs(e,r,n.unit);n.extend?o=Na(o,y.anchor,y.head,n.extend):o=y}n.addNew?s==-1?(s=d.length,Vt(a,kn(e,d.concat([o]),s),{scroll:!1,origin:"*mouse"})):d.length>1&&d[s].empty()&&n.unit=="char"&&!n.extend?(Vt(a,kn(e,d.slice(0,s).concat(d.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=a.sel):ja(a,s,o,ie):(s=0,Vt(a,new fn([o],0),ie),u=a.sel);var S=r;function $(We){if(ut(S,We)==0)return;if(S=We,n.unit=="rectangle"){for(var $e=[],lt=e.options.tabSize,nt=m(Ze(a,r.line).text,r.ch,lt),pt=m(Ze(a,We.line).text,We.ch,lt),At=Math.min(nt,pt),zt=Math.max(nt,pt),Lt=Math.min(r.line,We.line),ln=Math.min(e.lastLine(),Math.max(r.line,We.line));Lt<=ln;Lt++){var rn=Ze(a,Lt).text,Pt=Z(rn,At,lt);At==zt?$e.push(new Ct(Me(Lt,Pt),Me(Lt,Pt))):rn.length>Pt&&$e.push(new Ct(Me(Lt,Pt),Me(Lt,Z(rn,zt,lt))))}$e.length||$e.push(new Ct(r,r)),Vt(a,kn(e,u.ranges.slice(0,s).concat($e),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(We)}else{var an=o,Gt=bs(e,We,n.unit),Ft=an.anchor,Nt;ut(Gt.anchor,Ft)>0?(Nt=Gt.head,Ft=Zn(an.from(),Gt.anchor)):(Nt=Gt.anchor,Ft=vr(an.to(),Gt.head));var Mt=u.ranges.slice(0);Mt[s]=Vl(e,new Ct(dt(a,Ft),Nt)),Vt(a,kn(e,Mt,s),ie)}}var X=i.wrapper.getBoundingClientRect(),me=0;function _e(We){var $e=++me,lt=or(e,We,!0,n.unit=="rectangle");if(!lt)return;if(ut(lt,S)!=0){e.curOp.focus=q(),$(lt);var nt=Wi(i,a);(lt.line>=nt.to||lt.line<nt.from)&&setTimeout(Bt(e,function(){me==$e&&_e(We)}),150)}else{var pt=We.clientY<X.top?-20:We.clientY>X.bottom?20:0;pt&&setTimeout(Bt(e,function(){if(me!=$e)return;i.scroller.scrollTop+=pt,_e(We)}),50)}}function je(We){e.state.selectingText=!1,me=Infinity,We&&(f(We),i.input.focus()),qe(i.wrapper.ownerDocument,"mousemove",Be),qe(i.wrapper.ownerDocument,"mouseup",Ge),a.history.lastSelOrigin=null}var Be=Bt(e,function(We){We.buttons===0||!ae(We)?je(We):_e(We)}),Ge=Bt(e,je);e.state.selectingText=Ge,he(i.wrapper.ownerDocument,"mousemove",Be),he(i.wrapper.ownerDocument,"mouseup",Ge)}function Vl(e,t){var r=t.anchor,n=t.head,i=Ze(e.doc,r.line);if(ut(r,n)==0&&r.sticky==n.sticky)return t;var a=rt(i);if(!a)return t;var o=Ve(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 y=Ve(a,n.ch,n.sticky),S=y-o||(n.ch-r.ch)*(s.level==1?-1:1);y==u-1||y==u?d=S<0:d=S>0}var $=a[u+(d?-1:0)],X=d==($.level==1),me=X?$.from:$.to,_e=X?"after":"before";return r.ch==me&&r.sticky==_e?t:new Ct(new Me(r.line,me,_e),n)}function ys(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($){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&f(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!A(e,r))return b(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 y=vn(e.doc,a),S=e.display.gutterSpecs[u];return ye(e,r,e,y,S.className,t),b(t)}}}function za(e,t){return ys(e,t,"gutterClick",!0)}function xs(e,t){if(Un(e.display,t)||$l(e,t))return;if(Pe(e,t,"contextmenu"))return;Fe||e.display.input.onContextMenu(t)}function $l(e,t){return A(e,"gutterContextMenu")?ys(e,t,"gutterContextMenu",!1):!1}function ws(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ii(e)}var Fr={toString:function(){return"CodeMirror.Init"}},Es={},ea={};function Yl(e){var t=e.optionHandlers;function r(n,i,a,o){e.defaults[n]=i,a&&(t[n]=o?function(s,u,d){d!=Fr&&a(s,u,d)}:a)}e.defineOption=r,e.Init=Fr,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,Ma(n)},!0),r("indentUnit",2,Ma,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){fi(n),ii(n),tn(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 y=u.text.indexOf(i,d);if(y==-1)break;d=y+i.length,a.push(Me(o,y))}o++});for(var s=a.length-1;s>=0;s--)Pr(n.doc,i,a[s],Me(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!=Fr&&n.refresh()}),r("specialCharPlaceholder",_t,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",le?"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",!Xe),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){ws(n),di(n)},!0),r("keyMap","default",function(n,i,a){var o=Zi(i),s=a!=Fr&&Zi(a);s&&s.detach&&s.detach(n,o),o.attach&&o.attach(n,s||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,ql,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=La(i,n.options.lineNumbers),di(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?xa(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Lr(n)},!0),r("scrollbarStyle","native",function(n){ko(n),Lr(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=La(n.options.gutters,i),di(n)},!0),r("firstLineNumber",1,di,!0),r("lineNumberFormatter",function(n){return n},di,!0),r("showCursorWhenSelecting",!1,ai,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(Ar(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,ai,!0),r("singleCursorHeightPerLine",!0,ai,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,fi,!0),r("addModeClass",!1,fi,!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,fi,!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!=Fr;if(!t!=!n){var i=e.display.dragFunctions,a=t?he:qe;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 ql(e){e.options.lineWrapping?(U(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(we(e.display.wrapper,"CodeMirror-wrap"),Ni(e)),wa(e),tn(e),ii(e),setTimeout(function(){return Lr(e)},100)}function Ot(e,t){var r=this;if(!(this instanceof Ot))return new Ot(e,t);this.options=t=t?l(t):{},l(Es,t,!1);var n=t.value;typeof n=="string"?n=new nn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Ot.inputStyles[t.inputStyle](this),a=this.display=new cl(e,n,i,t);a.wrapper.CodeMirror=this,ws(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ko(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 _,keySeq:null,specialChars:null},t.autofocus&&!le&&a.input.focus(),L&&W<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Zl(this),Ol(),cr(this),this.curOp.forceUpdate=!0,Po(this,n),t.autofocus&&!le||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ca(r)},20):Ar(this);for(var o in ea)ea.hasOwnProperty(o)&&ea[o](this,t[o],Fr);_o(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Ha.length;++s)Ha[s](this);dr(this),P&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}Ot.defaults=Es,Ot.optionHandlers=ea;function Zl(e){var t=e.display;he(t.scroller,"mousedown",Bt(e,vs)),L&&W<11?he(t.scroller,"dblclick",Bt(e,function(u){if(Pe(e,u))return;var d=or(e,u);if(!d||za(e,u)||Un(e.display,u))return;f(u);var y=e.findWordAt(d);Vi(e.doc,y.anchor,y.head)})):he(t.scroller,"dblclick",function(u){return Pe(e,u)||f(u)}),he(t.scroller,"contextmenu",function(u){return xs(e,u)}),he(t.input.getField(),"contextmenu",function(u){t.scroller.contains(u.target)||xs(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 y=d.left-u.left,S=d.top-u.top;return y*y+S*S>20*20}he(t.scroller,"touchstart",function(u){if(!Pe(e,u)&&!a(u)&&!za(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)}}),he(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),he(t.scroller,"touchend",function(u){var d=t.activeTouch;if(d&&!Un(t,u)&&d.left!=null&&!d.moved&&new Date-d.start<300){var y=e.coordsChar(t.activeTouch,"page"),S;!d.prev||o(d,d.prev)?S=new Ct(y,y):!d.prev.prev||o(d,d.prev.prev)?S=e.findWordAt(y):S=new Ct(Me(y.line,0),dt(e.doc,Me(y.line+1,0))),e.setSelection(S.anchor,S.head),e.focus(),f(u)}i()}),he(t.scroller,"touchcancel",i),he(t.scroller,"scroll",function(){t.scroller.clientHeight&&(si(e,t.scroller.scrollTop),lr(e,t.scroller.scrollLeft,!0),ye(e,"scroll",e))}),he(t.scroller,"mousewheel",function(u){return Lo(e,u)}),he(t.scroller,"DOMMouseScroll",function(u){return Lo(e,u)}),he(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(u){Pe(e,u)||k(u)},over:function(u){Pe(e,u)||(Al(e,u),k(u))},start:function(u){return _l(e,u)},drop:Bt(e,Tl),leave:function(u){Pe(e,u)||is(e)}};var s=t.input.getField();he(s,"keyup",function(u){return ms.call(e,u)}),he(s,"keydown",Bt(e,ps)),he(s,"keypress",Bt(e,gs)),he(s,"focus",function(u){return Ca(e,u)}),he(s,"blur",function(u){return Ar(e,u)})}var Ha=[];Ot.defineInitHook=function(e){return Ha.push(e)};function Si(e,t,r,n){var i=e.doc,a;r==null&&(r="add"),r=="smart"&&(i.mode.indent?a=bn(e,t).state:r="prev");var o=e.options.tabSize,s=Ze(i,t),u=m(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var d=s.text.match(/^\s*/)[0],y;if(!n&&!/\S/.test(s.text))y=0,r="not";else if(r=="smart"&&(y=i.mode.indent(a,s.text.slice(d.length),s.text),y==Ae||y>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?y=m(Ze(i,t-1).text,null,o):y=0:r=="add"?y=u+e.options.indentUnit:r=="subtract"?y=u-e.options.indentUnit:typeof r=="number"&&(y=u+r),y=Math.max(0,y);var S="",$=0;if(e.options.indentWithTabs)for(var X=Math.floor(y/o);X;--X)$+=o,S+=" ";if($<y&&(S+=J(y-$)),S!=d)return Pr(i,S,Me(t,0),Me(t,d.length),"+input"),s.stateAfter=null,!0;for(var me=0;me<i.sel.ranges.length;me++){var _e=i.sel.ranges[me];if(_e.head.line==t&&_e.head.ch<d.length){var je=Me(t,d.length);ja(i,me,new Ct(je,je));break}}}var Sn=null;function ta(e){Sn=e}function Xa(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=ht(t),d=null;if(s&&n.ranges.length>1)if(Sn&&Sn.text.join(`
|
|
`)==t){if(n.ranges.length%Sn.text.length==0){d=[];for(var y=0;y<Sn.text.length;y++)d.push(a.splitLines(Sn.text[y]))}}else u.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(d=C(u,function(Be){return[Be]}));for(var S=e.curOp.updateInput,$=n.ranges.length-1;$>=0;$--){var X=n.ranges[$],me=X.from(),_e=X.to();X.empty()&&(r&&r>0?me=Me(me.line,me.ch-r):e.state.overwrite&&!s?_e=Me(_e.line,Math.min(Ze(a,_e.line).text.length,_e.ch+h(u).length)):s&&Sn&&Sn.lineWise&&Sn.text.join(`
|
|
`)==u.join(`
|
|
`)&&(me=_e=Me(me.line,0)));var je={from:me,to:_e,text:d?d[$%d.length]:u,origin:i||(s?"paste":e.state.cutIncoming>o?"cut":"+input")};Dr(e.doc,je),Xt(e,"inputRead",e,je)}t&&!s&&ks(e,t),Or(e),e.curOp.updateInput<2&&(e.curOp.updateInput=S),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Cs(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&sn(t,function(){return Xa(t,r,0,null,"paste")}),!0}function ks(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=Si(e,i.head.line,"smart");break}}else a.electricInput&&(a.electricInput.test(Ze(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=Si(e,i.head.line,"smart")));o&&Xt(e,"electricInput",e,i.head.line)}}function Ss(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:Me(i,0),head:Me(i+1,0)};r.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:r}}function Ts(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function _s(){var e=v("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=v("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return P?e.style.width="1000px":e.setAttribute("wrap","off"),z&&(e.style.border="1px solid black"),Ts(e),t}function Ql(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)&&Bt(this,t[n])(this,i,o),ye(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"](Zi(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:Jt(function(n,i){var a=n.token?n:e.getMode(this.options,n);if(a.startState)throw new Error("Overlays may not be stateful.");g(this.state.overlays,{mode:a,modeSpec:n,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,tn(this)}),removeOverlay:Jt(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++,tn(this);return}}}),indentLine:Jt(function(n,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Pn(this.doc,n)&&Si(this,n,i,a)}),indentSelection:Jt(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&&(Si(this,s.head.line,n,!0),a=s.head.line,o==this.doc.sel.primIndex&&Or(this));else{var u=s.from(),d=s.to(),y=Math.max(a,u.line);a=Math.min(this.lastLine(),d.line-(d.ch?0:1))+1;for(var S=y;S<a;++S)Si(this,S,n);var $=this.doc.sel.ranges;u.ch==0&&i.length==$.length&&$[o].from().ch>0&&ja(this.doc,o,new Ct(u,$[o].to()),de)}}}),getTokenAt:function(n,i){return _i(this,n,i)},getLineTokens:function(n,i){return _i(this,Me(n),i,!0)},getTokenTypeAt:function(n){n=dt(this.doc,n);var i=Qn(this,Ze(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 y=u?u.indexOf("overlay "):-1;return y<0?u:y==0?null:u.slice(0,y-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 y=0;y<o._global.length;y++){var S=o._global[y];S.pred(s,this)&&B(a,S.val)==-1&&a.push(S.val)}return a},getStateAfter:function(n,i){var a=this.doc;return n=br(a,n==null?a.first+a.size-1:n),bn(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=dt(this.doc,n):a=n?o.from():o.to(),Cn(this,a,i||"page")},charCoords:function(n,i){return ma(this,dt(this.doc,n),i||"page")},coordsChar:function(n,i){return n=lo(this,n,i||"page"),va(this,n.left,n.top)},lineAtHeight:function(n,i){return n=lo(this,{top:n,left:0},i||"page").top,vn(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=Ze(this.doc,n)}else s=n;return Ii(this,s,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-En(s):0)},defaultTextHeight:function(){return Tr(this.display)},defaultCharWidth:function(){return _r(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=Cn(this,dt(this.doc,n));var d=n.bottom,y=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 S=Math.max(u.wrapper.clientHeight,this.doc.height),$=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);(o=="above"||n.bottom+i.offsetHeight>S)&&n.top>i.offsetHeight?d=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=S&&(d=n.bottom),y+i.offsetWidth>$&&(y=$-i.offsetWidth)}i.style.top=d+"px",i.style.left=i.style.right="",s=="right"?(y=u.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(s=="left"?y=0:s=="middle"&&(y=(u.sizer.clientWidth-i.offsetWidth)/2),i.style.left=y+"px"),a&&Js(this,{left:y,top:d,right:y+i.offsetWidth,bottom:d+i.offsetHeight})},triggerOnKeyDown:Jt(ps),triggerOnKeyPress:Jt(gs),triggerOnKeyUp:ms,triggerOnMouseDown:Jt(vs),execCommand:function(n){if(wi.hasOwnProperty(n))return wi[n].call(null,this)},triggerElectric:Jt(function(n){ks(this,n)}),findPosH:function(n,i,a,o){var s=1;i<0&&(s=-1,i=-i);for(var u=dt(this.doc,n),d=0;d<i&&!(u=Ga(this.doc,u,s,a,o),u.hitSide);++d);return u},moveH:Jt(function(n,i){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?Ga(a.doc,o.head,n,i,a.options.rtlMoveVisually):n<0?o.from():o.to()},G)}),deleteH:Jt(function(n,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):Ir(this,function(s){var u=Ga(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=dt(this.doc,n),y=0;y<i;++y){var S=Cn(this,d,"div");if(u==null?u=S.left:S.left=u,d=As(this,S,s,a),d.hitSide)break}return d},moveV:Jt(function(n,i){var a=this,o=this.doc,s=[],u=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(y){if(u)return n<0?y.from():y.to();var S=Cn(a,y.head,"div");y.goalColumn!=null&&(S.left=y.goalColumn),s.push(S.left);var $=As(a,S,n,i);return i=="page"&&y==o.sel.primary()&&Sa(a,ma(a,$,"div").top-S.top),$},G),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=Ze(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),y=ke(d,u)?function(S){return ke(S,u)}:/\s/.test(d)?function(S){return/\s/.test(S)}:function(S){return!/\s/.test(S)&&!ke(S)};o>0&&y(a.charAt(o-1));)--o;for(;s<a.length&&y(a.charAt(s));)++s}return new Ct(Me(n.line,o),Me(n.line,s))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?U(this.display.cursorDiv,"CodeMirror-overwrite"):we(this.display.cursorDiv,"CodeMirror-overwrite"),ye(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==q()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Jt(function(n,i){oi(this,n,i)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-On(this)-this.display.barHeight,width:n.scrollWidth-On(this)-this.display.barWidth,clientHeight:fa(this),clientWidth:ir(this)}},scrollIntoView:Jt(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:Me(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?qs(this,n):xo(this,n.from,n.to,n.margin)}),setSize:Jt(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&&ao(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){Xn(a,s,"widget");break}}++s}),this.curOp.forceUpdate=!0,ye(this,"refresh",this)}),operation:function(n){return sn(this,n)},startOperation:function(){return cr(this)},endOperation:function(){return dr(this)},refresh:Jt(function(){var n=this.display.cachedTextHeight;tn(this),this.curOp.forceUpdate=!0,ii(this),oi(this,this.doc.scrollLeft,this.doc.scrollTop),Aa(this.display),(n==null||Math.abs(n-Tr(this.display))>.5||this.options.lineWrapping)&&wa(this),ye(this,"refresh",this)}),swapDoc:Jt(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Po(this,n),ii(this),this.display.input.reset(),oi(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Xt(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}},O(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 Ga(e,t,r,n,i){var a=t,o=r,s=Ze(e,t.line),u=i&&e.direction=="rtl"?-r:r;function d(){var Ge=t.line+u;return Ge<e.first||Ge>=e.first+e.size?!1:(t=new Me(Ge,t.ch,t.sticky),s=Ze(e,Ge))}function y(Ge){var We;if(n=="codepoint"){var $e=s.text.charCodeAt(t.ch+(n>0?0:-1));isNaN($e)?We=null:We=new Me(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*($e>=55296&&$e<56320?2:1))),-r)}else i?We=Pl(e.cm,s,t,r):We=Fa(s,t,r);if(We==null)if(!Ge&&d())t=Ua(i,e.cm,s,t.line,u);else return!1;else t=We;return!0}if(n=="char"||n=="codepoint")y();else if(n=="column")y(!0);else if(n=="word"||n=="group")for(var S=null,$=n=="group",X=e.cm&&e.cm.getHelper(t,"wordChars"),me=!0;!(r<0&&!y(!me));me=!1){var _e=s.text.charAt(t.ch)||`
|
|
`,je=ke(_e,X)?"w":$&&_e==`
|
|
`?"n":!$||/\s/.test(_e)?null:"p";if($&&!me&&!je&&(je="s"),S&&S!=je){r<0&&(r=1,y(),t.sticky="after");break}if(je&&(S=je),r>0&&!y(!me))break}var Be=Yi(e,t,a,o,!0);return Xr(a,Be)&&(Be.hitSide=!0),Be}function As(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*Tr(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=va(e,a,o),!d.outside);){if(r<0?o<=0:o>=i.height){d.hitSide=!0;break}o+=r*5}return d}var St=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new _,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};St.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;Ts(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}he(i,"paste",function(s){if(!a(s)||Pe(n,s)||Cs(s,n))return;W<=11&&setTimeout(Bt(n,function(){return t.updateFromDOM()}),20)}),he(i,"compositionstart",function(s){t.composing={data:s.data,done:!1}}),he(i,"compositionupdate",function(s){t.composing||(t.composing={data:s.data,done:!1})}),he(i,"compositionend",function(s){t.composing&&(s.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),he(i,"touchstart",function(){return r.forceCompositionEnd()}),he(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(s){if(!a(s)||Pe(n,s))return;if(n.somethingSelected())ta({lineWise:!1,text:n.getSelections()}),s.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var u=Ss(n);ta({lineWise:!0,text:u.text}),s.type=="cut"&&n.operation(function(){n.setSelections(u.ranges,0,de),n.replaceSelection("",null,"cut")})}else return;if(s.clipboardData){s.clipboardData.clearData();var d=Sn.text.join(`
|
|
`);if(s.clipboardData.setData("Text",d),s.clipboardData.getData("Text")==d){s.preventDefault();return}}var y=_s(),S=y.firstChild;n.display.lineSpace.insertBefore(y,n.display.lineSpace.firstChild),S.value=Sn.text.join(`
|
|
`);var $=document.activeElement;E(S),setTimeout(function(){n.display.lineSpace.removeChild(y),$.focus(),$==i&&r.showPrimarySelection()},50)}he(i,"copy",o),he(i,"cut",o)},St.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},St.prototype.prepareSelection=function(){var e=mo(this.cm,!1);return e.focus=document.activeElement==this.div,e},St.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},St.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},St.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=na(t,e.anchorNode,e.anchorOffset),o=na(t,e.focusNode,e.focusOffset);if(a&&!a.bad&&o&&!o.bad&&ut(Zn(a,o),n)==0&&ut(vr(a,o),i)==0)return;var s=t.display.view,u=n.line>=t.display.viewFrom&&Os(t,n)||{node:s[0].measure.map[2],offset:0},d=i.line<t.display.viewTo&&Os(t,i);if(!d){var y=s[s.length-1].measure,S=y.maps?y.maps[y.maps.length-1]:y.map;d={node:S[S.length-1],offset:S[S.length-2]-S[S.length-3]}}if(!u||!d){e.removeAllRanges();return}var $=e.rangeCount&&e.getRangeAt(0),X;try{X=H(u.node,u.offset,d.offset,d.node)}catch(me){}X&&(!oe&&t.state.focused?(e.collapse(u.node,u.offset),X.collapsed||(e.removeAllRanges(),e.addRange(X))):(e.removeAllRanges(),e.addRange(X)),$&&e.anchorNode==null?e.addRange($):oe&&this.startGracePeriod()),this.rememberSelection()},St.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)},St.prototype.showMultipleSelections=function(e){ne(this.cm.display.cursorDiv,e.cursors),ne(this.cm.display.selectionDiv,e.selection)},St.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},St.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},St.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},St.prototype.blur=function(){this.div.blur()},St.prototype.getField=function(){return this.div},St.prototype.supportsTouch=function(){return!0},St.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():sn(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)},St.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},St.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(j&&N&&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=na(t,e.anchorNode,e.anchorOffset),n=na(t,e.focusNode,e.focusOffset);r&&n&&sn(t,function(){Vt(t.doc,Kn(r,n),de),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},St.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=Me(n.line-1,Ze(e.doc,n.line-1).length)),i.ch==Ze(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=Me(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;n.line==t.viewFrom||(a=sr(e,n.line))==0?(o=wt(t.view[0].line),s=t.view[0].node):(o=wt(t.view[a].line),s=t.view[a-1].node.nextSibling);var u=sr(e,i.line),d,y;if(u==t.view.length-1?(d=t.viewTo-1,y=t.lineDiv.lastChild):(d=wt(t.view[u+1].line)-1,y=t.view[u+1].node.previousSibling),!s)return!1;for(var S=e.doc.splitLines(tu(e,s,y,o,d)),$=Dn(e.doc,Me(o,0),Me(d,Ze(e.doc,d).text.length));S.length>1&&$.length>1;)if(h(S)==h($))S.pop(),$.pop(),d--;else if(S[0]==$[0])S.shift(),$.shift(),o++;else break;for(var X=0,me=0,_e=S[0],je=$[0],Be=Math.min(_e.length,je.length);X<Be&&_e.charCodeAt(X)==je.charCodeAt(X);)++X;for(var Ge=h(S),We=h($),$e=Math.min(Ge.length-(S.length==1?X:0),We.length-($.length==1?X:0));me<$e&&Ge.charCodeAt(Ge.length-me-1)==We.charCodeAt(We.length-me-1);)++me;if(S.length==1&&$.length==1&&o==n.line)for(;X&&X>n.ch&&Ge.charCodeAt(Ge.length-me-1)==We.charCodeAt(We.length-me-1);)X--,me++;S[S.length-1]=Ge.slice(0,Ge.length-me).replace(/^\u200b+/,""),S[0]=S[0].slice(X).replace(/\u200b+$/,"");var lt=Me(o,X),nt=Me(d,$.length?h($).length-me:0);if(S.length>1||S[0]||ut(lt,nt))return Pr(e.doc,S,lt,nt,"+input"),!0},St.prototype.ensurePolled=function(){this.forceCompositionEnd()},St.prototype.reset=function(){this.forceCompositionEnd()},St.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},St.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)},St.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&sn(this.cm,function(){return tn(e.cm)})},St.prototype.setUneditable=function(e){e.contentEditable="false"},St.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Bt(this.cm,Xa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},St.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},St.prototype.onContextMenu=function(){},St.prototype.resetPosition=function(){},St.prototype.needsContentAttribute=!0;function Os(e,t){var r=ha(e,t.line);if(!r||r.hidden)return null;var n=Ze(e.doc,t.line),i=eo(r,n,t.line),a=rt(n,e.doc.direction),o="left";if(a){var s=Ve(a,t.ch);o=s%2?"right":"left"}var u=ro(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 Ur(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(X){return function(me){return me.id==X}}function y(){o&&(a+=s,u&&(a+=s),o=u=!1)}function S(X){X&&(y(),a+=X)}function $(X){if(X.nodeType==1){var me=X.getAttribute("cm-text");if(me){S(me);return}var _e=X.getAttribute("cm-marker"),je;if(_e){var Be=e.findMarks(Me(n,0),Me(i+1,0),d(+_e));Be.length&&(je=Be[0].find(0))&&S(Dn(e.doc,je.from,je.to).join(s));return}if(X.getAttribute("contenteditable")=="false")return;var Ge=/^(pre|div|p|li|table|br)$/i.test(X.nodeName);if(!/^br$/i.test(X.nodeName)&&X.textContent.length==0)return;Ge&&y();for(var We=0;We<X.childNodes.length;We++)$(X.childNodes[We]);/^(pre|p)$/i.test(X.nodeName)&&(u=!0),Ge&&(o=!0)}else X.nodeType==3&&S(X.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!($(t),t==r);)t=t.nextSibling,u=!1;return a}function na(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Ur(e.clipPos(Me(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||!w(n,t))return Ur(Me(wt(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var a=e.rest?h(e.rest):e.line;return Ur(Me(wt(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 y(je,Be,Ge){for(var We=-1;We<(d?d.length:0);We++)for(var $e=We<0?u.map:d[We],lt=0;lt<$e.length;lt+=3){var nt=$e[lt+2];if(nt==je||nt==Be){var pt=wt(We<0?e.line:e.rest[We]),At=$e[lt]+Ge;return(Ge<0||nt!=je)&&(At=$e[lt+(Ge?1:0)]),Me(pt,At)}}}var S=y(o,s,r);if(S)return Ur(S,i);for(var $=s.nextSibling,X=o?o.nodeValue.length-r:0;$;$=$.nextSibling){if(S=y($,$.firstChild,0),S)return Ur(Me(S.line,S.ch-X),i);X+=$.textContent.length}for(var me=s.previousSibling,_e=r;me;me=me.previousSibling){if(S=y(me,me.firstChild,-1),S)return Ur(Me(S.line,S.ch+_e),i);_e+=me.textContent.length}}var Dt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new _,this.hasSelection=!1,this.composing=null};Dt.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),z&&(i.style.width="0px"),he(i,"input",function(){L&&W>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),he(i,"paste",function(o){if(Pe(n,o)||Cs(o,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function a(o){if(Pe(n,o))return;if(n.somethingSelected())ta({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var s=Ss(n);ta({lineWise:!0,text:s.text}),o.type=="cut"?n.setSelections(s.ranges,null,de):(r.prevInput="",i.value=s.text.join(`
|
|
`),E(i))}else return;o.type=="cut"&&(n.state.cutIncoming=+new Date)}he(i,"cut",a),he(i,"copy",a),he(e.scroller,"paste",function(o){if(Un(e,o)||Pe(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)}),he(e.lineSpace,"selectstart",function(o){Un(e,o)||f(o)}),he(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"})}}),he(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Dt.prototype.createField=function(e){this.wrapper=_s(),this.textarea=this.wrapper.firstChild},Dt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Dt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=mo(e);if(e.options.moveInputWithCursor){var i=Cn(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},Dt.prototype.showSelection=function(e){var t=this.cm,r=t.display;ne(r.cursorDiv,e.cursors),ne(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Dt.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&&E(this.textarea),L&&W>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",L&&W>=9&&(this.hasSelection=null))},Dt.prototype.getField=function(){return this.textarea},Dt.prototype.supportsTouch=function(){return!1},Dt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!le||q()!=this.textarea))try{this.textarea.focus()}catch(e){}},Dt.prototype.blur=function(){this.textarea.blur()},Dt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Dt.prototype.receivedFocus=function(){this.slowPoll()},Dt.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()})},Dt.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)},Dt.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(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(L&&W>=9&&this.hasSelection===i||ce&&/[\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 sn(t,function(){Xa(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},Dt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Dt.prototype.onKeyPress=function(){L&&W>=9&&(this.hasSelection=null),this.fastPoll()},Dt.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=or(r,e),o=n.scroller.scrollTop;if(!a||R)return;var s=r.options.resetSelectionOnContextMenu;s&&r.doc.sel.contains(a)==-1&&Bt(r,Vt)(r.doc,Kn(a),de);var u=i.style.cssText,d=t.wrapper.style.cssText,y=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-y.top-5)+"px; left: "+(e.clientX-y.left-5)+`px;
|
|
z-index: 1000; background: `+(L?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var S;P&&(S=window.scrollY),n.input.focus(),P&&window.scrollTo(null,S),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=X,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function $(){if(i.selectionStart!=null){var _e=r.somethingSelected(),je="\u200B"+(_e?i.value:"");i.value="\u21DA",i.value=je,t.prevInput=_e?"":"\u200B",i.selectionStart=1,i.selectionEnd=je.length,n.selForContextMenu=r.doc.sel}}function X(){if(t.contextMenuPending!=X)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,L&&W<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=o),i.selectionStart!=null){(!L||L&&W<9)&&$();var _e=0,je=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Bt(r,Vo)(r):_e++<10?n.detectingSelectAll=setTimeout(je,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(je,200)}}if(L&&W>=9&&$(),Fe){k(e);var me=function(){qe(window,"mouseup",me),setTimeout(X,20)};he(window,"mouseup",me)}else setTimeout(X,50)},Dt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Dt.prototype.setUneditable=function(){},Dt.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=q();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(he(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&&(qe(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var s=Ot(function(u){return e.parentNode.insertBefore(u,e.nextSibling)},t);return s}function iu(e){e.off=qe,e.on=he,e.wheelEventPixels=dl,e.Doc=nn,e.splitLines=ht,e.countColumn=m,e.findColumn=Z,e.isWordChar=se,e.Pass=Ae,e.signal=ye,e.Line=rr,e.changeEnd=Vn,e.scrollbarModel=Co,e.Pos=Me,e.cmpPos=ut,e.modes=jt,e.mimeModes=yt,e.resolveMode=un,e.getMode=gn,e.modeExtensions=hn,e.extendMode=ia,e.copyState=_n,e.startState=Hr,e.innerMode=zr,e.commands=wi,e.keyMap=Bn,e.keyName=us,e.isModifierKey=ss,e.lookupKey=jr,e.normalizeKeyMap=Dl,e.StringStream=Rt,e.SharedTextMarker=bi,e.TextMarker=Yn,e.LineWidget=vi,e.e_preventDefault=f,e.e_stopPropagation=p,e.e_stop=k,e.addClass=U,e.contains=w,e.rmClass=we,e.keyNames=Jn}Yl(Ot),Ql(Ot);var au="iter insert remove copy getEditor constructor".split(" ");for(var ra in nn.prototype)nn.prototype.hasOwnProperty(ra)&&B(au,ra)<0&&(Ot.prototype[ra]=function(e){return function(){return e.apply(this.doc,arguments)}}(nn.prototype[ra]));return O(nn),Ot.inputStyles={textarea:Dt,contenteditable:St},Ot.defineMode=function(e){!Ot.defaults.mode&&e!="null"&&(Ot.defaults.mode=e),Tn.apply(this,arguments)},Ot.defineMIME=Mn,Ot.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ot.defineMIME("text/plain","null"),Ot.defineExtension=function(e,t){Ot.prototype[e]=t},Ot.defineDocExtension=function(e,t){nn.prototype[e]=t},Ot.fromTextArea=ru,iu(Ot),Ot.version="5.58.2",Ot})},X0ci:function(ft,Ye,x){},Y1PL:function(ft,Ye,x){"use strict";var K=x("wx14"),Ce=x("1OyB"),oe=x("vuIU"),Se=x("Ji7U"),ge=x("LK+K"),ee=x("cDcd"),L=x("VTBJ"),W=x("rePB"),P=x("Zm9Q"),V=x("Kwbf"),N=x("c+Xe"),R=x("m+aA"),ve=x("bdgK"),te=new Map;function F(de){de.forEach(function(ie){var G,Z=ie.target;(G=te.get(Z))===null||G===void 0||G.forEach(function(M){return M(Z)})})}var z=new ve.default(F),j=null,le=null;function ce(de,ie){te.has(de)||(te.set(de,new Set),z.observe(de)),te.get(de).add(ie)}function Oe(de,ie){te.has(de)&&(te.get(de).delete(ie),te.get(de).size||(z.unobserve(de),te.delete(de)))}var Xe=function(de){Object(Se.a)(G,de);var ie=Object(ge.a)(G);function G(){return Object(Ce.a)(this,G),ie.apply(this,arguments)}return Object(oe.a)(G,[{key:"render",value:function(){return this.props.children}}]),G}(ee.Component),Ie=ee.createContext(null);function De(de){var ie=de.children,G=de.onBatchResize,Z=ee.useRef(0),M=ee.useRef([]),J=ee.useContext(Ie),h=ee.useCallback(function(C,g,re){Z.current+=1;var pe=Z.current;M.current.push({size:C,element:g,data:re}),Promise.resolve().then(function(){pe===Z.current&&(G==null||G(M.current),M.current=[])}),J==null||J(C,g,re)},[G,J]);return ee.createElement(Ie.Provider,{value:h},ie)}function Fe(de){var ie=de.children,G=de.disabled,Z=ee.useRef(null),M=ee.useRef(null),J=ee.useContext(Ie),h=ee.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),C=ee.isValidElement(ie)&&Object(N.c)(ie),g=C?ie.ref:null,re=ee.useMemo(function(){return Object(N.a)(g,Z)},[g,Z]),pe=ee.useRef(de);pe.current=de;var Y=ee.useCallback(function(se){var ke=pe.current,Re=ke.onResize,Le=ke.data,be=se.getBoundingClientRect(),Ee=be.width,Ue=be.height,Je=se.offsetWidth,ze=se.offsetHeight,Ve=Math.floor(Ee),ot=Math.floor(Ue);if(h.current.width!==Ve||h.current.height!==ot||h.current.offsetWidth!==Je||h.current.offsetHeight!==ze){var rt={width:Ve,height:ot,offsetWidth:Je,offsetHeight:ze};h.current=rt;var Ke=Je===Math.round(Ee)?Ee:Je,he=ze===Math.round(Ue)?Ue:ze,it=Object(L.a)(Object(L.a)({},rt),{},{offsetWidth:Ke,offsetHeight:he});J==null||J(it,se,Le),Re&&Promise.resolve().then(function(){Re(it,se)})}},[]);return ee.useEffect(function(){var se=Object(R.a)(Z.current)||Object(R.a)(M.current);return se&&!G&&ce(se,Y),function(){return Oe(se,Y)}},[Z.current,G]),ee.createElement(Xe,{ref:M},C?ee.cloneElement(ie,{ref:re}):ie)}var xe="rc-observer-key";function we(de){var ie=de.children,G=Object(P.a)(ie);return G.map(function(Z,M){var J=(Z==null?void 0:Z.key)||"".concat(xe,"-").concat(M);return ee.createElement(Fe,Object(K.a)({},de,{key:J}),Z)})}we.Collection=De;var fe=we,ne=x("bT9E"),v=x("TSYQ"),Q=x.n(v),H=`
|
|
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
|
|
`,w=["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"],q={},U;function T(de){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,G=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(ie&&q[G])return q[G];var Z=window.getComputedStyle(de),M=Z.getPropertyValue("box-sizing")||Z.getPropertyValue("-moz-box-sizing")||Z.getPropertyValue("-webkit-box-sizing"),J=parseFloat(Z.getPropertyValue("padding-bottom"))+parseFloat(Z.getPropertyValue("padding-top")),h=parseFloat(Z.getPropertyValue("border-bottom-width"))+parseFloat(Z.getPropertyValue("border-top-width")),C=w.map(function(re){return"".concat(re,":").concat(Z.getPropertyValue(re))}).join(";"),g={sizingStyle:C,paddingSize:J,borderSize:h,boxSizing:M};return ie&&G&&(q[G]=g),g}function E(de){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Z=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;U||(U=document.createElement("textarea"),U.setAttribute("tab-index","-1"),U.setAttribute("aria-hidden","true"),document.body.appendChild(U)),de.getAttribute("wrap")?U.setAttribute("wrap",de.getAttribute("wrap")):U.removeAttribute("wrap");var M=T(de,ie),J=M.paddingSize,h=M.borderSize,C=M.boxSizing,g=M.sizingStyle;U.setAttribute("style","".concat(g,";").concat(H)),U.value=de.value||de.placeholder||"";var re=Number.MIN_SAFE_INTEGER,pe=Number.MAX_SAFE_INTEGER,Y=U.scrollHeight,se;if(C==="border-box"?Y+=h:C==="content-box"&&(Y-=J),G!==null||Z!==null){U.value=" ";var ke=U.scrollHeight-J;G!==null&&(re=ke*G,C==="border-box"&&(re=re+J+h),Y=Math.max(re,Y)),Z!==null&&(pe=ke*Z,C==="border-box"&&(pe=pe+J+h),se=Y>pe?"":"hidden",Y=Math.min(pe,Y))}return{height:Y,minHeight:re,maxHeight:pe,overflowY:se,resize:"none"}}var c=x("Gytx"),l=x.n(c),m;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(m||(m={}));var _=function(de){Object(Se.a)(G,de);var ie=Object(ge.a)(G);function G(Z){var M;return Object(Ce.a)(this,G),M=ie.call(this,Z),M.nextFrameActionId=void 0,M.resizeFrameId=void 0,M.textArea=void 0,M.saveTextArea=function(J){M.textArea=J},M.handleResize=function(J){var h=M.state.resizeStatus,C=M.props,g=C.autoSize,re=C.onResize;if(h!==m.NONE)return;typeof re=="function"&&re(J),g&&M.resizeOnNextFrame()},M.resizeOnNextFrame=function(){cancelAnimationFrame(M.nextFrameActionId),M.nextFrameActionId=requestAnimationFrame(M.resizeTextarea)},M.resizeTextarea=function(){var J=M.props.autoSize;if(!J||!M.textArea)return;var h=J.minRows,C=J.maxRows,g=E(M.textArea,!1,h,C);M.setState({textareaStyles:g,resizeStatus:m.RESIZING},function(){cancelAnimationFrame(M.resizeFrameId),M.resizeFrameId=requestAnimationFrame(function(){M.setState({resizeStatus:m.RESIZED},function(){M.resizeFrameId=requestAnimationFrame(function(){M.setState({resizeStatus:m.NONE}),M.fixFirefoxAutoScroll()})})})})},M.renderTextArea=function(){var J=M.props,h=J.prefixCls,C=h===void 0?"rc-textarea":h,g=J.autoSize,re=J.onResize,pe=J.className,Y=J.disabled,se=M.state,ke=se.textareaStyles,Re=se.resizeStatus,Le=Object(ne.a)(M.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),be=Q()(C,pe,Object(W.a)({},"".concat(C,"-disabled"),Y));"value"in Le&&(Le.value=Le.value||"");var Ee=Object(L.a)(Object(L.a)(Object(L.a)({},M.props.style),ke),Re===m.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return ee.createElement(fe,{onResize:M.handleResize,disabled:!(g||re)},ee.createElement("textarea",Object(K.a)({},Le,{className:be,style:Ee,ref:M.saveTextArea})))},M.state={textareaStyles:{},resizeStatus:m.NONE},M}return Object(oe.a)(G,[{key:"componentDidUpdate",value:function(M){(M.value!==this.props.value||!l()(M.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 M=this.textArea.selectionStart,J=this.textArea.selectionEnd;this.textArea.setSelectionRange(M,J)}}catch(h){}}},{key:"render",value:function(){return this.renderTextArea()}}]),G}(ee.Component),B=_,ue=function(de){Object(Se.a)(G,de);var ie=Object(ge.a)(G);function G(Z){var M;Object(Ce.a)(this,G),M=ie.call(this,Z),M.resizableTextArea=void 0,M.focus=function(){M.resizableTextArea.textArea.focus()},M.saveTextArea=function(h){M.resizableTextArea=h},M.handleChange=function(h){var C=M.props.onChange;M.setValue(h.target.value,function(){M.resizableTextArea.resizeTextarea()}),C&&C(h)},M.handleKeyDown=function(h){var C=M.props,g=C.onPressEnter,re=C.onKeyDown;h.keyCode===13&&g&&g(h),re&&re(h)};var J=typeof Z.value=="undefined"||Z.value===null?Z.defaultValue:Z.value;return M.state={value:J},M}return Object(oe.a)(G,[{key:"setValue",value:function(M,J){"value"in this.props||this.setState({value:M},J)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return ee.createElement(B,Object(K.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(M){return"value"in M?{value:M.value}:null}}]),G}(ee.Component),Ae=Ye.a=ue},ZpRC:function(ft,Ye,x){"use strict";function K(N){return typeof N=="object"&&N!=null&&N.nodeType===1}function Ce(N,R){return(!R||N!=="hidden")&&N!=="visible"&&N!=="clip"}function oe(N,R){if(N.clientHeight<N.scrollHeight||N.clientWidth<N.scrollWidth){var ve=getComputedStyle(N,null);return Ce(ve.overflowY,R)||Ce(ve.overflowX,R)||function(te){var F=function(z){if(!z.ownerDocument||!z.ownerDocument.defaultView)return null;try{return z.ownerDocument.defaultView.frameElement}catch(j){return null}}(te);return!!F&&(F.clientHeight<te.scrollHeight||F.clientWidth<te.scrollWidth)}(N)}return!1}function Se(N,R,ve,te,F,z,j,le){return z<N&&j>R||z>N&&j<R?0:z<=N&&le<=ve||j>=R&&le>=ve?z-N-te:j>R&&le<ve||z<N&&le>ve?j-R+F:0}var ge=function(N,R){var ve=window,te=R.scrollMode,F=R.block,z=R.inline,j=R.boundary,le=R.skipOverflowHiddenElements,ce=typeof j=="function"?j:function(ke){return ke!==j};if(!K(N))throw new TypeError("Invalid target");for(var Oe=document.scrollingElement||document.documentElement,Xe=[],Ie=N;K(Ie)&&ce(Ie);){if((Ie=Ie.parentElement)===Oe){Xe.push(Ie);break}Ie!=null&&Ie===document.body&&oe(Ie)&&!oe(document.documentElement)||Ie!=null&&oe(Ie,le)&&Xe.push(Ie)}for(var De=ve.visualViewport?ve.visualViewport.width:innerWidth,Fe=ve.visualViewport?ve.visualViewport.height:innerHeight,xe=window.scrollX||pageXOffset,we=window.scrollY||pageYOffset,fe=N.getBoundingClientRect(),ne=fe.height,v=fe.width,Q=fe.top,H=fe.right,w=fe.bottom,q=fe.left,U=F==="start"||F==="nearest"?Q:F==="end"?w:Q+ne/2,T=z==="center"?q+v/2:z==="end"?H:q,E=[],c=0;c<Xe.length;c++){var l=Xe[c],m=l.getBoundingClientRect(),_=m.height,B=m.width,ue=m.top,Ae=m.right,de=m.bottom,ie=m.left;if(te==="if-needed"&&Q>=0&&q>=0&&w<=Fe&&H<=De&&Q>=ue&&w<=de&&q>=ie&&H<=Ae)return E;var G=getComputedStyle(l),Z=parseInt(G.borderLeftWidth,10),M=parseInt(G.borderTopWidth,10),J=parseInt(G.borderRightWidth,10),h=parseInt(G.borderBottomWidth,10),C=0,g=0,re="offsetWidth"in l?l.offsetWidth-l.clientWidth-Z-J:0,pe="offsetHeight"in l?l.offsetHeight-l.clientHeight-M-h:0;if(Oe===l)C=F==="start"?U:F==="end"?U-Fe:F==="nearest"?Se(we,we+Fe,Fe,M,h,we+U,we+U+ne,ne):U-Fe/2,g=z==="start"?T:z==="center"?T-De/2:z==="end"?T-De:Se(xe,xe+De,De,Z,J,xe+T,xe+T+v,v),C=Math.max(0,C+we),g=Math.max(0,g+xe);else{C=F==="start"?U-ue-M:F==="end"?U-de+h+pe:F==="nearest"?Se(ue,de,_,M,h+pe,U,U+ne,ne):U-(ue+_/2)+pe/2,g=z==="start"?T-ie-Z:z==="center"?T-(ie+B/2)+re/2:z==="end"?T-Ae+J+re:Se(ie,Ae,B,Z,J+re,T,T+v,v);var Y=l.scrollLeft,se=l.scrollTop;U+=se-(C=Math.max(0,Math.min(se+C,l.scrollHeight-_+pe))),T+=Y-(g=Math.max(0,Math.min(Y+g,l.scrollWidth-B+re)))}E.push({el:l,top:C,left:g})}return E};function ee(N){return N===Object(N)&&Object.keys(N).length!==0}function L(N,R){R===void 0&&(R="auto");var ve="scrollBehavior"in document.body.style;N.forEach(function(te){var F=te.el,z=te.top,j=te.left;F.scroll&&ve?F.scroll({top:z,left:j,behavior:R}):(F.scrollTop=z,F.scrollLeft=j)})}function W(N){return N===!1?{block:"end",inline:"nearest"}:ee(N)?N:{block:"start",inline:"nearest"}}function P(N,R){var ve=!N.ownerDocument.documentElement.contains(N);if(ee(R)&&typeof R.behavior=="function")return R.behavior(ve?[]:ge(N,R));if(ve)return;var te=W(R);return L(ge(N,te),te.behavior)}var V=Ye.a=P},Zss7:function(ft,Ye,x){var K;(function(Ce){var oe=/^\s+/,Se=/\s+$/,ge=0,ee=Ce.round,L=Ce.min,W=Ce.max,P=Ce.random;function V(h,C){if(h=h||"",C=C||{},h instanceof V)return h;if(!(this instanceof V))return new V(h,C);var g=N(h);this._originalInput=h,this._r=g.r,this._g=g.g,this._b=g.b,this._a=g.a,this._roundA=ee(100*this._a)/100,this._format=C.format||g.format,this._gradientType=C.gradientType,this._r<1&&(this._r=ee(this._r)),this._g<1&&(this._g=ee(this._g)),this._b<1&&(this._b=ee(this._b)),this._ok=g.ok,this._tc_id=ge++}V.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 h=this.toRgb();return(h.r*299+h.g*587+h.b*114)/1e3},getLuminance:function(){var h=this.toRgb(),C,g,re,pe,Y,se;return C=h.r/255,g=h.g/255,re=h.b/255,C<=.03928?pe=C/12.92:pe=Ce.pow((C+.055)/1.055,2.4),g<=.03928?Y=g/12.92:Y=Ce.pow((g+.055)/1.055,2.4),re<=.03928?se=re/12.92:se=Ce.pow((re+.055)/1.055,2.4),.2126*pe+.7152*Y+.0722*se},setAlpha:function(h){return this._a=E(h),this._roundA=ee(100*this._a)/100,this},toHsv:function(){var h=F(this._r,this._g,this._b);return{h:h.h*360,s:h.s,v:h.v,a:this._a}},toHsvString:function(){var h=F(this._r,this._g,this._b),C=ee(h.h*360),g=ee(h.s*100),re=ee(h.v*100);return this._a==1?"hsv("+C+", "+g+"%, "+re+"%)":"hsva("+C+", "+g+"%, "+re+"%, "+this._roundA+")"},toHsl:function(){var h=ve(this._r,this._g,this._b);return{h:h.h*360,s:h.s,l:h.l,a:this._a}},toHslString:function(){var h=ve(this._r,this._g,this._b),C=ee(h.h*360),g=ee(h.s*100),re=ee(h.l*100);return this._a==1?"hsl("+C+", "+g+"%, "+re+"%)":"hsla("+C+", "+g+"%, "+re+"%, "+this._roundA+")"},toHex:function(h){return j(this._r,this._g,this._b,h)},toHexString:function(h){return"#"+this.toHex(h)},toHex8:function(h){return le(this._r,this._g,this._b,this._a,h)},toHex8String:function(h){return"#"+this.toHex8(h)},toRgb:function(){return{r:ee(this._r),g:ee(this._g),b:ee(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+ee(this._r)+", "+ee(this._g)+", "+ee(this._b)+")":"rgba("+ee(this._r)+", "+ee(this._g)+", "+ee(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:ee(c(this._r,255)*100)+"%",g:ee(c(this._g,255)*100)+"%",b:ee(c(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+ee(c(this._r,255)*100)+"%, "+ee(c(this._g,255)*100)+"%, "+ee(c(this._b,255)*100)+"%)":"rgba("+ee(c(this._r,255)*100)+"%, "+ee(c(this._g,255)*100)+"%, "+ee(c(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:U[j(this._r,this._g,this._b,!0)]||!1},toFilter:function(h){var C="#"+ce(this._r,this._g,this._b,this._a),g=C,re=this._gradientType?"GradientType = 1, ":"";if(h){var pe=V(h);g="#"+ce(pe._r,pe._g,pe._b,pe._a)}return"progid:DXImageTransform.Microsoft.gradient("+re+"startColorstr="+C+",endColorstr="+g+")"},toString:function(h){var C=!!h;h=h||this._format;var g=!1,re=this._a<1&&this._a>=0,pe=!C&&re&&(h==="hex"||h==="hex6"||h==="hex3"||h==="hex4"||h==="hex8"||h==="name");return pe?h==="name"&&this._a===0?this.toName():this.toRgbString():(h==="rgb"&&(g=this.toRgbString()),h==="prgb"&&(g=this.toPercentageRgbString()),(h==="hex"||h==="hex6")&&(g=this.toHexString()),h==="hex3"&&(g=this.toHexString(!0)),h==="hex4"&&(g=this.toHex8String(!0)),h==="hex8"&&(g=this.toHex8String()),h==="name"&&(g=this.toName()),h==="hsl"&&(g=this.toHslString()),h==="hsv"&&(g=this.toHsvString()),g||this.toHexString())},clone:function(){return V(this.toString())},_applyModification:function(h,C){var g=h.apply(null,[this].concat([].slice.call(C)));return this._r=g._r,this._g=g._g,this._b=g._b,this.setAlpha(g._a),this},lighten:function(){return this._applyModification(De,arguments)},brighten:function(){return this._applyModification(Fe,arguments)},darken:function(){return this._applyModification(xe,arguments)},desaturate:function(){return this._applyModification(Oe,arguments)},saturate:function(){return this._applyModification(Xe,arguments)},greyscale:function(){return this._applyModification(Ie,arguments)},spin:function(){return this._applyModification(we,arguments)},_applyCombination:function(h,C){return h.apply(null,[this].concat([].slice.call(C)))},analogous:function(){return this._applyCombination(H,arguments)},complement:function(){return this._applyCombination(fe,arguments)},monochromatic:function(){return this._applyCombination(w,arguments)},splitcomplement:function(){return this._applyCombination(Q,arguments)},triad:function(){return this._applyCombination(ne,arguments)},tetrad:function(){return this._applyCombination(v,arguments)}},V.fromRatio=function(h,C){if(typeof h=="object"){var g={};for(var re in h)h.hasOwnProperty(re)&&(re==="a"?g[re]=h[re]:g[re]=Ae(h[re]));h=g}return V(h,C)};function N(h){var C={r:0,g:0,b:0},g=1,re=null,pe=null,Y=null,se=!1,ke=!1;return typeof h=="string"&&(h=M(h)),typeof h=="object"&&(Z(h.r)&&Z(h.g)&&Z(h.b)?(C=R(h.r,h.g,h.b),se=!0,ke=String(h.r).substr(-1)==="%"?"prgb":"rgb"):Z(h.h)&&Z(h.s)&&Z(h.v)?(re=Ae(h.s),pe=Ae(h.v),C=z(h.h,re,pe),se=!0,ke="hsv"):Z(h.h)&&Z(h.s)&&Z(h.l)&&(re=Ae(h.s),Y=Ae(h.l),C=te(h.h,re,Y),se=!0,ke="hsl"),h.hasOwnProperty("a")&&(g=h.a)),g=E(g),{ok:se,format:h.format||ke,r:L(255,W(C.r,0)),g:L(255,W(C.g,0)),b:L(255,W(C.b,0)),a:g}}function R(h,C,g){return{r:c(h,255)*255,g:c(C,255)*255,b:c(g,255)*255}}function ve(h,C,g){h=c(h,255),C=c(C,255),g=c(g,255);var re=W(h,C,g),pe=L(h,C,g),Y,se,ke=(re+pe)/2;if(re==pe)Y=se=0;else{var Re=re-pe;se=ke>.5?Re/(2-re-pe):Re/(re+pe);switch(re){case h:Y=(C-g)/Re+(C<g?6:0);break;case C:Y=(g-h)/Re+2;break;case g:Y=(h-C)/Re+4;break}Y/=6}return{h:Y,s:se,l:ke}}function te(h,C,g){var re,pe,Y;h=c(h,360),C=c(C,100),g=c(g,100);function se(Le,be,Ee){return Ee<0&&(Ee+=1),Ee>1&&(Ee-=1),Ee<1/6?Le+(be-Le)*6*Ee:Ee<1/2?be:Ee<2/3?Le+(be-Le)*(2/3-Ee)*6:Le}if(C===0)re=pe=Y=g;else{var ke=g<.5?g*(1+C):g+C-g*C,Re=2*g-ke;re=se(Re,ke,h+1/3),pe=se(Re,ke,h),Y=se(Re,ke,h-1/3)}return{r:re*255,g:pe*255,b:Y*255}}function F(h,C,g){h=c(h,255),C=c(C,255),g=c(g,255);var re=W(h,C,g),pe=L(h,C,g),Y,se,ke=re,Re=re-pe;if(se=re===0?0:Re/re,re==pe)Y=0;else{switch(re){case h:Y=(C-g)/Re+(C<g?6:0);break;case C:Y=(g-h)/Re+2;break;case g:Y=(h-C)/Re+4;break}Y/=6}return{h:Y,s:se,v:ke}}function z(h,C,g){h=c(h,360)*6,C=c(C,100),g=c(g,100);var re=Ce.floor(h),pe=h-re,Y=g*(1-C),se=g*(1-pe*C),ke=g*(1-(1-pe)*C),Re=re%6,Le=[g,se,Y,Y,ke,g][Re],be=[ke,g,g,se,Y,Y][Re],Ee=[Y,Y,ke,g,g,se][Re];return{r:Le*255,g:be*255,b:Ee*255}}function j(h,C,g,re){var pe=[ue(ee(h).toString(16)),ue(ee(C).toString(16)),ue(ee(g).toString(16))];return re&&pe[0].charAt(0)==pe[0].charAt(1)&&pe[1].charAt(0)==pe[1].charAt(1)&&pe[2].charAt(0)==pe[2].charAt(1)?pe[0].charAt(0)+pe[1].charAt(0)+pe[2].charAt(0):pe.join("")}function le(h,C,g,re,pe){var Y=[ue(ee(h).toString(16)),ue(ee(C).toString(16)),ue(ee(g).toString(16)),ue(de(re))];return pe&&Y[0].charAt(0)==Y[0].charAt(1)&&Y[1].charAt(0)==Y[1].charAt(1)&&Y[2].charAt(0)==Y[2].charAt(1)&&Y[3].charAt(0)==Y[3].charAt(1)?Y[0].charAt(0)+Y[1].charAt(0)+Y[2].charAt(0)+Y[3].charAt(0):Y.join("")}function ce(h,C,g,re){var pe=[ue(de(re)),ue(ee(h).toString(16)),ue(ee(C).toString(16)),ue(ee(g).toString(16))];return pe.join("")}V.equals=function(h,C){return!h||!C?!1:V(h).toRgbString()==V(C).toRgbString()},V.random=function(){return V.fromRatio({r:P(),g:P(),b:P()})};function Oe(h,C){C=C===0?0:C||10;var g=V(h).toHsl();return g.s-=C/100,g.s=l(g.s),V(g)}function Xe(h,C){C=C===0?0:C||10;var g=V(h).toHsl();return g.s+=C/100,g.s=l(g.s),V(g)}function Ie(h){return V(h).desaturate(100)}function De(h,C){C=C===0?0:C||10;var g=V(h).toHsl();return g.l+=C/100,g.l=l(g.l),V(g)}function Fe(h,C){C=C===0?0:C||10;var g=V(h).toRgb();return g.r=W(0,L(255,g.r-ee(255*-(C/100)))),g.g=W(0,L(255,g.g-ee(255*-(C/100)))),g.b=W(0,L(255,g.b-ee(255*-(C/100)))),V(g)}function xe(h,C){C=C===0?0:C||10;var g=V(h).toHsl();return g.l-=C/100,g.l=l(g.l),V(g)}function we(h,C){var g=V(h).toHsl(),re=(g.h+C)%360;return g.h=re<0?360+re:re,V(g)}function fe(h){var C=V(h).toHsl();return C.h=(C.h+180)%360,V(C)}function ne(h){var C=V(h).toHsl(),g=C.h;return[V(h),V({h:(g+120)%360,s:C.s,l:C.l}),V({h:(g+240)%360,s:C.s,l:C.l})]}function v(h){var C=V(h).toHsl(),g=C.h;return[V(h),V({h:(g+90)%360,s:C.s,l:C.l}),V({h:(g+180)%360,s:C.s,l:C.l}),V({h:(g+270)%360,s:C.s,l:C.l})]}function Q(h){var C=V(h).toHsl(),g=C.h;return[V(h),V({h:(g+72)%360,s:C.s,l:C.l}),V({h:(g+216)%360,s:C.s,l:C.l})]}function H(h,C,g){C=C||6,g=g||30;var re=V(h).toHsl(),pe=360/g,Y=[V(h)];for(re.h=(re.h-(pe*C>>1)+720)%360;--C;)re.h=(re.h+pe)%360,Y.push(V(re));return Y}function w(h,C){C=C||6;for(var g=V(h).toHsv(),re=g.h,pe=g.s,Y=g.v,se=[],ke=1/C;C--;)se.push(V({h:re,s:pe,v:Y})),Y=(Y+ke)%1;return se}V.mix=function(h,C,g){g=g===0?0:g||50;var re=V(h).toRgb(),pe=V(C).toRgb(),Y=g/100,se={r:(pe.r-re.r)*Y+re.r,g:(pe.g-re.g)*Y+re.g,b:(pe.b-re.b)*Y+re.b,a:(pe.a-re.a)*Y+re.a};return V(se)},V.readability=function(h,C){var g=V(h),re=V(C);return(Ce.max(g.getLuminance(),re.getLuminance())+.05)/(Ce.min(g.getLuminance(),re.getLuminance())+.05)},V.isReadable=function(h,C,g){var re=V.readability(h,C),pe,Y;Y=!1,pe=J(g);switch(pe.level+pe.size){case"AAsmall":case"AAAlarge":Y=re>=4.5;break;case"AAlarge":Y=re>=3;break;case"AAAsmall":Y=re>=7;break}return Y},V.mostReadable=function(h,C,g){var re=null,pe=0,Y,se,ke,Re;g=g||{},se=g.includeFallbackColors,ke=g.level,Re=g.size;for(var Le=0;Le<C.length;Le++)Y=V.readability(h,C[Le]),Y>pe&&(pe=Y,re=V(C[Le]));return V.isReadable(h,re,{level:ke,size:Re})||!se?re:(g.includeFallbackColors=!1,V.mostReadable(h,["#fff","#000"],g))};var q=V.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"},U=V.hexNames=T(q);function T(h){var C={};for(var g in h)h.hasOwnProperty(g)&&(C[h[g]]=g);return C}function E(h){return h=parseFloat(h),(isNaN(h)||h<0||h>1)&&(h=1),h}function c(h,C){_(h)&&(h="100%");var g=B(h);return h=L(C,W(0,parseFloat(h))),g&&(h=parseInt(h*C,10)/100),Ce.abs(h-C)<1e-6?1:h%C/parseFloat(C)}function l(h){return L(1,W(0,h))}function m(h){return parseInt(h,16)}function _(h){return typeof h=="string"&&h.indexOf(".")!=-1&&parseFloat(h)===1}function B(h){return typeof h=="string"&&h.indexOf("%")!=-1}function ue(h){return h.length==1?"0"+h:""+h}function Ae(h){return h<=1&&(h=h*100+"%"),h}function de(h){return Ce.round(parseFloat(h)*255).toString(16)}function ie(h){return m(h)/255}var G=function(){var h="[-\\+]?\\d+%?",C="[-\\+]?\\d*\\.\\d+%?",g="(?:"+C+")|(?:"+h+")",re="[\\s|\\(]+("+g+")[,|\\s]+("+g+")[,|\\s]+("+g+")\\s*\\)?",pe="[\\s|\\(]+("+g+")[,|\\s]+("+g+")[,|\\s]+("+g+")[,|\\s]+("+g+")\\s*\\)?";return{CSS_UNIT:new RegExp(g),rgb:new RegExp("rgb"+re),rgba:new RegExp("rgba"+pe),hsl:new RegExp("hsl"+re),hsla:new RegExp("hsla"+pe),hsv:new RegExp("hsv"+re),hsva:new RegExp("hsva"+pe),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(h){return!!G.CSS_UNIT.exec(h)}function M(h){h=h.replace(oe,"").replace(Se,"").toLowerCase();var C=!1;if(q[h])h=q[h],C=!0;else if(h=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var g;return(g=G.rgb.exec(h))?{r:g[1],g:g[2],b:g[3]}:(g=G.rgba.exec(h))?{r:g[1],g:g[2],b:g[3],a:g[4]}:(g=G.hsl.exec(h))?{h:g[1],s:g[2],l:g[3]}:(g=G.hsla.exec(h))?{h:g[1],s:g[2],l:g[3],a:g[4]}:(g=G.hsv.exec(h))?{h:g[1],s:g[2],v:g[3]}:(g=G.hsva.exec(h))?{h:g[1],s:g[2],v:g[3],a:g[4]}:(g=G.hex8.exec(h))?{r:m(g[1]),g:m(g[2]),b:m(g[3]),a:ie(g[4]),format:C?"name":"hex8"}:(g=G.hex6.exec(h))?{r:m(g[1]),g:m(g[2]),b:m(g[3]),format:C?"name":"hex"}:(g=G.hex4.exec(h))?{r:m(g[1]+""+g[1]),g:m(g[2]+""+g[2]),b:m(g[3]+""+g[3]),a:ie(g[4]+""+g[4]),format:C?"name":"hex8"}:(g=G.hex3.exec(h))?{r:m(g[1]+""+g[1]),g:m(g[2]+""+g[2]),b:m(g[3]+""+g[3]),format:C?"name":"hex"}:!1}function J(h){var C,g;return h=h||{level:"AA",size:"small"},C=(h.level||"AA").toUpperCase(),g=(h.size||"small").toLowerCase(),C!=="AA"&&C!=="AAA"&&(C="AA"),g!=="small"&&g!=="large"&&(g="small"),{level:C,size:g}}ft.exports?ft.exports=V:!(K=function(){return V}.call(Ye,x,Ye,ft),K!==void 0&&(ft.exports=K))})(Math)},bT9E:function(ft,Ye,x){"use strict";x.d(Ye,"a",function(){return Ce});var K=x("VTBJ");function Ce(oe,Se){var ge=Object(K.a)({},oe);return Array.isArray(Se)&&Se.forEach(function(ee){delete ge[ee]}),ge}},c5Ni:function(ft,Ye,x){},dejd:function(ft,Ye,x){},dmUQ:function(ft,Ye,x){"use strict";var K=x("Ff2n"),Ce=x("rePB"),oe=x("1OyB"),Se=x("vuIU"),ge=x("Ji7U"),ee=x("md7G"),L=x("foSv"),W=x("cDcd"),P=x.n(W),V=x("TSYQ"),N=x.n(V),R=x("4IlW");function ve(ne,v){var Q=Object.keys(ne);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(ne);v&&(H=H.filter(function(w){return Object.getOwnPropertyDescriptor(ne,w).enumerable})),Q.push.apply(Q,H)}return Q}function te(ne){for(var v=1;v<arguments.length;v++){var Q=arguments[v]!=null?arguments[v]:{};v%2?ve(Object(Q),!0).forEach(function(H){Object(Ce.a)(ne,H,Q[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ne,Object.getOwnPropertyDescriptors(Q)):ve(Object(Q)).forEach(function(H){Object.defineProperty(ne,H,Object.getOwnPropertyDescriptor(Q,H))})}return ne}function F(ne){var v=z();return function(){var H=Object(L.a)(ne),w;if(v){var q=Object(L.a)(this).constructor;w=Reflect.construct(H,arguments,q)}else w=H.apply(this,arguments);return Object(ee.a)(this,w)}}function z(){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(ne){return!1}}function j(){}function le(ne){ne.preventDefault()}var ce=function(v){return v.replace(/[^\w.-]+/g,"")},Oe=200,Xe=600,Ie=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,De=function(v){return v!=null},Fe=function(v,Q){return Q===v||typeof Q=="number"&&typeof v=="number"&&isNaN(Q)&&isNaN(v)},xe=function(ne){Object(ge.a)(Q,ne);var v=F(Q);function Q(H){var w;Object(oe.a)(this,Q),w=v.call(this,H),w.onKeyDown=function(T){var E=w.props,c=E.onKeyDown,l=E.onPressEnter;if(T.keyCode===R.a.UP){var m=w.getRatio(T);w.up(T,m,null),w.stop()}else if(T.keyCode===R.a.DOWN){var _=w.getRatio(T);w.down(T,_,null),w.stop()}else T.keyCode===R.a.ENTER&&l&&l(T);if(w.recordCursorPosition(),w.lastKeyCode=T.keyCode,c){for(var B=arguments.length,ue=new Array(B>1?B-1:0),Ae=1;Ae<B;Ae++)ue[Ae-1]=arguments[Ae];c.apply(void 0,[T].concat(ue))}},w.onKeyUp=function(T){var E=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),E){for(var c=arguments.length,l=new Array(c>1?c-1:0),m=1;m<c;m++)l[m-1]=arguments[m];E.apply(void 0,[T].concat(l))}},w.onChange=function(T){var E=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(T)),w.setState({inputValue:w.rawInput}),E(w.toNumber(w.rawInput))},w.onMouseUp=function(){var T=w.props.onMouseUp;w.recordCursorPosition(),T&&T.apply(void 0,arguments)},w.onFocus=function(){var T;w.setState({focused:!0}),(T=w.props).onFocus.apply(T,arguments)},w.onBlur=function(){var T=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var E=w.getCurrentValidValue(w.state.inputValue),c=w.setValue(E,j);if(T){var l=w.input.value,m=w.getInputDisplayValue({focus:!1,value:c});w.input.value=m&&Number(m),T.apply(void 0,arguments),w.input.value=l}},w.getRatio=function(T){var E=1;return T.metaKey||T.ctrlKey?E=.1:T.shiftKey&&(E=10),E},w.getFullNum=function(T){return isNaN(T)?T:/e/i.test(String(T))?Number(T).toFixed(18).replace(/\.?0+$/,""):T},w.getPrecision=function(T){if(De(w.props.precision))return w.props.precision;var E=String(T);if(E.indexOf("e-")>=0)return parseInt(E.slice(E.indexOf("e-")+2),10);var c=0;return E.indexOf(".")>=0&&(c=E.length-E.indexOf(".")-1),c},w.getInputDisplayValue=function(T){var E=T||w.state,c=E.focused,l=E.inputValue,m=E.value,_;c?_=l:_=w.toPrecisionAsStep(m),_==null&&(_="");var B=w.formatWrapper(_);return De(w.props.decimalSeparator)&&(B=B.toString().replace(".",w.props.decimalSeparator)),B},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(T){}},w.restoreByAfter=function(T){if(T===void 0)return!1;var E=w.input.value,c=E.lastIndexOf(T);if(c===-1)return!1;var l=w.cursorBefore.length;return w.lastKeyCode===R.a.DELETE&&w.cursorBefore.charAt(l-1)===T[0]?(w.fixCaret(l,l),!0):c+T.length===E.length?(w.fixCaret(c,c),!0):!1},w.partRestoreByAfter=function(T){return T===void 0?!1:Array.prototype.some.call(T,function(E,c){var l=T.substring(c);return w.restoreByAfter(l)})},w.isNotCompleteNumber=function(T){return isNaN(T)||T===""||T===null||T&&T.toString().indexOf(".")===T.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(T,E,c){w.pressingUpOrDown=!0,w.step("down",T,E,c)},w.up=function(T,E,c){w.pressingUpOrDown=!0,w.step("up",T,E,c)},w.saveInput=function(T){w.input=T};var q=H.value;q===void 0&&(q=H.defaultValue),w.state={focused:H.autoFocus};var U=w.getValidValue(w.toNumber(q));return w.state=te(te({},w.state),{},{inputValue:w.toPrecisionAsStep(U),value:U}),w}return Object(Se.a)(Q,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var q=this.props,U=q.value,T=q.onChange,E=q.max,c=q.min,l=this.state.focused;if(w){if(!Fe(w.value,U)||!Fe(w.max,E)||!Fe(w.min,c)){var m=l?U:this.getValidValue(U),_;this.pressingUpOrDown?_=m:this.inputting?_=this.rawInput:_=this.toPrecisionAsStep(m),this.setState({value:m,inputValue:_})}var B="value"in this.props?U:this.state.value;"max"in this.props&&w.max!==E&&typeof B=="number"&&B>E&&T&&T(E),"min"in this.props&&w.min!==c&&typeof B=="number"&&B<c&&T&&T(c)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===R.a.BACKSPACE?ue=this.cursorStart-1:this.lastKeyCode===R.a.DELETE&&(ue=this.cursorStart):ue=this.input.value.length,this.fixCaret(ue,ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case R.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case R.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ae){}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(w){var q=w;return q===""?q="":this.isNotCompleteNumber(parseFloat(q))?q=this.state.value:q=this.getValidValue(q),this.toNumber(q)}},{key:"getValueFromEvent",value:function(w){var q=w.target.value.trim().replace(/。/g,".");return De(this.props.decimalSeparator)&&(q=q.replace(this.props.decimalSeparator,".")),q}},{key:"getValidValue",value:function(w){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,T=parseFloat(w);return isNaN(T)?w:(T<q&&(T=q),T>U&&(T=U),T)}},{key:"setValue",value:function(w,q){var U=this.props.precision,T=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),E=this.state.value,c=E===void 0?null:E,l=this.state.inputValue,m=l===void 0?null:l,_=typeof T=="number"?T.toFixed(U):"".concat(T),B=T!==c||_!=="".concat(m);return"value"in this.props?(m=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:m},q)):this.setState({value:T,inputValue:this.toPrecisionAsStep(w)},q),B&&this.props.onChange(T),T}},{key:"getMaxPrecision",value:function(w){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.props,T=U.precision,E=U.step;if(De(T))return T;var c=this.getPrecision(q),l=this.getPrecision(E),m=this.getPrecision(w);return w?Math.max(m,c+l):c+l}},{key:"getPrecisionFactor",value:function(w){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=this.getMaxPrecision(w,q);return Math.pow(10,U)}},{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(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var q=Math.abs(this.getMaxPrecision(w));return isNaN(q)?w.toString():Number(w).toFixed(q)}},{key:"toNumber",value:function(w){var q=this.props.precision,U=this.state.focused,T=w&&w.length>16&&U;return this.isNotCompleteNumber(w)||T?w:De(q)?Math.round(w*Math.pow(10,q))/Math.pow(10,q):Number(w)}},{key:"upStep",value:function(w,q){var U=this.props.step,T=this.getPrecisionFactor(w,q),E=Math.abs(this.getMaxPrecision(w,q)),c=((T*w+T*U*q)/T).toFixed(E);return this.toNumber(c)}},{key:"downStep",value:function(w,q){var U=this.props.step,T=this.getPrecisionFactor(w,q),E=Math.abs(this.getMaxPrecision(w,q)),c=((T*w-T*U*q)/T).toFixed(E);return this.toNumber(c)}},{key:"step",value:function(w,q){var U=this,T=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=arguments.length>3?arguments[3]:void 0;this.stop(),q&&(q.persist(),q.preventDefault());var c=this.props;if(c.disabled)return;var l=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(l))return;var m=this["".concat(w,"Step")](l,T),_=m>c.max||m<c.min;if(m>c.max?m=c.max:m<c.min&&(m=c.min),this.setValue(m,null),this.setState({focused:!0},function(){U.pressingUpOrDown=!1}),_)return;this.autoStepTimer=setTimeout(function(){U[w](q,T,!0)},E?Oe:Xe)}},{key:"fixCaret",value:function(w,q){if(w===void 0||q===void 0||!this.input||!this.input.value)return;try{var U=this.input.selectionStart,T=this.input.selectionEnd;(w!==U||q!==T)&&this.input.setSelectionRange(w,q)}catch(E){}}},{key:"render",value:function(){var w,q=this.props,U=q.prefixCls,T=q.disabled,E=q.readOnly,c=q.useTouch,l=q.autoComplete,m=q.upHandler,_=q.downHandler,B=q.className,ue=q.max,Ae=q.min,de=q.style,ie=q.title,G=q.onMouseEnter,Z=q.onMouseLeave,M=q.onMouseOver,J=q.onMouseOut,h=q.required,C=q.onClick,g=q.tabIndex,re=q.type,pe=q.placeholder,Y=q.id,se=q.inputMode,ke=q.pattern,Re=q.step,Le=q.maxLength,be=q.autoFocus,Ee=q.name,Ue=q.onPaste,Je=q.onInput,ze=Object(K.a)(q,["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"]),Ve=this.state,ot=Ve.value,rt=Ve.focused,Ke=N()(U,(w={},Object(Ce.a)(w,B,!!B),Object(Ce.a)(w,"".concat(U,"-disabled"),T),Object(Ce.a)(w,"".concat(U,"-focused"),rt),w)),he={};Object.keys(ze).forEach(function(k){(k.substr(0,5)==="data-"||k.substr(0,5)==="aria-"||k==="role")&&(he[k]=ze[k])});var it=!E&&!T,qe=this.getInputDisplayValue(null),ye=(ot||ot===0)&&(isNaN(ot)||Number(ot)>=ue),Pe=(ot||ot===0)&&(isNaN(ot)||Number(ot)<=Ae),I=ye||T||E,A=Pe||T||E,O=N()("".concat(U,"-handler"),"".concat(U,"-handler-up"),Object(Ce.a)({},"".concat(U,"-handler-up-disabled"),I)),f=N()("".concat(U,"-handler"),"".concat(U,"-handler-down"),Object(Ce.a)({},"".concat(U,"-handler-down-disabled"),A)),p=c?{onTouchStart:I?j:this.up,onTouchEnd:this.stop}:{onMouseDown:I?j:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},b=c?{onTouchStart:A?j:this.down,onTouchEnd:this.stop}:{onMouseDown:A?j:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return P.a.createElement("div",{className:Ke,style:de,title:ie,onMouseEnter:G,onMouseLeave:Z,onMouseOver:M,onMouseOut:J,onFocus:function(){return null},onBlur:function(){return null}},P.a.createElement("div",{className:"".concat(U,"-handler-wrap")},P.a.createElement("span",Object.assign({unselectable:"on"},p,{role:"button","aria-label":"Increase Value","aria-disabled":I,className:O}),m||P.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-up-inner"),onClick:le})),P.a.createElement("span",Object.assign({unselectable:"on"},b,{role:"button","aria-label":"Decrease Value","aria-disabled":A,className:f}),_||P.a.createElement("span",{unselectable:"on",className:"".concat(U,"-handler-down-inner"),onClick:le}))),P.a.createElement("div",{className:"".concat(U,"-input-wrap")},P.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ae,"aria-valuemax":ue,"aria-valuenow":ot,required:h,type:re,placeholder:pe,onPaste:Ue,onClick:C,onMouseUp:this.onMouseUp,className:"".concat(U,"-input"),tabIndex:g,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:it?this.onKeyDown:j,onKeyUp:it?this.onKeyUp:j,autoFocus:be,maxLength:Le,readOnly:E,disabled:T,max:ue,min:Ae,step:Re,name:Ee,title:ie,id:Y,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(qe),pattern:ke,inputMode:se,onInput:Je},he))))}}]),Q}(P.a.Component);xe.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:Ie,min:-Ie,step:1,style:{},onChange:j,onKeyDown:j,onPressEnter:j,onFocus:j,onBlur:j,parser:ce,required:!1,autoComplete:"off"};var we=xe,fe=Ye.a=we},h78n:function(ft,Ye,x){"use strict";x.d(Ye,"a",function(){return w});var K=x("cDcd"),Ce=x.n(K),oe=x("TSYQ"),Se=x.n(oe),ge={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},ee=function(T){var E=T.map(function(){return Object(K.useRef)()}),c=Object(K.useRef)();return Object(K.useEffect)(function(){var l=Date.now(),m=!1;Object.keys(E).forEach(function(_){var B=E[_].current;if(!B)return;m=!0;var ue=B.style;ue.transitionDuration=".3s, .3s, .3s, .06s",c.current&&l-c.current<100&&(ue.transitionDuration="0s, 0s")}),m&&(c.current=Date.now())}),[E]};function L(){return L=Object.assign||function(U){for(var T=1;T<arguments.length;T++){var E=arguments[T];for(var c in E)Object.prototype.hasOwnProperty.call(E,c)&&(U[c]=E[c])}return U},L.apply(this,arguments)}function W(U,T){return ve(U)||R(U,T)||V(U,T)||P()}function P(){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 V(U,T){if(!U)return;if(typeof U=="string")return N(U,T);var E=Object.prototype.toString.call(U).slice(8,-1);if(E==="Object"&&U.constructor&&(E=U.constructor.name),E==="Map"||E==="Set")return Array.from(U);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return N(U,T)}function N(U,T){(T==null||T>U.length)&&(T=U.length);for(var E=0,c=new Array(T);E<T;E++)c[E]=U[E];return c}function R(U,T){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var E=[],c=!0,l=!1,m=void 0;try{for(var _=U[Symbol.iterator](),B;!(c=(B=_.next()).done)&&!(E.push(B.value),T&&E.length===T);c=!0);}catch(ue){l=!0,m=ue}finally{try{!c&&_.return!=null&&_.return()}finally{if(l)throw m}}return E}function ve(U){if(Array.isArray(U))return U}function te(U,T){if(U==null)return{};var E=F(U,T),c,l;if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(U);for(l=0;l<m.length;l++){if(c=m[l],T.indexOf(c)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,c))continue;E[c]=U[c]}}return E}function F(U,T){if(U==null)return{};var E={},c=Object.keys(U),l,m;for(m=0;m<c.length;m++){if(l=c[m],T.indexOf(l)>=0)continue;E[l]=U[l]}return E}var z=function(T){var E=T.className,c=T.percent,l=T.prefixCls,m=T.strokeColor,_=T.strokeLinecap,B=T.strokeWidth,ue=T.style,Ae=T.trailColor,de=T.trailWidth,ie=T.transition,G=te(T,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete G.gapPosition;var Z=Array.isArray(c)?c:[c],M=Array.isArray(m)?m:[m],J=ee(Z),h=W(J,1),C=h[0],g=B/2,re=100-B/2,pe="M ".concat(_==="round"?g:0,",").concat(g,`
|
|
L `).concat(_==="round"?re:100,",").concat(g),Y="0 0 100 ".concat(B),se=0;return Ce.a.createElement("svg",L({className:Se()("".concat(l,"-line"),E),viewBox:Y,preserveAspectRatio:"none",style:ue},G),Ce.a.createElement("path",{className:"".concat(l,"-line-trail"),d:pe,strokeLinecap:_,stroke:Ae,strokeWidth:de||B,fillOpacity:"0"}),Z.map(function(ke,Re){var Le={strokeDasharray:"".concat(ke,"px, 100px"),strokeDashoffset:"-".concat(se,"px"),transition:ie||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},be=M[Re]||M[M.length-1];return se+=ke,Ce.a.createElement("path",{key:Re,className:"".concat(l,"-line-path"),d:pe,strokeLinecap:_,stroke:be,strokeWidth:B,fillOpacity:"0",ref:C[Re],style:Le})}))};z.defaultProps=ge;var j=z;function le(){return le=Object.assign||function(U){for(var T=1;T<arguments.length;T++){var E=arguments[T];for(var c in E)Object.prototype.hasOwnProperty.call(E,c)&&(U[c]=E[c])}return U},le.apply(this,arguments)}function ce(U,T){return Fe(U)||De(U,T)||Xe(U,T)||Oe()}function Oe(){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 Xe(U,T){if(!U)return;if(typeof U=="string")return Ie(U,T);var E=Object.prototype.toString.call(U).slice(8,-1);if(E==="Object"&&U.constructor&&(E=U.constructor.name),E==="Map"||E==="Set")return Array.from(U);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return Ie(U,T)}function Ie(U,T){(T==null||T>U.length)&&(T=U.length);for(var E=0,c=new Array(T);E<T;E++)c[E]=U[E];return c}function De(U,T){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(U)))return;var E=[],c=!0,l=!1,m=void 0;try{for(var _=U[Symbol.iterator](),B;!(c=(B=_.next()).done)&&!(E.push(B.value),T&&E.length===T);c=!0);}catch(ue){l=!0,m=ue}finally{try{!c&&_.return!=null&&_.return()}finally{if(l)throw m}}return E}function Fe(U){if(Array.isArray(U))return U}function xe(U,T){if(U==null)return{};var E=we(U,T),c,l;if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(U);for(l=0;l<m.length;l++){if(c=m[l],T.indexOf(c)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(U,c))continue;E[c]=U[c]}}return E}function we(U,T){if(U==null)return{};var E={},c=Object.keys(U),l,m;for(m=0;m<c.length;m++){if(l=c[m],T.indexOf(l)>=0)continue;E[l]=U[l]}return E}var fe=0;function ne(U){return+U.replace("%","")}function v(U){return Array.isArray(U)?U:[U]}function Q(U,T,E,c){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,m=arguments.length>5?arguments[5]:void 0,_=50-c/2,B=0,ue=-_,Ae=0,de=-2*_;switch(m){case"left":B=-_,ue=0,Ae=2*_,de=0;break;case"right":B=_,ue=0,Ae=-2*_,de=0;break;case"bottom":ue=_,de=2*_;break;default:}var ie="M 50,50 m ".concat(B,",").concat(ue,`
|
|
a `).concat(_,",").concat(_," 0 1 1 ").concat(Ae,",").concat(-de,`
|
|
a `).concat(_,",").concat(_," 0 1 1 ").concat(-Ae,",").concat(de),G=Math.PI*2*_,Z={stroke:E,strokeDasharray:"".concat(T/100*(G-l),"px ").concat(G,"px"),strokeDashoffset:"-".concat(l/2+U/100*(G-l),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ie,pathStyle:Z}}var H=function(T){var E=T.prefixCls,c=T.strokeWidth,l=T.trailWidth,m=T.gapDegree,_=T.gapPosition,B=T.trailColor,ue=T.strokeLinecap,Ae=T.style,de=T.className,ie=T.strokeColor,G=T.percent,Z=xe(T,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),M=Object(K.useMemo)(function(){return fe+=1,fe},[]),J=Q(0,100,B,c,m,_),h=J.pathString,C=J.pathStyle,g=v(G),re=v(ie),pe=re.find(function(Le){return Object.prototype.toString.call(Le)==="[object Object]"}),Y=ee(g),se=ce(Y,1),ke=se[0],Re=function(){var be=0;return g.map(function(Ee,Ue){var Je=re[Ue]||re[re.length-1],ze=Object.prototype.toString.call(Je)==="[object Object]"?"url(#".concat(E,"-gradient-").concat(M,")"):"",Ve=Q(be,Ee,Je,c,m,_);return be+=Ee,Ce.a.createElement("path",{key:Ue,className:"".concat(E,"-circle-path"),d:Ve.pathString,stroke:ze,strokeLinecap:ue,strokeWidth:c,opacity:Ee===0?0:1,fillOpacity:"0",style:Ve.pathStyle,ref:ke[Ue]})})};return Ce.a.createElement("svg",le({className:Se()("".concat(E,"-circle"),de),viewBox:"0 0 100 100",style:Ae},Z),pe&&Ce.a.createElement("defs",null,Ce.a.createElement("linearGradient",{id:"".concat(E,"-gradient-").concat(M),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(pe).sort(function(Le,be){return ne(Le)-ne(be)}).map(function(Le,be){return Ce.a.createElement("stop",{key:be,offset:Le,stopColor:pe[Le]})}))),Ce.a.createElement("path",{className:"".concat(E,"-circle-trail"),d:h,stroke:B,strokeLinecap:ue,strokeWidth:l||c,fillOpacity:"0",style:C}),Re().reverse())};H.defaultProps=ge;var w=H,q={Line:j,Circle:w}},iIVh:function(ft,Ye,x){},kSUc:function(ft,Ye,x){},lZu9:function(ft,Ye,x){(function(K){K(x("VrN/"),x("1eCo"),x("8EBN"))})(function(K){"use strict";K.defineMode("markdown",function(Ce,oe){var Se=K.getMode(Ce,"text/html"),ge=Se.name=="null";function ee(c){if(K.findModeByName){var l=K.findModeByName(c);l&&(c=l.mime||l.mimes[0])}var m=K.getMode(Ce,c);return m.name=="null"?null:m}oe.highlightFormatting===void 0&&(oe.highlightFormatting=!1),oe.maxBlockquoteDepth===void 0&&(oe.maxBlockquoteDepth=0),oe.taskLists===void 0&&(oe.taskLists=!1),oe.strikethrough===void 0&&(oe.strikethrough=!1),oe.emoji===void 0&&(oe.emoji=!1),oe.fencedCodeBlockHighlighting===void 0&&(oe.fencedCodeBlockHighlighting=!0),oe.fencedCodeBlockDefaultMode===void 0&&(oe.fencedCodeBlockDefaultMode="text/plain"),oe.xml===void 0&&(oe.xml=!0),oe.tokenTypeOverrides===void 0&&(oe.tokenTypeOverrides={});var L={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 W in L)L.hasOwnProperty(W)&&oe.tokenTypeOverrides[W]&&(L[W]=oe.tokenTypeOverrides[W]);var P=/^([*\-_])(?:\s*\1){2,}\s*$/,V=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,N=/^\[(x| )\](?=\s)/i,R=oe.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ve=/^ {0,3}(?:\={1,}|-{2,})\s*$/,te=/^[^#!\[\]*_\\<>` "'(~:]+/,F=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,z=/^\s*\[[^\]]+?\]:.*$/,j=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,le=" ";function ce(c,l,m){return l.f=l.inline=m,m(c,l)}function Oe(c,l,m){return l.f=l.block=m,m(c,l)}function Xe(c){return!c||!/\S/.test(c.string)}function Ie(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==Fe){var l=ge;if(!l){var m=K.innerMode(Se,c.htmlState);l=m.mode.name=="xml"&&m.state.tagStart===null&&!m.state.context&&m.state.tokenize.isInText}l&&(c.f=ne,c.block=De,c.htmlState=null)}return c.trailingSpace=0,c.trailingSpaceNewLine=!1,c.prevLine=c.thisLine,c.thisLine={stream:null},null}function De(c,l){var m=c.column()===l.indentation,_=Xe(l.prevLine.stream),B=l.indentedCode,ue=l.prevLine.hr,Ae=l.list!==!1,de=(l.listStack[l.listStack.length-1]||0)+3;l.indentedCode=!1;var ie=l.indentation;if(l.indentationDiff===null&&(l.indentationDiff=l.indentation,Ae)){for(l.list=null;ie<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=ie-l.listStack[l.listStack.length-1])}var G=!_&&!ue&&!l.prevLine.header&&(!Ae||!B)&&!l.prevLine.fencedCodeEnd,Z=(l.list===!1||ue||_)&&l.indentation<=de&&c.match(P),M=null;if(l.indentationDiff>=4&&(B||l.prevLine.fencedCodeEnd||l.prevLine.header||_))return c.skipToEnd(),l.indentedCode=!0,L.code;if(c.eatSpace())return null;if(m&&l.indentation<=de&&(M=c.match(R))&&M[1].length<=6)return l.quote=0,l.header=M[1].length,l.thisLine.header=!0,oe.highlightFormatting&&(l.formatting="header"),l.f=l.inline,we(l);if(l.indentation<=de&&c.eat(">"))return l.quote=m?1:l.quote+1,oe.highlightFormatting&&(l.formatting="quote"),c.eatSpace(),we(l);if(!Z&&!l.setext&&m&&l.indentation<=de&&(M=c.match(V))){var J=M[1]?"ol":"ul";return l.indentation=ie+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,oe.taskLists&&c.match(N,!1)&&(l.taskList=!0),l.f=l.inline,oe.highlightFormatting&&(l.formatting=["list","list-"+J]),we(l)}else{if(m&&l.indentation<=de&&(M=c.match(F,!0)))return l.quote=0,l.fencedEndRE=new RegExp(M[1]+"+ *$"),l.localMode=oe.fencedCodeBlockHighlighting&&ee(M[2]||oe.fencedCodeBlockDefaultMode),l.localMode&&(l.localState=K.startState(l.localMode)),l.f=l.block=xe,oe.highlightFormatting&&(l.formatting="code-block"),l.code=-1,we(l);if(l.setext||(!G||!Ae)&&!l.quote&&l.list===!1&&!l.code&&!Z&&!z.test(c.string)&&(M=c.lookAhead(1))&&(M=M.match(ve)))return l.setext?(l.header=l.setext,l.setext=0,c.skipToEnd(),oe.highlightFormatting&&(l.formatting="header")):(l.header=M[0].charAt(0)=="="?1:2,l.setext=l.header),l.thisLine.header=!0,l.f=l.inline,we(l);if(Z)return c.skipToEnd(),l.hr=!0,l.thisLine.hr=!0,L.hr;if(c.peek()==="[")return ce(c,l,q)}return ce(c,l,l.inline)}function Fe(c,l){var m=Se.token(c,l.htmlState);if(!ge){var _=K.innerMode(Se,l.htmlState);(_.mode.name=="xml"&&_.state.tagStart===null&&!_.state.context&&_.state.tokenize.isInText||l.md_inside&&c.current().indexOf(">")>-1)&&(l.f=ne,l.block=De,l.htmlState=null)}return m}function xe(c,l){var m=l.listStack[l.listStack.length-1]||0,_=l.indentation<m,B=m+3;if(l.fencedEndRE&&l.indentation<=B&&(_||c.match(l.fencedEndRE))){oe.highlightFormatting&&(l.formatting="code-block");var ue;return _||(ue=we(l)),l.localMode=l.localState=null,l.block=De,l.f=ne,l.fencedEndRE=null,l.code=0,l.thisLine.fencedCodeEnd=!0,_?Oe(c,l,l.block):ue}else return l.localMode?l.localMode.token(c,l.localState):(c.skipToEnd(),L.code)}function we(c){var l=[];if(c.formatting){l.push(L.formatting),typeof c.formatting=="string"&&(c.formatting=[c.formatting]);for(var m=0;m<c.formatting.length;m++)l.push(L.formatting+"-"+c.formatting[m]),c.formatting[m]==="header"&&l.push(L.formatting+"-"+c.formatting[m]+"-"+c.header),c.formatting[m]==="quote"&&(!oe.maxBlockquoteDepth||oe.maxBlockquoteDepth>=c.quote?l.push(L.formatting+"-"+c.formatting[m]+"-"+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(L.linkHref,"url"):(c.strong&&l.push(L.strong),c.em&&l.push(L.em),c.strikethrough&&l.push(L.strikethrough),c.emoji&&l.push(L.emoji),c.linkText&&l.push(L.linkText),c.code&&l.push(L.code),c.image&&l.push(L.image),c.imageAltText&&l.push(L.imageAltText,"link"),c.imageMarker&&l.push(L.imageMarker)),c.header&&l.push(L.header,L.header+"-"+c.header),c.quote&&(l.push(L.quote),!oe.maxBlockquoteDepth||oe.maxBlockquoteDepth>=c.quote?l.push(L.quote+"-"+c.quote):l.push(L.quote+"-"+oe.maxBlockquoteDepth)),c.list!==!1){var _=(c.listStack.length-1)%3;_?_===1?l.push(L.list2):l.push(L.list3):l.push(L.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 fe(c,l){return c.match(te,!0)?we(l):void 0}function ne(c,l){var m=l.text(c,l);if(typeof m!="undefined")return m;if(l.list)return l.list=null,we(l);if(l.taskList){var _=c.match(N,!0)[1]===" ";return _?l.taskOpen=!0:l.taskClosed=!0,oe.highlightFormatting&&(l.formatting="task"),l.taskList=!1,we(l)}if(l.taskOpen=!1,l.taskClosed=!1,l.header&&c.match(/^#+$/,!0))return oe.highlightFormatting&&(l.formatting="header"),we(l);var B=c.next();if(l.linkTitle){l.linkTitle=!1;var ue=B;B==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ae="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(c.match(new RegExp(Ae),!0))return L.linkHref}if(B==="`"){var de=l.formatting;oe.highlightFormatting&&(l.formatting="code"),c.eatWhile("`");var ie=c.current().length;if(l.code==0&&(!l.quote||ie==1))return l.code=ie,we(l);if(ie==l.code){var G=we(l);return l.code=0,G}else return l.formatting=de,we(l)}else if(l.code)return we(l);if(B==="\\"&&(c.next(),oe.highlightFormatting)){var Z=we(l),M=L.formatting+"-escape";return Z?Z+" "+M:M}if(B==="!"&&c.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return l.imageMarker=!0,l.image=!0,oe.highlightFormatting&&(l.formatting="image"),we(l);if(B==="["&&l.imageMarker&&c.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return l.imageMarker=!1,l.imageAltText=!0,oe.highlightFormatting&&(l.formatting="image"),we(l);if(B==="]"&&l.imageAltText){oe.highlightFormatting&&(l.formatting="image");var Z=we(l);return l.imageAltText=!1,l.image=!1,l.inline=l.f=Q,Z}if(B==="["&&!l.image)return l.linkText&&c.match(/^.*?\]/)||(l.linkText=!0,oe.highlightFormatting&&(l.formatting="link")),we(l);if(B==="]"&&l.linkText){oe.highlightFormatting&&(l.formatting="link");var Z=we(l);return l.linkText=!1,l.inline=l.f=c.match(/\(.*?\)| ?\[.*?\]/,!1)?Q:ne,Z}if(B==="<"&&c.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){l.f=l.inline=v,oe.highlightFormatting&&(l.formatting="link");var Z=we(l);return Z?Z+=" ":Z="",Z+L.linkInline}if(B==="<"&&c.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){l.f=l.inline=v,oe.highlightFormatting&&(l.formatting="link");var Z=we(l);return Z?Z+=" ":Z="",Z+L.linkEmail}if(oe.xml&&B==="<"&&c.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var J=c.string.indexOf(">",c.pos);if(J!=-1){var h=c.string.substring(c.start,J);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(h)&&(l.md_inside=!0)}return c.backUp(1),l.htmlState=K.startState(Se),Oe(c,l,Fe)}if(oe.xml&&B==="<"&&c.match(/^\/\w*?>/))return l.md_inside=!1,"tag";if(B==="*"||B==="_"){for(var C=1,g=c.pos==1?" ":c.string.charAt(c.pos-2);C<3&&c.eat(B);)C++;var re=c.peek()||" ",pe=!/\s/.test(re)&&(!j.test(re)||/\s/.test(g)||j.test(g)),Y=!/\s/.test(g)&&(!j.test(g)||/\s/.test(re)||j.test(re)),se=null,ke=null;if(C%2&&(!l.em&&pe&&(B==="*"||!Y||j.test(g))?se=!0:l.em==B&&Y&&(B==="*"||!pe||j.test(re))&&(se=!1)),C>1&&(!l.strong&&pe&&(B==="*"||!Y||j.test(g))?ke=!0:l.strong==B&&Y&&(B==="*"||!pe||j.test(re))&&(ke=!1)),ke!=null||se!=null){oe.highlightFormatting&&(l.formatting=se==null?"strong":ke==null?"em":"strong em"),se===!0&&(l.em=B),ke===!0&&(l.strong=B);var G=we(l);return se===!1&&(l.em=!1),ke===!1&&(l.strong=!1),G}}else if(B===" "&&(c.eat("*")||c.eat("_"))){if(c.peek()===" ")return we(l);c.backUp(1)}if(oe.strikethrough){if(B==="~"&&c.eatWhile(B)){if(l.strikethrough){oe.highlightFormatting&&(l.formatting="strikethrough");var G=we(l);return l.strikethrough=!1,G}else if(c.match(/^[^\s]/,!1))return l.strikethrough=!0,oe.highlightFormatting&&(l.formatting="strikethrough"),we(l)}else if(B===" "&&c.match(/^~~/,!0)){if(c.peek()===" ")return we(l);c.backUp(2)}}if(oe.emoji&&B===":"&&c.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){l.emoji=!0,oe.highlightFormatting&&(l.formatting="emoji");var Re=we(l);return l.emoji=!1,Re}return B===" "&&(c.match(/^ +$/,!1)?l.trailingSpace++:l.trailingSpace&&(l.trailingSpaceNewLine=!0)),we(l)}function v(c,l){var m=c.next();if(m===">"){l.f=l.inline=ne,oe.highlightFormatting&&(l.formatting="link");var _=we(l);return _?_+=" ":_="",_+L.linkInline}return c.match(/^[^>]+/,!0),L.linkInline}function Q(c,l){if(c.eatSpace())return null;var m=c.next();return m==="("||m==="["?(l.f=l.inline=w(m==="("?")":"]"),oe.highlightFormatting&&(l.formatting="link-string"),l.linkHref=!0,we(l)):"error"}var H={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(c){return function(l,m){var _=l.next();if(_===c){m.f=m.inline=ne,oe.highlightFormatting&&(m.formatting="link-string");var B=we(m);return m.linkHref=!1,B}return l.match(H[c]),m.linkHref=!0,we(m)}}function q(c,l){return c.match(/^([^\]\\]|\\.)*\]:/,!1)?(l.f=U,c.next(),oe.highlightFormatting&&(l.formatting="link"),l.linkText=!0,we(l)):ce(c,l,ne)}function U(c,l){if(c.match(/^\]:/,!0)){l.f=l.inline=T,oe.highlightFormatting&&(l.formatting="link");var m=we(l);return l.linkText=!1,m}return c.match(/^([^\]\\]|\\.)+/,!0),L.linkText}function T(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=ne,L.linkHref+" url")}var E={startState:function(){return{f:De,prevLine:{stream:null},thisLine:{stream:null},block:De,htmlState:null,indentation:0,inline:ne,text:fe,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&&K.copyState(Se,c.htmlState),indentation:c.indentation,localMode:c.localMode,localState:c.localMode?K.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 Ie(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!=Fe)){var m=c.match(/^\s*/,!0)[0].replace(/\t/g,le).length;if(l.indentation=m,l.indentationDiff=null,m>0)return null}}return l.f(c,l)},innerMode:function(c){return c.block==Fe?{state:c.htmlState,mode:Se}:c.localState?{state:c.localState,mode:c.localMode}:{state:c,mode:E}},indent:function(c,l,m){return c.block==Fe&&Se.indent?Se.indent(c.htmlState,l,m):c.localState&&c.localMode.indent?c.localMode.indent(c.localState,l,m):K.Pass},blankLine:Ie,getType:we,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return E},"xml"),K.defineMIME("text/markdown","markdown"),K.defineMIME("text/x-markdown","markdown")})},nojB:function(ft,Ye,x){"use strict";x.r(Ye);var K=x("T2oS"),Ce=x("W9HT"),oe=x("9og8"),Se=x("tJVT"),ge=x("k1fw"),ee=x("WmNS"),L=x.n(ee),W=x("cDcd"),P=x.n(W),V=x("X0ci"),N=x("iIVh"),R=x("Ty5D"),ve=x("55Ip"),te=x("+L6B"),F=x("2/Rp"),z=x("5NDa"),j=x("5rEg"),le=x("2qtc"),ce=x("kLXV"),Oe=x("miYZ"),Xe=x("tsqr"),Ie=x("PpiC"),De=x("y8nQ"),Fe=x("Vl3Y"),xe=x("DZo9"),we=x("8z0m"),fe=x("sRBo"),ne=x("kaz8"),v=x("LtfV"),Q=x("m3rI"),H=x("Ot1p"),w=ne.a.Group,q=we.a.Dragger;function U(B,ue){var Ae=new FileReader;Ae.addEventListener("load",function(){return ue(Ae.result)}),Ae.readAsDataURL(B)}var T=function(B){var ue=B.callback,Ae=B.tags,de=Ae===void 0?[]:Ae,ie=B.initialValues,G=ie===void 0?{}:ie,Z=B.removeAttachment,M=Object(W.useState)(""),J=Object(Se.a)(M,2),h=J[0],C=J[1],g=Fe.a.useForm(),re=Object(Se.a)(g,1),pe=re[0];function Y(be){var Ee=be.cover_id,Ue=be.attachment_ids,Je=Object(Ie.a)(be,["cover_id","attachment_ids"]);ue(Object(ge.a)(Object(ge.a)({},Je),{},{cover_id:Ee==null?void 0:Ee.map(function(ze){return ze.response?ze.response.id:ze.uid})[(Ee==null?void 0:Ee.length)-1],attachment_ids:Ue?Ue==null?void 0:Ue.map(function(ze){return ze.response?ze.response.id:ze.uid}):[]}))}function se(be){return Array.isArray(be)?be:be&&be.fileList}var ke={multiple:!0,beforeUpload:function(Ee){var Ue=Ee.size/1024/1024<100;if(!Ue)return Xe.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(100MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"),Ue},action:"".concat(Q.a.API_SERVER,"/api/attachments.json"),onRemove:function(Ee){ce.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){return Z(Ee.response?Ee.response.id:Ee.uid)},onCancel:function(){return!1}})}};function Re(be){be.file.status==="done"&&U(be.file.originFileObj,function(Ee){return C(Ee)})}var Le={showUploadList:!1,withCredentials:!0,action:"".concat(Q.a.API_SERVER,"/api/attachments.json"),onChange:Re};return Object(W.useEffect)(function(){G.title&&(pe.setFieldsValue(G),G.cover_id.length>0&&C(Q.a.IMG_SERVER+G.cover_id[0].url))},[G]),P.a.createElement(Fe.a,{form:pe,initialValues:G,className:"moop-panel",onFinish:Y},P.a.createElement(Fe.a.Item,{label:"\u6807\u9898",name:"title",extra:P.a.createElement("p",{className:"tip"},"\u7B80\u660E\u627C\u8981\u4ECB\u7ECD\u6587\u6863/\u89C6\u9891\u6240\u5305\u542B\u7684\u4E3B\u8981\u7684\u5185\u5BB9"),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},P.a.createElement(j.a,{placeholder:"\u4F8B\u5982\uFF1A\u8F6F\u4EF6\u5DE5\u7A0B\u6559\u5B66\u6848\u4F8B"})),P.a.createElement("div",{className:"flex-container"},P.a.createElement(Fe.a.Item,{label:"\u4F5C\u8005",name:"author_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u540D\u79F0"}]},P.a.createElement(j.a,{placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D",style:{marginRight:20,width:200}})),P.a.createElement(Fe.a.Item,{name:"author_school_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0"}]},P.a.createElement(j.a,{placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0",style:{width:200}}))),P.a.createElement(Fe.a.Item,{name:"tag_ids",label:"\u6807\u7B7E",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u6807\u7B7E"}]},P.a.createElement(w,null,de.map(function(be){return P.a.createElement(ne.a,{key:be.id,value:be.id}," ",be.name," ")}))),P.a.createElement(Fe.a.Item,{name:"publish",valuePropName:"checked"},P.a.createElement(ne.a,null,"\u662F\u5426\u7533\u8BF7\u53D1\u5E03")),P.a.createElement(Fe.a.Item,{name:"content",label:"\u63CF\u8FF0",valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},P.a.createElement(H.a,{id:"moop_cases_content",height:400})),P.a.createElement(Fe.a.Item,{name:"attachment_ids",valuePropName:"fileList",getValueFromEvent:se},P.a.createElement(q,ke,P.a.createElement("p",{className:"c-blue",style:{marginBottom:10,fontSize:18}},"\u4E0A\u4F20\u9644\u4EF6"),P.a.createElement("p",{className:"c-grey-c"},"\u4ECE\u6211\u7684\u7535\u8111\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u6863\uFF1A\u6309\u4F4FCTRL\u53EF\u4EE5\u4E0A\u4F20\u591A\u4EFD\u6587\u6863\u3002\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\uFF1A100MB"))),P.a.createElement(Fe.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",extra:"\u4E0A\u4F20\u5C3A\u5BF8\uFF1A120*90 px",getValueFromEvent:se,valuePropName:"fileList",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE"}]},P.a.createElement(we.a,Le,h?P.a.createElement("img",{src:h,width:120}):P.a.createElement("a",{title:"\u4E0A\u4F20\u5C01\u9762\u56FE",className:"upload-cover"}," ",P.a.createElement(v.a,null)," "))),P.a.createElement("div",{className:"desc"},P.a.createElement("h3",null,"\u5BA1\u6838\u8BF4\u660E"),P.a.createElement("p",null," \u5E73\u53F0\u7BA1\u7406\u5458\u5C06\u5BF9\u6BCF\u5929\u65B0\u4E0A\u4F20\u7684\u6587\u6863\u8FDB\u884C\u5BA1\u6838\uFF0C\u5BA1\u6838\u901A\u8FC7\u7684\u6587\u6863\u5C06\u516C\u5F00\u663E\u793A\uFF0C\u5426\u5219\u5C06\u79C1\u6709\u5316\u6216\u79FB\u9664 ")),P.a.createElement("div",{className:"desc"},P.a.createElement("h3",null,"\u6E29\u99A8\u63D0\u793A"),P.a.createElement("ul",{style:{padding:0}},P.a.createElement("li",null,"1.\u8BF7\u52FF\u4E0A\u4F20\u5DF2\u8BBE\u7F6E\u52A0\u5BC6\u53E3\u4EE4\u7684\u6587\u6863\u8D44\u6E90\uFF1B"),P.a.createElement("li",null,"2.\u53EF\u4EE5\u4E0A\u4F20\u7B26\u5408\u6559\u5B66\u6848\u4F8B\u6807\u51C6\u7684\u6587\u6863\u8D44\u6599\uFF0C\u5982",P.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34799",target:"_blank"}," \u6848\u4F8B\u5165\u5E93\u6807\u51C6 ")," \u3001",P.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34798",target:"_blank"},"\u6848\u4F8B\u4F7F\u7528\u8BF4\u660E\u4E66"),"\u4EE5\u53CA\u5176\u4ED6\u8D44\u6599\u7B49\uFF0C\u4E0A\u4F20\u652F\u6301\u7684\u6587\u4EF6\u6700\u5927\u5BB9\u91CF\uFF1A100MB\uFF1B"),P.a.createElement("li",null,"3.\u8BF7\u786E\u4FDD\u4E0A\u4F20\u5185\u5BB9\u65E0\u4FB5\u6743\u6216\u8FDD\u53CD\u56FD\u5BB6\u5173\u4E8E\u4E92\u8054\u7F51\u653F\u7B56\u7684\u4E0D\u826F\u884C\u4E3A\uFF1B"),P.a.createElement("li",null,"4.\u8BF7\u4F7F\u7528Chrome\uFF0CFirefox\uFF0CSafari\uFF0CIE11\uFF08\u53CA\u4EE5\u4E0A\u7248\u672C\uFF09\u6D4F\u89C8\u5668\uFF1B"))),P.a.createElement(Fe.a.Item,{style:{marginTop:10}},P.a.createElement(F.a,{type:"primary",htmlType:"submit"},"\u63D0\u4EA4")))},E=x("wzkS"),c={loading:!1,data:{},tags:[]},l;(function(B){B[B.GET_DATA=0]="GET_DATA",B[B.SET_LOADING=1]="SET_LOADING",B[B.GET_TAGS=2]="GET_TAGS"})(l||(l={}));function m(B,ue){switch(ue.type){case l.GET_DATA:return Object(ge.a)(Object(ge.a)({},B),ue.payload);case l.GET_TAGS:return Object(ge.a)(Object(ge.a)({},B),{},{tags:ue.payload});case l.SET_LOADING:return Object(ge.a)(Object(ge.a)({},B),{},{loading:ue.payload});default:throw new Error}}var _=Ye.default=function(){var B=Object(R.i)(),ue=B.caseId,Ae=Object(R.g)(),de=Object(W.useReducer)(m,c),ie=Object(Se.a)(de,2),G=ie[0],Z=ie[1],M=G.loading,J=G.tags,h=G.data;Object(W.useEffect)(function(){function pe(){return Y.apply(this,arguments)}function Y(){return Y=Object(oe.a)(L.a.mark(function se(){var ke;return L.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return Le.next=2,Object(E.b)();case 2:ke=Le.sent,Z({type:l.GET_TAGS,payload:ke.library_tags});case 4:case"end":return Le.stop()}},se)})),Y.apply(this,arguments)}pe()},[]),Object(W.useEffect)(function(){var pe=!1;function Y(){return se.apply(this,arguments)}function se(){return se=Object(oe.a)(L.a.mark(function ke(){var Re,Le,be,Ee,Ue,Je,ze,Ve,ot;return L.a.wrap(function(Ke){for(;;)switch(Ke.prev=Ke.next){case 0:return Z({type:l.SET_LOADING,payload:!1}),Ke.next=3,Object(E.c)(ue);case 3:Re=Ke.sent,Le=Re.author_name,be=Re.author_school_name,Ee=Re.content,Ue=Re.cover,Je=Re.attachments,ze=Re.status,Ve=Re.title,ot=Re.tags,pe||(Re.status===404?Ae.push("/moop_cases"):Z({type:l.GET_DATA,payload:{data:{title:Ve,author_name:Le,author_school_name:be,content:Ee,tag_ids:ot.map(function(he){return he.id}),publish:ze==="published",attachment_ids:Je.map(function(he){return{uid:he.id,id:he.id,name:he.title,url:he.url,filesize:he.filesize,status:"done"}}),cover_id:Ue!=null&&Ue.id?[{uid:Ue==null?void 0:Ue.id,id:Ue==null?void 0:Ue.id,name:Ue==null?void 0:Ue.title,url:Ue==null?void 0:Ue.url,filesize:Ue==null?void 0:Ue.filesize,status:"done"}]:[]},loading:!1}}));case 6:case"end":return Ke.stop()}},ke)})),se.apply(this,arguments)}return!pe&&ue&&Y(),function(){pe=!0}},[ue]);function C(pe){return g.apply(this,arguments)}function g(){return g=Object(oe.a)(L.a.mark(function pe(Y){var se,ke;return L.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:if(!ue){Le.next=6;break}return Le.next=3,Object(E.e)(ue,Y);case 3:Ae.push("/moop_cases/".concat(ue,"/publish-success")),Le.next=11;break;case 6:return Le.next=8,Object(E.a)(Y);case 8:se=Le.sent,ke=se.id,ke&&Ae.push("/moop_cases/".concat(ke,"/publish-success"));case 11:case"end":return Le.stop()}},pe)})),g.apply(this,arguments)}var re={initialValues:h,tags:J,removeAttachment:E.d,callback:C};return P.a.createElement(Ce.a,{spinning:M,delay:500},P.a.createElement("div",{className:"moop-info"},P.a.createElement("div",{className:"crumb"},P.a.createElement(ve.a,{to:"/moop_cases"},"\u6559\u5B66\u6848\u4F8B > "),P.a.createElement("span",null,"\u65B0\u5EFA")),P.a.createElement("div",{className:"title"},P.a.createElement("h2",null,"\u4E0A\u4F20\u6559\u5B66\u6848\u4F8B"),P.a.createElement(ve.a,{to:"/moop_cases"},"\u8FD4\u56DE")),P.a.createElement(T,re)))}},osHv:function(ft,Ye,x){(function(K){K(x("VrN/"))})(function(K){"use strict";var Ce=K.Pos;function oe(j,le){return j.line-le.line||j.ch-le.ch}var Se="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",ge=Se+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ee=new RegExp("<(/?)(["+Se+"]["+ge+"]*)","g");function L(j,le,ce,Oe){this.line=le,this.ch=ce,this.cm=j,this.text=j.getLine(le),this.min=Oe?Math.max(Oe.from,j.firstLine()):j.firstLine(),this.max=Oe?Math.min(Oe.to-1,j.lastLine()):j.lastLine()}function W(j,le){var ce=j.cm.getTokenTypeAt(Ce(j.line,le));return ce&&/\btag\b/.test(ce)}function P(j){return j.line>=j.max?void 0:(j.ch=0,j.text=j.cm.getLine(++j.line),!0)}function V(j){return j.line<=j.min?void 0:(j.text=j.cm.getLine(--j.line),j.ch=j.text.length,!0)}function N(j){for(;;){var le=j.text.indexOf(">",j.ch);if(le==-1){if(P(j))continue;return}if(!W(j,le+1)){j.ch=le+1;continue}var ce=j.text.lastIndexOf("/",le),Oe=ce>-1&&!/\S/.test(j.text.slice(ce+1,le));return j.ch=le+1,Oe?"selfClose":"regular"}}function R(j){for(;;){var le=j.ch?j.text.lastIndexOf("<",j.ch-1):-1;if(le==-1){if(V(j))continue;return}if(!W(j,le+1)){j.ch=le;continue}ee.lastIndex=le,j.ch=le;var ce=ee.exec(j.text);if(ce&&ce.index==le)return ce}}function ve(j){for(;;){ee.lastIndex=j.ch;var le=ee.exec(j.text);if(!le){if(P(j))continue;return}if(!W(j,le.index+1)){j.ch=le.index+1;continue}return j.ch=le.index+le[0].length,le}}function te(j){for(;;){var le=j.ch?j.text.lastIndexOf(">",j.ch-1):-1;if(le==-1){if(V(j))continue;return}if(!W(j,le+1)){j.ch=le;continue}var ce=j.text.lastIndexOf("/",le),Oe=ce>-1&&!/\S/.test(j.text.slice(ce+1,le));return j.ch=le+1,Oe?"selfClose":"regular"}}function F(j,le){for(var ce=[];;){var Oe=ve(j),Xe,Ie=j.line,De=j.ch-(Oe?Oe[0].length:0);if(!Oe||!(Xe=N(j)))return;if(Xe=="selfClose")continue;if(Oe[1]){for(var Fe=ce.length-1;Fe>=0;--Fe)if(ce[Fe]==Oe[2]){ce.length=Fe;break}if(Fe<0&&(!le||le==Oe[2]))return{tag:Oe[2],from:Ce(Ie,De),to:Ce(j.line,j.ch)}}else ce.push(Oe[2])}}function z(j,le){for(var ce=[];;){var Oe=te(j);if(!Oe)return;if(Oe=="selfClose"){R(j);continue}var Xe=j.line,Ie=j.ch,De=R(j);if(!De)return;if(De[1])ce.push(De[2]);else{for(var Fe=ce.length-1;Fe>=0;--Fe)if(ce[Fe]==De[2]){ce.length=Fe;break}if(Fe<0&&(!le||le==De[2]))return{tag:De[2],from:Ce(j.line,j.ch),to:Ce(Xe,Ie)}}}}K.registerHelper("fold","xml",function(j,le){for(var ce=new L(j,le.line,0);;){var Oe=ve(ce);if(!Oe||ce.line!=le.line)return;var Xe=N(ce);if(!Xe)return;if(!Oe[1]&&Xe!="selfClose"){var Ie=Ce(ce.line,ce.ch),De=F(ce,Oe[2]);return De&&oe(De.from,Ie)>0?{from:Ie,to:De.from}:null}}}),K.findMatchingTag=function(j,le,ce){var Oe=new L(j,le.line,le.ch,ce);if(Oe.text.indexOf(">")==-1&&Oe.text.indexOf("<")==-1)return;var Xe=N(Oe),Ie=Xe&&Ce(Oe.line,Oe.ch),De=Xe&&R(Oe);if(!Xe||!De||oe(Oe,le)>0)return;var Fe={from:Ce(Oe.line,Oe.ch),to:Ie,tag:De[2]};return Xe=="selfClose"?{open:Fe,close:null,at:"open"}:De[1]?{open:z(Oe,De[2]),close:Fe,at:"close"}:(Oe=new L(j,Ie.line,Ie.ch,ce),{open:Fe,close:F(Oe,De[2]),at:"open"})},K.findEnclosingTag=function(j,le,ce,Oe){for(var Xe=new L(j,le.line,le.ch,ce);;){var Ie=z(Xe,Oe);if(!Ie)break;var De=new L(j,le.line,le.ch,ce),Fe=F(De,Ie.tag);if(Fe)return{open:Ie,close:Fe}}},K.scanForClosingTag=function(j,le,ce,Oe){var Xe=new L(j,le.line,le.ch,Oe?{from:0,to:Oe}:null);return F(Xe,ce)}})},"p77/":function(ft,Ye,x){},rUJ1:function(ft,Ye){const x=/[&<>"']/,K=/[&<>"']/g,Ce=/[<>"']|&(?!#?\w+;)/,oe=/[<>"']|&(?!#?\w+;)/g,Se={"&":"&","<":"<",">":">",'"':""","'":"'"},ge=xe=>Se[xe];function ee(xe,we){if(we){if(x.test(xe))return xe.replace(K,ge)}else if(Ce.test(xe))return xe.replace(oe,ge);return xe}const L=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(xe){return xe.replace(L,(we,fe)=>(fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""))}const P=/(^|[^\[])\^/g;function V(xe,we){xe=xe.source||xe,we=we||"";const fe={replace:(ne,v)=>(v=v.source||v,v=v.replace(P,"$1"),xe=xe.replace(ne,v),fe),getRegex:()=>new RegExp(xe,we)};return fe}const N=/[^\w:]/g,R=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ve(xe,we,fe){if(xe){let ne;try{ne=decodeURIComponent(W(fe)).replace(N,"").toLowerCase()}catch(v){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}we&&!R.test(fe)&&(fe=le(we,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(ne){return null}return fe}const te={},F=/^[^:]+:\/*[^/]*$/,z=/^([^:]+:)[\s\S]*$/,j=/^([^:]+:\/*[^/]*)[\s\S]*$/;function le(xe,we){te[" "+xe]||(F.test(xe)?te[" "+xe]=xe+"/":te[" "+xe]=Ie(xe,"/",!0)),xe=te[" "+xe];const fe=xe.indexOf(":")===-1;return we.substring(0,2)==="//"?fe?we:xe.replace(z,"$1")+we:we.charAt(0)==="/"?fe?we:xe.replace(j,"$1")+we:xe+we}const ce={exec:function(){}};function Oe(xe){let we=1,fe,ne;for(;we<arguments.length;we++){fe=arguments[we];for(ne in fe)Object.prototype.hasOwnProperty.call(fe,ne)&&(xe[ne]=fe[ne])}return xe}function Xe(xe,we){const fe=xe.replace(/\|/g,(Q,H,w)=>{let q=!1,U=H;for(;--U>=0&&w[U]==="\\";)q=!q;return q?"|":" |"}),ne=fe.split(/ \|/);let v=0;if(ne.length>we)ne.splice(we);else for(;ne.length<we;)ne.push("");for(;v<ne.length;v++)ne[v]=ne[v].trim().replace(/\\\|/g,"|");return ne}function Ie(xe,we,fe){const ne=xe.length;if(ne===0)return"";let v=0;for(;v<ne;){const Q=xe.charAt(ne-v-1);if(Q===we&&!fe)v++;else if(Q!==we&&fe)v++;else break}return xe.substr(0,ne-v)}function De(xe,we){if(xe.indexOf(we[1])===-1)return-1;const fe=xe.length;let ne=0,v=0;for(;v<fe;v++)if(xe[v]==="\\")v++;else if(xe[v]===we[0])ne++;else if(xe[v]===we[1]&&(ne--,ne<0))return v;return-1}function Fe(xe){xe&&xe.sanitize&&!xe.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ft.exports={escape:ee,unescape:W,edit:V,cleanUrl:ve,resolveUrl:le,noopTest:ce,merge:Oe,splitCells:Xe,rtrim:Ie,findClosingBracket:De,checkSanitizeDeprecation:Fe}},wzkS:function(ft,Ye,x){"use strict";x.d(Ye,"c",function(){return ge}),x.d(Ye,"b",function(){return ee}),x.d(Ye,"d",function(){return L}),x.d(Ye,"a",function(){return P}),x.d(Ye,"e",function(){return V});var K=x("9og8"),Ce=x("WmNS"),oe=x.n(Ce),Se=x("ErOA");function ge(N){return Object(Se.c)("libraries/".concat(N,".json"))}function ee(){return Object(Se.c)("library_tags.json")}function L(N){return W.apply(this,arguments)}function W(){return W=Object(K.a)(oe.a.mark(function N(R){var ve;return oe.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(Se.b)("attachments/".concat(R,".json"));case 2:return ve=F.sent,F.abrupt("return",ve.status===0);case 4:case"end":return F.stop()}},N)})),W.apply(this,arguments)}function P(N){return Object(Se.f)("libraries.json",N)}function V(N,R){return Object(Se.g)("libraries/".concat(N,".json"),R)}}}]);
|