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.
NewEduCoderBuild/p__Shixuns__Edit__body__Lev...

117 lines
441 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[216,7,10],{"+NIl":function(Tt,nt,m){(function(P){P(m("VrN/"))})(function(P){"use strict";P.defineMode("stex",function(fe,te){"use strict";function H(ae,V){ae.cmdState.push(V)}function v(ae){return ae.cmdState.length>0?ae.cmdState[ae.cmdState.length-1]:null}function he(ae){var V=ae.cmdState.pop();V&&V.closeBracket()}function N(ae){for(var V=ae.cmdState,T=V.length-1;T>=0;T--){var R=V[T];if(R.name=="DEFAULT")continue;return R}return{styleIdentifier:function(){return null}}}function U(ae,V,T){return function(){this.name=ae,this.bracketNo=0,this.style=V,this.styles=T,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var A={};A.importmodule=U("importmodule","tag",["string","builtin"]),A.documentclass=U("documentclass","tag",["","atom"]),A.usepackage=U("usepackage","tag",["atom"]),A.begin=U("begin","tag",["atom"]),A.end=U("end","tag",["atom"]),A.label=U("label","tag",["atom"]),A.ref=U("ref","tag",["atom"]),A.eqref=U("eqref","tag",["atom"]),A.cite=U("cite","tag",["atom"]),A.bibitem=U("bibitem","tag",["atom"]),A.Bibitem=U("Bibitem","tag",["atom"]),A.RBibitem=U("RBibitem","tag",["atom"]),A.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function be(ae,V){ae.f=V}function ee(ae,V){var T;if(ae.match(/^\\[a-zA-Z@]+/)){var R=ae.current().slice(1);return T=A.hasOwnProperty(R)?A[R]:A.DEFAULT,T=new T,H(V,T),be(V,Ce),T.style}if(ae.match(/^\\[$&%#{}_]/))return"tag";if(ae.match(/^\\[,;!\/\\]/))return"tag";if(ae.match("\\["))return be(V,function($,me){return ne($,me,"\\]")}),"keyword";if(ae.match("\\("))return be(V,function($,me){return ne($,me,"\\)")}),"keyword";if(ae.match("$$"))return be(V,function($,me){return ne($,me,"$$")}),"keyword";if(ae.match("$"))return be(V,function($,me){return ne($,me,"$")}),"keyword";var K=ae.next();if(K=="%")return ae.skipToEnd(),"comment";if(K=="}"||K=="]"){if(T=v(V),T)T.closeBracket(K),be(V,Ce);else return"error";return"bracket"}else return K=="{"||K=="["?(T=A.DEFAULT,T=new T,H(V,T),"bracket"):/\d/.test(K)?(ae.eatWhile(/[\w.%]/),"atom"):(ae.eatWhile(/[\w\-_]/),T=N(V),T.name=="begin"&&(T.argument=ae.current()),T.styleIdentifier())}function ne(ae,V,T){if(ae.eatSpace())return null;if(T&&ae.match(T))return be(V,ee),"keyword";if(ae.match(/^\\[a-zA-Z@]+/))return"tag";if(ae.match(/^[a-zA-Z]+/))return"variable-2";if(ae.match(/^\\[$&%#{}_]/))return"tag";if(ae.match(/^\\[,;!\/]/))return"tag";if(ae.match(/^[\^_&]/))return"tag";if(ae.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(ae.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var R=ae.next();return R=="{"||R=="}"||R=="["||R=="]"||R=="("||R==")"?"bracket":R=="%"?(ae.skipToEnd(),"comment"):"error"}function Ce(ae,V){var T=ae.peek(),R;return T=="{"||T=="["?(R=v(V),R.openBracket(T),ae.eat(T),be(V,ee),"bracket"):/[ \t\r]/.test(T)?(ae.eat(T),null):(be(V,ee),he(V),ee(ae,V))}return{startState:function(){var ae=te.inMathMode?function(V,T){return ne(V,T)}:ee;return{cmdState:[],f:ae}},copyState:function(ae){return{cmdState:ae.cmdState.slice(),f:ae.f}},token:function(ae,V){return V.f(ae,V)},blankLine:function(ae){ae.f=ee,ae.cmdState.length=0},lineComment:"%"}}),P.defineMIME("text/x-stex","stex"),P.defineMIME("text/x-latex","stex")})},"19Vz":function(Tt,nt,m){(function(P){P(m("VrN/"))})(function(P){P.defineOption("placeholder","",function(U,A,be){var ee=be&&be!=P.Init;if(A&&!ee)U.on("blur",v),U.on("change",he),U.on("swapDoc",he),P.on(U.getInputField(),"compositionupdate",U.state.placeholderCompose=function(){H(U)}),he(U);else if(!A&&ee){U.off("blur",v),U.off("change",he),U.off("swapDoc",he),P.off(U.getInputField(),"compositionupdate",U.state.placeholderCompose),fe(U);var ne=U.getWrapperElement();ne.className=ne.className.replace(" CodeMirror-empty","")}A&&!U.hasFocus()&&v(U)});function fe(U){U.state.placeholder&&(U.state.placeholder.parentNode.removeChild(U.state.placeholder),U.state.placeholder=null)}function te(U){fe(U);var A=U.state.placeholder=document.createElement("pre");A.style.cssText="height: 0; overflow: visible",A.style.direction=U.getOption("direction"),A.className="CodeMirror-placeholder CodeMirror-line-like";var be=U.getOption("placeholder");typeof be=="string"&&(be=document.createTextNode(be)),A.appendChild(be),U.display.lineSpace.insertBefore(A,U.display.lineSpace.firstChild)}function H(U){setTimeout(function(){var A=!1,be=U.getInputField();be.nodeName=="TEXTAREA"?A=!be.value:U.lineCount()==1&&(A=!/[^\u200b]/.test(be.querySelector(".CodeMirror-line").textContent)),A?te(U):fe(U)},20)}function v(U){N(U)&&te(U)}function he(U){var A=U.getWrapperElement(),be=N(U);A.className=A.className.replace(" CodeMirror-empty","")+(be?" CodeMirror-empty":""),be?te(U):fe(U)}function N(U){return U.lineCount()===1&&U.getLine(0)===""}})},"1eCo":function(Tt,nt,m){(function(P){P(m("VrN/"))})(function(P){"use strict";var fe={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},te={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};P.defineMode("xml",function(H,v){var he=H.indentUnit,N={},U=v.htmlMode?fe:te;for(var A in U)N[A]=U[A];for(var A in v)N[A]=v[A];var be,ee;function ne(w,ie){function Z(xe){return ie.tokenize=xe,xe(w,ie)}var _=w.next();if(_=="<")return w.eat("!")?w.eat("[")?w.match("CDATA[")?Z(V("atom","]]>")):null:w.match("--")?Z(V("comment","-->")):w.match("DOCTYPE",!0,!0)?(w.eatWhile(/[\w\._\-]/),Z(T(1))):null:w.eat("?")?(w.eatWhile(/[\w\._\-]/),ie.tokenize=V("meta","?>"),"meta"):(be=w.eat("/")?"closeTag":"openTag",ie.tokenize=Ce,"tag bracket");if(_=="&"){var ue;return w.eat("#")?w.eat("x")?ue=w.eatWhile(/[a-fA-F\d]/)&&w.eat(";"):ue=w.eatWhile(/[\d]/)&&w.eat(";"):ue=w.eatWhile(/[\w\.\-:]/)&&w.eat(";"),ue?"atom":"error"}else return w.eatWhile(/[^&<]/),null}ne.isInText=!0;function Ce(w,ie){var Z=w.next();if(Z==">"||Z=="/"&&w.eat(">"))return ie.tokenize=ne,be=Z==">"?"endTag":"selfcloseTag","tag bracket";if(Z=="=")return be="equals",null;if(Z=="<"){ie.tokenize=ne,ie.state=me,ie.tagName=ie.tagStart=null;var _=ie.tokenize(w,ie);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(Z)?(ie.tokenize=ae(Z),ie.stringStartCol=w.column(),ie.tokenize(w,ie)):(w.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ae(w){var ie=function(Z,_){for(;!Z.eol();)if(Z.next()==w){_.tokenize=Ce;break}return"string"};return ie.isInAttribute=!0,ie}function V(w,ie){return function(Z,_){for(;!Z.eol();){if(Z.match(ie)){_.tokenize=ne;break}Z.next()}return w}}function T(w){return function(ie,Z){for(var _;(_=ie.next())!=null;){if(_=="<")return Z.tokenize=T(w+1),Z.tokenize(ie,Z);if(_==">")if(w==1){Z.tokenize=ne;break}else return Z.tokenize=T(w-1),Z.tokenize(ie,Z)}return"meta"}}function R(w,ie,Z){this.prev=w.context,this.tagName=ie,this.indent=w.indented,this.startOfLine=Z,(N.doNotIndent.hasOwnProperty(ie)||w.context&&w.context.noIndent)&&(this.noIndent=!0)}function K(w){w.context&&(w.context=w.context.prev)}function $(w,ie){for(var Z;;){if(!w.context)return;if(Z=w.context.tagName,!N.contextGrabbers.hasOwnProperty(Z)||!N.contextGrabbers[Z].hasOwnProperty(ie))return;K(w)}}function me(w,ie,Z){return w=="openTag"?(Z.tagStart=ie.column(),Le):w=="closeTag"?ce:me}function Le(w,ie,Z){return w=="word"?(Z.tagName=ie.current(),ee="tag",le):N.allowMissingTagName&&w=="endTag"?(ee="tag bracket",le(w,ie,Z)):(ee="error",Le)}function ce(w,ie,Z){if(w=="word"){var _=ie.current();return Z.context&&Z.context.tagName!=_&&N.implicitlyClosed.hasOwnProperty(Z.context.tagName)&&K(Z),Z.context&&Z.context.tagName==_||N.matchClosing===!1?(ee="tag",ge):(ee="tag error",Te)}else return N.allowMissingTagName&&w=="endTag"?(ee="tag bracket",ge(w,ie,Z)):(ee="error",Te)}function ge(w,ie,Z){return w!="endTag"?(ee="error",ge):(K(Z),me)}function Te(w,ie,Z){return ee="error",ge(w,ie,Z)}function le(w,ie,Z){if(w=="word")return ee="attribute",se;if(w=="endTag"||w=="selfcloseTag"){var _=Z.tagName,ue=Z.tagStart;return Z.tagName=Z.tagStart=null,w=="selfcloseTag"||N.autoSelfClosers.hasOwnProperty(_)?$(Z,_):($(Z,_),Z.context=new R(Z,_,ue==Z.indented)),me}return ee="error",le}function se(w,ie,Z){return w=="equals"?Oe:(N.allowMissing||(ee="error"),le(w,ie,Z))}function Oe(w,ie,Z){return w=="string"?re:w=="word"&&N.allowUnquoted?(ee="string",le):(ee="error",le(w,ie,Z))}function re(w,ie,Z){return w=="string"?re:le(w,ie,Z)}return{startState:function(w){var ie={tokenize:ne,state:me,indented:w||0,tagName:null,tagStart:null,context:null};return w!=null&&(ie.baseIndent=w),ie},token:function(w,ie){if(!ie.tagName&&w.sol()&&(ie.indented=w.indentation()),w.eatSpace())return null;be=null;var Z=ie.tokenize(w,ie);return(Z||be)&&Z!="comment"&&(ee=null,ie.state=ie.state(be||Z,w,ie),ee&&(Z=ee=="error"?Z+" error":ee)),Z},indent:function(w,ie,Z){var _=w.context;if(w.tokenize.isInAttribute)return w.tagStart==w.indented?w.stringStartCol+1:w.indented+he;if(_&&_.noIndent)return P.Pass;if(w.tokenize!=Ce&&w.tokenize!=ne)return Z?Z.match(/^(\s*)/)[0].length:0;if(w.tagName)return N.multilineTagIndentPastTag!==!1?w.tagStart+w.tagName.length+2:w.tagStart+he*(N.multilineTagIndentFactor||1);if(N.alignCDATA&&/<!\[CDATA\[/.test(ie))return 0;var ue=ie&&/^<(\/)?([\w_:\.-]*)/.exec(ie);if(ue&&ue[1])for(;_;)if(_.tagName==ue[2]){_=_.prev;break}else if(N.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(ue)for(;_;){var xe=N.contextGrabbers[_.tagName];if(xe&&xe.hasOwnProperty(ue[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+he:w.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:N.htmlMode?"html":"xml",helperType:N.htmlMode?"html":"xml",skipAttribute:function(w){w.state==Oe&&(w.state=le)},xmlCurrentTag:function(w){return w.tagName?{name:w.tagName,close:w.type=="closeTag"}:null},xmlCurrentContext:function(w){for(var ie=[],Z=w.context;Z;Z=Z.prev)Z.tagName&&ie.push(Z.tagName);return ie.reverse()}}}),P.defineMIME("text/xml","xml"),P.defineMIME("application/xml","xml"),P.mimeModes.hasOwnProperty("text/html")||P.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"3TLj":function(Tt,nt,m){Tt.exports={flex_box_center:"flex_box_center____TbjK",flex_space_between:"flex_space_between___2coRZ",flex_box_vertical_center:"flex_box_vertical_center___3NVFE",flex_box_center_end:"flex_box_center_end___3GKhy",flex_box_column:"flex_box_column___2SLfn",bg:"bg___3oKWe",formWrap:"formWrap___2Y1wq"}},"5v/u":function(Tt,nt,m){"use strict";m.r(nt);var P=m("5NDa"),fe=m("5rEg"),te=m("2qtc"),H=m("kLXV"),v=m("9og8"),he=m("k1fw"),N=m("y8nQ"),U=m("Vl3Y"),A=m("tJVT"),be=m("PpiC"),ee=m("Znn+"),ne=m("ZTPi"),Ce=m("WmNS"),ae=m.n(Ce),V=m("q1tI"),T=m.n(V),R=m("9kvl"),K=m("Ot1p"),$=m("HBuW"),me=m("3TLj"),Le=m.n(me),ce=m("xKgJ"),ge=m("UqFu"),Te=m("9ZNV"),le=m("nuEh"),se=ne.a.TabPane,Oe=function(w){var ie,Z,_=w.shixunsDetail,ue=w.dispatch,xe=w.match,oe=w.practiceSetting,Be=Object(be.a)(w,["shixunsDetail","dispatch","match","practiceSetting"]),E=U.a.useForm(),d=Object(A.a)(E,1),W=d[0],pe=Object(V.useState)({}),ve=Object(A.a)(pe,2),Ne=ve[0],qe=ve[1],Me=_.challengesNew,Ve=Object(V.useRef)(null),ke=oe.selectQuestionParams,Re=oe.id,Q=oe.newQuestion,X=Object(V.useState)(!0),He=Object(A.a)(X,2),at=He[0],pt=He[1];Object(V.useEffect)(function(){pt(!0),ue({type:"shixunsDetail/getChallengesNew",payload:Object(he.a)({},xe.params)}),pt(!1)},[xe.params]);var Ye=function(){var tt=Object(v.a)(ae.a.mark(function Ge(_e){var Pe,st,lt;return ae.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:return Pe=Object(he.a)({},Ne),st=!(!_e.unity_3d_routes||_e.unity_3d_routes==""),Pe.identifier=xe.params.id,Pe.st=1,et.next=6,Object($.b)(Object(he.a)(Object(he.a)({},Pe),{},{unity_3d_routes:st?_e.unity_3d_routes:null,unity_3d:st}));case 6:lt=et.sent,lt.status===1&&(R.e.replace("/shixuns/".concat(xe.params.id,"/edit/").concat(lt.challenge_id,"/editquestion?tab=2")),setTimeout(function(){ue({type:"practiceSetting/setParams",payload:{newQuestion:null}}),ue({type:"practiceSetting/setUpdateIndex"})},200));case 8:case"end":return et.stop()}},Ge)}));return function(_e){return tt.apply(this,arguments)}}(),rt=function(){$e()},je=function(Ge){clearTimeout(Ve.current),Ve.current=setTimeout(function(){"subject"in Ge&&Q&&ue({type:"practiceSetting/setParams",payload:{newQuestion:{st:1,name:Ge==null?void 0:Ge.subject}}});var _e=W.getFieldsValue(),Pe=_e.subject,st=_e.task_pass;Pe!==""||st!==Object(ge.a)(Me.task_pass_default)?ue({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):ue({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},500)},Fe=function(Ge){qe(Object(he.a)({},W.getFieldsValue())),je(Ge)},$e=function(){var Ge,_e=function(){R.e.push("/shixuns/".concat(Re,"/challenges")),ue({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};oe!=null&&(Ge=oe.sideBar)!==null&&Ge!==void 0&&Ge.confirmLeave?H.a.confirm({title:"\u79BB\u5F00\u6B64\u9875\u63D0\u793A",content:"\u7CFB\u7EDF\u53EF\u80FD\u4E0D\u4F1A\u4FDD\u5B58\u60A8\u6240\u505A\u7684\u66F4\u6539\u3002",okText:"\u79BB\u5F00",cancelText:"\u53D6\u6D88",onOk:function(){_e()}}):_e()};return T.a.createElement("section",{className:Le.a.bg},T.a.createElement(ne.a,{activeKey:"1"},T.a.createElement(se,{tab:"\u672C\u5173\u4EFB\u52A1",key:"1"},T.a.createElement(U.a,{form:W,className:Le.a.formWrap,scrollToFirstError:!0,layout:"vertical",onValuesChange:Fe,onFinish:Ye},T.a.createElement("div",{className:Le.a.fieldWrap},T.a.createElement(U.a.Item,{initialValue:"",name:"subject",label:"\u4EFB\u52A1\u540D\u79F0:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0"}]},T.a.createElement(fe.a,{bordered:!1,maxLength:60,suffix:"".concat(((ie=Ne.subject)===null||ie===void 0?void 0:ie.length)||0,"/60"),placeholder:"\u4F8B\u5982\uFF1A\u4ECEPython\u7A0B\u5E8F\u8BBE\u8BA1-\u5165\u95E8\u7CBE\u901A"}))),T.a.createElement("div",{className:Le.a.mdWrap},T.a.createElement(U.a.Item,{name:"task_pass",label:"\u8FC7\u5173\u4EFB\u52A1:",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u4E1A\u7684\u7B80\u4ECB"},{max:35e3,message:"\u6700\u5927\u9650\u523635000\u4E2A\u5B57\u7B26"}]},T.a.createElement(K.a,{watch:!0,defaultValue:Me.task_pass_default}))),Object(ce.n)()&&T.a.createElement("div",{className:Le.a.fieldWrap},T.a.createElement(U.a.Item,{initialValue:"",name:"unity_3d_routes",label:"\u5D4C\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0:"},T.a.createElement(fe.a,{bordered:!1,maxLength:60,suffix:"".concat(((Z=Ne.unity_3d_routes)===null||Z===void 0?void 0:Z.length)||0,"/60"),placeholder:"\u8BF7\u8F93\u5165\u7B2C\u4E09\u65B9\u5E73\u53F0\u5730\u5740"}))),T.a.createElement(U.a.Item,{noStyle:!0},T.a.createElement(Te.a,{okButtonProps:{htmlType:"submit"},className:"customFixedButton",onCancel:rt}))))),T.a.createElement(le.a,{loading:at}))};nt.default=Object(R.b)(function(re){var w=re.shixunsDetail,ie=re.practiceSetting;return{shixunsDetail:w,practiceSetting:ie}})(Oe)},"7ahc":function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return Le});var P=m("k1fw"),fe=m("0Owb"),te=m("+L6B"),H=m("2/Rp"),v=m("y8nQ"),he=m("Vl3Y"),N=m("tJVT"),U=m("OaEy"),A=m("2fM7"),be=m("q1tI"),ee=m.n(be),ne=m("VrN/"),Ce=m.n(ne),ae=m("p77/"),V=m.n(ae),T=m("c5Ni"),R=m.n(T),K=A.a.Option,$={labelCol:{span:4},wrapperCol:{span:20}},me={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"]};nt.b=function(ce){var ge=ce.callback,Te=ce.onCancel,le=Object(be.useState)("python"),se=Object(N.a)(le,2),Oe=se[0],re=se[1];function w(Z){re(me[Z][1])}function ie(Z){ge(Z)}return ee.a.createElement(he.a,Object(fe.a)({},$,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ie}),ee.a.createElement(he.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},ee.a.createElement(A.a,{onChange:w},Object.keys(me).map(function(Z){return ee.a.createElement(K,{key:Z,value:Z},me[Z][0])}))),ee.a.createElement(he.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},ee.a.createElement(Le,{mode:Oe})),ee.a.createElement("div",{className:"flex-container flex-end"},ee.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ee.a.createElement(H.a,{type:"ghost",onClick:Te},"\u53D6\u6D88")))};function Le(ce){var ge=ce.value,Te=ce.onChange,le=ce.mode,se=ce.options,Oe=se===void 0?{}:se,re=Object(be.useRef)(),w=Object(be.useState)(),ie=Object(N.a)(w,2),Z=ie[0],_=ie[1];return Object(be.useEffect)(function(){if(Z){function ue(xe){var oe=xe.getValue();Te&&Te(oe)}return Z.on("change",ue),function(){Z.off("change",ue)}}},[Z,Te]),Object(be.useEffect)(function(){Z&&Z.setOption("mode",le)},[Z,le]),Object(be.useEffect)(function(){Z&&((ge!==Z.getValue()||ge==="")&&setTimeout(function(){Z.setValue(ge||" ")},300))},[Z,ge]),Object(be.useEffect)(function(){if(re.current&&!Z){var ue=Ce.a.fromTextArea(re.current,Object(P.a)({mode:le,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Oe));_(ue)}},[re.current,Z]),ee.a.createElement("div",{className:"my-codemirror-container"},ee.a.createElement("textarea",{ref:re}))}},"7ixt":function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return te});var P={adjustX:1,adjustY:1},fe=[0,0],te={left:{points:["cr","cl"],overflow:P,offset:[-4,0],targetOffset:fe},right:{points:["cl","cr"],overflow:P,offset:[4,0],targetOffset:fe},top:{points:["bc","tc"],overflow:P,offset:[0,-4],targetOffset:fe},bottom:{points:["tc","bc"],overflow:P,offset:[0,4],targetOffset:fe},topLeft:{points:["bl","tl"],overflow:P,offset:[0,-4],targetOffset:fe},leftTop:{points:["tr","tl"],overflow:P,offset:[-4,0],targetOffset:fe},topRight:{points:["br","tr"],overflow:P,offset:[0,-4],targetOffset:fe},rightTop:{points:["tl","tr"],overflow:P,offset:[4,0],targetOffset:fe},bottomRight:{points:["tr","br"],overflow:P,offset:[0,4],targetOffset:fe},rightBottom:{points:["bl","br"],overflow:P,offset:[4,0],targetOffset:fe},bottomLeft:{points:["tl","bl"],overflow:P,offset:[0,4],targetOffset:fe},leftBottom:{points:["br","bl"],overflow:P,offset:[-4,0],targetOffset:fe}},H=te},"8EBN":function(Tt,nt,m){(function(P){P(m("VrN/"))})(function(P){"use strict";P.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var fe=0;fe<P.modeInfo.length;fe++){var te=P.modeInfo[fe];te.mimes&&(te.mime=te.mimes[0])}P.findModeByMIME=function(H){H=H.toLowerCase();for(var v=0;v<P.modeInfo.length;v++){var he=P.modeInfo[v];if(he.mime==H)return he;if(he.mimes){for(var N=0;N<he.mimes.length;N++)if(he.mimes[N]==H)return he}}if(/\+xml$/.test(H))return P.findModeByMIME("application/xml");if(/\+json$/.test(H))return P.findModeByMIME("application/json")},P.findModeByExtension=function(H){H=H.toLowerCase();for(var v=0;v<P.modeInfo.length;v++){var he=P.modeInfo[v];if(he.ext){for(var N=0;N<he.ext.length;N++)if(he.ext[N]==H)return he}}},P.findModeByFileName=function(H){for(var v=0;v<P.modeInfo.length;v++){var he=P.modeInfo[v];if(he.file&&he.file.test(H))return he}var N=H.lastIndexOf("."),U=N>-1&&H.substring(N+1,H.length);if(U)return P.findModeByExtension(U)},P.findModeByName=function(H){H=H.toLowerCase();for(var v=0;v<P.modeInfo.length;v++){var he=P.modeInfo[v];if(he.name.toLowerCase()==H)return he;if(he.alias){for(var N=0;N<he.alias.length;N++)if(he.alias[N].toLowerCase()==H)return he}}}})},"9Bee":function(Tt,nt,m){"use strict";var P=m("k1fw"),fe=m("tJVT"),te=m("q1tI"),H=m.n(te),v=m("vg9a"),he=m("DlQD"),N=m.n(he),U=m("rUJ1");function A(W,pe){var ve=W.match(/^(\s+)(?:```)/);if(ve===null)return pe;var Ne=ve[1];return pe.split(`
`).map(function(qe){var Me=qe.match(/^\s+/);if(Me===null)return qe;var Ve=Object(fe.a)(Me,1),ke=Ve[0];return ke.length>=Ne.length?qe.slice(Ne.length):qe}).join(`
`)}var be=[],ee=["<ul>"],ne=new N.a.Renderer,Ce=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function ae(){be.length=0,ee=["<ul>"]}var V={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function T(W,pe,ve,Ne){if(pe>=W.length||W[pe].level<=ve)return pe;var qe=W[pe];Ne.push("<li><a href='#"+qe.anchor+"'>"+qe.text+"</a>"),pe++;var Me=[];return pe=T(W,pe,qe.level,Me),Me.length>0&&(Ne.push("<ul>"),Me.forEach(function(Ve){Ne.push(Ve)}),Ne.push("</ul>")),Ne.push("</li>"),pe=T(W,pe,ve,Ne),pe}function R(){return T(be,0,0,ee),ee.push("</ul>"),ee.join("")}var K={heading:function(pe){var ve=Ce.exec(pe);if(ve)return{type:"heading",raw:ve[0],depth:ve[1].length,text:ve[2]}},fences:function(pe){var ve=this.rules.block.fences.exec(pe);if(ve){var Ne=ve[0],qe=A(Ne,ve[3]||""),Me=ve[2]?ve[2].trim():ve[2];if(["latex","katex","math"].indexOf(Me)>=0){var Ve=Le(),ke=qe;qe=Ve,ce[Ve]={type:"block",expression:ke}}return{type:"code",raw:Ne,lang:Me,text:qe}}}},$=/(?:\${2})([^\n`]+?)(?:\${2})/gi,me=0,Le=function(){return"__special_katext_id_".concat(me++,"__")},ce={};function ge(){return ce}function Te(){me=0,ce={}}function le(W){return W=W.replace($,function(pe,ve){var Ne=Le();return ce[Ne]={type:"inline",expression:ve},Ne}),W}var se=ne.listitem;ne.listitem=function(W){return se(le(W))};var Oe=ne.paragraph;ne.paragraph=function(W){return Oe(le(W))};var re=ne.tablecell;ne.tablecell=function(W,pe){return re(le(W),pe)},ne.code=function(W,pe,ve){var Ne=(pe||"").match(/\S*/)[0];return Ne?["latex","katex","math"].indexOf(Ne)>=0?"<p class='editormd-tex'>".concat(W,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(pe,'">').concat(ve?W:Object(U.escape)(W,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(ve?W:Object(U.escape)(W,!0))+"</code></pre>"},ne.heading=function(W,pe,ve){var Ne=this.options.headerPrefix+ve.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return be.push({anchor:Ne,level:pe,text:W}),"<h"+pe+' id="'+Ne+'">'+W+"</h"+pe+">"},N.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),N.a.use({tokenizer:K,renderer:ne});var w=N.a,ie=m("SJMd"),Z=m("ulZh"),_=m.n(Z),ue=m("m3rI"),xe=m("Oy/b"),oe=m("p5ED"),Be=/<pre[^>]*>/g;function E(W){var pe=document.createElement("div");return pe.innerHTML=W,pe.childNodes.length===0?"":pe.childNodes[0].nodeValue}var d=nt.a=function(W){var pe=W.value,ve=pe===void 0?"":pe,Ne=W.className,qe=W.showTextOnly,Me=W.showLines,Ve=W.style,ke=Ve===void 0?{}:Ve,Re=W.stylesPrev,Q=Re===void 0?{}:Re,X=String(ve),He=Object(te.useState)(""),at=Object(fe.a)(He,2),pt=at[0],Ye=at[1],rt=Object(te.useMemo)(function(){try{var tt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ge=/\"\/api\/attachments\/|\"\/attachments\/download\//g,_e=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;X=X.replace(tt,"("+ue.a.API_SERVER+"/api/attachments/").replace(Ge,'"'+ue.a.API_SERVER+"/api/attachments/").replace(_e,'"'+ue.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,`
`),X=X.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(dt){}var Pe=w(X),st=ge();if(X.match(/\[TOC\]/)&&(Pe=Pe.replace("<p>[TOC]</p>",R()),ae()),Pe=Pe.replace(/(__special_katext_id_\d+__)/g,function(dt,et){var wt=st[et],mt=wt.type,ut=wt.expression;return Object(xe.renderToString)(E(ut)||"",{displayMode:mt==="block",throwOnError:!1,output:"html"})}),Pe=Pe.replace(/▁/g,"\u2581\u2581\u2581"),Te(),qe){var lt=document.createElement("div");return lt.innerHTML=Pe,lt.innerText}return setTimeout(function(){return $e()},500),Pe},[X]),je=Object(te.useRef)();V.WebkitLineClamp=Me,Me&&(ke=Object(P.a)(Object(P.a)({},ke),V));function Fe(tt){var Ge=tt.target;if(Ge.tagName.toUpperCase()==="A"){var _e=Ge.getAttribute("href");if(_e.indexOf("office")>-1)tt.preventDefault(),Ye(_e);else if(_e.startsWith("#")){tt.preventDefault();var Pe=document.getElementById(_e.replace("#",""));Pe&&Pe.scrollIntoView(!0)}}}var $e=function(){var Ge,_e=(Ge=je.current)===null||Ge===void 0?void 0:Ge.querySelectorAll("video");_e==null||_e.forEach(function(Pe){if(Pe.oncontextmenu=function(){return!1},Pe.src.indexOf(".m3u8")>-1&&!Pe.canPlayType("application/vnd.apple.mpegurl")){if(_.a.isSupported()){var st=new _.a;st.loadSource(Pe.src),st.attachMedia(Pe)}}})};return Object(te.useEffect)(function(){if(je.current&&rt&&(rt.match(Be)&&window.PR.prettyPrint()),je.current)return je.current.addEventListener("click",Fe),function(){je.current.removeEventListener("click",Fe),Te(),ae()}},[rt,je.current,Fe]),H.a.createElement(H.a.Fragment,null,H.a.createElement("div",{ref:je,style:Object(P.a)({},ke),className:"".concat(Ne||""," markdown-body "),dangerouslySetInnerHTML:{__html:rt}}),H.a.createElement(oe.a,{close:!0,data:pt,type:pt!=null&&pt.length?"office":"",style:Object(P.a)({},Q),onClose:function(){return Ye("")}}))}},"9VGf":function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return te});var P=m("q1tI"),fe=m.n(P);function te(H,v){var he=Object(P.useRef)();Object(P.useEffect)(function(){he.current=H}),Object(P.useEffect)(function(){function N(){he.current()}if(v!==null){var U=setInterval(N,v);return function(){return clearInterval(U)}}},[v])}},"9ZNV":function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return be});var P=m("0Owb"),fe=m("+L6B"),te=m("2/Rp"),H=m("q1tI"),v=m.n(H),he=m("UUDw"),N=m.n(he),U=m("TSYQ"),A=m.n(U),be=function(ne){var Ce=ne.cancelText,ae=Ce===void 0?"\u53D6\u6D88":Ce,V=ne.okText,T=V===void 0?"\u786E\u5B9A":V,R=ne.loading,K=R===void 0?!1:R,$=ne.hasOkBtn,me=$===void 0?!0:$,Le=ne.okButtonProps,ce=Le===void 0?{}:Le,ge=ne.onCancel,Te=ge===void 0?function(){}:ge,le=ne.onOk,se=le===void 0?function(){}:le,Oe=ne.className,re=Oe===void 0?"":Oe;return v.a.createElement("div",{className:A()(N.a.buttonFixed,re)},v.a.createElement("div",{className:N.a.buttonWrap},v.a.createElement(te.a,{size:"large",className:"".concat(N.a.button," mr20"),onClick:Te},ae),me&&v.a.createElement(te.a,Object(P.a)({size:"large",type:"primary",className:"".concat(N.a.button," mr20"),loading:K,onClick:se},ce),T)))}},Bd2K:function(Tt,nt,m){(function(P){P(m("VrN/"),m("osHv"))})(function(P){P.defineOption("autoCloseTags",!1,function(A,be,ee){if(ee!=P.Init&&ee&&A.removeKeyMap("autoCloseTags"),!be)return;var ne={name:"autoCloseTags"};(typeof be!="object"||be.whenClosing!==!1)&&(ne["'/'"]=function(Ce){return he(Ce)}),(typeof be!="object"||be.whenOpening!==!1)&&(ne["'>'"]=function(Ce){return H(Ce)}),A.addKeyMap(ne)});var fe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],te=["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 H(A){if(A.getOption("disableInput"))return P.Pass;for(var be=A.listSelections(),ee=[],ne=A.getOption("autoCloseTags"),Ce=0;Ce<be.length;Ce++){if(!be[Ce].empty())return P.Pass;var ae=be[Ce].head,V=A.getTokenAt(ae),T=P.innerMode(A.getMode(),V.state),R=T.state,K=T.mode.xmlCurrentTag&&T.mode.xmlCurrentTag(R),$=K&&K.name;if(!$)return P.Pass;var me=T.mode.configuration=="html",Le=typeof ne=="object"&&ne.dontCloseTags||me&&fe,ce=typeof ne=="object"&&ne.indentTags||me&&te;V.end>ae.ch&&($=$.slice(0,$.length-V.end+ae.ch));var ge=$.toLowerCase();if(!$||V.type=="string"&&(V.end!=ae.ch||!/[\"\']/.test(V.string.charAt(V.string.length-1))||V.string.length==1)||V.type=="tag"&&K.close||V.string.indexOf("/")==ae.ch-V.start-1||Le&&N(Le,ge)>-1||U(A,T.mode.xmlCurrentContext&&T.mode.xmlCurrentContext(R)||[],$,ae,!0))return P.Pass;var Te=typeof ne=="object"&&ne.emptyTags;if(Te&&N(Te,$)>-1){ee[Ce]={text:"/>",newPos:P.Pos(ae.line,ae.ch+2)};continue}var le=ce&&N(ce,ge)>-1;ee[Ce]={indent:le,text:">"+(le?`
`:"")+"</"+$+">",newPos:le?P.Pos(ae.line+1,0):P.Pos(ae.line,ae.ch+1)}}for(var se=typeof ne=="object"&&ne.dontIndentOnAutoClose,Ce=be.length-1;Ce>=0;Ce--){var Oe=ee[Ce];A.replaceRange(Oe.text,be[Ce].head,be[Ce].anchor,"+insert");var re=A.listSelections().slice(0);re[Ce]={head:Oe.newPos,anchor:Oe.newPos},A.setSelections(re),!se&&Oe.indent&&(A.indentLine(Oe.newPos.line,null,!0),A.indentLine(Oe.newPos.line+1,null,!0))}}function v(A,be){for(var ee=A.listSelections(),ne=[],Ce=be?"/":"</",ae=A.getOption("autoCloseTags"),V=typeof ae=="object"&&ae.dontIndentOnSlash,T=0;T<ee.length;T++){if(!ee[T].empty())return P.Pass;var R=ee[T].head,K=A.getTokenAt(R),$=P.innerMode(A.getMode(),K.state),me=$.state;if(be&&(K.type=="string"||K.string.charAt(0)!="<"||K.start!=R.ch-1))return P.Pass;var Le,ce=$.mode.name!="xml"&&A.getMode().name=="htmlmixed";if(ce&&$.mode.name=="javascript")Le=Ce+"script";else if(ce&&$.mode.name=="css")Le=Ce+"style";else{var ge=$.mode.xmlCurrentContext&&$.mode.xmlCurrentContext(me);if(!ge||ge.length&&U(A,ge,ge[ge.length-1],R))return P.Pass;Le=Ce+ge[ge.length-1]}A.getLine(R.line).charAt(K.end)!=">"&&(Le+=">"),ne[T]=Le}if(A.replaceSelections(ne),ee=A.listSelections(),!V)for(var T=0;T<ee.length;T++)(T==ee.length-1||ee[T].head.line<ee[T+1].head.line)&&A.indentLine(ee[T].head.line)}function he(A){return A.getOption("disableInput")?P.Pass:v(A,!0)}P.commands.closeTag=function(A){return v(A)};function N(A,be){if(A.indexOf)return A.indexOf(be);for(var ee=0,ne=A.length;ee<ne;++ee)if(A[ee]==be)return ee;return-1}function U(A,be,ee,ne,Ce){if(!P.scanForClosingTag)return!1;var ae=Math.min(A.lastLine()+1,ne.line+500),V=P.scanForClosingTag(A,ne,null,ae);if(!V||V.tag!=ee)return!1;for(var T=Ce?1:0,R=be.length-1;R>=0&&be[R]==ee;R--)++T;ne=V.to;for(var R=1;R<T;R++){var K=P.scanForClosingTag(A,ne,null,ae);if(!K||K.tag!=ee)return!1;ne=K.to}return!0}})},BjJ7:function(Tt,nt,m){"use strict";m.d(nt,"d",function(){return fe}),m.d(nt,"c",function(){return te}),m.d(nt,"e",function(){return H}),m.d(nt,"b",function(){return v}),m.d(nt,"a",function(){return N});var P=m("m3rI");function fe(U){var A=!0;if(U.length>0){for(var be=0;be<U.length;be++)if(U[be].compile_success==0||!U[be].compile_success){A=!1;break}}else A=!1;return A}function te(U){for(var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",be=[],ee=0;ee<U.length;ee++){var ne=U[ee],Ce=A?"".concat(A,"/").concat(ne.name):"".concat(ne.name);be.push({title:ne.name,isLeaf:!(ne.type==="tree"),key:Ce})}return be}function H(U,A,be){for(var ee=0;ee<U.length;ee++){var ne=U[ee];if(ne.key===A){ne.children=be;break}ne.children&&H(ne.children,A,be)}return U}function v(U,A,be){var ee;return function(){var ne=this,Ce=arguments,ae=function(){ee=null,be||U.apply(ne,Ce)},V=be&&!ee;clearTimeout(ee),ee=setTimeout(ae,A),V&&U.apply(ne,Ce)}}var he=!0,N=P.a.API_SERVER},"C+DQ":function(Tt,nt,m){},DlQD:function(Tt,nt,m){(function(P,fe){Tt.exports=fe()})(this,function(){"use strict";function P(k,D){for(var j=0;j<D.length;j++){var h=D[j];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(k,h.key,h)}}function fe(k,D,j){return D&&P(k.prototype,D),j&&P(k,j),k}function te(k,D){if(!k)return;if(typeof k=="string")return H(k,D);var j=Object.prototype.toString.call(k).slice(8,-1);if(j==="Object"&&k.constructor&&(j=k.constructor.name),j==="Map"||j==="Set")return Array.from(k);if(j==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(j))return H(k,D)}function H(k,D){(D==null||D>k.length)&&(D=k.length);for(var j=0,h=new Array(D);j<D;j++)h[j]=k[j];return h}function v(k,D){var j;if(typeof Symbol=="undefined"||k[Symbol.iterator]==null){if(Array.isArray(k)||(j=te(k))||D&&k&&typeof k.length=="number"){j&&(k=j);var h=0;return function(){return h>=k.length?{done:!0}:{done:!1,value:k[h++]}}}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 j=k[Symbol.iterator](),j.next.bind(j)}function he(k,D){return D={exports:{}},k(D,D.exports),D.exports}var N=he(function(k){function D(){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 j(h){k.exports.defaults=h}k.exports={defaults:D(),getDefaults:D,changeDefaults:j}}),U=N.defaults,A=N.getDefaults,be=N.changeDefaults,ee=/[&<>"']/,ne=/[&<>"']/g,Ce=/[<>"']|&(?!#?\w+;)/,ae=/[<>"']|&(?!#?\w+;)/g,V={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},T=function(D){return V[D]};function R(k,D){if(D){if(ee.test(k))return k.replace(ne,T)}else if(Ce.test(k))return k.replace(ae,T);return k}var K=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function $(k){return k.replace(K,function(D,j){return j=j.toLowerCase(),j==="colon"?":":j.charAt(0)==="#"?j.charAt(1)==="x"?String.fromCharCode(parseInt(j.substring(2),16)):String.fromCharCode(+j.substring(1)):""})}var me=/(^|[^\[])\^/g;function Le(k,D){k=k.source||k,D=D||"";var j={replace:function(p,b){return b=b.source||b,b=b.replace(me,"$1"),k=k.replace(p,b),j},getRegex:function(){return new RegExp(k,D)}};return j}var ce=/[^\w:]/g,ge=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Te(k,D,j){if(k){var h;try{h=decodeURIComponent($(j)).replace(ce,"").toLowerCase()}catch(p){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}D&&!ge.test(j)&&(j=w(D,j));try{j=encodeURI(j).replace(/%25/g,"%")}catch(p){return null}return j}var le={},se=/^[^:]+:\/*[^/]*$/,Oe=/^([^:]+:)[\s\S]*$/,re=/^([^:]+:\/*[^/]*)[\s\S]*$/;function w(k,D){le[" "+k]||(se.test(k)?le[" "+k]=k+"/":le[" "+k]=ue(k,"/",!0)),k=le[" "+k];var j=k.indexOf(":")===-1;return D.substring(0,2)==="//"?j?D:k.replace(Oe,"$1")+D:D.charAt(0)==="/"?j?D:k.replace(re,"$1")+D:k+D}var ie={exec:function(){}};function Z(k){for(var D=1,j,h;D<arguments.length;D++){j=arguments[D];for(h in j)Object.prototype.hasOwnProperty.call(j,h)&&(k[h]=j[h])}return k}function _(k,D){var j=k.replace(/\|/g,function(b,x,Y){for(var de=!1,Ae=x;--Ae>=0&&Y[Ae]==="\\";)de=!de;return de?"|":" |"}),h=j.split(/ \|/),p=0;if(h.length>D)h.splice(D);else for(;h.length<D;)h.push("");for(;p<h.length;p++)h[p]=h[p].trim().replace(/\\\|/g,"|");return h}function ue(k,D,j){var h=k.length;if(h===0)return"";for(var p=0;p<h;){var b=k.charAt(h-p-1);if(b===D&&!j)p++;else if(b!==D&&j)p++;else break}return k.substr(0,h-p)}function xe(k,D){if(k.indexOf(D[1])===-1)return-1;for(var j=k.length,h=0,p=0;p<j;p++)if(k[p]==="\\")p++;else if(k[p]===D[0])h++;else if(k[p]===D[1]&&(h--,h<0))return p;return-1}function oe(k){k&&k.sanitize&&!k.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 Be={escape:R,unescape:$,edit:Le,cleanUrl:Te,resolveUrl:w,noopTest:ie,merge:Z,splitCells:_,rtrim:ue,findClosingBracket:xe,checkSanitizeDeprecation:oe},E=N.defaults,d=Be.rtrim,W=Be.splitCells,pe=Be.escape,ve=Be.findClosingBracket;function Ne(k,D,j){var h=D.href,p=D.title?pe(D.title):null,b=k[1].replace(/\\([\[\]])/g,"$1");return k[0].charAt(0)!=="!"?{type:"link",raw:j,href:h,title:p,text:b}:{type:"image",raw:j,href:h,title:p,text:pe(b)}}function qe(k,D){var j=k.match(/^(\s+)(?:```)/);if(j===null)return D;var h=j[1];return D.split(`
`).map(function(p){var b=p.match(/^\s+/);if(b===null)return p;var x=b[0];return x.length>=h.length?p.slice(h.length):p}).join(`
`)}var Me=function(){function k(j){this.options=j||E}var D=k.prototype;return D.space=function(h){var p=this.rules.block.newline.exec(h);if(p)return p[0].length>1?{type:"space",raw:p[0]}:{raw:`
`}},D.code=function(h,p){var b=this.rules.block.code.exec(h);if(b){var x=p[p.length-1];if(x&&x.type==="paragraph")return{raw:b[0],text:b[0].trimRight()};var Y=b[0].replace(/^ {4}/gm,"");return{type:"code",raw:b[0],codeBlockStyle:"indented",text:this.options.pedantic?Y:d(Y,`
`)}}},D.fences=function(h){var p=this.rules.block.fences.exec(h);if(p){var b=p[0],x=qe(b,p[3]||"");return{type:"code",raw:b,lang:p[2]?p[2].trim():p[2],text:x}}},D.heading=function(h){var p=this.rules.block.heading.exec(h);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},D.nptable=function(h){var p=this.rules.block.nptable.exec(h);if(p){var b={type:"table",header:W(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 x=b.align.length,Y;for(Y=0;Y<x;Y++)/^ *-+: *$/.test(b.align[Y])?b.align[Y]="right":/^ *:-+: *$/.test(b.align[Y])?b.align[Y]="center":/^ *:-+ *$/.test(b.align[Y])?b.align[Y]="left":b.align[Y]=null;for(x=b.cells.length,Y=0;Y<x;Y++)b.cells[Y]=W(b.cells[Y],b.header.length);return b}}},D.hr=function(h){var p=this.rules.block.hr.exec(h);if(p)return{type:"hr",raw:p[0]}},D.blockquote=function(h){var p=this.rules.block.blockquote.exec(h);if(p){var b=p[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:p[0],text:b}}},D.list=function(h){var p=this.rules.block.list.exec(h);if(p){for(var b=p[0],x=p[2],Y=x.length>1,de=x[x.length-1]===")",Ae={type:"list",raw:b,ordered:Y,start:Y?+x.slice(0,-1):"",loose:!1,items:[]},gt=p[0].match(this.rules.block.item),Rt=!1,Ot,On,Kt,Ct,Mn,Qt,jn,Ln=gt.length,Pt=0;Pt<Ln;Pt++)Ot=gt[Pt],b=Ot,On=Ot.length,Ot=Ot.replace(/^ *([*+-]|\d+[.)]) */,""),~Ot.indexOf(`
`)&&(On-=Ot.length,Ot=this.options.pedantic?Ot.replace(/^ {1,4}/gm,""):Ot.replace(new RegExp("^ {1,"+On+"}","gm"),"")),Pt!==Ln-1&&(Kt=this.rules.block.bullet.exec(gt[Pt+1])[0],(Y?Kt.length===1||!de&&Kt[Kt.length-1]===")":Kt.length>1||this.options.smartLists&&Kt!==x)&&(Ct=gt.slice(Pt+1).join(`
`),Ae.raw=Ae.raw.substring(0,Ae.raw.length-Ct.length),Pt=Ln-1)),Mn=Rt||/\n\n(?!\s*$)/.test(Ot),Pt!==Ln-1&&(Rt=Ot.charAt(Ot.length-1)===`
`,Mn||(Mn=Rt)),Mn&&(Ae.loose=!0),Qt=/^\[[ xX]\] /.test(Ot),jn=void 0,Qt&&(jn=Ot[1]!==" ",Ot=Ot.replace(/^\[[ xX]\] +/,"")),Ae.items.push({type:"list_item",raw:b,task:Qt,checked:jn,loose:Mn,text:Ot});return Ae}},D.html=function(h){var p=this.rules.block.html.exec(h);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]):pe(p[0]):p[0]}},D.def=function(h){var p=this.rules.block.def.exec(h);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]}}},D.table=function(h){var p=this.rules.block.table.exec(h);if(p){var b={type:"table",header:W(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 x=b.align.length,Y;for(Y=0;Y<x;Y++)/^ *-+: *$/.test(b.align[Y])?b.align[Y]="right":/^ *:-+: *$/.test(b.align[Y])?b.align[Y]="center":/^ *:-+ *$/.test(b.align[Y])?b.align[Y]="left":b.align[Y]=null;for(x=b.cells.length,Y=0;Y<x;Y++)b.cells[Y]=W(b.cells[Y].replace(/^ *\| *| *\| *$/g,""),b.header.length);return b}}},D.lheading=function(h){var p=this.rules.block.lheading.exec(h);if(p)return{type:"heading",raw:p[0],depth:p[2].charAt(0)==="="?1:2,text:p[1]}},D.paragraph=function(h){var p=this.rules.block.paragraph.exec(h);if(p)return{type:"paragraph",raw:p[0],text:p[1].charAt(p[1].length-1)===`
`?p[1].slice(0,-1):p[1]}},D.text=function(h,p){var b=this.rules.block.text.exec(h);if(b){var x=p[p.length-1];return x&&x.type==="text"?{raw:b[0],text:b[0]}:{type:"text",raw:b[0],text:b[0]}}},D.escape=function(h){var p=this.rules.inline.escape.exec(h);if(p)return{type:"escape",raw:p[0],text:pe(p[1])}},D.tag=function(h,p,b){var x=this.rules.inline.tag.exec(h);if(x)return!p&&/^<a /i.test(x[0])?p=!0:p&&/^<\/a>/i.test(x[0])&&(p=!1),!b&&/^<(pre|code|kbd|script)(\s|>)/i.test(x[0])?b=!0:b&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(x[0])&&(b=!1),{type:this.options.sanitize?"text":"html",raw:x[0],inLink:p,inRawBlock:b,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(x[0]):pe(x[0]):x[0]}},D.link=function(h){var p=this.rules.inline.link.exec(h);if(p){var b=ve(p[2],"()");if(b>-1){var x=p[0].indexOf("!")===0?5:4,Y=x+p[1].length+b;p[2]=p[2].substring(0,b),p[0]=p[0].substring(0,Y).trim(),p[3]=""}var de=p[2],Ae="";if(this.options.pedantic){var gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(de);gt?(de=gt[1],Ae=gt[3]):Ae=""}else Ae=p[3]?p[3].slice(1,-1):"";de=de.trim().replace(/^<([\s\S]*)>$/,"$1");var Rt=Ne(p,{href:de&&de.replace(this.rules.inline._escapes,"$1"),title:Ae&&Ae.replace(this.rules.inline._escapes,"$1")},p[0]);return Rt}},D.reflink=function(h,p){var b;if((b=this.rules.inline.reflink.exec(h))||(b=this.rules.inline.nolink.exec(h))){var x=(b[2]||b[1]).replace(/\s+/g," ");if(x=p[x.toLowerCase()],!x||!x.href){var Y=b[0].charAt(0);return{type:"text",raw:Y,text:Y}}var de=Ne(b,x,b[0]);return de}},D.strong=function(h,p,b){b===void 0&&(b="");var x=this.rules.inline.strong.start.exec(h);if(x&&(!x[1]||x[1]&&(b===""||this.rules.inline.punctuation.exec(b)))){p=p.slice(-1*h.length);var Y=x[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Y.lastIndex=0;for(var de;(x=Y.exec(p))!=null;)if(de=this.rules.inline.strong.middle.exec(p.slice(0,x.index+3)),de)return{type:"strong",raw:h.slice(0,de[0].length),text:h.slice(2,de[0].length-2)}}},D.em=function(h,p,b){b===void 0&&(b="");var x=this.rules.inline.em.start.exec(h);if(x&&(!x[1]||x[1]&&(b===""||this.rules.inline.punctuation.exec(b)))){p=p.slice(-1*h.length);var Y=x[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Y.lastIndex=0;for(var de;(x=Y.exec(p))!=null;)if(de=this.rules.inline.em.middle.exec(p.slice(0,x.index+2)),de)return{type:"em",raw:h.slice(0,de[0].length),text:h.slice(1,de[0].length-1)}}},D.codespan=function(h){var p=this.rules.inline.code.exec(h);if(p){var b=p[2].replace(/\n/g," "),x=/[^ ]/.test(b),Y=b.startsWith(" ")&&b.endsWith(" ");return x&&Y&&(b=b.substring(1,b.length-1)),b=pe(b,!0),{type:"codespan",raw:p[0],text:b}}},D.br=function(h){var p=this.rules.inline.br.exec(h);if(p)return{type:"br",raw:p[0]}},D.del=function(h){var p=this.rules.inline.del.exec(h);if(p)return{type:"del",raw:p[0],text:p[1]}},D.autolink=function(h,p){var b=this.rules.inline.autolink.exec(h);if(b){var x,Y;return b[2]==="@"?(x=pe(this.options.mangle?p(b[1]):b[1]),Y="mailto:"+x):(x=pe(b[1]),Y=x),{type:"link",raw:b[0],text:x,href:Y,tokens:[{type:"text",raw:x,text:x}]}}},D.url=function(h,p){var b;if(b=this.rules.inline.url.exec(h)){var x,Y;if(b[2]==="@")x=pe(this.options.mangle?p(b[0]):b[0]),Y="mailto:"+x;else{var de;do de=b[0],b[0]=this.rules.inline._backpedal.exec(b[0])[0];while(de!==b[0]);x=pe(b[0]),b[1]==="www."?Y="http://"+x:Y=x}return{type:"link",raw:b[0],text:x,href:Y,tokens:[{type:"text",raw:x,text:x}]}}},D.inlineText=function(h,p,b){var x=this.rules.inline.text.exec(h);if(x){var Y;return p?Y=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(x[0]):pe(x[0]):x[0]:Y=pe(this.options.smartypants?b(x[0]):x[0]),{type:"text",raw:x[0],text:Y}}},k}(),Ve=Be.noopTest,ke=Be.edit,Re=Be.merge,Q={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:Ve,table:Ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Q._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Q._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Q.def=ke(Q.def).replace("label",Q._label).replace("title",Q._title).getRegex(),Q.bullet=/(?:[*+-]|\d{1,9}[.)])/,Q.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Q.item=ke(Q.item,"gm").replace(/bull/g,Q.bullet).getRegex(),Q.list=ke(Q.list).replace(/bull/g,Q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Q.def.source+")").getRegex(),Q._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",Q._comment=/<!--(?!-?>)[\s\S]*?-->/,Q.html=ke(Q.html,"i").replace("comment",Q._comment).replace("tag",Q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Q.paragraph=ke(Q._paragraph).replace("hr",Q.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",Q._tag).getRegex(),Q.blockquote=ke(Q.blockquote).replace("paragraph",Q.paragraph).getRegex(),Q.normal=Re({},Q),Q.gfm=Re({},Q.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*|$)"}),Q.gfm.nptable=ke(Q.gfm.nptable).replace("hr",Q.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",Q._tag).getRegex(),Q.gfm.table=ke(Q.gfm.table).replace("hr",Q.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",Q._tag).getRegex(),Q.pedantic=Re({},Q.normal,{html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Q._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:Ve,paragraph:ke(Q.normal._paragraph).replace("hr",Q.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var X={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ve,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:Ve,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};X._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",X.punctuation=ke(X.punctuation).replace(/punctuation/g,X._punctuation).getRegex(),X._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",X._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",X.em.start=ke(X.em.start).replace(/punctuation/g,X._punctuation).getRegex(),X.em.middle=ke(X.em.middle).replace(/punctuation/g,X._punctuation).replace(/overlapSkip/g,X._overlapSkip).getRegex(),X.em.endAst=ke(X.em.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.em.endUnd=ke(X.em.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.start=ke(X.strong.start).replace(/punctuation/g,X._punctuation).getRegex(),X.strong.middle=ke(X.strong.middle).replace(/punctuation/g,X._punctuation).replace(/blockSkip/g,X._blockSkip).getRegex(),X.strong.endAst=ke(X.strong.endAst,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.strong.endUnd=ke(X.strong.endUnd,"g").replace(/punctuation/g,X._punctuation).getRegex(),X.blockSkip=ke(X._blockSkip,"g").getRegex(),X.overlapSkip=ke(X._overlapSkip,"g").getRegex(),X._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,X._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,X._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])?)+(?![-_])/,X.autolink=ke(X.autolink).replace("scheme",X._scheme).replace("email",X._email).getRegex(),X._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,X.tag=ke(X.tag).replace("comment",Q._comment).replace("attribute",X._attribute).getRegex(),X._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,X._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,X._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,X.link=ke(X.link).replace("label",X._label).replace("href",X._href).replace("title",X._title).getRegex(),X.reflink=ke(X.reflink).replace("label",X._label).getRegex(),X.reflinkSearch=ke(X.reflinkSearch,"g").replace("reflink",X.reflink).replace("nolink",X.nolink).getRegex(),X.normal=Re({},X),X.pedantic=Re({},X.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:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",X._label).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",X._label).getRegex()}),X.gfm=Re({},X.normal,{escape:ke(X.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),X.gfm.url=ke(X.gfm.url,"i").replace("email",X.gfm._extended_email).getRegex(),X.breaks=Re({},X.gfm,{br:ke(X.br).replace("{2,}","*").getRegex(),text:ke(X.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var He={block:Q,inline:X},at=N.defaults,pt=He.block,Ye=He.inline;function rt(k){return k.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 je(k){var D="",j,h,p=k.length;for(j=0;j<p;j++)h=k.charCodeAt(j),Math.random()>.5&&(h="x"+h.toString(16)),D+="&#"+h+";";return D}var Fe=function(){function k(j){this.tokens=[],this.tokens.links=Object.create(null),this.options=j||at,this.options.tokenizer=this.options.tokenizer||new Me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var h={block:pt.normal,inline:Ye.normal};this.options.pedantic?(h.block=pt.pedantic,h.inline=Ye.pedantic):this.options.gfm&&(h.block=pt.gfm,this.options.breaks?h.inline=Ye.breaks:h.inline=Ye.gfm),this.tokenizer.rules=h}k.lex=function(h,p){var b=new k(p);return b.lex(h)};var D=k.prototype;return D.lex=function(h){return h=h.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(h,this.tokens,!0),this.inline(this.tokens),this.tokens},D.blockTokens=function(h,p,b){p===void 0&&(p=[]),b===void 0&&(b=!0),h=h.replace(/^ +$/gm,"");for(var x,Y,de,Ae;h;){if(x=this.tokenizer.space(h)){h=h.substring(x.raw.length),x.type&&p.push(x);continue}if(x=this.tokenizer.code(h,p)){h=h.substring(x.raw.length),x.type?p.push(x):(Ae=p[p.length-1],Ae.raw+=`
`+x.raw,Ae.text+=`
`+x.text);continue}if(x=this.tokenizer.fences(h)){h=h.substring(x.raw.length),p.push(x);continue}if(x=this.tokenizer.heading(h)){h=h.substring(x.raw.length),p.push(x);continue}if(x=this.tokenizer.nptable(h)){h=h.substring(x.raw.length),p.push(x);continue}if(x=this.tokenizer.hr(h)){h=h.substring(x.raw.length),p.push(x);continue}if(x=this.tokenizer.blockquote(h)){h=h.substring(x.raw.length),x.tokens=this.blockTokens(x.text,[],b),p.push(x);continue}if(x=this.tokenizer.list(h)){for(h=h.substring(x.raw.length),de=x.items.length,Y=0;Y<de;Y++)x.items[Y].tokens=this.blockTokens(x.items[Y].text,[],!1);p.push(x);continue}if(x=this.tokenizer.html(h)){h=h.substring(x.raw.length),p.push(x);continue}if(b&&(x=this.tokenizer.def(h))){h=h.substring(x.raw.length),this.tokens.links[x.tag]||(this.tokens.links[x.tag]={href:x.href,title:x.title});continue}if(x=this.tokenizer.table(h)){h=h.substring(x.raw.length),p.push(x);continue}if(x=this.tokenizer.lheading(h)){h=h.substring(x.raw.length),p.push(x);continue}if(b&&(x=this.tokenizer.paragraph(h))){h=h.substring(x.raw.length),p.push(x);continue}if(x=this.tokenizer.text(h,p)){h=h.substring(x.raw.length),x.type?p.push(x):(Ae=p[p.length-1],Ae.raw+=`
`+x.raw,Ae.text+=`
`+x.text);continue}if(h){var gt="Infinite loop on byte: "+h.charCodeAt(0);if(this.options.silent){console.error(gt);break}else throw new Error(gt)}}return p},D.inline=function(h){var p,b,x,Y,de,Ae,gt=h.length;for(p=0;p<gt;p++){Ae=h[p];switch(Ae.type){case"paragraph":case"text":case"heading":{Ae.tokens=[],this.inlineTokens(Ae.text,Ae.tokens);break}case"table":{for(Ae.tokens={header:[],cells:[]},Y=Ae.header.length,b=0;b<Y;b++)Ae.tokens.header[b]=[],this.inlineTokens(Ae.header[b],Ae.tokens.header[b]);for(Y=Ae.cells.length,b=0;b<Y;b++)for(de=Ae.cells[b],Ae.tokens.cells[b]=[],x=0;x<de.length;x++)Ae.tokens.cells[b][x]=[],this.inlineTokens(de[x],Ae.tokens.cells[b][x]);break}case"blockquote":{this.inline(Ae.tokens);break}case"list":{for(Y=Ae.items.length,b=0;b<Y;b++)this.inline(Ae.items[b].tokens);break}}}return h},D.inlineTokens=function(h,p,b,x,Y){p===void 0&&(p=[]),b===void 0&&(b=!1),x===void 0&&(x=!1),Y===void 0&&(Y="");var de,Ae=h,gt;if(this.tokens.links){var Rt=Object.keys(this.tokens.links);if(Rt.length>0)for(;(gt=this.tokenizer.rules.inline.reflinkSearch.exec(Ae))!=null;)Rt.includes(gt[0].slice(gt[0].lastIndexOf("[")+1,-1))&&(Ae=Ae.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(gt=this.tokenizer.rules.inline.blockSkip.exec(Ae))!=null;)Ae=Ae.slice(0,gt.index)+"["+"a".repeat(gt[0].length-2)+"]"+Ae.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;h;){if(de=this.tokenizer.escape(h)){h=h.substring(de.raw.length),p.push(de);continue}if(de=this.tokenizer.tag(h,b,x)){h=h.substring(de.raw.length),b=de.inLink,x=de.inRawBlock,p.push(de);continue}if(de=this.tokenizer.link(h)){h=h.substring(de.raw.length),de.type==="link"&&(de.tokens=this.inlineTokens(de.text,[],!0,x)),p.push(de);continue}if(de=this.tokenizer.reflink(h,this.tokens.links)){h=h.substring(de.raw.length),de.type==="link"&&(de.tokens=this.inlineTokens(de.text,[],!0,x)),p.push(de);continue}if(de=this.tokenizer.strong(h,Ae,Y)){h=h.substring(de.raw.length),de.tokens=this.inlineTokens(de.text,[],b,x),p.push(de);continue}if(de=this.tokenizer.em(h,Ae,Y)){h=h.substring(de.raw.length),de.tokens=this.inlineTokens(de.text,[],b,x),p.push(de);continue}if(de=this.tokenizer.codespan(h)){h=h.substring(de.raw.length),p.push(de);continue}if(de=this.tokenizer.br(h)){h=h.substring(de.raw.length),p.push(de);continue}if(de=this.tokenizer.del(h)){h=h.substring(de.raw.length),de.tokens=this.inlineTokens(de.text,[],b,x),p.push(de);continue}if(de=this.tokenizer.autolink(h,je)){h=h.substring(de.raw.length),p.push(de);continue}if(!b&&(de=this.tokenizer.url(h,je))){h=h.substring(de.raw.length),p.push(de);continue}if(de=this.tokenizer.inlineText(h,x,rt)){h=h.substring(de.raw.length),Y=de.raw.slice(-1),p.push(de);continue}if(h){var Ot="Infinite loop on byte: "+h.charCodeAt(0);if(this.options.silent){console.error(Ot);break}else throw new Error(Ot)}}return p},fe(k,null,[{key:"rules",get:function(){return{block:pt,inline:Ye}}}]),k}(),$e=N.defaults,tt=Be.cleanUrl,Ge=Be.escape,_e=function(){function k(j){this.options=j||$e}var D=k.prototype;return D.code=function(h,p,b){var x=(p||"").match(/\S*/)[0];if(this.options.highlight){var Y=this.options.highlight(h,x);Y!=null&&Y!==h&&(b=!0,h=Y)}return x?'<pre><code class="'+this.options.langPrefix+Ge(x,!0)+'">'+(b?h:Ge(h,!0))+`</code></pre>
`:"<pre><code>"+(b?h:Ge(h,!0))+`</code></pre>
`},D.blockquote=function(h){return`<blockquote>
`+h+`</blockquote>
`},D.html=function(h){return h},D.heading=function(h,p,b,x){return this.options.headerIds?"<h"+p+' id="'+this.options.headerPrefix+x.slug(b)+'">'+h+"</h"+p+`>
`:"<h"+p+">"+h+"</h"+p+`>
`},D.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},D.list=function(h,p,b){var x=p?"ol":"ul",Y=p&&b!==1?' start="'+b+'"':"";return"<"+x+Y+`>
`+h+"</"+x+`>
`},D.listitem=function(h){return"<li>"+h+`</li>
`},D.checkbox=function(h){return"<input "+(h?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},D.paragraph=function(h){return"<p>"+h+`</p>
`},D.table=function(h,p){return p&&(p="<tbody>"+p+"</tbody>"),`<table>
<thead>
`+h+`</thead>
`+p+`</table>
`},D.tablerow=function(h){return`<tr>
`+h+`</tr>
`},D.tablecell=function(h,p){var b=p.header?"th":"td",x=p.align?"<"+b+' align="'+p.align+'">':"<"+b+">";return x+h+"</"+b+`>
`},D.strong=function(h){return"<strong>"+h+"</strong>"},D.em=function(h){return"<em>"+h+"</em>"},D.codespan=function(h){return"<code>"+h+"</code>"},D.br=function(){return this.options.xhtml?"<br/>":"<br>"},D.del=function(h){return"<del>"+h+"</del>"},D.link=function(h,p,b){if(h=tt(this.options.sanitize,this.options.baseUrl,h),h===null)return b;var x='<a href="'+Ge(h)+'"';return p&&(x+=' title="'+p+'"'),x+=">"+b+"</a>",x},D.image=function(h,p,b){if(h=tt(this.options.sanitize,this.options.baseUrl,h),h===null)return b;var x='<img src="'+h+'" alt="'+b+'"';return p&&(x+=' title="'+p+'"'),x+=this.options.xhtml?"/>":">",x},D.text=function(h){return h},k}(),Pe=function(){function k(){}var D=k.prototype;return D.strong=function(h){return h},D.em=function(h){return h},D.codespan=function(h){return h},D.del=function(h){return h},D.html=function(h){return h},D.text=function(h){return h},D.link=function(h,p,b){return""+b},D.image=function(h,p,b){return""+b},D.br=function(){return""},k}(),st=function(){function k(){this.seen={}}var D=k.prototype;return D.slug=function(h){var p=h.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},k}(),lt=N.defaults,dt=Be.unescape,et=function(){function k(j){this.options=j||lt,this.options.renderer=this.options.renderer||new _e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Pe,this.slugger=new st}k.parse=function(h,p){var b=new k(p);return b.parse(h)};var D=k.prototype;return D.parse=function(h,p){p===void 0&&(p=!0);var b="",x,Y,de,Ae,gt,Rt,Ot,On,Kt,Ct,Mn,Qt,jn,Ln,Pt,Qn,hr,qn,br=h.length;for(x=0;x<br;x++){Ct=h[x];switch(Ct.type){case"space":continue;case"hr":{b+=this.renderer.hr();continue}case"heading":{b+=this.renderer.heading(this.parseInline(Ct.tokens),Ct.depth,dt(this.parseInline(Ct.tokens,this.textRenderer)),this.slugger);continue}case"code":{b+=this.renderer.code(Ct.text,Ct.lang,Ct.escaped);continue}case"table":{for(On="",Ot="",Ae=Ct.header.length,Y=0;Y<Ae;Y++)Ot+=this.renderer.tablecell(this.parseInline(Ct.tokens.header[Y]),{header:!0,align:Ct.align[Y]});for(On+=this.renderer.tablerow(Ot),Kt="",Ae=Ct.cells.length,Y=0;Y<Ae;Y++){for(Rt=Ct.tokens.cells[Y],Ot="",gt=Rt.length,de=0;de<gt;de++)Ot+=this.renderer.tablecell(this.parseInline(Rt[de]),{header:!1,align:Ct.align[de]});Kt+=this.renderer.tablerow(Ot)}b+=this.renderer.table(On,Kt);continue}case"blockquote":{Kt=this.parse(Ct.tokens),b+=this.renderer.blockquote(Kt);continue}case"list":{for(Mn=Ct.ordered,Qt=Ct.start,jn=Ct.loose,Ae=Ct.items.length,Kt="",Y=0;Y<Ae;Y++)Pt=Ct.items[Y],Qn=Pt.checked,hr=Pt.task,Ln="",Pt.task&&(qn=this.renderer.checkbox(Qn),jn?Pt.tokens.length>0&&Pt.tokens[0].type==="text"?(Pt.tokens[0].text=qn+" "+Pt.tokens[0].text,Pt.tokens[0].tokens&&Pt.tokens[0].tokens.length>0&&Pt.tokens[0].tokens[0].type==="text"&&(Pt.tokens[0].tokens[0].text=qn+" "+Pt.tokens[0].tokens[0].text)):Pt.tokens.unshift({type:"text",text:qn}):Ln+=qn),Ln+=this.parse(Pt.tokens,jn),Kt+=this.renderer.listitem(Ln,hr,Qn);b+=this.renderer.list(Kt,Mn,Qt);continue}case"html":{b+=this.renderer.html(Ct.text);continue}case"paragraph":{b+=this.renderer.paragraph(this.parseInline(Ct.tokens));continue}case"text":{for(Kt=Ct.tokens?this.parseInline(Ct.tokens):Ct.text;x+1<br&&h[x+1].type==="text";)Ct=h[++x],Kt+=`
`+(Ct.tokens?this.parseInline(Ct.tokens):Ct.text);b+=p?this.renderer.paragraph(Kt):Kt;continue}default:{var yr='Token with "'+Ct.type+'" type was not found.';if(this.options.silent){console.error(yr);return}else throw new Error(yr)}}}return b},D.parseInline=function(h,p){p=p||this.renderer;var b="",x,Y,de=h.length;for(x=0;x<de;x++){Y=h[x];switch(Y.type){case"escape":{b+=p.text(Y.text);break}case"html":{b+=p.html(Y.text);break}case"link":{b+=p.link(Y.href,Y.title,this.parseInline(Y.tokens,p));break}case"image":{b+=p.image(Y.href,Y.title,Y.text);break}case"strong":{b+=p.strong(this.parseInline(Y.tokens,p));break}case"em":{b+=p.em(this.parseInline(Y.tokens,p));break}case"codespan":{b+=p.codespan(Y.text);break}case"br":{b+=p.br();break}case"del":{b+=p.del(this.parseInline(Y.tokens,p));break}case"text":{b+=p.text(Y.text);break}default:{var Ae='Token with "'+Y.type+'" type was not found.';if(this.options.silent){console.error(Ae);return}else throw new Error(Ae)}}}return b},k}(),wt=Be.merge,mt=Be.checkSanitizeDeprecation,ut=Be.escape,Ee=N.getDefaults,xt=N.changeDefaults,ct=N.defaults;function Se(k,D,j){if(typeof k=="undefined"||k===null)throw new Error("marked(): input parameter is undefined or null");if(typeof k!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(k)+", string expected");if(typeof D=="function"&&(j=D,D=null),D=wt({},Se.defaults,D||{}),mt(D),j){var h=D.highlight,p;try{p=Fe.lex(k,D)}catch(de){return j(de)}var b=function(Ae){var gt;if(!Ae)try{gt=et.parse(p,D)}catch(Rt){Ae=Rt}return D.highlight=h,Ae?j(Ae):j(null,gt)};if(!h||h.length<3)return b();if(delete D.highlight,!p.length)return b();var x=0;Se.walkTokens(p,function(de){de.type==="code"&&(x++,setTimeout(function(){h(de.text,de.lang,function(Ae,gt){if(Ae)return b(Ae);gt!=null&&gt!==de.text&&(de.text=gt,de.escaped=!0),x--,x===0&&b()})},0))}),x===0&&b();return}try{var Y=Fe.lex(k,D);return D.walkTokens&&Se.walkTokens(Y,D.walkTokens),et.parse(Y,D)}catch(de){if(de.message+=`
Please report this to https://github.com/markedjs/marked.`,D.silent)return"<p>An error occurred:</p><pre>"+ut(de.message+"",!0)+"</pre>";throw de}}Se.options=Se.setOptions=function(k){return wt(Se.defaults,k),xt(Se.defaults),Se},Se.getDefaults=Ee,Se.defaults=ct,Se.use=function(k){var D=wt({},k);if(k.renderer&&function(){var h=Se.defaults.renderer||new _e,p=function(Y){var de=h[Y];h[Y]=function(){for(var Ae=arguments.length,gt=new Array(Ae),Rt=0;Rt<Ae;Rt++)gt[Rt]=arguments[Rt];var Ot=k.renderer[Y].apply(h,gt);return Ot===!1&&(Ot=de.apply(h,gt)),Ot}};for(var b in k.renderer)p(b);D.renderer=h}(),k.tokenizer&&function(){var h=Se.defaults.tokenizer||new Me,p=function(Y){var de=h[Y];h[Y]=function(){for(var Ae=arguments.length,gt=new Array(Ae),Rt=0;Rt<Ae;Rt++)gt[Rt]=arguments[Rt];var Ot=k.tokenizer[Y].apply(h,gt);return Ot===!1&&(Ot=de.apply(h,gt)),Ot}};for(var b in k.tokenizer)p(b);D.tokenizer=h}(),k.walkTokens){var j=Se.defaults.walkTokens;D.walkTokens=function(h){k.walkTokens(h),j&&j(h)}}Se.setOptions(D)},Se.walkTokens=function(k,D){for(var j=v(k),h;!(h=j()).done;){var p=h.value;D(p);switch(p.type){case"table":{for(var b=v(p.tokens.header),x;!(x=b()).done;){var Y=x.value;Se.walkTokens(Y,D)}for(var de=v(p.tokens.cells),Ae;!(Ae=de()).done;)for(var gt=Ae.value,Rt=v(gt),Ot;!(Ot=Rt()).done;){var On=Ot.value;Se.walkTokens(On,D)}break}case"list":{Se.walkTokens(p.items,D);break}default:p.tokens&&Se.walkTokens(p.tokens,D)}}},Se.Parser=et,Se.parser=et.parse,Se.Renderer=_e,Se.TextRenderer=Pe,Se.Lexer=Fe,Se.lexer=Fe.lex,Se.Tokenizer=Me,Se.Slugger=st,Se.parse=Se;var Ke=Se;return Ke})},ELLl:function(Tt,nt,m){(function(P){P(m("VrN/"))})(function(P){var fe={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},te=P.Pos;P.defineOption("autoCloseBrackets",!1,function(V,T,R){R&&R!=P.Init&&(V.removeKeyMap(v),V.state.closeBrackets=null),T&&(he(H(T,"pairs")),V.state.closeBrackets=T,V.addKeyMap(v))});function H(V,T){return T=="pairs"&&typeof V=="string"?V:typeof V=="object"&&V[T]!=null?V[T]:fe[T]}var v={Backspace:A,Enter:be};function he(V){for(var T=0;T<V.length;T++){var R=V.charAt(T),K="'"+R+"'";v[K]||(v[K]=N(R))}}he(fe.pairs+"`");function N(V){return function(T){return ne(T,V)}}function U(V){var T=V.state.closeBrackets;if(!T||T.override)return T;var R=V.getModeAt(V.getCursor());return R.closeBrackets||T}function A(V){var T=U(V);if(!T||V.getOption("disableInput"))return P.Pass;for(var R=H(T,"pairs"),K=V.listSelections(),$=0;$<K.length;$++){if(!K[$].empty())return P.Pass;var me=Ce(V,K[$].head);if(!me||R.indexOf(me)%2!=0)return P.Pass}for(var $=K.length-1;$>=0;$--){var Le=K[$].head;V.replaceRange("",te(Le.line,Le.ch-1),te(Le.line,Le.ch+1),"+delete")}}function be(V){var T=U(V),R=T&&H(T,"explode");if(!R||V.getOption("disableInput"))return P.Pass;for(var K=V.listSelections(),$=0;$<K.length;$++){if(!K[$].empty())return P.Pass;var me=Ce(V,K[$].head);if(!me||R.indexOf(me)%2!=0)return P.Pass}V.operation(function(){var Le=V.lineSeparator()||`
`;V.replaceSelection(Le+Le,null),V.execCommand("goCharLeft"),K=V.listSelections();for(var ce=0;ce<K.length;ce++){var ge=K[ce].head.line;V.indentLine(ge,null,!0),V.indentLine(ge+1,null,!0)}})}function ee(V){var T=P.cmpPos(V.anchor,V.head)>0;return{anchor:new te(V.anchor.line,V.anchor.ch+(T?-1:1)),head:new te(V.head.line,V.head.ch+(T?1:-1))}}function ne(V,T){var R=U(V);if(!R||V.getOption("disableInput"))return P.Pass;var K=H(R,"pairs"),$=K.indexOf(T);if($==-1)return P.Pass;for(var me=H(R,"closeBefore"),Le=H(R,"triples"),ce=K.charAt($+1)==T,ge=V.listSelections(),Te=$%2==0,le,se=0;se<ge.length;se++){var Oe=ge[se],re=Oe.head,w,ie=V.getRange(re,te(re.line,re.ch+1));if(Te&&!Oe.empty())w="surround";else if((ce||!Te)&&ie==T)ce&&ae(V,re)?w="both":Le.indexOf(T)>=0&&V.getRange(re,te(re.line,re.ch+3))==T+T+T?w="skipThree":w="skip";else if(ce&&re.ch>1&&Le.indexOf(T)>=0&&V.getRange(te(re.line,re.ch-2),re)==T+T){if(re.ch>2&&/\bstring/.test(V.getTokenTypeAt(te(re.line,re.ch-2))))return P.Pass;w="addFour"}else if(ce){var Z=re.ch==0?" ":V.getRange(te(re.line,re.ch-1),re);if(!P.isWordChar(ie)&&Z!=T&&!P.isWordChar(Z))w="both";else return P.Pass}else if(Te&&(ie.length===0||/\s/.test(ie)||me.indexOf(ie)>-1))w="both";else return P.Pass;if(!le)le=w;else if(le!=w)return P.Pass}var _=$%2?K.charAt($-1):T,ue=$%2?T:K.charAt($+1);V.operation(function(){if(le=="skip")V.execCommand("goCharRight");else if(le=="skipThree")for(var xe=0;xe<3;xe++)V.execCommand("goCharRight");else if(le=="surround"){for(var oe=V.getSelections(),xe=0;xe<oe.length;xe++)oe[xe]=_+oe[xe]+ue;V.replaceSelections(oe,"around"),oe=V.listSelections().slice();for(var xe=0;xe<oe.length;xe++)oe[xe]=ee(oe[xe]);V.setSelections(oe)}else le=="both"?(V.replaceSelection(_+ue,null),V.triggerElectric(_+ue),V.execCommand("goCharLeft")):le=="addFour"&&(V.replaceSelection(_+_+_+_,"before"),V.execCommand("goCharRight"))})}function Ce(V,T){var R=V.getRange(te(T.line,T.ch-1),te(T.line,T.ch+1));return R.length==2?R:null}function ae(V,T){var R=V.getTokenAt(te(T.line,T.ch+1));return/\bstring/.test(R.type)&&R.start==T.ch&&(T.ch==0||!/\bstring/.test(V.getTokenTypeAt(T)))}})},F8wB:function(Tt,nt,m){Tt.exports={loading:"loading___1SIOG"}},Gytx:function(Tt,nt){Tt.exports=function(P,fe,te,H){var v=te?te.call(H,P,fe):void 0;if(v!==void 0)return!!v;if(P===fe)return!0;if(typeof P!="object"||!P||typeof fe!="object"||!fe)return!1;var he=Object.keys(P),N=Object.keys(fe);if(he.length!==N.length)return!1;for(var U=Object.prototype.hasOwnProperty.bind(fe),A=0;A<he.length;A++){var be=he[A];if(!U(be))return!1;var ee=P[be],ne=fe[be];if(v=te?te.call(H,ee,ne,be):void 0,v===!1||v===void 0&&ee!==ne)return!1}return!0}},HmJG:function(Tt,nt,m){},I8Z2:function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return H}),m.d(nt,"b",function(){return Ce}),m.d(nt,"c",function(){return V});var P=m("q1tI"),fe=function(){var T=function(R,K){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,me){$.__proto__=me}||function($,me){for(var Le in me)me.hasOwnProperty(Le)&&($[Le]=me[Le])},T(R,K)};return function(R,K){T(R,K);function $(){this.constructor=R}R.prototype=K===null?Object.create(K):($.prototype=K.prototype,new $)}}(),te=P.createContext(null),H=function(T){fe(R,T);function R(){return T!==null&&T.apply(this,arguments)||this}return R.prototype.render=function(){return P.createElement(te.Provider,{value:this.props.store},this.props.children)},R}(P.Component),v=m("Gytx"),he=m.n(v),N=m("2mql"),U=m.n(N),A=function(){var T=function(R,K){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,me){$.__proto__=me}||function($,me){for(var Le in me)me.hasOwnProperty(Le)&&($[Le]=me[Le])},T(R,K)};return function(R,K){T(R,K);function $(){this.constructor=R}R.prototype=K===null?Object.create(K):($.prototype=K.prototype,new $)}}(),be=function(){return be=Object.assign||function(T){for(var R,K=1,$=arguments.length;K<$;K++){R=arguments[K];for(var me in R)Object.prototype.hasOwnProperty.call(R,me)&&(T[me]=R[me])}return T},be.apply(this,arguments)};function ee(T){return T.displayName||T.name||"Component"}var ne=function(){return{}};function Ce(T,R){R===void 0&&(R={});var K=!!T,$=T||ne;return function(Le){var ce=function(Te){A(le,Te);function le(se,Oe){var re=Te.call(this,se,Oe)||this;return re.unsubscribe=null,re.handleChange=function(){if(!re.unsubscribe)return;var w=$(re.store.getState(),re.props);re.setState({subscribed:w})},re.store=re.context,re.state={subscribed:$(re.store.getState(),se),store:re.store,props:se},re}return le.getDerivedStateFromProps=function(se,Oe){return T&&T.length===2&&se!==Oe.props?{subscribed:$(Oe.store.getState(),se),props:se}:{props:se}},le.prototype.componentDidMount=function(){this.trySubscribe()},le.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},le.prototype.shouldComponentUpdate=function(se,Oe){return!he()(this.props,se)||!he()(this.state.subscribed,Oe.subscribed)},le.prototype.trySubscribe=function(){K&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},le.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},le.prototype.render=function(){var se=be(be(be({},this.props),this.state.subscribed),{store:this.store});return P.createElement(Le,be({},se,{ref:this.props.miniStoreForwardedRef}))},le.displayName="Connect("+ee(Le)+")",le.contextType=te,le}(P.Component);if(R.forwardRef){var ge=P.forwardRef(function(Te,le){return P.createElement(ce,be({},Te,{miniStoreForwardedRef:le}))});return U()(ge,Le)}return U()(ce,Le)}}var ae=function(){return ae=Object.assign||function(T){for(var R,K=1,$=arguments.length;K<$;K++){R=arguments[K];for(var me in R)Object.prototype.hasOwnProperty.call(R,me)&&(T[me]=R[me])}return T},ae.apply(this,arguments)};function V(T){var R=T,K=[];function $(ce){R=ae(ae({},R),ce);for(var ge=0;ge<K.length;ge++)K[ge]()}function me(){return R}function Le(ce){return K.push(ce),function(){var Te=K.indexOf(ce);K.splice(Te,1)}}return{setState:$,getState:me,subscribe:Le}}},LdHM:function(Tt,nt,m){"use strict";m.d(nt,"b",function(){return me}),m.d(nt,"a",function(){return ce});var P=m("1OyB"),fe=m("vuIU"),te=m("Ji7U"),H=m("LK+K"),v=m("q1tI"),he=m("rePB"),N=m("Ff2n"),U=m("ODXe"),A=m("4IlW"),be=m("bX4T"),ee=m("YrtM"),ne=m("TSYQ"),Ce=m.n(ne),ae=m("+nKL"),V=m("8OUc"),T=function(W,pe){var ve=W.prefixCls,Ne=W.id,qe=W.flattenOptions,Me=W.childrenAsData,Ve=W.values,ke=W.searchValue,Re=W.multiple,Q=W.defaultActiveFirstOption,X=W.height,He=W.itemHeight,at=W.notFoundContent,pt=W.open,Ye=W.menuItemSelectedIcon,rt=W.virtual,je=W.onSelect,Fe=W.onToggleOpen,$e=W.onActiveValue,tt=W.onScroll,Ge=W.onMouseEnter,_e="".concat(ve,"-item"),Pe=Object(ee.a)(function(){return qe},[pt,qe],function(Ke,k){return k[0]&&Ke[1]!==k[1]}),st=v.useRef(null),lt=function(k){k.preventDefault()},dt=function(k){st.current&&st.current.scrollTo({index:k})},et=function(k){for(var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=Pe.length,h=0;h<j;h+=1){var p=(k+h*D+j)%j,b=Pe[p],x=b.group,Y=b.data;if(!x&&!Y.disabled)return p}return-1},wt=v.useState(function(){return et(0)}),mt=Object(U.a)(wt,2),ut=mt[0],Ee=mt[1],xt=function(k){Ee(k);var D=Pe[k];if(!D){$e(null,-1);return}$e(D.data.value,k)};v.useEffect(function(){xt(Q!==!1?et(0):-1)},[Pe.length,ke]),v.useEffect(function(){var Ke=setTimeout(function(){if(!Re&&pt&&Ve.size===1){var k=Array.from(Ve)[0],D=Pe.findIndex(function(j){var h=j.data;return h.value===k});xt(D),dt(D)}});return function(){return clearTimeout(Ke)}},[pt]);var ct=function(k){k!==void 0&&je(k,{selected:!Ve.has(k)}),Re||Fe(!1)};if(v.useImperativeHandle(pe,function(){return{onKeyDown:function(k){var D=k.which;switch(D){case A.a.UP:case A.a.DOWN:{var j=0;if(D===A.a.UP?j=-1:D===A.a.DOWN&&(j=1),j!==0){var h=et(ut+j,j);dt(h),xt(h)}break}case A.a.ENTER:{var p=Pe[ut];p&&!p.data.disabled?ct(p.data.value):ct(void 0),pt&&k.preventDefault();break}case A.a.ESC:Fe(!1)}},onKeyUp:function(){},scrollTo:function(k){dt(k)}}}),Pe.length===0)return v.createElement("div",{role:"listbox",id:"".concat(Ne,"_list"),className:"".concat(_e,"-empty"),onMouseDown:lt},at);function Se(Ke){var k=Pe[Ke];if(!k)return null;var D=k.data||{},j=D.value,h=D.label,p=D.children,b=Object(be.a)(D,!0),x=Me?p:h;return k?v.createElement("div",Object.assign({"aria-label":typeof x=="string"?x:null},b,{key:Ke,role:"option",id:"".concat(Ne,"_list_").concat(Ke),"aria-selected":Ve.has(j)}),j):null}return v.createElement(v.Fragment,null,v.createElement("div",{role:"listbox",id:"".concat(Ne,"_list"),style:{height:0,width:0,overflow:"hidden"}},Se(ut-1),Se(ut),Se(ut+1)),v.createElement(ae.a,{itemKey:"key",ref:st,data:Pe,height:X,itemHeight:He,fullHeight:!1,onMouseDown:lt,onScroll:tt,virtual:rt,onMouseEnter:Ge},function(Ke,k){var D,j=Ke.group,h=Ke.groupOption,p=Ke.data,b=p.label,x=p.key;if(j)return v.createElement("div",{className:Ce()(_e,"".concat(_e,"-group"))},b!==void 0?b:x);var Y=p.disabled,de=p.value,Ae=p.title,gt=p.children,Rt=p.style,Ot=p.className,On=Object(N.a)(p,["disabled","value","title","children","style","className"]),Kt=Ve.has(de),Ct="".concat(_e,"-option"),Mn=Ce()(_e,Ct,Ot,(D={},Object(he.a)(D,"".concat(Ct,"-grouped"),h),Object(he.a)(D,"".concat(Ct,"-active"),ut===k&&!Y),Object(he.a)(D,"".concat(Ct,"-disabled"),Y),Object(he.a)(D,"".concat(Ct,"-selected"),Kt),D)),Qt=Me?gt:b,jn=!Ye||typeof Ye=="function"||Kt;return v.createElement("div",Object.assign({},On,{"aria-selected":Kt,className:Mn,title:Ae,onMouseMove:function(){if(ut===k||Y)return;xt(k)},onClick:function(){Y||ct(de)},style:Rt}),v.createElement("div",{className:"".concat(Ct,"-content")},Qt||de),v.isValidElement(Ye)||Kt,jn&&v.createElement(V.a,{className:"".concat(_e,"-option-state"),customizeIcon:Ye,customizeIconProps:{isSelected:Kt}},Kt?"\u2713":null))}))},R=v.forwardRef(T);R.displayName="OptionList";var K=R,$=function(){return null};$.isSelectOption=!0;var me=$,Le=function(){return null};Le.isSelectOptGroup=!0;var ce=Le,ge=m("VTBJ"),Te=m("Zm9Q");function le(d){var W=d.key,pe=d.props,ve=pe.children,Ne=pe.value,qe=Object(N.a)(pe,["children","value"]);return Object(ge.a)({key:W,value:Ne!==void 0?Ne:W,children:ve},qe)}function se(d){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Te.a)(d).map(function(pe,ve){if(!v.isValidElement(pe)||!pe.type)return null;var Ne=pe.type.isSelectOptGroup,qe=pe.key,Me=pe.props,Ve=Me.children,ke=Object(N.a)(Me,["children"]);return W||!Ne?le(pe):Object(ge.a)(Object(ge.a)({key:"__RC_SELECT_GRP__".concat(qe===null?ve:qe,"__"),label:qe},ke),{},{options:se(Ve)})}).filter(function(pe){return pe})}var Oe=m("2Qr1"),re=m("qNPg"),w=m("U8pU"),ie=m("Kwbf"),Z=m("WKfj");function _(d){var W=d.mode,pe=d.options,ve=d.children,Ne=d.backfill,qe=d.allowClear,Me=d.placeholder,Ve=d.getInputElement,ke=d.showSearch,Re=d.onSearch,Q=d.defaultOpen,X=d.autoFocus,He=d.labelInValue,at=d.value,pt=d.inputValue,Ye=d.optionLabelProp,rt=W==="multiple"||W==="tags",je=ke!==void 0?ke:rt||W==="combobox",Fe=pe||se(ve);if(Object(ie.a)(W!=="tags"||Fe.every(function(_e){return!_e.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var $e=Fe.some(function(_e){return _e.options?_e.options.some(function(Pe){return typeof("value"in Pe?Pe.value:Pe.key)=="number"}):typeof("value"in _e?_e.value:_e.key)=="number"});Object(ie.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ie.a)(W!=="combobox"||!Ye,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ie.a)(W==="combobox"||!Ne,"`backfill` only works with `combobox` mode."),Object(ie.a)(W==="combobox"||!Ve,"`getInputElement` only work with `combobox` mode."),Object(ie.b)(W!=="combobox"||!Ve||!qe||!Me,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Re&&!je&&W!=="combobox"&&W!=="tags"&&Object(ie.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ie.b)(!Q||X,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),at!=null){var tt=Object(Z.d)(at);Object(ie.a)(!He||tt.every(function(_e){return Object(w.a)(_e)==="object"&&("key"in _e||"value"in _e)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ie.a)(!rt||Array.isArray(at),"`value` should be array when `mode` is `multiple` or `tags`")}if(ve){var Ge=null;Object(Te.a)(ve).some(function(_e){if(!v.isValidElement(_e)||!_e.type)return!1;var Pe=_e.type;if(Pe.isSelectOption)return!1;if(Pe.isSelectOptGroup){var st=Object(Te.a)(_e.props.children).every(function(lt){return!v.isValidElement(lt)||!_e.type||lt.type.isSelectOption?!0:(Ge=lt.type,!1)});return!st}return Ge=Pe,!0}),Ge&&Object(ie.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ge.displayName||Ge.name||Ge,"`.")),Object(ie.a)(pt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var ue=_,xe=Object(re.a)({prefixCls:"rc-select",components:{optionList:K},convertChildrenToData:se,flattenOptions:Oe.d,getLabeledValue:Oe.e,filterOptions:Oe.b,isValueDisabled:Oe.g,findValueOption:Oe.c,warningProps:ue,fillOptionsWithMissingValue:Oe.a}),oe=function(d){Object(te.a)(pe,d);var W=Object(H.a)(pe);function pe(){var ve;return Object(P.a)(this,pe),ve=W.apply(this,arguments),ve.selectRef=v.createRef(),ve.focus=function(){ve.selectRef.current.focus()},ve.blur=function(){ve.selectRef.current.blur()},ve}return Object(fe.a)(pe,[{key:"render",value:function(){return v.createElement(xe,Object.assign({ref:this.selectRef},this.props))}}]),pe}(v.Component);oe.Option=me,oe.OptGroup=ce;var Be=oe,E=nt.c=Be},M8RZ:function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return A});var P=m("fWQN"),fe=m("mtLc"),te=m("yKVA"),H=m("879j"),v=m("q1tI"),he=m.n(v),N=m("i8i4"),U=m.n(N),A=function(be){Object(te.a)(ne,be);var ee=Object(H.a)(ne);function ne(Ce){var ae;Object(P.a)(this,ne),ae=ee.call(this,Ce);var V=window.document;return ae.node=V.createElement("div"),V.body.appendChild(ae.node),ae}return Object(fe.a)(ne,[{key:"render",value:function(){var ae=this.props.children;return Object(N.createPortal)(ae,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),ne}(he.a.Component)},OLES:function(Tt,nt,m){"use strict";var P=m("U8pU"),fe=m("VTBJ"),te=m("Ff2n"),H=m("q1tI"),v=m("uciX"),he=m("7ixt"),N=function(Ce){var ae=Ce.overlay,V=Ce.prefixCls,T=Ce.id,R=Ce.overlayInnerStyle;return H.createElement("div",{className:"".concat(V,"-inner"),id:T,role:"tooltip",style:R},typeof ae=="function"?ae():ae)},U=N,A=function(Ce,ae){var V=Ce.overlayClassName,T=Ce.trigger,R=T===void 0?["hover"]:T,K=Ce.mouseEnterDelay,$=K===void 0?0:K,me=Ce.mouseLeaveDelay,Le=me===void 0?.1:me,ce=Ce.overlayStyle,ge=Ce.prefixCls,Te=ge===void 0?"rc-tooltip":ge,le=Ce.children,se=Ce.onVisibleChange,Oe=Ce.afterVisibleChange,re=Ce.transitionName,w=Ce.animation,ie=Ce.placement,Z=ie===void 0?"right":ie,_=Ce.align,ue=_===void 0?{}:_,xe=Ce.destroyTooltipOnHide,oe=xe===void 0?!1:xe,Be=Ce.defaultVisible,E=Ce.getTooltipContainer,d=Ce.overlayInnerStyle,W=Object(te.a)(Ce,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),pe=Object(H.useRef)(null);Object(H.useImperativeHandle)(ae,function(){return pe.current});var ve=Object(fe.a)({},W);"visible"in Ce&&(ve.popupVisible=Ce.visible);var Ne=function(){var Re=Ce.arrowContent,Q=Re===void 0?null:Re,X=Ce.overlay,He=Ce.id;return[H.createElement("div",{className:"".concat(Te,"-arrow"),key:"arrow"},Q),H.createElement(U,{key:"content",prefixCls:Te,id:He,overlay:X,overlayInnerStyle:d})]},qe=!1,Me=!1;if(typeof oe=="boolean")qe=oe;else if(oe&&Object(P.a)(oe)==="object"){var Ve=oe.keepParent;qe=Ve===!0,Me=Ve===!1}return H.createElement(v.a,Object.assign({popupClassName:V,prefixCls:Te,popup:Ne,action:R,builtinPlacements:he.a,popupPlacement:Z,ref:pe,popupAlign:ue,getPopupContainer:E,onPopupVisibleChange:se,afterPopupVisibleChange:Oe,popupTransitionName:re,popupAnimation:w,defaultPopupVisible:Be,destroyPopupOnHide:qe,autoDestroy:Me,mouseLeaveDelay:Le,popupStyle:ce,mouseEnterDelay:$},ve),le)},be=Object(H.forwardRef)(A),ee=nt.a=be},Ot1p:function(Tt,nt,m){"use strict";var P=m("2qtc"),fe=m("kLXV"),te=m("rAM+"),H=m("miYZ"),v=m("tsqr"),he=m("tJVT"),N=m("jrin"),U=m("q1tI"),A=m.n(U),be=m("VrN/"),ee=m.n(be),ne=m("bdgK"),Ce=m("p77/"),ae=m("Bd2K"),V=m("ELLl"),T=m("19Vz"),R=m("lZu9"),K=m("+NIl"),$=m("kSUc"),me=m("9Bee"),Le=function(k){var D=k.value,j=D===void 0?"":D,h=k.className,p=k.showTextOnly,b=k.showLines,x=k.style,Y=x===void 0?{}:x,de=Object(U.useMemo)(function(){return""},[j]);return A.a.createElement(A.a.Fragment,null,A.a.createElement("div",{dangerouslySetInnerHTML:{__html:de}}))},ce=m("0Owb"),ge=m("dejd"),Te=m("C+DQ"),le=[{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 se(k){var D=k.onActionCallback,j=k.title,h=k.icon,p=k.actionName,b=k.className,x=b===void 0?"":b,Y=k.children;function de(){D(p)}return A.a.createElement("a",{title:j,className:x,onClick:de},A.a.createElement("i",{className:"md-iconfont ".concat(h)}),Y)}var Oe=function(k){var D=k.watch,j=k.showNullButton,h=k.onActionCallback,p=k.fullScreen,b=k.insertTemp,x=k.hidetoolBar,Y=[].concat(le,[{title:"".concat(D?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(D?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return A.a.createElement("ul",{className:"markdown-toolbar-container"},!x&&Y.map(function(de,Ae){return A.a.createElement("li",{key:Ae},de.actionName?A.a.createElement(se,Object(ce.a)({},de,{onActionCallback:h})):A.a.createElement("span",{className:"v-line"}))}),j?A.a.createElement("li",null,A.a.createElement(se,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:h},A.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,b&&A.a.createElement("li",null,A.a.createElement(se,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(b),onActionCallback:h},A.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),A.a.createElement("li",{className:"btn-full-screen"},A.a.createElement(se,{icon:"".concat(p?"icon-shrink":"icon-enlarge"),title:p?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:h})))},re=m("M8RZ"),w=m("+L6B"),ie=m("2/Rp"),Z=m("y8nQ"),_=m("Vl3Y"),ue=m("5NDa"),xe=m("5rEg"),oe={labelCol:{span:4},wrapperCol:{span:20}},Be=function(k){var D=k.callback,j=k.onCancel;function h(p){D(p)}return A.a.createElement(_.a,Object(ce.a)({},oe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:h}),A.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},A.a.createElement(xe.a,null)),A.a.createElement(_.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},A.a.createElement(xe.a,null)),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(ie.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(ie.a,{type:"ghost",onClick:j},"\u53D6\u6D88")))},E=m("7ahc"),d=m("HmJG"),W=m("BjJ7"),pe=_.a.useForm,ve={width:280,marginRight:10},Ne={labelCol:{span:5},wrapperCol:{span:19}},qe=function(k){var D=k.callback,j=k.onCancel,h=pe(),p=Object(he.a)(h,1),b=p[0];function x(Ae){D(Ae)}function Y(Ae,gt){b.setFieldsValue({src:"/api/attachments/".concat(Ae.id),type:gt.type})}function de(Ae){var gt=Ae.target.files[0];Ve(gt,Y)}return A.a.createElement(_.a,Object(ce.a)({form:b},Ne,{className:"upload-image-panel",onFinish:x}),A.a.createElement(_.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},A.a.createElement("div",{className:"flex-container"},A.a.createElement(_.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},A.a.createElement(xe.a,{style:ve})),A.a.createElement(Me,{onFileChange:de}))),A.a.createElement(_.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},A.a.createElement(xe.a,{style:{width:264}})),A.a.createElement(_.a.Item,{style:{textAlign:"right"}},A.a.createElement(ie.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(ie.a,{type:"ghost",onClick:j},"\u53D6\u6D88")))};function Me(k){var D=k.onFileChange;return A.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",A.a.createElement("input",{type:"file",onChange:D}))}function Ve(k,D){if(!k)throw new String("\u6CA1\u6709\u6587\u4EF6");var j=new FormData;j.append("editormd-image-file",k),j.append("file_param_name","editormd-image-file"),j.append("byxhr","true");var h=new window.XMLHttpRequest;h.withCredentials=!0,h.addEventListener("load",function(p){D(JSON.parse(p.target.responseText),k)},!1),h.addEventListener("error",function(p){console.error(p)},!1),h.open("POST","".concat(W.a,"/api/attachments.json")),h.send(j)}var ke=m("giR+"),Re=m("fyUT"),Q=m("7Kak"),X=m("9yH6"),He=X.a.Group,at={margin:"0 8px"},pt=function(k){var D=k.callback,j=k.onCancel;function h(p){D(p)}return A.a.createElement(_.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:h},A.a.createElement("div",{className:"flex-container"},A.a.createElement("span",{style:at},"\u5355\u5143\u683C\u6570\uFF1A"),A.a.createElement("span",{style:at},"\u884C\u6570"),A.a.createElement(_.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},A.a.createElement(Re.a,null)),A.a.createElement("span",{style:at},"\u5217\u6570"),A.a.createElement(_.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},A.a.createElement(Re.a,null))),A.a.createElement("div",{className:"flex-container",style:{marginTop:12}},A.a.createElement("span",{style:at},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),A.a.createElement(_.a.Item,{name:"align"},A.a.createElement(He,null,A.a.createElement(X.a,{value:"default"},A.a.createElement("i",{className:"fa fa-align-justify"})),A.a.createElement(X.a,{value:"left"},A.a.createElement("i",{className:"fa fa-align-left"})),A.a.createElement(X.a,{value:"center"},A.a.createElement("i",{className:"fa fa-align-center"})),A.a.createElement(X.a,{value:"right"},A.a.createElement("i",{className:"fa fa-align-right"}))))),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(ie.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(ie.a,{type:"ghost",onClick:j},"\u53D6\u6D88")))},Ye=m("m3rI"),rt="link",je="upload-image",Fe="code-block",$e="add-table",tt="------------",Ge={default:tt,left:":".concat(tt),center:":".concat(tt,":"),right:"".concat(tt,":")},_e=m("9VGf"),Pe,st;function lt(){}var dt=0,et=1e4,wt="\u2581",mt=`
**\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 ut(k){return/^\d+$/.test(k)?"".concat(k,"px"):k}var Ee=navigator.platform.toUpperCase().indexOf("MAC")>=0,xt=Ee?"Cmd":"Ctrl",ct=(Pe={},Object(N.a)(Pe,xt+"-B","bold"),Object(N.a)(Pe,xt+"-I","italic"),Pe),Se=(st={},Object(N.a)(st,rt,"\u6DFB\u52A0\u94FE\u63A5"),Object(N.a)(st,Fe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(N.a)(st,je,"\u6DFB\u52A0\u56FE\u7247"),Object(N.a)(st,$e,"\u6DFB\u52A0\u8868\u683C"),st),Ke=nt.a=function(k){var D=k.defaultValue,j=D===void 0?"":D,h=k.onChange,p=k.width,b=p===void 0?"100%":p,x=k.height,Y=x===void 0?400:x,de=k.miniToolbar,Ae=de===void 0?!1:de,gt=k.isFocus,Rt=gt===void 0?!1:gt,Ot=k.watch,On=k.insertTemp,Kt=k.mode,Ct=Kt===void 0?"markdown":Kt,Mn=k.id,Qt=Mn===void 0?"markdown-editor-id":Mn,jn=k.showResizeBar,Ln=jn===void 0?!1:jn,Pt=k.noStorage,Qn=Pt===void 0?!1:Pt,hr=k.showNullButton,qn=hr===void 0?!1:hr,br=k.hidetoolBar,yr=br===void 0?!1:br,Ri=k.fullScreen,pr=Ri===void 0?!1:Ri,Wr=k.onBlur,ti=k.onCMBeforeChange,mn=k.onFullScreen,ht=k.className,Tr=ht===void 0?"":ht,mi=k.disablePaste,mr=mi===void 0?!1:mi,Jt=k.placeholder,Dr=Jt===void 0?"":Jt,Br=k.values,zr=Br===void 0?"":Br,Ie=Object(U.useState)(null),kt=Object(he.a)(Ie,2),Xe=kt[0],vi=kt[1],gi=Object(U.useState)(j),Ar=Object(he.a)(gi,2),ni=Ar[0],Mt=Ar[1],_a=Object(U.useState)(Ot),ea=Object(he.a)(_a,2),$n=ea[0],er=ea[1],ta=Object(U.useState)(pr),Pi=Object(he.a)(ta,2),tr=Pi[0],ri=Pi[1],na=Object(U.useState)(""),ii=Object(he.a)(na,2),Lr=ii[0],Rr=ii[1],ji=Object(U.useState)(0),Ni=Object(he.a)(ji,2),Hr=Ni[0],Ii=Ni[1],ra=Object(U.useState)(Y),lr=Object(he.a)(ra,2),ia=lr[0],aa=lr[1],ai=Object(U.useState)(!1),Sr=Object(he.a)(ai,2),oo=Sr[0],Ui=Sr[1],oi=Object(U.useRef)(),Fi=Object(U.useRef)(),Kr=Object(U.useRef)(),nr=Object(U.useRef)();Object(U.useEffect)(function(){Mt(zr),Xe==null||Xe.setValue(zr)},[zr]),Object(U.useEffect)(function(){mn==null||mn(tr)},[tr]),Object(U.useEffect)(function(){if(oi.current){var vt=ee.a.fromTextArea(oi.current,{mode:Ct,lineNumbers:!Ae,lineWrapping:!0,value:j,autoCloseTags:!0,autoCloseBrackets:!0});Rt&&vt.focus();function Dt(At,qt){if(mr){qt.preventDefault();return}var Yt=qt.clipboardData;if(Yt){var rn=Yt.types.toString(),wn=Yt.items,dn=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];if(rn==="Files"||Yt.types.indexOf("Files")>-1){if(qt.preventDefault(),Ct=="stex")return;try{var Hn,vr=wn[1];((Hn=wn[0])===null||Hn===void 0?void 0:Hn.kind)==="file"&&(vr=wn[0]);var fn=vr.getAsFile(),Vr=fn.name.split(".").pop();Ve(fn,function(Nn){if(Nn.id){var Xr,kr,yi;(fn==null||((Xr=fn.type)===null||Xr===void 0)?void 0:Xr.indexOf("image"))>-1?vt.replaceSelection("![,](/api/attachments/".concat(Nn.id,"?type=").concat(Nn.content_type,")")):(fn==null||((kr=fn.type)===null||kr===void 0)?void 0:kr.indexOf("video"))>-1?vt.replaceSelection('<video width="100%" controls src="'.concat(Ye.a.API_SERVER,"/api/attachments/").concat(Nn.id,'"></video>')):(fn==null||((yi=fn.type)===null||yi===void 0)?void 0:yi.indexOf("pdf"))>-1?vt.replaceSelection('<a href="'.concat(Ye.a.API_SERVER,"/api/attachments/").concat(Nn.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):dn.includes(Vr)?vt.replaceSelection('<a href="'.concat(Ye.a.API_SERVER,"/api/attachments/").concat(Nn.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):vt.replaceSelection("[".concat(fn.name,"](").concat(Ye.a.API_SERVER,"/api/attachments/").concat(Nn.id,"?type=").concat(Nn.content_type,")"))}else(Nn==null?void 0:Nn.status)===401&&(document.location.href="/user/login")})}catch(Nn){v.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Dt),vi(vt),function(){vt.off("paste",Dt)}}},[]);var Wi=Object(U.useCallback)(function(){if(Fi.current)try{}catch(vt){console.log(vt,"---- to set md editor body height")}},[ia,Fi,tr]);Object(U.useEffect)(function(){function vt(){var At=new ne.default(function(qt){var Yt=Object(te.a)(qt),rn;try{for(Yt.s();!(rn=Yt.n()).done;){var wn=rn.value;(wn.target.offsetHeight>0||wn.target.offsetWidth>0)&&(Wi(),Xe.setSize("100%","100%"),Xe.refresh())}}catch(dn){Yt.e(dn)}finally{Yt.f()}});return At.observe(oi.current.parentElement),At}if(Xe){var Dt=vt();return function(){Dt.unobserve(oi.current.parentElement)}}},[Xe,Wi]),Object(U.useEffect)(function(){if(Xe){for(var vt=[],Dt=function(){var wn=qt[At];Yt=Object(he.a)(wn,2);var dn=Yt[0],Hn=Yt[1],vr=Object(N.a)({},dn,function(){Bi(Hn)});vt.push(vr),Xe.addKeyMap(vr)},At=0,qt=Object.entries(ct);At<qt.length;At++){var Yt;Dt()}return function(){var rn=Object(te.a)(vt),wn;try{for(rn.s();!(wn=rn.n()).done;){var dn=wn.value;Xe.removeKeyMap(dn)}}catch(Hn){rn.e(Hn)}finally{rn.f()}}}},[Xe]),Object(U.useEffect)(function(){pr!==tr&&ri(pr)},[pr]),Object(_e.a)(function(){if(!Qn&&Hr>0){var vt=new Date().getTime(),Dt=window.sessionStorage.getItem(Qt);vt>=Hr+et&&(!Dt||Dt!==ni)&&(window.sessionStorage.setItem(Qt,ni),Ui(!0))}},et),Object(U.useEffect)(function(){er(Ot)},[Xe,Ot]),Object(U.useEffect)(function(){Xe&&(Rt&&Xe.focus())},[Xe,Rt]),Object(U.useEffect)(function(){if($n&&Xe){var vt=Xe.getScrollerElement();function Dt(At){var qt=At.target;if(nr.current){var Yt=qt.scrollTop/qt.scrollHeight;nr.current.scrollTop=nr.current.scrollHeight*Yt}}return vt.addEventListener("scroll",Dt),function(){vt.removeEventListener("scroll",Dt)}}},[Xe,$n]),Object(U.useEffect)(function(){if(Xe&&ti){function vt(Dt,At){ti(Dt,At)}return Xe.on("beforeChange",vt),function(){Xe.off("beforeChange",vt)}}},[Xe,ti]),Object(U.useEffect)(function(){if(Xe&&Wr){function vt(){Wr(Xe.getValue())}return Xe.on("blur",vt),function(){Xe.off("blur",vt)}}},[Xe,Wr]),Object(U.useEffect)(function(){if(Xe){function vt(Dt){var At=Dt.getValue();Mt(At),Ii(new Date().getTime()),Dt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),h&&h(At)}return Xe.on("change",vt),function(){Xe.off("change",vt)}}},[Xe,h]),Object(U.useEffect)(function(){Xe&&(j==null?(Xe.setValue(""),Mt("")):j!==Xe.getValue()&&(Xe.setValue(j),Mt(j),Xe.setCursor(Xe.lineCount(),0)))},[Xe,j]);var Bi=Object(U.useCallback)(function(vt){var Dt=Xe.getCursor(),At=Xe.getSelection(),qt=At.split(`
`);switch(vt){case"bold":return Xe.replaceSelection("**"+At+"**"),At===""&&Xe.setCursor(Dt.line,Dt.ch+2),Xe.focus();case"italic":return Xe.replaceSelection("*"+At+"*"),At===""&&Xe.setCursor(Dt.line,Dt.ch+1),Xe.focus();case"code":return Xe.replaceSelection("`"+At+"`"),At===""&&Xe.setCursor(Dt.line,Dt.ch+1),Xe.focus();case"inline-latex":return Xe.replaceSelection("`$$"+At+"$$`"),At===""&&Xe.setCursor(Dt.line,Dt.ch+3),Xe.focus();case"latex":return Xe.replaceSelection("```latex\n"+At+"\n```"),Xe.setCursor(Dt.line+1,At.length+1),Xe.focus();case"line-break":return Xe.replaceSelection(`<br/>
`),Xe.focus();case"list-ul":return At===""?Xe.replaceSelection("- "+At):Xe.replaceSelection(qt.map(function(Yt){return Yt===""?"":"- ".concat(Yt)}).join(`
`)),Xe.focus();case"list-ol":return At===""?Xe.replaceSelection("1. "+At):Xe.replaceSelection(qt.map(function(Yt,rn){return Yt===""?"":"".concat(rn+1,". ").concat(Yt)}).join(`
`)),Xe.focus();case"add-null-ch":return At===""&&Xe.setCursor(Dt.line,Dt.ch+1),Xe.replaceSelection(wt),Xe.focus();case"inster-template-1":return At===""&&Xe.setCursor(Dt.line,Dt.ch),Xe.replaceSelection(mt),Xe.focus();case"eraser":return Xe.setValue(""),Xe.focus();case"trigger-watch":return er(!$n),Xe.focus();case"trigger-full-screen":return ri(!tr),Xe.focus();case rt:Rr(rt);return;case Fe:Rr(Fe);return;case je:Rr(je);return;case $e:Rr($e);return;default:throw new Error}},[Xe,$n,tr]),bi=Object(U.useCallback)(function(vt){Rr("");switch(Lr){case rt:var Dt=vt.title,At=vt.link;return Xe.replaceSelection("[".concat(Dt,"](").concat(At,")")),Xe.focus();case Fe:var qt=vt.language,Yt=vt.content;return Xe.replaceSelection(["```"+qt,Yt,"```"].join(`
`)),Xe.focus();case je:var rn=vt.src,wn=vt.alt;return Xe.replaceSelection("![ ".concat(wn," ]( ").concat(rn,' "').concat(wn,'" )')),Xe.focus();case $e:for(var dn=vt.row,Hn=vt.col,vr=vt.align,fn=`
`,Vr=0;Vr<dn;Vr++){for(var Nn=[],Xr=[],kr=0;kr<Hn;kr++)Vr===1&&Xr.push(Ge[vr]),Nn.push(" ");Vr===1&&(fn+="| ".concat(Xr.join(" | "),` |
`)),fn+="| ".concat(Nn.join(Hn===1?"":" | "),` |
`)}return Xe.replaceSelection(fn+`
`),Xe.focus();default:throw new Error}},[Xe,Lr]),si=Object(U.useMemo)(function(){switch(Lr){case rt:return A.a.createElement(Be,{callback:bi,onCancel:_r});case Fe:return A.a.createElement(E.b,{callback:bi,onCancel:_r});case je:return A.a.createElement(qe,{callback:bi,onCancel:_r});case $e:return A.a.createElement(pt,{callback:bi,onCancel:_r});default:return null}},[Lr]);function _r(){Rr("")}Object(U.useEffect)(function(){if(Kr.current){var vt=Kr.current,Dt=!1,At=0;function qt(wn){Dt=!0,At=wn.pageY}function Yt(){Dt=!1}function rn(wn){if(Dt){var dn=wn.pageY-At;dn<0&&(dn=0),dn>300&&(dn=300);var Hn=Y+dn+"px";aa(Hn)}}return vt.addEventListener("mousedown",qt),document.addEventListener("mousemove",rn),document.addEventListener("mouseup",Yt),function(){vt.removeEventListener("mousedown",qt),document.removeEventListener("mousemove",rn),document.removeEventListener("mouseup",Yt)}}},[Xe,Kr]),Object(U.useEffect)(function(){aa(Y)},[Y]);var Pr=ut(b),zi=ut(ia),Hi={width:Pr,height:zi},Ki=Object(U.useMemo)(function(){if(Hr){var vt=new Date(Hr),Dt=vt.getHours(),At=vt.getMinutes(),qt=vt.getSeconds();return Dt=Dt<10?"0"+Dt:Dt,At=At<10?"0"+At:At,qt=qt<10?"0"+qt:qt,"".concat(Dt,":").concat(At,":").concat(qt)}return 0},[Hr]);function ka(){window.sessionStorage.removeItem(Qt),Ui(!1),Ii(0)}function Ma(){Ui(!1),Ii(0),Xe.setValue(window.sessionStorage.getItem(Qt))}return A.a.createElement(U.Fragment,null,A.a.createElement("div",{className:"markdown-editor-wrapper",ref:Fi},A.a.createElement("div",{className:"markdown-editor-container ".concat(Tr," ").concat($n?"on-preview":""," ").concat(Ae?"mini":""," ").concat(tr?"full-screen":""),style:Hi},A.a.createElement(Oe,{insertTemp:On,watch:$n,fullScreen:tr,showNullButton:qn,onActionCallback:Bi,hidetoolBar:yr}),A.a.createElement("div",{className:"markdown-editor-body"},A.a.createElement("div",{className:"codemirror-container"},A.a.createElement("textarea",{ref:oi,placeholder:Dr})),$n?A.a.createElement("div",{ref:nr,className:"preview-container"},Ct==="stex"&&A.a.createElement(Le,{value:ni}),Ct!=="stex"&&A.a.createElement(me.a,{value:ni})):null))),Ln?A.a.createElement("a",{ref:Kr,className:"editor-resize"}):null,A.a.createElement(re.a,null,Se[Lr]?A.a.createElement(fe.a,{centered:!0,title:Se[Lr],visible:!0,onCancel:_r,footer:null},si):null))}},SJMd:function(Tt,nt){/**
* @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 m,P,fe,te=!1,H,v;window.PR_SHOULD_USE_CONTINUATION=!0;var he,N;(function(){var U=window,A=["break,continue,do,else,for,if,return,while"],be=[A,"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"],ee=[be,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],ne=[ee,"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"],Ce=[ee,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],ae=[ee,"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"],V="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",T=[ee,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],R="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",K=[A,"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"],$=[A,"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"],me=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Le=[ne,ae,Ce,T,R,K,$,me],ce=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ge="str",Te="kwd",le="com",se="typ",Oe="lit",re="pun",w="pln",ie="tag",Z="dec",_="src",ue="atn",xe="atv",oe="nocode",Be="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function E(je){for(var Fe=0,$e=!1,tt=!1,Ge=0,_e=je.length;Ge<_e;++Ge){var Pe=je[Ge];if(Pe.ignoreCase)tt=!0;else if(/[a-z]/i.test(Pe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){$e=!0,tt=!1;break}}var st={b:8,t:9,n:10,v:11,f:12,r:13};function lt(ut){var Ee=ut.charCodeAt(0);if(Ee!==92)return Ee;var xt=ut.charAt(1);return Ee=st[xt],Ee||("0"<=xt&&xt<="7"?parseInt(ut.substring(1),8):xt==="u"||xt==="x"?parseInt(ut.substring(2),16):ut.charCodeAt(1))}function dt(ut){if(ut<32)return(ut<16?"\\x0":"\\x")+ut.toString(16);var Ee=String.fromCharCode(ut);return Ee==="\\"||Ee==="-"||Ee==="]"||Ee==="^"?"\\"+Ee:Ee}function et(ut){var Ee=ut.substring(1,ut.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")),xt=[],ct=Ee[0]==="^",Se=["["];ct&&Se.push("^");for(var Ke=ct?1:0,k=Ee.length;Ke<k;++Ke){var D=Ee[Ke];if(/\\[bdsw]/i.test(D))Se.push(D);else{var j=lt(D),h;Ke+2<k&&Ee[Ke+1]==="-"?(h=lt(Ee[Ke+2]),Ke+=2):h=j,xt.push([j,h]),h<65||j>122||(h<65||j>90||xt.push([Math.max(65,j)|32,Math.min(h,90)|32]),h<97||j>122||xt.push([Math.max(97,j)&~32,Math.min(h,122)&~32]))}}xt.sort(function(Y,de){return Y[0]-de[0]||de[1]-Y[1]});for(var p=[],b=[],Ke=0;Ke<xt.length;++Ke){var x=xt[Ke];x[0]<=b[1]+1?b[1]=Math.max(b[1],x[1]):p.push(b=x)}for(var Ke=0;Ke<p.length;++Ke){var x=p[Ke];Se.push(dt(x[0])),x[1]>x[0]&&(x[1]+1>x[0]&&Se.push("-"),Se.push(dt(x[1])))}return Se.push("]"),Se.join("")}function wt(ut){for(var Ee=ut.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")),xt=Ee.length,ct=[],Se=0,Ke=0;Se<xt;++Se){var k=Ee[Se];if(k==="(")++Ke;else if(k.charAt(0)==="\\"){var D=+k.substring(1);D&&(D<=Ke?ct[D]=-1:Ee[Se]=dt(D))}}for(var Se=1;Se<ct.length;++Se)ct[Se]===-1&&(ct[Se]=++Fe);for(var Se=0,Ke=0;Se<xt;++Se){var k=Ee[Se];if(k==="(")++Ke,ct[Ke]||(Ee[Se]="(?:");else if(k.charAt(0)==="\\"){var D=+k.substring(1);D&&D<=Ke&&(Ee[Se]="\\"+ct[D])}}for(var Se=0;Se<xt;++Se)Ee[Se]==="^"&&Ee[Se+1]!=="^"&&(Ee[Se]="");if(ut.ignoreCase&&$e)for(var Se=0;Se<xt;++Se){var k=Ee[Se],j=k.charAt(0);k.length>=2&&j==="["?Ee[Se]=et(k):j!=="\\"&&(Ee[Se]=k.replace(/[a-zA-Z]/g,function(b){var x=b.charCodeAt(0);return"["+String.fromCharCode(x&~32,x|32)+"]"}))}return Ee.join("")}for(var mt=[],Ge=0,_e=je.length;Ge<_e;++Ge){var Pe=je[Ge];if(Pe.global||Pe.multiline)throw new Error(""+Pe);mt.push("(?:"+wt(Pe)+")")}return new RegExp(mt.join("|"),tt?"gi":"g")}function d(je,Fe){var $e=/(?:^|\s)nocode(?:\s|$)/,tt=[],Ge=0,_e=[],Pe=0;function st(lt){var dt=lt.nodeType;if(dt==1){if($e.test(lt.className))return;for(var et=lt.firstChild;et;et=et.nextSibling)st(et);var wt=lt.nodeName.toLowerCase();(wt==="br"||wt==="li")&&(tt[Pe]=`
`,_e[Pe<<1]=Ge++,_e[Pe++<<1|1]=lt)}else if(dt==3||dt==4){var mt=lt.nodeValue;mt.length&&(Fe?mt=mt.replace(/\r\n?/g,`
`):mt=mt.replace(/[ \t\r\n]+/g," "),tt[Pe]=mt,_e[Pe<<1]=Ge,Ge+=mt.length,_e[Pe++<<1|1]=lt)}}return st(je),{sourceCode:tt.join("").replace(/\n$/,""),spans:_e}}function W(je,Fe,$e,tt,Ge){if(!$e)return;var _e={sourceNode:je,pre:1,langExtension:null,numberLines:null,sourceCode:$e,spans:null,basePos:Fe,decorations:null};tt(_e),Ge.push.apply(Ge,_e.decorations)}var pe=/\S/;function ve(je){for(var Fe=void 0,$e=je.firstChild;$e;$e=$e.nextSibling){var tt=$e.nodeType;Fe=tt===1?Fe?je:$e:tt===3&&pe.test($e.nodeValue)?je:Fe}return Fe===je?void 0:Fe}function Ne(je,Fe){var $e={},tt;(function(){for(var Pe=je.concat(Fe),st=[],lt={},dt=0,et=Pe.length;dt<et;++dt){var wt=Pe[dt],mt=wt[3];if(mt)for(var ut=mt.length;--ut>=0;)$e[mt.charAt(ut)]=wt;var Ee=wt[1],xt=""+Ee;lt.hasOwnProperty(xt)||(st.push(Ee),lt[xt]=null)}st.push(/[\0-\uffff]/),tt=E(st)})();var Ge=Fe.length,_e=function(Pe){for(var st=Pe.sourceCode,lt=Pe.basePos,dt=Pe.sourceNode,et=[lt,w],wt=0,mt=st.match(tt)||[],ut={},Ee=0,xt=mt.length;Ee<xt;++Ee){var ct=mt[Ee],Se=ut[ct],Ke=void 0,k;if(typeof Se=="string")k=!1;else{var D=$e[ct.charAt(0)];if(D)Ke=ct.match(D[1]),Se=D[0];else{for(var j=0;j<Ge;++j)if(D=Fe[j],Ke=ct.match(D[1]),Ke){Se=D[0];break}Ke||(Se=w)}k=Se.length>=5&&Se.substring(0,5)==="lang-",k&&!(Ke&&typeof Ke[1]=="string")&&(k=!1,Se=_),k||(ut[ct]=Se)}var h=wt;if(wt+=ct.length,!k)et.push(lt+h,Se);else{var p=Ke[1],b=ct.indexOf(p),x=b+p.length;Ke[2]&&(x=ct.length-Ke[2].length,b=x-p.length);var Y=Se.substring(5);W(dt,lt+h,ct.substring(0,b),_e,et),W(dt,lt+h+b,p,X(Y,p),et),W(dt,lt+h+x,ct.substring(x),_e,et)}}Pe.decorations=et};return _e}function qe(je){var Fe=[],$e=[];je.tripleQuotedStrings?Fe.push([ge,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):je.multiLineStrings?Fe.push([ge,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Fe.push([ge,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),je.verbatimStrings&&$e.push([ge,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var tt=je.hashComments;tt&&(je.cStyleComments?(tt>1?Fe.push([le,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Fe.push([le,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([ge,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Fe.push([le,/^#[^\r\n]*/,null,"#"])),je.cStyleComments&&($e.push([le,/^\/\/[^\r\n]*/,null]),$e.push([le,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ge=je.regexLiterals;if(Ge){var _e=Ge>1?"":`
\r`,Pe=_e?".":"[\\S\\s]",st="/(?=[^/*"+_e+"])(?:[^/\\x5B\\x5C"+_e+"]|\\x5C"+Pe+"|\\x5B(?:[^\\x5C\\x5D"+_e+"]|\\x5C"+Pe+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+Be+"("+st+")")])}var lt=je.types;lt&&$e.push([se,lt]);var dt=(""+je.keywords).replace(/^ | $/g,"");dt.length&&$e.push([Te,new RegExp("^(?:"+dt.replace(/[\s,]+/g,"|")+")\\b"),null]),Fe.push([w,/^\s+/,null,` \r
\xA0`]);var et="^.[^\\s\\w.$@'\"`/\\\\]*";return je.regexLiterals&&(et+="(?!s*/)"),$e.push([Oe,/^@[a-z_$][a-z_$@0-9]*/i,null],[se,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[w,/^[a-z_$][a-z_$@0-9]*/i,null],[Oe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[w,/^\\[\s\S]?/,null],[re,new RegExp(et),null]),Ne(Fe,$e)}var Me=qe({keywords:Le,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ve(je,Fe,$e){for(var tt=/(?:^|\s)nocode(?:\s|$)/,Ge=/\r\n?|\n/,_e=je.ownerDocument,Pe=_e.createElement("li");je.firstChild;)Pe.appendChild(je.firstChild);var st=[Pe];function lt(Ee){var xt=Ee.nodeType;if(xt==1&&!tt.test(Ee.className))if(Ee.nodeName==="br")dt(Ee),Ee.parentNode&&Ee.parentNode.removeChild(Ee);else for(var ct=Ee.firstChild;ct;ct=ct.nextSibling)lt(ct);else if((xt==3||xt==4)&&$e){var Se=Ee.nodeValue,Ke=Se.match(Ge);if(Ke){var k=Se.substring(0,Ke.index);Ee.nodeValue=k;var D=Se.substring(Ke.index+Ke[0].length);if(D){var j=Ee.parentNode;j.insertBefore(_e.createTextNode(D),Ee.nextSibling)}dt(Ee),k||Ee.parentNode.removeChild(Ee)}}}function dt(Ee){for(;!Ee.nextSibling;)if(Ee=Ee.parentNode,!Ee)return;function xt(Ke,k){var D=k?Ke.cloneNode(!1):Ke,j=Ke.parentNode;if(j){var h=xt(j,1),p=Ke.nextSibling;h.appendChild(D);for(var b=p;b;b=p)p=b.nextSibling,h.appendChild(b)}return D}for(var ct=xt(Ee.nextSibling,0),Se;(Se=ct.parentNode)&&Se.nodeType===1;)ct=Se;st.push(ct)}for(var et=0;et<st.length;++et)lt(st[et]);Fe===(Fe|0)&&st[0].setAttribute("value",Fe);var wt=_e.createElement("ol");wt.className="linenums";for(var mt=Math.max(0,Fe-1|0)||0,et=0,ut=st.length;et<ut;++et)Pe=st[et],Pe.className="L"+(et+mt)%10,Pe.firstChild||Pe.appendChild(_e.createTextNode("\xA0")),wt.appendChild(Pe);je.appendChild(wt)}function ke(je){var Fe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Fe=Fe&&+Fe[1]<=8;var $e=/\n/g,tt=je.sourceCode,Ge=tt.length,_e=0,Pe=je.spans,st=Pe.length,lt=0,dt=je.decorations,et=dt.length,wt=0;dt[et]=Ge;var mt,ut;for(ut=mt=0;ut<et;)dt[ut]!==dt[ut+2]?(dt[mt++]=dt[ut++],dt[mt++]=dt[ut++]):ut+=2;for(et=mt,ut=mt=0;ut<et;){for(var Ee=dt[ut],xt=dt[ut+1],ct=ut+2;ct+2<=et&&dt[ct+1]===xt;)ct+=2;dt[mt++]=Ee,dt[mt++]=xt,ut=ct}et=dt.length=mt;var Se=je.sourceNode,Ke="";Se&&(Ke=Se.style.display,Se.style.display="none");try{for(var k=null;lt<st;){var D=Pe[lt],j=Pe[lt+2]||Ge,h=dt[wt+2]||Ge,ct=Math.min(j,h),p=Pe[lt+1],b;if(p.nodeType!==1&&(b=tt.substring(_e,ct))){Fe&&(b=b.replace($e,"\r")),p.nodeValue=b;var x=p.ownerDocument,Y=x.createElement("span");Y.className=dt[wt+1];var de=p.parentNode;de.replaceChild(Y,p),Y.appendChild(p),_e<j&&(Pe[lt+1]=p=x.createTextNode(tt.substring(ct,j)),de.insertBefore(p,Y.nextSibling))}_e=ct,_e>=j&&(lt+=2),_e>=h&&(wt+=2)}}finally{Se&&(Se.style.display=Ke)}}var Re={};function Q(je,Fe){for(var $e=Fe.length;--$e>=0;){var tt=Fe[$e];Re.hasOwnProperty(tt)?U.console&&console.warn("cannot override language handler %s",tt):Re[tt]=je}}function X(je,Fe){return je&&Re.hasOwnProperty(je)||(je=/^\s*</.test(Fe)?"default-markup":"default-code"),Re[je]}Q(Me,["default-code"]),Q(Ne([],[[w,/^[^<?]+/],[Z,/^<!\w[^>]*(?:>|$)/],[le,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[re,/^(?:<[%?]|[%?]>)/],["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"]),Q(Ne([[w,/^[\s]+/,null,` \r
`],[xe,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ie,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[ue,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[re,/^[=<>\/]+/],["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"]),Q(Ne([],[[xe,/^[\s\S]+/]]),["uq.val"]),Q(qe({keywords:ne,hashComments:!0,cStyleComments:!0,types:ce}),["c","cc","cpp","cxx","cyc","m"]),Q(qe({keywords:"null,true,false"}),["json"]),Q(qe({keywords:ae,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:ce}),["cs"]),Q(qe({keywords:Ce,cStyleComments:!0}),["java"]),Q(qe({keywords:me,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Q(qe({keywords:K,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Q(qe({keywords:R,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Q(qe({keywords:$,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Q(qe({keywords:T,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Q(qe({keywords:V,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Q(Ne([],[[ge,/^[\s\S]+/]]),["regex"]);function He(je){var Fe=je.langExtension;try{var $e=d(je.sourceNode,je.pre),tt=$e.sourceCode;je.sourceCode=tt,je.spans=$e.spans,je.basePos=0,X(Fe,tt)(je),ke(je)}catch(Ge){U.console&&console.log(Ge&&Ge.stack||Ge)}}function at(je,Fe,$e){var tt=$e||!1,Ge=Fe||null,_e=document.createElement("div");_e.innerHTML="<pre>"+je+"</pre>",_e=_e.firstChild,tt&&Ve(_e,tt,!0);var Pe={langExtension:Ge,numberLines:tt,sourceNode:_e,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return He(Pe),_e.innerHTML}function pt(je,Fe){var $e=Fe||document.body,tt=$e.ownerDocument||document;function Ge(D){return $e.getElementsByTagName(D)}for(var _e=[Ge("pre"),Ge("code"),Ge("xmp")],Pe=[],st=0;st<_e.length;++st)for(var lt=0,dt=_e[st].length;lt<dt;++lt)Pe.push(_e[st][lt]);_e=null;var et=Date;et.now||(et={now:function(){return+new Date}});var wt=0,mt=/\blang(?:uage)?-([\w.]+)(?!\S)/,ut=/\bprettyprint\b/,Ee=/\bprettyprinted\b/,xt=/pre|xmp/i,ct=/^code$/i,Se=/^(?:pre|code|xmp)$/i,Ke={};function k(){for(var D=U.PR_SHOULD_USE_CONTINUATION?et.now()+250:Infinity;wt<Pe.length&&et.now()<D;wt++){for(var j=Pe[wt],h=Ke,p=j;p=p.previousSibling;){var b=p.nodeType,x=(b===7||b===8)&&p.nodeValue;if(x?!/^\??prettify\b/.test(x):b!==3||/\S/.test(p.nodeValue))break;if(x){h={},x.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ln,Pt,Qn){h[Pt]=Qn});break}}var Y=j.className;if((h!==Ke||ut.test(Y))&&!Ee.test(Y)){for(var de=!1,Ae=j.parentNode;Ae;Ae=Ae.parentNode){var gt=Ae.tagName;if(Se.test(gt)&&Ae.className&&ut.test(Ae.className)){de=!0;break}}if(!de){j.className+=" prettyprinted";var Rt=h.lang;if(!Rt){Rt=Y.match(mt);var Ot;!Rt&&(Ot=ve(j))&&ct.test(Ot.tagName)&&(Rt=Ot.className.match(mt)),Rt&&(Rt=Rt[1])}var On;if(xt.test(j.tagName))On=1;else{var Kt=j.currentStyle,Ct=tt.defaultView,Mn=Kt?Kt.whiteSpace:Ct&&Ct.getComputedStyle?Ct.getComputedStyle(j,null).getPropertyValue("white-space"):0;On=Mn&&Mn.substring(0,3)==="pre"}var Qt=h.linenums;(Qt=Qt==="true"||+Qt)||(Qt=Y.match(/\blinenums\b(?::(\d+))?/),Qt=Qt?Qt[1]&&Qt[1].length?+Qt[1]:!0:!1),Qt&&Ve(j,Qt,On);var jn={langExtension:Rt,sourceNode:j,numberLines:Qt,pre:On,sourceCode:null,basePos:null,spans:null,decorations:null};He(jn)}}}wt<Pe.length?U.setTimeout(k,250):typeof je=="function"&&je()}k()}var Ye=U.PR={createSimpleLexer:Ne,registerLangHandler:Q,sourceDecorator:qe,PR_ATTRIB_NAME:ue,PR_ATTRIB_VALUE:xe,PR_COMMENT:le,PR_DECLARATION:Z,PR_KEYWORD:Te,PR_LITERAL:Oe,PR_NOCODE:oe,PR_PLAIN:w,PR_PUNCTUATION:re,PR_SOURCE:_,PR_STRING:ge,PR_TAG:ie,PR_TYPE:se,prettyPrintOne:te?U.prettyPrintOne=at:he=at,prettyPrint:N=te?U.prettyPrint=pt:N=pt},rt=U.define;typeof rt=="function"&&rt.amd&&rt("google-code-prettify",[],function(){return Ye})})()},UUDw:function(Tt,nt,m){Tt.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return P});var P=function(te){var H=document.createElement("textarea");return H.value=te,H.value}},"VrN/":function(Tt,nt,m){(function(P,fe){Tt.exports=fe()})(this,function(){"use strict";var P=navigator.userAgent,fe=navigator.platform,te=/gecko\/\d/i.test(P),H=/MSIE \d/.test(P),v=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(P),he=/Edge\/(\d+)/.exec(P),N=H||v||he,U=N&&(H?document.documentMode||6:+(he||v)[1]),A=!he&&/WebKit\//.test(P),be=A&&/Qt\/\d+\.\d+/.test(P),ee=!he&&/Chrome\//.test(P),ne=/Opera\//.test(P),Ce=/Apple Computer/.test(navigator.vendor),ae=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(P),V=/PhantomJS/.test(P),T=!he&&/AppleWebKit/.test(P)&&/Mobile\/\w+/.test(P),R=/Android/.test(P),K=T||R||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(P),$=T||/Mac/.test(fe),me=/\bCrOS\b/.test(P),Le=/win/i.test(fe),ce=ne&&P.match(/Version\/(\d*\.\d*)/);ce&&(ce=Number(ce[1])),ce&&ce>=15&&(ne=!1,A=!0);var ge=$&&(be||ne&&(ce==null||ce<12.11)),Te=te||N&&U>=9;function le(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var se=function(e,t){var r=e.className,n=le(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 Oe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function re(e,t){return Oe(e).appendChild(t)}function w(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 ie(e,t,r,n){var i=w(e,t,r,n);return i.setAttribute("role","presentation"),i}var Z;document.createRange?Z=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:Z=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 _(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 ue(){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 xe(e,t){var r=e.className;le(t).test(r)||(e.className+=(r?" ":"")+t)}function oe(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!le(r[n]).test(t)&&(t+=" "+r[n]);return t}var Be=function(e){e.select()};T?Be=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:N&&(Be=function(e){try{e.select()}catch(t){}});function E(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function d(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 W(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 pe=function(){this.id=null,this.f=null,this.time=0,this.handler=E(this.onTimeout,this)};pe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},pe.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 ve(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var Ne=50,qe={toString:function(){return"CodeMirror.Pass"}},Me={scroll:!1},Ve={origin:"*mouse"},ke={origin:"+move"};function Re(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 Q=[""];function X(e){for(;Q.length<=e;)Q.push(He(Q)+" ");return Q[e]}function He(e){return e[e.length-1]}function at(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function pt(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function Ye(){}function rt(e,t){var r;return Object.create?r=Object.create(e):(Ye.prototype=e,r=new Ye),t&&d(t,r),r}var je=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Fe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||je.test(e))}function $e(e,t){return t?t.source.indexOf("\\w")>-1&&Fe(e)?!0:t.test(e):Fe(e)}function tt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ge=/[\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 _e(e){return e.charCodeAt(0)>=768&&Ge.test(e)}function Pe(e,t,r){for(;(r<0?t>0:t<e.length)&&_e(e.charAt(t));)t+=r;return t}function st(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 lt(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 dt=null;function et(e,t,r){var n;dt=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:dt=i),a.from==t&&(a.from!=a.to&&r!="before"?n=i:dt=i)}return n!=null?n:dt}var wt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(c){return c<=247?e.charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?t.charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":c==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function l(c,O,L){this.level=c,this.from=O,this.to=L}return function(c,O){var L=O=="ltr"?"L":"R";if(c.length==0||O=="ltr"&&!n.test(c))return!1;for(var q=c.length,G=[],we=0;we<q;++we)G.push(r(c.charCodeAt(we)));for(var De=0,ze=L;De<q;++De){var Ze=G[De];Ze=="m"?G[De]=ze:ze=Ze}for(var it=0,Qe=L;it<q;++it){var ot=G[it];ot=="1"&&Qe=="r"?G[it]="n":a.test(ot)&&(Qe=ot,ot=="r"&&(G[it]="R"))}for(var _t=1,yt=G[0];_t<q-1;++_t){var Wt=G[_t];Wt=="+"&&yt=="1"&&G[_t+1]=="1"?G[_t]="1":Wt==","&&yt==G[_t+1]&&(yt=="1"||yt=="n")&&(G[_t]=yt),yt=Wt}for(var pn=0;pn<q;++pn){var Kn=G[pn];if(Kn==",")G[pn]="N";else if(Kn=="%"){var Cn=void 0;for(Cn=pn+1;Cn<q&&G[Cn]=="%";++Cn);for(var gr=pn&&G[pn-1]=="!"||Cn<q&&G[Cn]=="1"?"1":"N",cr=pn;cr<Cn;++cr)G[cr]=gr;pn=Cn-1}}for(var Rn=0,dr=L;Rn<q;++Rn){var Gn=G[Rn];dr=="L"&&Gn=="1"?G[Rn]="L":a.test(Gn)&&(dr=Gn)}for(var zn=0;zn<q;++zn)if(i.test(G[zn])){var Pn=void 0;for(Pn=zn+1;Pn<q&&i.test(G[Pn]);++Pn);for(var kn=(zn?G[zn-1]:L)=="L",fr=(Pn<q?G[Pn]:L)=="L",Oa=kn==fr?kn?"L":"R":L,Li=zn;Li<Pn;++Li)G[Li]=Oa;zn=Pn-1}for(var Zn=[],ei,Vn=0;Vn<q;)if(o.test(G[Vn])){var fs=Vn;for(++Vn;Vn<q&&o.test(G[Vn]);++Vn);Zn.push(new l(0,fs,Vn))}else{var pi=Vn,Qi=Zn.length,qi=O=="rtl"?1:0;for(++Vn;Vn<q&&G[Vn]!="L";++Vn);for(var sr=pi;sr<Vn;)if(s.test(G[sr])){pi<sr&&(Zn.splice(Qi,0,new l(1,pi,sr)),Qi+=qi);var Sa=sr;for(++sr;sr<Vn&&s.test(G[sr]);++sr);Zn.splice(Qi,0,new l(2,Sa,sr)),Qi+=qi,pi=sr}else++sr;pi<Vn&&Zn.splice(Qi,0,new l(1,pi,Vn))}return O=="ltr"&&(Zn[0].level==1&&(ei=c.match(/^\s+/))&&(Zn[0].from=ei[0].length,Zn.unshift(new l(0,0,ei[0].length))),He(Zn).level==1&&(ei=c.match(/\s+$/))&&(He(Zn).to-=ei[0].length,Zn.push(new l(0,q-ei[0].length,q)))),O=="rtl"?Zn.reverse():Zn}}();function mt(e,t){var r=e.order;return r==null&&(r=e.order=wt(e.text,t)),r}var ut=[],Ee=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]||ut).concat(r)}};function xt(e,t){return e._handlers&&e._handlers[t]||ut}function ct(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=ve(i,r);a>-1&&(n[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function Se(e,t){var r=xt(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 Ke(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Se(e,r||t.type,e,t),b(t)||t.codemirrorIgnore}function k(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)ve(r,t[n])==-1&&r.push(t[n])}function D(e,t){return xt(e,t).length>0}function j(e){e.prototype.on=function(t,r){Ee(this,t,r)},e.prototype.off=function(t,r){ct(this,t,r)}}function h(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 x(e){h(e),p(e)}function Y(e){return e.target||e.srcElement}function de(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),$&&e.ctrlKey&&t==1&&(t=3),t}var Ae=function(){if(N&&U<9)return!1;var e=w("div");return"draggable"in e||"dragDrop"in e}(),gt;function Rt(e){if(gt==null){var t=w("span","\u200B");re(e,w("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(gt=t.offsetWidth<=1&&t.offsetHeight>2&&!(N&&U<8))}var r=gt?w("span","\u200B"):w("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var Ot;function On(e){if(Ot!=null)return Ot;var t=re(e,document.createTextNode("A\u062EA")),r=Z(t,0,1).getBoundingClientRect(),n=Z(t,1,2).getBoundingClientRect();return Oe(e),!r||r.left==r.right?!1:Ot=n.right-r.right<3}var Kt=`
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/)},Ct=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},Mn=function(){var e=w("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Qt=null;function jn(e){if(Qt!=null)return Qt;var t=re(e,w("span","x")),r=t.getBoundingClientRect(),n=Z(t,0,1).getBoundingClientRect();return Qt=Math.abs(r.left-n.left)>1}var Ln={},Pt={};function Qn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ln[e]=t}function hr(e,t){Pt[e]=t}function qn(e){if(typeof e=="string"&&Pt.hasOwnProperty(e))e=Pt[e];else if(e&&typeof e.name=="string"&&Pt.hasOwnProperty(e.name)){var t=Pt[e.name];typeof t=="string"&&(t={name:t}),e=rt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return qn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return qn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function br(e,t){t=qn(t);var r=Ln[t.name];if(!r)return br(e,"text/plain");var n=r(e,t);if(yr.hasOwnProperty(t.name)){var i=yr[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 yr={};function Ri(e,t){var r=yr.hasOwnProperty(e)?yr[e]:yr[e]={};d(t,r)}function pr(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 Wr(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 ti(e,t,r){return e.startState?e.startState(t,r):!0}var mn=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};mn.prototype.eol=function(){return this.pos>=this.string.length},mn.prototype.sol=function(){return this.pos==this.lineStart},mn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},mn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},mn.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},mn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},mn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},mn.prototype.skipToEnd=function(){this.pos=this.string.length},mn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},mn.prototype.backUp=function(e){this.pos-=e},mn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=W(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},mn.prototype.indentation=function(){return W(this.string,null,this.tabSize)-(this.lineStart?W(this.string,this.lineStart,this.tabSize):0)},mn.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)}},mn.prototype.current=function(){return this.string.slice(this.start,this.pos)},mn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},mn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},mn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ht(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 Tr(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 mi(e,t,r){var n=[];return e.iter(t,r,function(i){n.push(i.text)}),n}function mr(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Jt(e){if(e.parent==null)return null;for(var t=e.parent,r=ve(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 Dr(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],l=s.height;if(t<l)break;t-=l}return r+o}function Br(e,t){return t>=e.first&&t<e.first+e.size}function zr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ie(e,t,r){if(r===void 0&&(r=null),!(this instanceof Ie))return new Ie(e,t,r);this.line=e,this.ch=t,this.sticky=r}function kt(e,t){return e.line-t.line||e.ch-t.ch}function Xe(e,t){return e.sticky==t.sticky&&kt(e,t)==0}function vi(e){return Ie(e.line,e.ch)}function gi(e,t){return kt(e,t)<0?t:e}function Ar(e,t){return kt(e,t)<0?e:t}function ni(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Mt(e,t){if(t.line<e.first)return Ie(e.first,0);var r=e.first+e.size-1;return t.line>r?Ie(r,ht(e,r).text.length):_a(t,ht(e,t.line).text.length)}function _a(e,t){var r=e.ch;return r==null||r>t?Ie(e.line,t):r<0?Ie(e.line,0):e}function ea(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=Mt(e,t[n]);return r}var $n=function(e,t){this.state=e,this.lookAhead=t},er=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};er.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},er.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}},er.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},er.fromSaved=function(e,t,r){return t instanceof $n?new er(e,pr(e.mode,t.state),r,t.lookAhead):new er(e,pr(e.mode,t),r)},er.prototype.save=function(e){var t=e!==!1?pr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new $n(t,this.maxLookAhead):t};function ta(e,t,r,n){var i=[e.state.modeGen],a={};Ni(e,t.text,e.doc.mode,r,function(c,O){return i.push(c,O)},a,n);for(var o=r.state,s=function(c){r.baseTokens=i;var O=e.state.overlays[c],L=1,q=0;r.state=!0,Ni(e,t.text,O.mode,r,function(G,we){for(var De=L;q<G;){var ze=i[L];ze>G&&i.splice(L,1,G,i[L+1],ze),L+=2,q=Math.min(G,ze)}if(!we)return;if(O.opaque)i.splice(De,L-De,G,"overlay "+we),L=De+2;else for(;De<L;De+=2){var Ze=i[De+1];i[De+1]=(Ze?Ze+" ":"")+"overlay "+we}},a),r.state=o,r.baseTokens=null,r.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Pi(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=tr(e,Jt(t)),i=t.text.length>e.options.maxHighlightLength&&pr(e.doc.mode,n.state),a=ta(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 tr(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new er(n,!0,t);var a=Hr(e,t,r),o=a>n.first&&ht(n,a-1).stateAfter,s=o?er.fromSaved(n,o,a):new er(n,ti(n.mode),a);return n.iter(a,t,function(l){ri(e,l.text,s);var c=s.line;l.stateAfter=c==t-1||c%5==0||c>=i.viewFrom&&c<i.viewTo?s.save():null,s.nextLine()}),r&&(n.modeFrontier=s.line),s}function ri(e,t,r,n){var i=e.doc.mode,a=new mn(t,e.options.tabSize,r);for(a.start=a.pos=n||0,t==""&&na(i,r.state);!a.eol();)ii(i,a,r.state),a.start=a.pos}function na(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Wr(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function ii(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Wr(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 Lr=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Rr(e,t,r,n){var i=e.doc,a=i.mode,o;t=Mt(i,t);var s=ht(i,t.line),l=tr(e,t.line,r),c=new mn(s.text,e.options.tabSize,l),O;for(n&&(O=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,o=ii(a,c,l.state),n&&O.push(new Lr(c,o,pr(i.mode,l.state)));return n?O:new Lr(c,o,l.state)}function ji(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 Ni(e,t,r,n,i,a,o){var s=r.flattenSpans;s==null&&(s=e.options.flattenSpans);var l=0,c=null,O=new mn(t,e.options.tabSize,n),L,q=e.options.addModeClass&&[null];for(t==""&&ji(na(r,n.state),a);!O.eol();){if(O.pos>e.options.maxHighlightLength?(s=!1,o&&ri(e,t,n,O.pos),O.pos=t.length,L=null):L=ji(ii(r,O,n.state,q),a),q){var G=q[0].name;G&&(L="m-"+(L?G+" "+L:G))}if(!s||c!=L){for(;l<O.start;)l=Math.min(O.start,l+5e3),i(l,c);c=L}O.start=O.pos}for(;l<O.pos;){var we=Math.min(O.pos,l+5e3);i(we,c),l=we}}function Hr(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 l=ht(a,s-1),c=l.stateAfter;if(c&&(!r||s+(c instanceof $n?c.lookAhead:0)<=a.modeFrontier))return s;var O=W(l.text,null,e.options.tabSize);(i==null||n>O)&&(i=s-1,n=O)}return i}function Ii(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=ht(e,n).stateAfter;if(i&&(!(i instanceof $n)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var ra=!1,lr=!1;function ia(){ra=!0}function aa(){lr=!0}function ai(e,t,r){this.marker=e,this.from=t,this.to=r}function Sr(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function oo(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Ui(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 l=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(n||(n=[])).push(new ai(o,a.from,l?null:a.to))}}return n}function Fi(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 l=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(n||(n=[])).push(new ai(o,l?null:a.from-t,a.to==null?null:a.to-t))}}return n}function Kr(e,t){if(t.full)return null;var r=Br(e,t.from.line)&&ht(e,t.from.line).markedSpans,n=Br(e,t.to.line)&&ht(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,a=t.to.ch,o=kt(t.from,t.to)==0,s=oi(r,i,o),l=Fi(n,a,o),c=t.text.length==1,O=He(t.text).length+(c?i:0);if(s)for(var L=0;L<s.length;++L){var q=s[L];if(q.to==null){var G=Sr(l,q.marker);G?c&&(q.to=G.to==null?null:G.to+O):q.to=i}}if(l)for(var we=0;we<l.length;++we){var De=l[we];if(De.to!=null&&(De.to+=O),De.from==null){var ze=Sr(s,De.marker);ze||(De.from=O,c&&(s||(s=[])).push(De))}else De.from+=O,c&&(s||(s=[])).push(De)}s&&(s=nr(s)),l&&l!=s&&(l=nr(l));var Ze=[s];if(!c){var it=t.text.length-2,Qe;if(it>0&&s)for(var ot=0;ot<s.length;++ot)s[ot].to==null&&(Qe||(Qe=[])).push(new ai(s[ot].marker,null,null));for(var _t=0;_t<it;++_t)Ze.push(Qe);Ze.push(l)}return Ze}function nr(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 Wi(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(G){if(G.markedSpans)for(var we=0;we<G.markedSpans.length;++we){var De=G.markedSpans[we].marker;De.readOnly&&(!n||ve(n,De)==-1)&&(n||(n=[])).push(De)}}),!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),l=0;l<i.length;++l){var c=i[l];if(kt(c.to,s.from)<0||kt(c.from,s.to)>0)continue;var O=[l,1],L=kt(c.from,s.from),q=kt(c.to,s.to);(L<0||!o.inclusiveLeft&&!L)&&O.push({from:c.from,to:s.from}),(q>0||!o.inclusiveRight&&!q)&&O.push({from:s.to,to:c.to}),i.splice.apply(i,O),l+=O.length-3}return i}function Bi(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 bi(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function si(e){return e.inclusiveLeft?-1:0}function _r(e){return e.inclusiveRight?1:0}function Pr(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),i=t.find(),a=kt(n.from,i.from)||si(e)-si(t);if(a)return-a;var o=kt(n.to,i.to)||_r(e)-_r(t);return o||t.id-e.id}function zi(e,t){var r=lr&&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||Pr(n,i.marker)<0)&&(n=i.marker);return n}function Hi(e){return zi(e,!0)}function Ki(e){return zi(e,!1)}function ka(e,t){var r=lr&&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||Pr(n,a.marker)<0)&&(n=a.marker)}return n}function Ma(e,t,r,n,i){var a=ht(e,t),o=lr&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var l=o[s];if(!l.marker.collapsed)continue;var c=l.marker.find(0),O=kt(c.from,r)||si(l.marker)-si(i),L=kt(c.to,n)||_r(l.marker)-_r(i);if(O>=0&&L<=0||O<=0&&L>=0)continue;if(O<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?kt(c.to,r)>=0:kt(c.to,r)>0)||O>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?kt(c.from,n)<=0:kt(c.from,n)<0))return!0}}function vt(e){for(var t;t=Hi(e);)e=t.find(-1,!0).line;return e}function Dt(e){for(var t;t=Ki(e);)e=t.find(1,!0).line;return e}function At(e){for(var t,r;t=Ki(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function qt(e,t){var r=ht(e,t),n=vt(r);return r==n?t:Jt(n)}function Yt(e,t){if(t>e.lastLine())return t;var r=ht(e,t),n;if(!rn(e,r))return t;for(;n=Ki(r);)r=n.find(1,!0).line;return Jt(r)+1}function rn(e,t){var r=lr&&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&&wn(e,t,n))return!0}}function wn(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return wn(e,n.line,Sr(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)&&wn(e,t,i))return!0}function dn(e){e=vt(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 Hn(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=Hi(n);){var i=r.find(0,!0);n=i.from.line,t+=i.from.ch-i.to.ch}for(n=e;r=Ki(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 vr(e){var t=e.display,r=e.doc;t.maxLine=ht(r,r.first),t.maxLineLength=Hn(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var i=Hn(n);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var fn=function(e,t,r){this.text=e,bi(this,t),this.height=r?r(this):1};fn.prototype.lineNo=function(){return Jt(this)},j(fn);function Vr(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Bi(e),bi(e,r);var i=n?n(e):1;i!=e.height&&mr(e,i)}function Nn(e){e.parent=null,Bi(e)}var Xr={},kr={};function yi(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?kr:Xr;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function so(e,t){var r=ie("span",null,null,A?"padding-right: .1px":null),n={pre:ie("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=ps,On(e.display.measure)&&(o=mt(a,e.doc.direction))&&(n.addToken=ms(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&Jt(a);Fo(a,n,Pi(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=oe(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=oe(a.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Rt(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(A){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Se(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=oe(n.pre.className,n.textClass||"")),n}function Ta(e){var t=w("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ps(e,t,r,n,i,a,o){if(!t)return;var s=e.splitSpaces?lo(t,e.trailingSpace):t,l=e.cm.state.specialChars,c=!1,O;if(!l.test(t))e.col+=t.length,O=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,O),N&&U<9&&(c=!0),e.pos+=t.length;else{O=document.createDocumentFragment();for(var L=0;;){l.lastIndex=L;var q=l.exec(t),G=q?q.index-L:t.length-L;if(G){var we=document.createTextNode(s.slice(L,L+G));N&&U<9?O.appendChild(w("span",[we])):O.appendChild(we),e.map.push(e.pos,e.pos+G,we),e.col+=G,e.pos+=G}if(!q)break;L+=G+1;var De=void 0;if(q[0]==" "){var ze=e.cm.options.tabSize,Ze=ze-e.col%ze;De=O.appendChild(w("span",X(Ze),"cm-tab")),De.setAttribute("role","presentation"),De.setAttribute("cm-text"," "),e.col+=Ze}else q[0]=="\r"||q[0]==`
`?(De=O.appendChild(w("span",q[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),De.setAttribute("cm-text",q[0]),e.col+=1):(De=e.cm.options.specialCharPlaceholder(q[0]),De.setAttribute("cm-text",q[0]),N&&U<9?O.appendChild(w("span",[De])):O.appendChild(De),e.col+=1);e.map.push(e.pos,e.pos+1,De),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,r||n||i||c||a||o){var it=r||"";n&&(it+=n),i&&(it+=i);var Qe=w("span",[O],it,a);if(o)for(var ot in o)o.hasOwnProperty(ot)&&ot!="style"&&ot!="class"&&Qe.setAttribute(ot,o[ot]);return e.content.appendChild(Qe)}e.content.appendChild(O)}function lo(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 ms(e,t){return function(r,n,i,a,o,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,O=c+n.length;;){for(var L=void 0,q=0;q<t.length&&!(L=t[q],L.to>c&&L.from<=c);q++);if(L.to>=O)return e(r,n,i,a,o,s,l);e(r,n.slice(0,L.to-c),i,a,null,s,l),a=null,n=n.slice(L.to-c),c=L.to}}}function uo(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 Fo(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]),yi(r[o+1],t.cm.options));return}for(var s=i.length,l=0,c=1,O="",L,q,G=0,we,De,ze,Ze,it;;){if(G==l){we=De=ze=q="",it=null,Ze=null,G=Infinity;for(var Qe=[],ot=void 0,_t=0;_t<n.length;++_t){var yt=n[_t],Wt=yt.marker;if(Wt.type=="bookmark"&&yt.from==l&&Wt.widgetNode)Qe.push(Wt);else if(yt.from<=l&&(yt.to==null||yt.to>l||Wt.collapsed&&yt.to==l&&yt.from==l)){if(yt.to!=null&&yt.to!=l&&G>yt.to&&(G=yt.to,De=""),Wt.className&&(we+=" "+Wt.className),Wt.css&&(q=(q?q+";":"")+Wt.css),Wt.startStyle&&yt.from==l&&(ze+=" "+Wt.startStyle),Wt.endStyle&&yt.to==G&&(ot||(ot=[])).push(Wt.endStyle,yt.to),Wt.title&&((it||(it={})).title=Wt.title),Wt.attributes)for(var pn in Wt.attributes)(it||(it={}))[pn]=Wt.attributes[pn];Wt.collapsed&&(!Ze||Pr(Ze.marker,Wt)<0)&&(Ze=yt)}else yt.from>l&&G>yt.from&&(G=yt.from)}if(ot)for(var Kn=0;Kn<ot.length;Kn+=2)ot[Kn+1]==G&&(De+=" "+ot[Kn]);if(!Ze||Ze.from==l)for(var Cn=0;Cn<Qe.length;++Cn)uo(t,0,Qe[Cn]);if(Ze&&(Ze.from||0)==l){if(uo(t,(Ze.to==null?s+1:Ze.to)-l,Ze.marker,Ze.from==null),Ze.to==null)return;Ze.to==l&&(Ze=!1)}}if(l>=s)break;for(var gr=Math.min(s,G);;){if(O){var cr=l+O.length;if(!Ze){var Rn=cr>gr?O.slice(0,gr-l):O;t.addToken(t,Rn,L?L+we:we,ze,l+Rn.length==G?De:"",q,it)}if(cr>=gr){O=O.slice(gr-l),l=gr;break}l=cr,ze=""}O=i.slice(a,a=r[c++]),L=yi(r[c++],t.cm.options)}}}function co(e,t,r){this.line=t,this.rest=At(t),this.size=this.rest?Jt(He(this.rest))-r+1:1,this.node=this.text=null,this.hidden=rn(e,t)}function Vi(e,t,r){for(var n=[],i,a=t;a<r;a=i){var o=new co(e.doc,ht(e.doc,a),a);i=a+o.size,n.push(o)}return n}var xi=null;function Wo(e){xi?xi.ops.push(e):e.ownsGroup=xi={ops:[e],delayedCallbacks:[]}}function Da(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 Bo(e,t){var r=e.ownsGroup;if(!r)return;try{Da(r)}finally{xi=null,t(r)}}var Ei=null;function Sn(e,t){var r=xt(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),i;xi?i=xi.delayedCallbacks:Ei?i=Ei:(i=Ei=[],setTimeout(fo,0));for(var a=function(s){i.push(function(){return r[s].apply(null,n)})},o=0;o<r.length;++o)a(o)}function fo(){var e=Ei;Ei=null;for(var t=0;t<e.length;++t)e[t]()}function ho(e,t,r,n){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?po(e,t):a=="gutter"?Ra(e,t,r,n):a=="class"?La(e,t):a=="widget"&&Ho(e,t,n)}t.changes=null}function Xi(e){return e.node==e.text&&(e.node=w("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),N&&U<8&&(e.node.style.zIndex=2)),e.node}function zo(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=Xi(t);t.background=n.insertBefore(w("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Aa(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):so(e,t)}function po(e,t){var r=t.text.className,n=Aa(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,La(e,t)):r&&(t.text.className=r)}function La(e,t){zo(e,t),t.line.wrapClass?Xi(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 Ra(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=Xi(t);t.gutterBackground=w("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=Xi(t),s=t.gutter=w("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(w("div",zr(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,O=a.hasOwnProperty(c)&&a[c];O&&s.appendChild(w("div",[O],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function Ho(e,t,r){t.alignable&&(t.alignable=null);for(var n=le("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);Pa(e,t,r)}function mo(e,t,r,n){var i=Aa(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),La(e,t),Ra(e,t,r,n),Pa(e,t,n),t.node}function Pa(e,t,r){if(vo(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)vo(e,t.rest[n],t,r,!1)}function vo(e,t,r,n,i){if(!t.widgets)return;for(var a=Xi(r),o=0,s=t.widgets;o<s.length;++o){var l=s[o],c=w("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Ko(l,c,r,n),e.display.input.setUneditable(c),i&&l.above?a.insertBefore(c,r.gutter||r.text):a.appendChild(c),Sn(l,"redraw")}}function Ko(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 wi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!_(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;"),re(t.display.measure,w("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function jr(e,t){for(var r=Y(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 ja(e){return e.lineSpace.offsetTop}function y(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function I(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=re(e.measure,w("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 B(e){return Ne-e.display.nativeBarWidth}function C(e){return e.display.scroller.clientWidth-B(e)-e.display.barWidth}function u(e){return e.display.scroller.clientHeight-B(e)-e.display.barHeight}function g(e,t,r){var n=e.options.lineWrapping,i=n&&C(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 l=o[s],c=o[s+1];Math.abs(l.bottom-c.bottom)>2&&a.push((l.bottom+c.top)/2-r.top)}}a.push(r.bottom-r.top)}}function f(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(Jt(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function S(e,t){t=vt(t);var r=Jt(t),n=e.display.externalMeasured=new co(e.doc,t,r);n.lineN=r;var i=n.built=so(e,n);return n.text=i.pre,re(e.display.lineMeasure,i.pre),n}function M(e,t,r,n){return J(e,F(e,t),r,n)}function z(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[hn(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function F(e,t){var r=Jt(t),n=z(e,r);n&&!n.text?n=null:n&&n.changes&&(ho(e,n,r,yn(e)),e.curOp.forceUpdate=!0),n||(n=S(e,t));var i=f(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function J(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||(g(e,t.view,t.rect),t.hasHeights=!0),o=Je(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 ye={left:0,right:0,top:0,bottom:0};function We(e,t,r){for(var n,i,a,o,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,a=1,o="left"):t<l?(i=t-s,a=i+1):(c==e.length-3||t==l&&e[c+3]>t)&&(a=l-s,i=a-1,t>=l&&(o="right")),i!=null){if(n=e[c+2],s==l&&r==(n.insertLeft?"left":"right")&&(o=r),r=="left"&&i==0)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[(c-=3)+2],o="left";if(r=="right"&&i==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],o="right";break}return{node:n,start:i,end:a,collapse:o,coverStart:s,coverEnd:l}}function Ue(e,t){var r=ye;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 Je(e,t,r,n){var i=We(t.map,r,n),a=i.node,o=i.start,s=i.end,l=i.collapse,c;if(a.nodeType==3){for(var O=0;O<4;O++){for(;o&&_e(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+s<i.coverEnd&&_e(t.line.text.charAt(i.coverStart+s));)++s;if(N&&U<9&&o==0&&s==i.coverEnd-i.coverStart?c=a.parentNode.getBoundingClientRect():c=Ue(Z(a,o,s).getClientRects(),n),c.left||c.right||o==0)break;s=o,o=o-1,l="right"}N&&U<11&&(c=St(e.display.measure,c))}else{o>0&&(l=n="right");var L;e.options.lineWrapping&&(L=a.getClientRects()).length>1?c=L[n=="right"?L.length-1:0]:c=a.getBoundingClientRect()}if(N&&U<9&&!o&&(!c||!c.left&&!c.right)){var q=a.parentNode.getClientRects()[0];q?c={left:q.left,right:q.left+In(e.display),top:q.top,bottom:q.bottom}:c=ye}for(var G=c.top-t.rect.top,we=c.bottom-t.rect.top,De=(G+we)/2,ze=t.view.measure.heights,Ze=0;Ze<ze.length-1&&!(De<ze[Ze]);Ze++);var it=Ze?ze[Ze-1]:0,Qe=ze[Ze],ot={left:(l=="right"?c.right:c.left)-t.rect.left,right:(l=="left"?c.left:c.right)-t.rect.left,top:it,bottom:Qe};return!c.left&&!c.right&&(ot.bogus=!0),e.options.singleCursorHeightPerLine||(ot.rtop=G,ot.rbottom=we),ot}function St(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!jn(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 Ut(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 Lt(e){e.display.externalMeasure=null,Oe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ut(e.display.view[t])}function jt(e){Lt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ft(){return ee&&R?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function It(){return ee&&R?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Nt(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=wi(e.widgets[r]));return t}function Xt(e,t,r,n,i){if(!i){var a=Nt(t);r.top+=a,r.bottom+=a}if(n=="line")return r;n||(n="local");var o=dn(t);if(n=="local"?o+=ja(e.display):o-=e.display.viewOffset,n=="page"||n=="window"){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(n=="window"?0:It());var l=s.left+(n=="window"?0:Ft());r.left+=l,r.right+=l}return r.top+=o,r.bottom+=o,r}function Bt(e,t,r){if(r=="div")return t;var n=t.left,i=t.top;if(r=="page")n-=Ft(),i-=It();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 vn(e,t,r,n,i){return n||(n=ht(e.doc,t.line)),Xt(e,n,M(e,n,t.ch,i),r)}function zt(e,t,r,n,i,a){n=n||ht(e.doc,t.line),i||(i=F(e,n));function o(we,De){var ze=J(e,i,we,De?"right":"left",a);return De?ze.left=ze.right:ze.right=ze.left,Xt(e,n,ze,r)}var s=mt(n,e.doc.direction),l=t.ch,c=t.sticky;if(l>=n.text.length?(l=n.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return o(c=="before"?l-1:l,c=="before");function O(we,De,ze){var Ze=s[De],it=Ze.level==1;return o(ze?we-1:we,it!=ze)}var L=et(s,l,c),q=dt,G=O(l,L,c=="before");return q!=null&&(G.other=O(l,q,c!="before")),G}function Et(e,t){var r=0;t=Mt(e.doc,t),e.options.lineWrapping||(r=In(e.display)*t.ch);var n=ht(e.doc,t.line),i=dn(n)+ja(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function bt(e,t,r,n,i){var a=Ie(e,t,r);return a.xRel=i,n&&(a.outside=n),a}function Ht(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return bt(n.first,0,null,-1,-1);var i=Dr(n,r),a=n.first+n.size-1;if(i>a)return bt(n.first+n.size-1,ht(n,a).text.length,null,1,1);t<0&&(t=0);for(var o=ht(n,i);;){var s=gn(e,o,i,t,r),l=ka(o,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;o=ht(n,i=c.line)}}function Gt(e,t,r,n){n-=Nt(t);var i=t.text.length,a=st(function(o){return J(e,r,o-1).bottom<=n},i,0);return i=st(function(o){return J(e,r,o).top>n},a,i),{begin:a,end:i}}function ft(e,t,r,n){r||(r=F(e,t));var i=Xt(e,t,J(e,r,n),"line").top;return Gt(e,t,r,i)}function $t(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function gn(e,t,r,n,i){i-=dn(t);var a=F(e,t),o=Nt(t),s=0,l=t.text.length,c=!0,O=mt(t,e.doc.direction);if(O){var L=(e.options.lineWrapping?sn:Zt)(e,t,r,a,O,n,i);c=L.level!=1,s=c?L.from:L.to-1,l=c?L.to:L.from-1}var q=null,G=null,we=st(function(_t){var yt=J(e,a,_t);return yt.top+=o,yt.bottom+=o,$t(yt,n,i,!1)?(yt.top<=i&&yt.left<=n&&(q=_t,G=yt),!0):!1},s,l),De,ze,Ze=!1;if(G){var it=n-G.left<G.right-n,Qe=it==c;we=q+(Qe?0:1),ze=Qe?"after":"before",De=it?G.left:G.right}else{!c&&(we==l||we==s)&&we++,ze=we==0?"after":we==t.text.length?"before":J(e,a,we-(c?1:0)).bottom+o<=i==c?"after":"before";var ot=zt(e,Ie(r,we,ze),"line",t,a);De=ot.left,Ze=i<ot.top?-1:i>=ot.bottom?1:0}return we=Pe(t.text,we,1),bt(r,we,ze,Ze,n-De)}function Zt(e,t,r,n,i,a,o){var s=st(function(L){var q=i[L],G=q.level!=1;return $t(zt(e,Ie(r,G?q.to:q.from,G?"before":"after"),"line",t,n),a,o,!0)},0,i.length-1),l=i[s];if(s>0){var c=l.level!=1,O=zt(e,Ie(r,c?l.from:l.to,c?"after":"before"),"line",t,n);$t(O,a,o,!0)&&O.top>o&&(l=i[s-1])}return l}function sn(e,t,r,n,i,a,o){var s=Gt(e,t,n,o),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var O=null,L=null,q=0;q<i.length;q++){var G=i[q];if(G.from>=c||G.to<=l)continue;var we=G.level!=1,De=J(e,n,we?Math.min(c,G.to)-1:Math.max(l,G.from)).right,ze=De<a?a-De+1e9:De-a;(!O||L>ze)&&(O=G,L=ze)}return O||(O=i[i.length-1]),O.from<l&&(O={from:l,to:O.to,level:O.level}),O.to>c&&(O={from:O.from,to:c,level:O.level}),O}var an;function _n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(an==null){an=w("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)an.appendChild(document.createTextNode("x")),an.appendChild(w("br"));an.appendChild(document.createTextNode("x"))}re(e.measure,an);var r=an.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Oe(e.measure),r||1}function In(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=w("span","xxxxxxxxxx"),r=w("pre",[t],"CodeMirror-line-like");re(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function yn(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:Yn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Yn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function xr(e){var t=_n(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/In(e.display)-3);return function(i){if(rn(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 rr(e){var t=e.doc,r=xr(e);t.iter(function(n){var i=r(n);i!=n.height&&mr(n,i)})}function Un(e,t,r,n){var i=e.display;if(!r&&Y(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(L){return null}var l=Ht(e,a,o),c;if(n&&l.xRel>0&&(c=ht(e.doc,l.line).text).length==l.ch){var O=W(c,c.length,e.options.tabSize)-c.length;l=Ie(l.line,Math.max(0,Math.round((a-I(e.display).left)/In(e.display))-O))}return l}function hn(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 ln(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)lr&&qt(e.doc,t)<i.viewTo&&bn(e);else if(r<=i.viewFrom)lr&&Yt(e.doc,r+n)>i.viewFrom?bn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)bn(e);else if(t<=i.viewFrom){var a=Er(e,r,r+n,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=n):bn(e)}else if(r>=i.viewTo){var o=Er(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):bn(e)}else{var s=Er(e,t,t,-1),l=Er(e,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Vi(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):bn(e)}var c=i.externalMeasured;c&&(r<c.lineN?c.lineN+=n:t<c.lineN+c.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[hn(e,t)];if(a.node==null)return;var o=a.changes||(a.changes=[]);ve(o,r)==-1&&o.push(r)}function bn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Er(e,t,r,n){var i=hn(e,t),a,o=e.display.view;if(!lr||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=o[l].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(;qt(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 Gr(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Vi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Vi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(hn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Vi(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,hn(e,r)))),n.viewTo=r}function $r(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 on(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Mr(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 l=s.empty();(l||e.options.showCursorWhenSelecting)&&Yr(e,s.head,i),l||nn(e,s,a)}return n}function Yr(e,t,r){var n=zt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(w("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(w("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 cn(e,t){return e.top-t.top||e.left-t.left}function nn(e,t,r){var n=e.display,i=e.doc,a=document.createDocumentFragment(),o=I(e.display),s=o.left,l=Math.max(n.sizerWidth,C(e)-n.sizer.offsetLeft)-o.right,c=i.direction=="ltr";function O(Qe,ot,_t,yt){ot<0&&(ot=0),ot=Math.round(ot),yt=Math.round(yt),a.appendChild(w("div",null,"CodeMirror-selected","position: absolute; left: "+Qe+`px;
top: `+ot+"px; width: "+(_t==null?l-Qe:_t)+`px;
height: `+(yt-ot)+"px"))}function L(Qe,ot,_t){var yt=ht(i,Qe),Wt=yt.text.length,pn,Kn;function Cn(Rn,dr){return vn(e,Ie(Qe,Rn),"div",yt,dr)}function gr(Rn,dr,Gn){var zn=ft(e,yt,null,Rn),Pn=dr=="ltr"==(Gn=="after")?"left":"right",kn=Gn=="after"?zn.begin:zn.end-(/\s/.test(yt.text.charAt(zn.end-1))?2:1);return Cn(kn,Pn)[Pn]}var cr=mt(yt,i.direction);return lt(cr,ot||0,_t==null?Wt:_t,function(Rn,dr,Gn,zn){var Pn=Gn=="ltr",kn=Cn(Rn,Pn?"left":"right"),fr=Cn(dr-1,Pn?"right":"left"),Oa=ot==null&&Rn==0,Li=_t==null&&dr==Wt,Zn=zn==0,ei=!cr||zn==cr.length-1;if(fr.top-kn.top<=3){var Vn=(c?Oa:Li)&&Zn,fs=(c?Li:Oa)&&ei,pi=Vn?s:(Pn?kn:fr).left,Qi=fs?l:(Pn?fr:kn).right;O(pi,kn.top,Qi-pi,kn.bottom)}else{var qi,sr,Sa,hs;Pn?(qi=c&&Oa&&Zn?s:kn.left,sr=c?l:gr(Rn,Gn,"before"),Sa=c?s:gr(dr,Gn,"after"),hs=c&&Li&&ei?l:fr.right):(qi=c?gr(Rn,Gn,"before"):s,sr=!c&&Oa&&Zn?l:kn.right,Sa=!c&&Li&&ei?s:fr.left,hs=c?gr(dr,Gn,"after"):l),O(qi,kn.top,sr-qi,kn.bottom),kn.bottom<fr.top&&O(s,kn.bottom,null,fr.top),O(Sa,fr.top,hs-Sa,fr.bottom)}(!pn||cn(kn,pn)<0)&&(pn=kn),cn(fr,pn)<0&&(pn=fr),(!Kn||cn(kn,Kn)<0)&&(Kn=kn),cn(fr,Kn)<0&&(Kn=fr)}),{start:pn,end:Kn}}var q=t.from(),G=t.to();if(q.line==G.line)L(q.line,q.ch,G.ch);else{var we=ht(i,q.line),De=ht(i,G.line),ze=vt(we)==vt(De),Ze=L(q.line,q.ch,ze?we.text.length+1:null).end,it=L(G.line,ze?0:null,G.ch).start;ze&&(Ze.top<it.top-2?(O(Ze.right,Ze.top,null,Ze.bottom),O(s,it.top,it.left,it.bottom)):O(Ze.right,Ze.top,it.left-Ze.right,Ze.bottom)),Ze.bottom<it.top&&O(s,Ze.bottom,null,it.top)}r.appendChild(a)}function Fn(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()||Ci(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function go(e){e.state.focused||(e.display.input.focus(),Jr(e))}function Na(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ci(e))},100)}function Jr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Se(e,"focus",e,t),e.state.focused=!0,xe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),A&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Fn(e)}function Ci(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Se(e,"blur",e,t),e.state.focused=!1,se(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function oa(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(N&&U<8){var l=i.node.offsetTop+i.node.offsetHeight;o=l-r,r=l}else{var c=i.node.getBoundingClientRect();o=c.bottom-c.top,!a&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-c.left-1)}var O=i.line.height-o;if((O>.005||O<-.005)&&(mr(i.line,o),Ia(i.line),i.rest))for(var L=0;L<i.rest.length;L++)Ia(i.rest[L]);if(s>e.display.sizerWidth){var q=Math.ceil(s/In(e.display));q>e.display.maxLineLength&&(e.display.maxLineLength=q,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function Ia(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 sa(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-ja(e));var i=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,a=Dr(t,n),o=Dr(t,i);if(r&&r.ensure){var s=r.ensure.from.line,l=r.ensure.to.line;s<a?(a=s,o=Dr(t,dn(ht(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=o&&(a=Dr(t,dn(ht(t,l))-e.wrapper.clientHeight),o=l)}return{from:a,to:Math.max(o,a+1)}}function Vo(e,t){if(Ke(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&&!V){var a=w("div","\u200B",null,`position: absolute;
top: `+(t.top-r.viewOffset-ja(e.display))+`px;
height: `+(t.bottom-t.top+B(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 Xo(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(t=t.ch?Ie(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Ie(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,s=zt(e,t),l=!r||r==t?s:zt(e,r);i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n};var c=Ua(e,i),O=e.doc.scrollTop,L=e.doc.scrollLeft;if(c.scrollTop!=null&&(_i(e,c.scrollTop),Math.abs(e.doc.scrollTop-O)>1&&(o=!0)),c.scrollLeft!=null&&(wr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-L)>1&&(o=!0)),!o)break}return i}function bo(e,t){var r=Ua(e,t);r.scrollTop!=null&&_i(e,r.scrollTop),r.scrollLeft!=null&&wr(e,r.scrollLeft)}function Ua(e,t){var r=e.display,n=_n(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,a=u(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+y(r),l=t.top<n,c=t.bottom>s-n;if(t.top<i)o.scrollTop=l?0:t.top;else if(t.bottom>i+a){var O=Math.min(t.top,(c?s:t.bottom)-a);O!=i&&(o.scrollTop=O)}var L=e.options.fixedGutter?0:r.gutters.offsetWidth,q=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-L,G=C(e)-r.gutters.offsetWidth,we=t.right-t.left>G;return we&&(t.right=t.left+G),t.left<10?o.scrollLeft=0:t.left<q?o.scrollLeft=Math.max(0,t.left+L-(we?0:10)):t.right>G+q-3&&(o.scrollLeft=t.right+(we?0:10)-G),o}function Fa(e,t){if(t==null)return;la(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Oi(e){la(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Si(e,t,r){(t!=null||r!=null)&&la(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Go(e,t){la(e),e.curOp.scrollToPos=t}function la(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Et(e,t.from),n=Et(e,t.to);Gi(e,r,n,t.margin)}}function Gi(e,t,r,n){var i=Ua(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});Si(e,i.scrollLeft,i.scrollTop)}function _i(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;te||Ji(e,{top:t}),ki(e,t,!0),te&&Ji(e),Yi(e,100)}function ki(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 wr(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,Vt(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+y(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+B(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Zr=function(e,t,r){this.cm=r;var n=this.vert=w("div",[w("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=w("div",[w("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),Ee(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ee(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,N&&U<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Zr.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}},Zr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Zr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Zr.prototype.zeroWidthHack=function(){var e=$&&!ae?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new pe,this.disableVert=new pe},Zr.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)},Zr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var $i=function(){};$i.prototype.update=function(){return{bottom:0,right:0}},$i.prototype.setScrollLeft=function(){},$i.prototype.setScrollTop=function(){},$i.prototype.clear=function(){};function ui(e,t){t||(t=li(e));var r=e.display.barWidth,n=e.display.barHeight;ua(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&oa(e),ua(e,li(e)),r=e.display.barWidth,n=e.display.barHeight}function ua(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 Wa={native:Zr,null:$i};function ca(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&se(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Wa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ee(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"?wr(e,t):_i(e,t)},e),e.display.scrollbars.addClass&&xe(e.display.wrapper,e.display.scrollbars.addClass)}var Ba=0;function Qr(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:++Ba},Wo(e.curOp)}function ci(e){var t=e.curOp;t&&Bo(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;yo(r)})}function yo(e){for(var t=e.ops,r=0;r<t.length;r++)$o(t[r]);for(var n=0;n<t.length;n++)Yo(t[n]);for(var i=0;i<t.length;i++)Jo(t[i]);for(var a=0;a<t.length;a++)za(t[a]);for(var o=0;o<t.length;o++)Zo(t[o])}function $o(e){var t=e.cm,r=t.display;xo(t),e.updateMaxLine&&vr(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 Cr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yo(e){e.updatedDisplay=e.mustUpdate&&di(e.cm,e.update)}function Jo(e){var t=e.cm,r=t.display;e.updatedDisplay&&oa(t),e.barMeasure=li(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=M(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+B(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-C(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function za(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&wr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==ue();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ui(t,e.barMeasure),e.updatedDisplay&&tn(t,e.barMeasure),e.selectionChanged&&Fn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&go(e.cm)}function Zo(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&da(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&ki(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&wr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Xo(t,Mt(n,e.scrollToPos.from),Mt(n,e.scrollToPos.to),e.scrollToPos.margin);Vo(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var s=0;s<a.length;++s)a[s].lines.length||Se(a[s],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&Se(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Se(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ir(e,t){if(e.curOp)return t();Qr(e);try{return t()}finally{ci(e)}}function Tn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Qr(e);try{return t.apply(e,arguments)}finally{ci(e)}}}function Xn(e){return function(){if(this.curOp)return e.apply(this,arguments);Qr(this);try{return e.apply(this,arguments)}finally{ci(this)}}}function Dn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Qr(t);try{return e.apply(this,arguments)}finally{ci(t)}}}function Yi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,E(Qo,e))}function Qo(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=tr(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?pr(t.mode,n.state):null,l=ta(e,a,n,!0);s&&(n.state=s),a.styles=l.styles;var c=a.styleClasses,O=l.classes;O?a.styleClasses=O:c&&(a.styleClasses=null);for(var L=!o||o.length!=a.styles.length||c!=O&&(!c||!O||c.bgClass!=O.bgClass||c.textClass!=O.textClass),q=0;!L&&q<o.length;++q)L=o[q]!=a.styles[q];L&&i.push(n.line),a.stateAfter=n.save(),n.nextLine()}else a.text.length<=e.options.maxHighlightLength&&ri(e,a.text,n),a.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return Yi(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&ir(e,function(){for(var a=0;a<i.length;a++)xn(e,i[a],"text")})}var Cr=function(e,t,r){var n=e.display;this.viewport=t,this.visible=sa(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=C(e),this.force=r,this.dims=yn(e),this.events=[]};Cr.prototype.signal=function(e,t){D(e,t)&&this.events.push(arguments)},Cr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Se.apply(null,this.events[e])};function xo(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=B(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=B(e)+"px",t.scrollbarsClipped=!0)}function Eo(e){if(e.hasFocus())return null;var t=ue();if(!t||!_(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&_(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function wo(e){if(!e||!e.activeElt||e.activeElt==ue())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(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 di(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return bn(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&&$r(e)==0)return!1;Wn(e)&&(bn(e),t.dims=yn(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)),lr&&(a=qt(e.doc,a),o=Yt(e.doc,o));var s=a!=r.viewFrom||o!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Gr(e,a,o),r.viewOffset=dn(ht(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=$r(e);if(!s&&l==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var c=Eo(e);return l>4&&(r.lineDiv.style.display="none"),Co(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,wo(c),Oe(r.cursorDiv),Oe(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Yi(e,400)),r.updateLineNumbers=null,!0}function da(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==C(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+y(e.display)-u(e),r.top)}),t.visible=sa(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=sa(e.display,e.doc,r));if(!di(e,t))break;oa(e);var i=li(e);on(e),ui(e,i),tn(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 Ji(e,t){var r=new Cr(e,t);if(di(e,r)){oa(e),da(e,r);var n=li(e);on(e),ui(e,n),tn(e,n),r.finish()}}function Co(e,t,r){var n=e.display,i=e.options.lineNumbers,a=n.lineDiv,o=a.firstChild;function s(we){var De=we.nextSibling;return A&&$&&e.display.currentWheelTarget==we?we.style.display="none":we.parentNode.removeChild(we),De}for(var l=n.view,c=n.viewFrom,O=0;O<l.length;O++){var L=l[O];if(!L.hidden)if(!L.node||L.node.parentNode!=a){var q=mo(e,L,c,r);a.insertBefore(q,o)}else{for(;o!=L.node;)o=s(o);var G=i&&t!=null&&t<=c&&L.lineNumber;L.changes&&(ve(L.changes,"gutter")>-1&&(G=!1),ho(e,L,c,r)),G&&(Oe(L.lineNumber),L.lineNumber.appendChild(document.createTextNode(zr(e.options,c)))),o=L.node.nextSibling}c+=L.size}for(;o;)o=s(o)}function fa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function tn(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+B(e)+"px"}function Vt(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Yn(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 l=0;l<s.length;l++)s[l].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}function Wn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=zr(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(w("div",[w("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",fa(e.display),!0}return!1}function ar(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 Mi(e){var t=e.gutters,r=e.gutterSpecs;Oe(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(w("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",fa(e)}function Nr(e){Mi(e.display),ln(e),Vt(e)}function Zi(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=w("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=w("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=ie("div",null,"CodeMirror-code"),i.selectionDiv=w("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=w("div",null,"CodeMirror-cursors"),i.measure=w("div",null,"CodeMirror-measure"),i.lineMeasure=w("div",null,"CodeMirror-measure"),i.lineSpace=ie("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=ie("div",[i.lineSpace],"CodeMirror-lines");i.mover=w("div",[a],null,"position: relative"),i.sizer=w("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=w("div",null,null,"position: absolute; height: "+Ne+"px; width: 1px;"),i.gutters=w("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=w("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=w("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),N&&U<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!A&&!(te&&K)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=ar(n.gutters,n.lineNumbers),Mi(i),r.init(i)}var qr=0,Bn=null;N?Bn=-.53:te?Bn=15:ee?Bn=-.7:Ce&&(Bn=-1/3);function ha(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 Ha(e){var t=ha(e);return t.x*=Bn,t.y*=Bn,t}function Ka(e,t){var r=ha(t),n=r.x,i=r.y,a=e.display,o=a.scroller,s=o.scrollWidth>o.clientWidth,l=o.scrollHeight>o.clientHeight;if(!(n&&s||i&&l))return;if(i&&$&&A){e:for(var c=t.target,O=a.view;c!=o;c=c.parentNode)for(var L=0;L<O.length;L++)if(O[L].node==c){e.display.currentWheelTarget=c;break e}}if(n&&!te&&!ne&&Bn!=null){i&&l&&_i(e,Math.max(0,o.scrollTop+i*Bn)),wr(e,Math.max(0,o.scrollLeft+n*Bn)),(!i||i&&l)&&h(t),a.wheelStartX=null;return}if(i&&Bn!=null){var q=i*Bn,G=e.doc.scrollTop,we=G+a.wrapper.clientHeight;q<0?G=Math.max(0,G+q-50):we=Math.min(e.doc.height,we+q+50),Ji(e,{top:G,bottom:we})}qr<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 De=o.scrollLeft-a.wheelStartX,ze=o.scrollTop-a.wheelStartY,Ze=ze&&a.wheelDY&&ze/a.wheelDY||De&&a.wheelDX&&De/a.wheelDX;if(a.wheelStartX=a.wheelStartY=null,!Ze)return;Bn=(Bn*qr+Ze)/(qr+1),++qr},200)):(a.wheelDX+=n,a.wheelDY+=i))}var or=function(e,t){this.ranges=e,this.primIndex=t};or.prototype.primary=function(){return this.ranges[this.primIndex]},or.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(!Xe(r.anchor,n.anchor)||!Xe(r.head,n.head))return!1}return!0},or.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new en(vi(this.ranges[t].anchor),vi(this.ranges[t].head));return new or(e,this.primIndex)},or.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},or.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(kt(t,n.from())>=0&&kt(e,n.to())<=0)return r}return-1};var en=function(e,t){this.anchor=e,this.head=t};en.prototype.from=function(){return Ar(this.anchor,this.head)},en.prototype.to=function(){return gi(this.anchor,this.head)},en.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Or(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(q,G){return kt(q.from(),G.from())}),r=ve(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],l=kt(s.to(),o.from());if(n&&!o.empty()?l>0:l>=0){var c=Ar(s.from(),o.from()),O=gi(s.to(),o.to()),L=s.empty()?o.from()==o.head:s.from()==s.head;a<=r&&--r,t.splice(--a,2,new en(L?O:c,L?c:O))}}return new or(t,r)}function Ir(e,t){return new or([new en(e,t||e)],0)}function Ur(e){return e.text?Ie(e.from.line+e.text.length-1,He(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Va(e,t){if(kt(e,t.from)<0)return e;if(kt(e,t.to)<=0)return Ur(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+=Ur(t).ch-t.to.ch),Ie(r,n)}function pa(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new en(Va(i.anchor,t),Va(i.head,t)))}return Or(e.cm,r,e.sel.primIndex)}function Oo(e,t,r){return e.line==t.line?Ie(r.line,e.ch-t.ch+r.ch):Ie(r.line+(e.line-t.line),e.ch)}function So(e,t,r){for(var n=[],i=Ie(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],l=Oo(s.from,i,a),c=Oo(Ur(s),i,a);if(i=s.to,a=c,r=="around"){var O=e.sel.ranges[o],L=kt(O.head,O.anchor)<0;n[o]=new en(L?c:l,L?l:c)}else n[o]=new en(l,l)}return new or(n,e.sel.primIndex)}function fi(e){e.doc.mode=br(e.options,e.doc.modeOption),Xa(e)}function Xa(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,Yi(e,100),e.state.modeGen++,e.curOp&&ln(e)}function vs(e,t){return t.from.ch==0&&t.to.ch==0&&He(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function qo(e,t,r,n){function i(it){return r?r[it]:null}function a(it,Qe,ot){Vr(it,Qe,ot,n),Sn(it,"change",it,t)}function o(it,Qe){for(var ot=[],_t=it;_t<Qe;++_t)ot.push(new fn(c[_t],i(_t),n));return ot}var s=t.from,l=t.to,c=t.text,O=ht(e,s.line),L=ht(e,l.line),q=He(c),G=i(c.length-1),we=l.line-s.line;if(t.full)e.insert(0,o(0,c.length)),e.remove(c.length,e.size-c.length);else if(vs(e,t)){var De=o(0,c.length-1);a(L,L.text,G),we&&e.remove(s.line,we),De.length&&e.insert(s.line,De)}else if(O==L)if(c.length==1)a(O,O.text.slice(0,s.ch)+q+O.text.slice(l.ch),G);else{var ze=o(1,c.length-1);ze.push(new fn(q+O.text.slice(l.ch),G,n)),a(O,O.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,ze)}else if(c.length==1)a(O,O.text.slice(0,s.ch)+c[0]+L.text.slice(l.ch),i(0)),e.remove(s.line+1,we);else{a(O,O.text.slice(0,s.ch)+c[0],i(0)),a(L,q+L.text.slice(l.ch),G);var Ze=o(1,c.length-1);we>1&&e.remove(s.line+1,we-1),e.insert(s.line+1,Ze)}Sn(e,"change",e,t)}function Ti(e,t,r){function n(i,a,o){if(i.linked)for(var s=0;s<i.linked.length;++s){var l=i.linked[s];if(l.doc==a)continue;var c=o&&l.sharedHist;if(r&&!c)continue;t(l.doc,c),n(l.doc,i,c)}}n(e,null,!0)}function gs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,rr(e),fi(e),bs(e),e.options.lineWrapping||vr(e),e.options.mode=t.modeOption,ln(e)}function bs(e){(e.doc.direction=="rtl"?xe:se)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){ir(e,function(){bs(e),ln(e)})}function _o(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 es(e,t){var r={from:vi(t.from),to:Ur(t),text:Tr(e,t.from,t.to)};return Es(e,r,t.from.line,t.to.line+1),Ti(e,function(n){return Es(n,r,t.from.line,t.to.line+1)},!0),r}function ys(e){for(;e.length;){var t=He(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return ys(e.done),He(e.done);if(e.done.length&&!He(e.done).ranges)return He(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),He(e.done)}function xs(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=He(o.changes),kt(t.from,t.to)==0&&kt(t.from,s.to)==0?s.to=Ur(t):o.changes.push(es(e,t));else{var l=He(i.done);for((!l||!l.ranges)&&ko(e.sel,i.done),o={changes:[es(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||Se(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 vl(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,He(i.done),t))?i.done[i.done.length-1]=t:ko(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=r,n&&n.clearRedo!==!1&&ys(i.undone)}function ko(e,t){var r=He(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Es(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 gl(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(gl(r[i]));return n}function ws(e,t){var r=bl(e,t),n=Kr(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 l=o[s],c=0;c<a.length;++c)if(a[c].marker==l.marker)continue e;a.push(l)}}else o&&(r[i]=o)}return r}function ma(e,t,r){for(var n=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){n.push(r?or.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];n.push({changes:s});for(var l=0;l<o.length;++l){var c=o[l],O=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var L in c)(O=L.match(/^spans_(\d+)$/))&&(ve(t,Number(O[1]))>-1&&(He(s)[L]=c[L],delete c[L]))}}return n}function ts(e,t,r,n){if(n){var i=e.anchor;if(r){var a=kt(t,i)<0;a!=kt(r,i)<0?(i=t,t=r):a!=kt(t,r)<0&&(t=r)}return new en(i,t)}else return new en(r||t,t)}function Mo(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Jn(e,new or([ts(e.sel.primary(),t,r,i)],0),n)}function Cs(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]=ts(e.sel.ranges[a],t[a],null,i);var o=Or(e.cm,n,e.sel.primIndex);Jn(e,o,r)}function ns(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Jn(e,Or(e.cm,i,e.sel.primIndex),n)}function Os(e,t,r,n){Jn(e,Ir(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 en(Mt(e,i[a].anchor),Mt(e,i[a].head))},origin:r&&r.origin};return Se(e,"beforeSelectionChange",e,n),e.cm&&Se(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Or(e.cm,n.ranges,n.ranges.length-1):t}function Ss(e,t,r){var n=e.history.done,i=He(n);i&&i.ranges?(n[n.length-1]=t,To(e,t,r)):Jn(e,t,r)}function Jn(e,t,r){To(e,t,r),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function To(e,t,r){(D(e,"beforeSelectionChange")||e.cm&&D(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,r));var n=r&&r.bias||(kt(t.primary().head,e.sel.primary().head)<0?-1:1);_s(e,Ms(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&Oi(e.cm)}function _s(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,k(e.cm)),Sn(e,"cursorActivity",e)}function ks(e){_s(e,Ms(e,e.sel,null,!1))}function Ms(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],l=Do(e,o.anchor,s&&s.anchor,r,n),c=Do(e,o.head,s&&s.head,r,n);(i||l!=o.anchor||c!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new en(l,c))}return i?Or(e.cm,i,t.primIndex):t}function va(e,t,r,n,i){var a=ht(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,O="selectRight"in l?!l.selectRight:l.inclusiveRight;if((s.from==null||(c?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(O?s.to>=t.ch:s.to>t.ch))){if(i&&(Se(l,"beforeCursorEnter"),l.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!l.atomic)continue;if(r){var L=l.find(n<0?1:-1),q=void 0;if((n<0?O:c)&&(L=Ts(e,L,-n,L&&L.line==t.line?a:null)),L&&L.line==t.line&&(q=kt(L,r))&&(n<0?q<0:q>0))return va(e,L,t,n,i)}var G=l.find(n<0?-1:1);return(n<0?c:O)&&(G=Ts(e,G,n,G.line==t.line?a:null)),G?va(e,G,t,n,i):null}}return t}function Do(e,t,r,n,i){var a=n||1,o=va(e,t,r,a,i)||!i&&va(e,t,r,a,!0)||va(e,t,r,-a,i)||!i&&va(e,t,r,-a,!0);return o||(e.cantEdit=!0,Ie(e.first,0))}function Ts(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?Mt(e,Ie(t.line-1)):null:r>0&&t.ch==(n||ht(e,t.line)).text.length?t.line<e.first+e.size-1?Ie(t.line+1,0):null:new Ie(t.line,t.ch+r)}function Ds(e){e.setSelection(Ie(e.firstLine(),0),Ie(e.lastLine()),Me)}function As(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=Mt(e,i)),a&&(n.to=Mt(e,a)),o&&(n.text=o),s!==void 0&&(n.origin=s)}),Se(e,"beforeChange",e,n),e.cm&&Se(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 ga(e,t,r){if(e.cm){if(!e.cm.curOp)return Tn(e.cm,ga)(e,t,r);if(e.cm.state.suppressEdits)return}if((D(e,"beforeChange")||e.cm&&D(e.cm,"beforeChange"))&&(t=As(e,t,!0),!t))return;var n=ra&&!r&&Wi(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Ls(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&kt(t.from,t.to)==0)return;var r=pa(e,t);xs(e,t,r,e.cm?e.cm.curOp.id:NaN),Ga(e,t,r,Kr(e,t));var n=[];Ti(e,function(i,a){!a&&ve(n,i.history)==-1&&(Ns(i.history,t),n.push(i.history)),Ga(i,t,null,Kr(i,t))})}function Ao(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,l=t=="undo"?i.undone:i.done,c=0;c<s.length&&!(a=s[c],r?a.ranges&&!a.equals(e.sel):!a.ranges);c++);if(c==s.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(ko(a,l),r&&!a.equals(e.sel)){Jn(e,a,{clearRedo:!1});return}o=a}else if(n){s.push(a);return}else break;var O=[];ko(o,l),l.push({changes:O,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var L=D(e,"beforeChange")||e.cm&&D(e.cm,"beforeChange"),q=function(De){var ze=a.changes[De];if(ze.origin=t,L&&!As(e,ze,!1))return s.length=0,{};O.push(es(e,ze));var Ze=De?pa(e,ze):He(s);Ga(e,ze,Ze,ws(e,ze)),!De&&e.cm&&e.cm.scrollIntoView({from:ze.from,to:Ur(ze)});var it=[];Ti(e,function(Qe,ot){!ot&&ve(it,Qe.history)==-1&&(Ns(Qe.history,ze),it.push(Qe.history)),Ga(Qe,ze,null,ws(Qe,ze))})},G=a.changes.length-1;G>=0;--G){var we=q(G);if(we)return we.v}}function Rs(e,t){if(t==0)return;if(e.first+=t,e.sel=new or(at(e.sel.ranges,function(i){return new en(Ie(i.anchor.line+t,i.anchor.ch),Ie(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){ln(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 Ga(e,t,r,n){if(e.cm&&!e.cm.curOp)return Tn(e.cm,Ga)(e,t,r,n);if(t.to.line<e.first){Rs(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);Rs(e,i),t={from:Ie(e.first,0),to:Ie(t.to.line+i,t.to.ch),text:[He(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:Ie(a,ht(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Tr(e,t.from,t.to),r||(r=pa(e,t)),e.cm?xl(e.cm,t,n):qo(e,t,n),To(e,r,Me),e.cantEdit&&Do(e,Ie(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,l=a.line;e.options.lineWrapping||(l=Jt(vt(ht(n,a.line))),n.iter(l,o.line+1,function(G){if(G==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&k(e),qo(n,t,r,xr(e)),e.options.lineWrapping||(n.iter(l,a.line+t.text.length,function(G){var we=Hn(G);we>i.maxLineLength&&(i.maxLine=G,i.maxLineLength=we,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),Ii(n,a.line),Yi(e,400);var c=t.text.length-(o.line-a.line)-1;t.full?ln(e):a.line==o.line&&t.text.length==1&&!vs(e.doc,t)?xn(e,a.line,"text"):ln(e,a.line,o.line+1,c);var O=D(e,"changes"),L=D(e,"change");if(L||O){var q={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};L&&Sn(e,"change",e,q),O&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(q)}e.display.selForContextMenu=null}function ba(e,t,r,n,i){var a;n||(n=r),kt(n,r)<0&&(a=[n,r],r=a[0],n=a[1]),typeof t=="string"&&(t=e.splitLines(t)),ga(e,{from:r,to:n,text:t,origin:i})}function Ps(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function js(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++)Ps(a.ranges[s].anchor,t,r,n),Ps(a.ranges[s].head,t,r,n);continue}for(var l=0;l<a.changes.length;++l){var c=a.changes[l];if(r<c.from.line)c.from=Ie(c.from.line+n,c.from.ch),c.to=Ie(c.to.line+n,c.to.ch);else if(t<=c.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function Ns(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;js(e.done,r,n,i),js(e.undone,r,n,i)}function $a(e,t,r,n){var i=t,a=t;return typeof t=="number"?a=ht(e,ni(e,t)):i=Jt(t),i==null?null:(n(a,i)&&e.cm&&xn(e.cm,i,r),a)}function Ya(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}Ya.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,Nn(i),Sn(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 Ja(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}Ja.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 Ya))){var s=[];this.collapse(s),this.children=[new Ya(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 l=new Ya(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++n,0,l),l.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 Ja(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=ve(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new Ja(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 Za=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};Za.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Jt(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=wi(this);mr(r,Math.max(0,r.height-a)),e&&(ir(e,function(){Is(e,r,-a),xn(e,n,"widget")}),Sn(e,"lineWidgetCleared",e,this,n))},Za.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=wi(this)-t;if(!i)return;rn(this.doc,n)||mr(n,n.height+i),r&&ir(r,function(){r.curOp.forceUpdate=!0,Is(r,n,i),Sn(r,"lineWidgetChanged",r,e,Jt(n))})},j(Za);function Is(e,t,r){dn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Fa(e,r)}function El(e,t,r,n){var i=new Za(e,r,n),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),$a(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&&!rn(e,o)){var l=dn(o)<e.scrollTop;mr(o,o.height+wi(i)),l&&Fa(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Sn(a,"lineWidgetAdded",a,i,typeof t=="number"?t:Jt(t)),i}var Us=0,Di=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};Di.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Qr(e),D(this,"clear")){var r=this.find();r&&Sn(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=Sr(o.markedSpans,this);e&&!this.collapsed?xn(e,Jt(o),"text"):e&&(s.to!=null&&(i=Jt(o)),s.from!=null&&(n=Jt(o))),o.markedSpans=oo(o.markedSpans,s),s.from==null&&this.collapsed&&!rn(this.doc,o)&&e&&mr(o,_n(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=vt(this.lines[l]),O=Hn(c);O>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=O,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&ln(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ks(e.doc)),e&&Sn(e,"markerCleared",e,this,n,i),t&&ci(e),this.parent&&this.parent.clear()},Di.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=Sr(a.markedSpans,this);if(o.from!=null&&(r=Ie(t?a:Jt(a),o.from),e==-1))return r;if(o.to!=null&&(n=Ie(t?a:Jt(a),o.to),e==1))return n}return r&&{from:r,to:n}},Di.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;ir(n,function(){var i=t.line,a=Jt(t.line),o=z(n,a);if(o&&(Ut(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!rn(r.doc,i)&&r.height!=null){var s=r.height;r.height=null;var l=wi(r)-s;l&&mr(i,i.height+l)}Sn(n,"markerChanged",n,e)})},Di.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ve(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Di.prototype.detachLine=function(e){if(this.lines.splice(ve(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},j(Di);function ya(e,t,r,n,i){if(n&&n.shared)return wl(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Tn(e.cm,ya)(e,t,r,n,i);var a=new Di(e,i),o=kt(t,r);if(n&&d(n,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=ie("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Ma(e,t.line,t,r,a)||t.line!=r.line&&Ma(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");aa()}a.addToHistory&&xs(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s=t.line,l=e.cm,c;if(e.iter(s,r.line+1,function(L){l&&a.collapsed&&!l.options.lineWrapping&&vt(L)==l.display.maxLine&&(c=!0),a.collapsed&&s!=t.line&&mr(L,0),Ui(L,new ai(a,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),a.collapsed&&e.iter(t.line,r.line+1,function(L){rn(e,L)&&mr(L,0)}),a.clearOnEnter&&Ee(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(ia(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Us,a.atomic=!0),l){if(c&&(l.curOp.updateMaxLine=!0),a.collapsed)ln(l,t.line,r.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var O=t.line;O<=r.line;O++)xn(l,O,"text");a.atomic&&ks(l.doc),Sn(l,"markerAdded",l,a)}return a}var Qa=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};Qa.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Sn(this,"clear")},Qa.prototype.find=function(e,t){return this.primary.find(e,t)},j(Qa);function wl(e,t,r,n,i){n=d(n),n.shared=!1;var a=[ya(e,t,r,n,i)],o=a[0],s=n.widgetNode;return Ti(e,function(l){s&&(n.widgetNode=s.cloneNode(!0)),a.push(ya(l,Mt(l,t),Mt(l,r),n,i));for(var c=0;c<l.linked.length;++c)if(l.linked[c].isParent)return;o=He(a)}),new Qa(a,o)}function Fs(e){return e.findMarks(Ie(e.first,0),e.clipPos(Ie(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(kt(a,o)){var s=ya(e,a,o,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function Ol(e){for(var t=function(n){var i=e[n],a=[i.primary.doc];Ti(i.primary.doc,function(l){return a.push(l)});for(var o=0;o<i.markers.length;o++){var s=i.markers[o];ve(a,s.doc)==-1&&(s.parent=null,i.markers.splice(o--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,ur=function(e,t,r,n,i){if(!(this instanceof ur))return new ur(e,t,r,n,i);r==null&&(r=0),Ja.call(this,[new Ya([new fn("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=Ie(r,0);this.sel=Ir(a),this.history=new _o(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)),qo(this,{from:a,to:a,text:e}),Jn(this,Ir(a),Me)};ur.prototype=rt(Ja.prototype,{constructor:ur,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=mi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:Dn(function(e){var t=Ie(this.first,0),r=this.first+this.size-1;ga(this,{from:t,to:Ie(r,ht(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Si(this.cm,0,0),Jn(this,Ir(t),Me)}),replaceRange:function(e,t,r,n){t=Mt(this,t),r=r?Mt(this,r):t,ba(this,e,t,r,n)},getRange:function(e,t,r){var n=Tr(this,Mt(this,e),Mt(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(Br(this,e))return ht(this,e)},getLineNumber:function(e){return Jt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ht(this,e)),vt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Mt(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:Dn(function(e,t,r){Os(this,Mt(this,typeof e=="number"?Ie(e,t||0):e),null,r)}),setSelection:Dn(function(e,t,r){Os(this,Mt(this,e),Mt(this,t||e),r)}),extendSelection:Dn(function(e,t,r){Mo(this,Mt(this,e),t&&Mt(this,t),r)}),extendSelections:Dn(function(e,t){Cs(this,ea(this,e),t)}),extendSelectionsBy:Dn(function(e,t){var r=at(this.sel.ranges,e);Cs(this,ea(this,r),t)}),setSelections:Dn(function(e,t,r){if(!e.length)return;for(var n=[],i=0;i<e.length;i++)n[i]=new en(Mt(this,e[i].anchor),Mt(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Jn(this,Or(this.cm,n,t),r)}),addSelection:Dn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new en(Mt(this,e),Mt(this,t||e))),Jn(this,Or(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=Tr(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=Tr(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:Dn(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"&&So(this,n,t),l=n.length-1;l>=0;l--)ga(this,n[l]);s?Ss(this,s):this.cm&&Oi(this.cm)}),undo:Dn(function(){Ao(this,"undo")}),redo:Dn(function(){Ao(this,"redo")}),undoSelection:Dn(function(){Ao(this,"undo",!0)}),redoSelection:Dn(function(){Ao(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 _o(this.history.maxGeneration),Ti(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:ma(this.history.done),undone:ma(this.history.undone)}},setHistory:function(e){var t=this.history=new _o(this.history.maxGeneration);t.done=ma(e.done.slice(0),null,!0),t.undone=ma(e.undone.slice(0),null,!0)},setGutterMarker:Dn(function(e,t,r){return $a(this,e,"gutter",function(n){var i=n.gutterMarkers||(n.gutterMarkers={});return i[t]=r,!r&&tt(i)&&(n.gutterMarkers=null),!0})}),clearGutter:Dn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&$a(t,r,"gutter",function(){return r.gutterMarkers[e]=null,tt(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Br(this,e))return null;if(t=e,e=ht(this,e),!e)return null}else if(t=Jt(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:Dn(function(e,t,r){return $a(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(le(r).test(n[i]))return!1;n[i]+=" "+r}return!0})}),removeLineClass:Dn(function(e,t,r){return $a(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(le(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:Dn(function(e,t,r){return El(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ya(this,Mt(this,e),Mt(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=Mt(this,e),ya(this,e,e,r,"bookmark")},findMarksAt:function(e){e=Mt(this,e);var t=[],r=ht(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=Mt(this,e),t=Mt(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 l=o[s];!(l.to!=null&&i==e.line&&e.ch>=l.to||l.from==null&&i!=e.line||l.from!=null&&i==t.line&&l.from>=t.ch)&&(!r||r(l.marker))&&n.push(l.marker.parent||l.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}),Mt(this,Ie(r,t))},indexFromPos:function(e){e=Mt(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 ur(mi(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 ur(mi(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,Fs(this)),n},unlinkDoc:function(e){if(e instanceof En&&(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),Ol(Fs(this));break}if(e.history==this.history){var n=[e.id];Ti(e,function(i){return n.push(i.id)},!0),e.history=new _o(null),e.history.done=ma(this.history.done,n),e.history.undone=ma(this.history.undone,n)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Kt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Dn(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)})}),ur.prototype.eachLine=ur.prototype.iter;var Ws=0;function _l(e){var t=this;if(Bs(t),Ke(t,e)||jr(t.display,e))return;h(e),N&&(Ws=+new Date);var r=Un(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&&Tn(t,function(){r=Mt(t.doc,r);var G={from:r,to:r,text:t.doc.splitLines(a.filter(function(we){return we!=null}).join(t.doc.lineSeparator())),origin:"paste"};ga(t.doc,G),Ss(t.doc,Ir(Mt(t.doc,r),Mt(t.doc,Ur(G))))})()},l=function(G,we){if(t.options.allowDropFileTypes&&ve(t.options.allowDropFileTypes,G.type)==-1){s();return}var De=new FileReader;De.onerror=function(){return s()},De.onload=function(){var ze=De.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ze)){s();return}a[we]=ze,s()},De.readAsText(G)},c=0;c<n.length;c++)l(n[c],c);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 O=e.dataTransfer.getData("Text");if(O){var L;if(t.state.draggingText&&!t.state.draggingText.copy&&(L=t.listSelections()),To(t.doc,Ir(r,r)),L)for(var q=0;q<L.length;++q)ba(t.doc,"",L[q].anchor,L[q].head,"drag");t.replaceSelection(O,"around","paste"),t.display.input.focus()}}catch(G){}}}function kl(e,t){if(N&&(!e.state.draggingText||+new Date-Ws<100)){x(t);return}if(Ke(e,t)||jr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Ce){var r=w("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ne&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ne&&r.parentNode.removeChild(r)}}function Ml(e,t){var r=Un(e,t);if(!r)return;var n=document.createDocumentFragment();Yr(e,r,n),e.display.dragCursor||(e.display.dragCursor=w("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),re(e.display.dragCursor,n)}function Bs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function zs(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 Hs=!1;function Tl(){if(Hs)return;Dl(),Hs=!0}function Dl(){var e;Ee(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,zs(Al)},100))}),Ee(window,"blur",function(){return zs(Ci)})}function Al(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ai={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"},qa=0;qa<10;qa++)Ai[qa+48]=Ai[qa+96]=String(qa);for(var Lo=65;Lo<=90;Lo++)Ai[Lo]=String.fromCharCode(Lo);for(var eo=1;eo<=12;eo++)Ai[eo+111]=Ai[eo+63235]="F"+eo;var hi={};hi.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"},hi.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"},hi.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"},hi.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"]},hi.default=$?hi.macDefault:hi.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Rl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var i=at(r.split(" "),Ll),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 l=t[s];if(!l)t[s]=o;else if(l!=o)throw new Error("Inconsistent bindings for "+s)}delete e[r]}for(var c in t)e[c]=t[c];return e}function xa(e,t,r,n){t=Ro(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 xa(e,t.fallthrough,r,n);for(var a=0;a<t.fallthrough.length;a++){var o=xa(e,t.fallthrough[a],r,n);if(o)return o}}}function Ks(e){var t=typeof e=="string"?e:Ai[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Vs(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ge?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ge?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Xs(e,t){if(ne&&e.keyCode==34&&e.char)return!1;var r=Ai[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),Vs(r,e,t))}function Ro(e){return typeof e=="string"?hi[e]:e}function Ea(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var a=t(r[i]);n.length&&kt(a.from,He(n).to)<=0;){var o=n.pop();if(kt(o.from,a.from)<0){a.from=o.from;break}}n.push(a)}ir(e,function(){for(var s=n.length-1;s>=0;s--)ba(e.doc,"",n[s].from,n[s].to,"+delete");Oi(e)})}function rs(e,t,r){var n=Pe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function is(e,t,r){var n=rs(e,t.ch,r);return n==null?null:new Ie(t.line,n,r<0?"after":"before")}function as(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=mt(r,t.doc.direction);if(a){var o=i<0?He(a):a[0],s=i<0==(o.level==1),l=s?"after":"before",c;if(o.level>0||t.doc.direction=="rtl"){var O=F(t,r);c=i<0?r.text.length-1:0;var L=J(t,O,c).top;c=st(function(q){return J(t,O,q).top==L},i<0==(o.level==1)?o.from:o.to-1,c),l=="before"&&(c=rs(r,c,1))}else c=i<0?o.to:o.from;return new Ie(n,c,l)}}return new Ie(n,i<0?r.text.length:0,i<0?"before":"after")}function Pl(e,t,r,n){var i=mt(t,e.doc.direction);if(!i)return is(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=et(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 is(t,r,n);var s=function(Ze,it){return rs(t,Ze instanceof Ie?Ze.ch:Ze,it)},l,c=function(Ze){return e.options.lineWrapping?(l=l||F(e,t),ft(e,t,l,Ze)):{begin:0,end:t.text.length}},O=c(r.sticky=="before"?s(r,-1):r.ch);if(e.doc.direction=="rtl"||o.level==1){var L=o.level==1==n<0,q=s(r,L?1:-1);if(q!=null&&(L?q<=o.to&&q<=O.end:q>=o.from&&q>=O.begin)){var G=L?"before":"after";return new Ie(r.line,q,G)}}var we=function(Ze,it,Qe){for(var ot=function(pn,Kn){return Kn?new Ie(r.line,s(pn,1),"before"):new Ie(r.line,pn,"after")};Ze>=0&&Ze<i.length;Ze+=it){var _t=i[Ze],yt=it>0==(_t.level!=1),Wt=yt?Qe.begin:s(Qe.end,-1);if(_t.from<=Wt&&Wt<_t.to)return ot(Wt,yt);if(Wt=yt?_t.from:s(_t.to,-1),Qe.begin<=Wt&&Wt<Qe.end)return ot(Wt,yt)}},De=we(a+n,n,O);if(De)return De;var ze=n>0?O.end:s(O.begin,-1);return ze!=null&&!(n>0&&ze==t.text.length)&&(De=we(n>0?0:i.length-1,n,c(ze)),De)?De:null}var to={selectAll:Ds,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Me)},killLine:function(e){return Ea(e,function(t){if(t.empty()){var r=ht(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:Ie(t.head.line+1,0)}:{from:t.head,to:Ie(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ea(e,function(t){return{from:Ie(t.from().line,0),to:Mt(e.doc,Ie(t.to().line+1,0))}})},delLineLeft:function(e){return Ea(e,function(t){return{from:Ie(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ea(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 Ea(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(Ie(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ie(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Gs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return $s(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return jl(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")},ke)},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")},ke)},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/)?$s(e,t.head):n},ke)},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=W(e.getLine(a.line),a.ch,n);t.push(X(n-o%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ir(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=ht(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new Ie(i.line,i.ch-1)),i.ch>0)i=new Ie(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),Ie(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=ht(e.doc,i.line-1).text;o&&(i=new Ie(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),Ie(i.line-1,o.length-1),i,"+transpose"))}}r.push(new en(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return ir(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);Oi(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Gs(e,t){var r=ht(e.doc,t),n=vt(r);return n!=r&&(t=Jt(n)),as(!0,e,n,t,1)}function jl(e,t){var r=ht(e.doc,t),n=Dt(r);return n!=r&&(t=Jt(n)),as(!0,e,r,t,-1)}function $s(e,t){var r=Gs(e,t.line),n=ht(e.doc,r.line),i=mt(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 Ie(r.line,o?0:a,r.sticky)}return r}function Po(e,t,r){if(typeof t=="string"&&(t=to[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)!=qe}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function Nl(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=xa(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&xa(t,e.options.extraKeys,r,e)||xa(t,e.options.keyMap,r,e)}var Il=new pe;function no(e,t,r,n){var i=e.state.keySeq;if(i){if(Ks(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())}),Ys(e,i+" "+t,r,n))return!0}return Ys(e,t,r,n)}function Ys(e,t,r,n){var i=Nl(e,t,n);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Sn(e,"keyHandled",e,t,r),(i=="handled"||i=="multi")&&(h(r),Fn(e)),!!i}function Js(e,t){var r=Xs(t,!0);return r?t.shiftKey&&!e.state.keySeq?no(e,"Shift-"+r,t,function(n){return Po(e,n,!0)})||no(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Po(e,n)}):no(e,r,t,function(n){return Po(e,n)}):!1}function Ul(e,t,r){return no(e,"'"+r+"'",t,function(n){return Po(e,n,!0)})}var os=null;function Zs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=ue(),Ke(t,e))return;N&&U<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=Js(t,e);ne&&(os=n?r:null,!n&&r==88&&!Mn&&($?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),te&&!$&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;xe(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(se(t,"CodeMirror-crosshair"),ct(document,"keyup",r),ct(document,"mouseover",r))}Ee(document,"keyup",r),Ee(document,"mouseover",r)}function Qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(jr(t.display,e)||Ke(t,e)||e.ctrlKey&&!e.altKey||$&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(ne&&r==os){os=null,h(e);return}if(ne&&(!e.which||e.which<10)&&Js(t,e))return;var i=String.fromCharCode(n==null?r:n);if(i=="\b")return;if(Ul(t,e,i))return;t.display.input.onKeyPress(e)}var Wl=400,ss=function(e,t,r){this.time=e,this.pos=t,this.button=r};ss.prototype.compare=function(e,t,r){return this.time+Wl>e&&kt(t,this.pos)==0&&r==this.button};var ro,io;function Bl(e,t){var r=+new Date;return io&&io.compare(r,e,t)?(ro=io=null,"triple"):ro&&ro.compare(r,e,t)?(io=new ss(r,e,t),ro=null,"double"):(ro=new ss(r,e,t),io=null,"single")}function el(e){var t=this,r=t.display;if(Ke(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,jr(r,e)){A||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(ls(t,e))return;var n=Un(t,e),i=de(e),a=n?Bl(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?Kl(t,n,a,e):Y(e)==r.scroller&&h(e):i==2?(n&&Mo(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(Te?t.display.input.onContextMenu(e):Na(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,no(e,Vs(a,i),i,function(o){if(typeof o=="string"&&(o=to[o]),!o)return!1;var s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=o(e,r)!=qe}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=me?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=$?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!($?r.altKey:r.ctrlKey)),i}function Kl(e,t,r,n){N?setTimeout(E(go,e),0):e.curOp.focus=ue();var i=Hl(e,r,n),a=e.doc.sel,o;e.options.dragDrop&&Ae&&!e.isReadOnly()&&r=="single"&&(o=a.contains(t))>-1&&(kt((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(kt(o.to(),t)>0||t.xRel<0)?Vl(e,n,t,i):Xl(e,n,t,i)}function Vl(e,t,r,n){var i=e.display,a=!1,o=Tn(e,function(c){A&&(i.scroller.draggable=!1),e.state.draggingText=!1,ct(i.wrapper.ownerDocument,"mouseup",o),ct(i.wrapper.ownerDocument,"mousemove",s),ct(i.scroller,"dragstart",l),ct(i.scroller,"drop",o),a||(h(c),n.addNew||Mo(e.doc,r,null,null,n.extend),A&&!Ce||N&&U==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),s=function(c){a=a||Math.abs(t.clientX-c.clientX)+Math.abs(t.clientY-c.clientY)>=10},l=function(){return a=!0};A&&(i.scroller.draggable=!0),e.state.draggingText=o,o.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),Ee(i.wrapper.ownerDocument,"mouseup",o),Ee(i.wrapper.ownerDocument,"mousemove",s),Ee(i.scroller,"dragstart",l),Ee(i.scroller,"drop",o),Na(e),setTimeout(function(){return i.input.focus()},20)}function tl(e,t,r){if(r=="char")return new en(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new en(Ie(t.line,0),Mt(e.doc,Ie(t.line+1,0)));var n=r(e,t);return new en(n.from,n.to)}function Xl(e,t,r,n){var i=e.display,a=e.doc;h(t);var o,s,l=a.sel,c=l.ranges;if(n.addNew&&!n.extend?(s=a.sel.contains(r),s>-1?o=c[s]:o=new en(r,r)):(o=a.sel.primary(),s=a.sel.primIndex),n.unit=="rectangle")n.addNew||(o=new en(r,r)),r=Un(e,t,!0,!0),s=-1;else{var O=tl(e,r,n.unit);n.extend?o=ts(o,O.anchor,O.head,n.extend):o=O}n.addNew?s==-1?(s=c.length,Jn(a,Or(e,c.concat([o]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&n.unit=="char"&&!n.extend?(Jn(a,Or(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=a.sel):ns(a,s,o,Ve):(s=0,Jn(a,new or([o],0),Ve),l=a.sel);var L=r;function q(Qe){if(kt(L,Qe)==0)return;if(L=Qe,n.unit=="rectangle"){for(var ot=[],_t=e.options.tabSize,yt=W(ht(a,r.line).text,r.ch,_t),Wt=W(ht(a,Qe.line).text,Qe.ch,_t),pn=Math.min(yt,Wt),Kn=Math.max(yt,Wt),Cn=Math.min(r.line,Qe.line),gr=Math.min(e.lastLine(),Math.max(r.line,Qe.line));Cn<=gr;Cn++){var cr=ht(a,Cn).text,Rn=Re(cr,pn,_t);pn==Kn?ot.push(new en(Ie(Cn,Rn),Ie(Cn,Rn))):cr.length>Rn&&ot.push(new en(Ie(Cn,Rn),Ie(Cn,Re(cr,Kn,_t))))}ot.length||ot.push(new en(r,r)),Jn(a,Or(e,l.ranges.slice(0,s).concat(ot),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Qe)}else{var dr=o,Gn=tl(e,Qe,n.unit),zn=dr.anchor,Pn;kt(Gn.anchor,zn)>0?(Pn=Gn.head,zn=Ar(dr.from(),Gn.anchor)):(Pn=Gn.anchor,zn=gi(dr.to(),Gn.head));var kn=l.ranges.slice(0);kn[s]=Gl(e,new en(Mt(a,zn),Pn)),Jn(a,Or(e,kn,s),Ve)}}var G=i.wrapper.getBoundingClientRect(),we=0;function De(Qe){var ot=++we,_t=Un(e,Qe,!0,n.unit=="rectangle");if(!_t)return;if(kt(_t,L)!=0){e.curOp.focus=ue(),q(_t);var yt=sa(i,a);(_t.line>=yt.to||_t.line<yt.from)&&setTimeout(Tn(e,function(){we==ot&&De(Qe)}),150)}else{var Wt=Qe.clientY<G.top?-20:Qe.clientY>G.bottom?20:0;Wt&&setTimeout(Tn(e,function(){if(we!=ot)return;i.scroller.scrollTop+=Wt,De(Qe)}),50)}}function ze(Qe){e.state.selectingText=!1,we=Infinity,Qe&&(h(Qe),i.input.focus()),ct(i.wrapper.ownerDocument,"mousemove",Ze),ct(i.wrapper.ownerDocument,"mouseup",it),a.history.lastSelOrigin=null}var Ze=Tn(e,function(Qe){Qe.buttons===0||!de(Qe)?ze(Qe):De(Qe)}),it=Tn(e,ze);e.state.selectingText=it,Ee(i.wrapper.ownerDocument,"mousemove",Ze),Ee(i.wrapper.ownerDocument,"mouseup",it)}function Gl(e,t){var r=t.anchor,n=t.head,i=ht(e.doc,r.line);if(kt(r,n)==0&&r.sticky==n.sticky)return t;var a=mt(i);if(!a)return t;var o=et(a,r.ch,r.sticky),s=a[o];if(s.from!=r.ch&&s.to!=r.ch)return t;var l=o+(s.from==r.ch==(s.level!=1)?0:1);if(l==0||l==a.length)return t;var c;if(n.line!=r.line)c=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var O=et(a,n.ch,n.sticky),L=O-o||(n.ch-r.ch)*(s.level==1?-1:1);O==l-1||O==l?c=L<0:c=L>0}var q=a[l+(c?-1:0)],G=c==(q.level==1),we=G?q.from:q.to,De=G?"after":"before";return r.ch==we&&r.sticky==De?t:new en(new Ie(r.line,we,De),n)}function nl(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(q){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&h(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!D(e,r))return b(t);a-=s.top-o.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=o.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i){var O=Dr(e.doc,a),L=e.display.gutterSpecs[l];return Se(e,r,e,O,L.className,t),b(t)}}}function ls(e,t){return nl(e,t,"gutterClick",!0)}function rl(e,t){if(jr(e.display,t)||$l(e,t))return;if(Ke(e,t,"contextmenu"))return;Te||e.display.input.onContextMenu(t)}function $l(e,t){return D(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function il(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),jt(e)}var wa={toString:function(){return"CodeMirror.Init"}},al={},jo={};function Yl(e){var t=e.optionHandlers;function r(n,i,a,o){e.defaults[n]=i,a&&(t[n]=o?function(s,l,c){c!=wa&&a(s,l,c)}:a)}e.defineOption=r,e.Init=wa,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,fi(n)},!0),r("indentUnit",2,fi,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Xa(n),jt(n),ln(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(l){for(var c=0;;){var O=l.text.indexOf(i,c);if(O==-1)break;c=O+i.length,a.push(Ie(o,O))}o++});for(var s=a.length-1;s>=0;s--)ba(n.doc,i,a[s],Ie(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!=wa&&n.refresh()}),r("specialCharPlaceholder",Ta,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",K?"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",!Le),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){il(n),Nr(n)},!0),r("keyMap","default",function(n,i,a){var o=Ro(i),s=a!=wa&&Ro(a);s&&s.detach&&s.detach(n,o),o.attach&&o.attach(n,s||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=ar(i,n.options.lineNumbers),Nr(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?Yn(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return ui(n)},!0),r("scrollbarStyle","native",function(n){ca(n),ui(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=ar(n.options.gutters,i),Nr(n)},!0),r("firstLineNumber",1,Nr,!0),r("lineNumberFormatter",function(n){return n},Nr,!0),r("showCursorWhenSelecting",!1,on,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(Ci(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,on,!0),r("singleCursorHeightPerLine",!0,on,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Xa,!0),r("addModeClass",!1,Xa,!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,Xa,!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!=wa;if(!t!=!n){var i=e.display.dragFunctions,a=t?Ee:ct;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(xe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(se(e.display.wrapper,"CodeMirror-wrap"),vr(e)),rr(e),ln(e),jt(e),setTimeout(function(){return ui(e)},100)}function En(e,t){var r=this;if(!(this instanceof En))return new En(e,t);this.options=t=t?d(t):{},d(al,t,!1);var n=t.value;typeof n=="string"?n=new ur(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new En.inputStyles[t.inputStyle](this),a=this.display=new Zi(e,n,i,t);a.wrapper.CodeMirror=this,il(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ca(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 pe,keySeq:null,specialChars:null},t.autofocus&&!K&&a.input.focus(),N&&U<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Ql(this),Tl(),Qr(this),this.curOp.forceUpdate=!0,gs(this,n),t.autofocus&&!K||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Jr(r)},20):Ci(this);for(var o in jo)jo.hasOwnProperty(o)&&jo[o](this,t[o],wa);Wn(this),t.finishInit&&t.finishInit(this);for(var s=0;s<us.length;++s)us[s](this);ci(this),A&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}En.defaults=al,En.optionHandlers=jo;function Ql(e){var t=e.display;Ee(t.scroller,"mousedown",Tn(e,el)),N&&U<11?Ee(t.scroller,"dblclick",Tn(e,function(l){if(Ke(e,l))return;var c=Un(e,l);if(!c||ls(e,l)||jr(e.display,l))return;h(l);var O=e.findWordAt(c);Mo(e.doc,O.anchor,O.head)})):Ee(t.scroller,"dblclick",function(l){return Ke(e,l)||h(l)}),Ee(t.scroller,"contextmenu",function(l){return rl(e,l)}),Ee(t.input.getField(),"contextmenu",function(l){t.scroller.contains(l.target)||rl(e,l)});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(l){if(l.touches.length!=1)return!1;var c=l.touches[0];return c.radiusX<=1&&c.radiusY<=1}function o(l,c){if(c.left==null)return!0;var O=c.left-l.left,L=c.top-l.top;return O*O+L*L>20*20}Ee(t.scroller,"touchstart",function(l){if(!Ke(e,l)&&!a(l)&&!ls(e,l)){t.input.ensurePolled(),clearTimeout(r);var c=+new Date;t.activeTouch={start:c,moved:!1,prev:c-n.end<=300?n:null},l.touches.length==1&&(t.activeTouch.left=l.touches[0].pageX,t.activeTouch.top=l.touches[0].pageY)}}),Ee(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ee(t.scroller,"touchend",function(l){var c=t.activeTouch;if(c&&!jr(t,l)&&c.left!=null&&!c.moved&&new Date-c.start<300){var O=e.coordsChar(t.activeTouch,"page"),L;!c.prev||o(c,c.prev)?L=new en(O,O):!c.prev.prev||o(c,c.prev.prev)?L=e.findWordAt(O):L=new en(Ie(O.line,0),Mt(e.doc,Ie(O.line+1,0))),e.setSelection(L.anchor,L.head),e.focus(),h(l)}i()}),Ee(t.scroller,"touchcancel",i),Ee(t.scroller,"scroll",function(){t.scroller.clientHeight&&(_i(e,t.scroller.scrollTop),wr(e,t.scroller.scrollLeft,!0),Se(e,"scroll",e))}),Ee(t.scroller,"mousewheel",function(l){return Ka(e,l)}),Ee(t.scroller,"DOMMouseScroll",function(l){return Ka(e,l)}),Ee(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(l){Ke(e,l)||x(l)},over:function(l){Ke(e,l)||(Ml(e,l),x(l))},start:function(l){return kl(e,l)},drop:Tn(e,_l),leave:function(l){Ke(e,l)||Bs(e)}};var s=t.input.getField();Ee(s,"keyup",function(l){return Qs.call(e,l)}),Ee(s,"keydown",Tn(e,Zs)),Ee(s,"keypress",Tn(e,qs)),Ee(s,"focus",function(l){return Jr(e,l)}),Ee(s,"blur",function(l){return Ci(e,l)})}var us=[];En.defineInitHook=function(e){return us.push(e)};function ao(e,t,r,n){var i=e.doc,a;r==null&&(r="add"),r=="smart"&&(i.mode.indent?a=tr(e,t).state:r="prev");var o=e.options.tabSize,s=ht(i,t),l=W(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var c=s.text.match(/^\s*/)[0],O;if(!n&&!/\S/.test(s.text))O=0,r="not";else if(r=="smart"&&(O=i.mode.indent(a,s.text.slice(c.length),s.text),O==qe||O>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?O=W(ht(i,t-1).text,null,o):O=0:r=="add"?O=l+e.options.indentUnit:r=="subtract"?O=l-e.options.indentUnit:typeof r=="number"&&(O=l+r),O=Math.max(0,O);var L="",q=0;if(e.options.indentWithTabs)for(var G=Math.floor(O/o);G;--G)q+=o,L+=" ";if(q<O&&(L+=X(O-q)),L!=c)return ba(i,L,Ie(t,0),Ie(t,c.length),"+input"),s.stateAfter=null,!0;for(var we=0;we<i.sel.ranges.length;we++){var De=i.sel.ranges[we];if(De.head.line==t&&De.head.ch<c.length){var ze=Ie(t,c.length);ns(i,we,new en(ze,ze));break}}}var Fr=null;function No(e){Fr=e}function cs(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,l=Kt(t),c=null;if(s&&n.ranges.length>1)if(Fr&&Fr.text.join(`
`)==t){if(n.ranges.length%Fr.text.length==0){c=[];for(var O=0;O<Fr.text.length;O++)c.push(a.splitLines(Fr.text[O]))}}else l.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(c=at(l,function(Ze){return[Ze]}));for(var L=e.curOp.updateInput,q=n.ranges.length-1;q>=0;q--){var G=n.ranges[q],we=G.from(),De=G.to();G.empty()&&(r&&r>0?we=Ie(we.line,we.ch-r):e.state.overwrite&&!s?De=Ie(De.line,Math.min(ht(a,De.line).text.length,De.ch+He(l).length)):s&&Fr&&Fr.lineWise&&Fr.text.join(`
`)==l.join(`
`)&&(we=De=Ie(we.line,0)));var ze={from:we,to:De,text:c?c[q%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>o?"cut":"+input")};ga(e.doc,ze),Sn(e,"inputRead",e,ze)}t&&!s&&sl(e,t),Oi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=L),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ol(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&ir(t,function(){return cs(t,r,0,null,"paste")}),!0}function sl(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=ao(e,i.head.line,"smart");break}}else a.electricInput&&(a.electricInput.test(ht(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=ao(e,i.head.line,"smart")));o&&Sn(e,"electricInput",e,i.head.line)}}function ll(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:Ie(i,0),head:Ie(i+1,0)};r.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:r}}function ul(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=w("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=w("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return A?e.style.width="1000px":e.setAttribute("wrap","off"),T&&(e.style.border="1px solid black"),ul(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)&&Tn(this,t[n])(this,i,o),Se(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"](Ro(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:Xn(function(n,i){var a=n.token?n:e.getMode(this.options,n);if(a.startState)throw new Error("Overlays may not be stateful.");pt(this.state.overlays,{mode:a,modeSpec:n,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,ln(this)}),removeOverlay:Xn(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++,ln(this);return}}}),indentLine:Xn(function(n,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Br(this.doc,n)&&ao(this,n,i,a)}),indentSelection:Xn(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&&(ao(this,s.head.line,n,!0),a=s.head.line,o==this.doc.sel.primIndex&&Oi(this));else{var l=s.from(),c=s.to(),O=Math.max(a,l.line);a=Math.min(this.lastLine(),c.line-(c.ch?0:1))+1;for(var L=O;L<a;++L)ao(this,L,n);var q=this.doc.sel.ranges;l.ch==0&&i.length==q.length&&q[o].from().ch>0&&ns(this.doc,o,new en(l,q[o].to()),Me)}}}),getTokenAt:function(n,i){return Rr(this,n,i)},getLineTokens:function(n,i){return Rr(this,Ie(n),i,!0)},getTokenTypeAt:function(n){n=Mt(this.doc,n);var i=Pi(this,ht(this.doc,n.line)),a=0,o=(i.length-1)/2,s=n.ch,l;if(s==0)l=i[2];else for(;;){var c=a+o>>1;if((c?i[c*2-1]:0)>=s)o=c;else if(i[c*2+1]<s)a=c+1;else{l=i[c*2+2];break}}var O=l?l.indexOf("overlay "):-1;return O<0?l:O==0?null:l.slice(0,O-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 l=0;l<s[i].length;l++){var c=o[s[i][l]];c&&a.push(c)}else s.helperType&&o[s.helperType]?a.push(o[s.helperType]):o[s.name]&&a.push(o[s.name]);for(var O=0;O<o._global.length;O++){var L=o._global[O];L.pred(s,this)&&ve(a,L.val)==-1&&a.push(L.val)}return a},getStateAfter:function(n,i){var a=this.doc;return n=ni(a,n==null?a.first+a.size-1:n),tr(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=Mt(this.doc,n):a=n?o.from():o.to(),zt(this,a,i||"page")},charCoords:function(n,i){return vn(this,Mt(this.doc,n),i||"page")},coordsChar:function(n,i){return n=Bt(this,n,i||"page"),Ht(this,n.left,n.top)},lineAtHeight:function(n,i){return n=Bt(this,{top:n,left:0},i||"page").top,Dr(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,i,a){var o=!1,s;if(typeof n=="number"){var l=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>l&&(n=l,o=!0),s=ht(this.doc,n)}else s=n;return Xt(this,s,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-dn(s):0)},defaultTextHeight:function(){return _n(this.display)},defaultCharWidth:function(){return In(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,a,o,s){var l=this.display;n=zt(this,Mt(this.doc,n));var c=n.bottom,O=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),l.sizer.appendChild(i),o=="over")c=n.top;else if(o=="above"||o=="near"){var L=Math.max(l.wrapper.clientHeight,this.doc.height),q=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);(o=="above"||n.bottom+i.offsetHeight>L)&&n.top>i.offsetHeight?c=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=L&&(c=n.bottom),O+i.offsetWidth>q&&(O=q-i.offsetWidth)}i.style.top=c+"px",i.style.left=i.style.right="",s=="right"?(O=l.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(s=="left"?O=0:s=="middle"&&(O=(l.sizer.clientWidth-i.offsetWidth)/2),i.style.left=O+"px"),a&&bo(this,{left:O,top:c,right:O+i.offsetWidth,bottom:c+i.offsetHeight})},triggerOnKeyDown:Xn(Zs),triggerOnKeyPress:Xn(qs),triggerOnKeyUp:Qs,triggerOnMouseDown:Xn(el),execCommand:function(n){if(to.hasOwnProperty(n))return to[n].call(null,this)},triggerElectric:Xn(function(n){sl(this,n)}),findPosH:function(n,i,a,o){var s=1;i<0&&(s=-1,i=-i);for(var l=Mt(this.doc,n),c=0;c<i&&!(l=ds(this.doc,l,s,a,o),l.hitSide);++c);return l},moveH:Xn(function(n,i){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?ds(a.doc,o.head,n,i,a.options.rtlMoveVisually):n<0?o.from():o.to()},ke)}),deleteH:Xn(function(n,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):Ea(this,function(s){var l=ds(o,s.head,n,i,!1);return n<0?{from:l,to:s.head}:{from:s.head,to:l}})}),findPosV:function(n,i,a,o){var s=1,l=o;i<0&&(s=-1,i=-i);for(var c=Mt(this.doc,n),O=0;O<i;++O){var L=zt(this,c,"div");if(l==null?l=L.left:L.left=l,c=dl(this,L,s,a),c.hitSide)break}return c},moveV:Xn(function(n,i){var a=this,o=this.doc,s=[],l=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(O){if(l)return n<0?O.from():O.to();var L=zt(a,O.head,"div");O.goalColumn!=null&&(L.left=O.goalColumn),s.push(L.left);var q=dl(a,L,n,i);return i=="page"&&O==o.sel.primary()&&Fa(a,vn(a,q,"div").top-L.top),q},ke),s.length)for(var c=0;c<o.sel.ranges.length;c++)o.sel.ranges[c].goalColumn=s[c]}),findWordAt:function(n){var i=this.doc,a=ht(i,n.line).text,o=n.ch,s=n.ch;if(a){var l=this.getHelper(n,"wordChars");(n.sticky=="before"||s==a.length)&&o?--o:++s;for(var c=a.charAt(o),O=$e(c,l)?function(L){return $e(L,l)}:/\s/.test(c)?function(L){return/\s/.test(L)}:function(L){return!/\s/.test(L)&&!$e(L)};o>0&&O(a.charAt(o-1));)--o;for(;s<a.length&&O(a.charAt(s));)++s}return new en(Ie(n.line,o),Ie(n.line,s))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?xe(this.display.cursorDiv,"CodeMirror-overwrite"):se(this.display.cursorDiv,"CodeMirror-overwrite"),Se(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==ue()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Xn(function(n,i){Si(this,n,i)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-B(this)-this.display.barHeight,width:n.scrollWidth-B(this)-this.display.barWidth,clientHeight:u(this),clientWidth:C(this)}},scrollIntoView:Xn(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:Ie(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?Go(this,n):Gi(this,n.from,n.to,n.margin)}),setSize:Xn(function(n,i){var a=this,o=function(l){return typeof l=="number"||/^\d+$/.test(String(l))?l+"px":l};n!=null&&(this.display.wrapper.style.width=o(n)),i!=null&&(this.display.wrapper.style.height=o(i)),this.options.lineWrapping&&Lt(this);var s=this.display.viewFrom;this.doc.iter(s,this.display.viewTo,function(l){if(l.widgets){for(var c=0;c<l.widgets.length;c++)if(l.widgets[c].noHScroll){xn(a,s,"widget");break}}++s}),this.curOp.forceUpdate=!0,Se(this,"refresh",this)}),operation:function(n){return ir(this,n)},startOperation:function(){return Qr(this)},endOperation:function(){return ci(this)},refresh:Xn(function(){var n=this.display.cachedTextHeight;ln(this),this.curOp.forceUpdate=!0,jt(this),Si(this,this.doc.scrollLeft,this.doc.scrollTop),fa(this.display),(n==null||Math.abs(n-_n(this.display))>.5||this.options.lineWrapping)&&rr(this),Se(this,"refresh",this)}),swapDoc:Xn(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),gs(this,n),jt(this),this.display.input.reset(),Si(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Sn(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}},j(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 ds(e,t,r,n,i){var a=t,o=r,s=ht(e,t.line),l=i&&e.direction=="rtl"?-r:r;function c(){var it=t.line+l;return it<e.first||it>=e.first+e.size?!1:(t=new Ie(it,t.ch,t.sticky),s=ht(e,it))}function O(it){var Qe;if(n=="codepoint"){var ot=s.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ot)?Qe=null:Qe=new Ie(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(ot>=55296&&ot<56320?2:1))),-r)}else i?Qe=Pl(e.cm,s,t,r):Qe=is(s,t,r);if(Qe==null)if(!it&&c())t=as(i,e.cm,s,t.line,l);else return!1;else t=Qe;return!0}if(n=="char"||n=="codepoint")O();else if(n=="column")O(!0);else if(n=="word"||n=="group")for(var L=null,q=n=="group",G=e.cm&&e.cm.getHelper(t,"wordChars"),we=!0;!(r<0&&!O(!we));we=!1){var De=s.text.charAt(t.ch)||`
`,ze=$e(De,G)?"w":q&&De==`
`?"n":!q||/\s/.test(De)?null:"p";if(q&&!we&&!ze&&(ze="s"),L&&L!=ze){r<0&&(r=1,O(),t.sticky="after");break}if(ze&&(L=ze),r>0&&!O(!we))break}var Ze=Do(e,t,a,o,!0);return Xe(a,Ze)&&(Ze.hitSide=!0),Ze}function dl(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),l=Math.max(s-.5*_n(e.display),3);o=(r>0?t.bottom:t.top)+r*l}else n=="line"&&(o=r>0?t.bottom+3:t.top-3);for(var c;!(c=Ht(e,a,o),!c.outside);){if(r<0?o<=0:o>=i.height){c.hitSide=!0;break}o+=r*5}return c}var un=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new pe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};un.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;ul(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function a(s){for(var l=s.target;l;l=l.parentNode){if(l==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(l.className))break}return!1}Ee(i,"paste",function(s){if(!a(s)||Ke(n,s)||ol(s,n))return;U<=11&&setTimeout(Tn(n,function(){return t.updateFromDOM()}),20)}),Ee(i,"compositionstart",function(s){t.composing={data:s.data,done:!1}}),Ee(i,"compositionupdate",function(s){t.composing||(t.composing={data:s.data,done:!1})}),Ee(i,"compositionend",function(s){t.composing&&(s.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ee(i,"touchstart",function(){return r.forceCompositionEnd()}),Ee(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(s){if(!a(s)||Ke(n,s))return;if(n.somethingSelected())No({lineWise:!1,text:n.getSelections()}),s.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var l=ll(n);No({lineWise:!0,text:l.text}),s.type=="cut"&&n.operation(function(){n.setSelections(l.ranges,0,Me),n.replaceSelection("",null,"cut")})}else return;if(s.clipboardData){s.clipboardData.clearData();var c=Fr.text.join(`
`);if(s.clipboardData.setData("Text",c),s.clipboardData.getData("Text")==c){s.preventDefault();return}}var O=cl(),L=O.firstChild;n.display.lineSpace.insertBefore(O,n.display.lineSpace.firstChild),L.value=Fr.text.join(`
`);var q=document.activeElement;Be(L),setTimeout(function(){n.display.lineSpace.removeChild(O),q.focus(),q==i&&r.showPrimarySelection()},50)}Ee(i,"copy",o),Ee(i,"cut",o)},un.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},un.prototype.prepareSelection=function(){var e=Mr(this.cm,!1);return e.focus=document.activeElement==this.div,e},un.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},un.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},un.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=Io(t,e.anchorNode,e.anchorOffset),o=Io(t,e.focusNode,e.focusOffset);if(a&&!a.bad&&o&&!o.bad&&kt(Ar(a,o),n)==0&&kt(gi(a,o),i)==0)return;var s=t.display.view,l=n.line>=t.display.viewFrom&&fl(t,n)||{node:s[0].measure.map[2],offset:0},c=i.line<t.display.viewTo&&fl(t,i);if(!c){var O=s[s.length-1].measure,L=O.maps?O.maps[O.maps.length-1]:O.map;c={node:L[L.length-1],offset:L[L.length-2]-L[L.length-3]}}if(!l||!c){e.removeAllRanges();return}var q=e.rangeCount&&e.getRangeAt(0),G;try{G=Z(l.node,l.offset,c.offset,c.node)}catch(we){}G&&(!te&&t.state.focused?(e.collapse(l.node,l.offset),G.collapsed||(e.removeAllRanges(),e.addRange(G))):(e.removeAllRanges(),e.addRange(G)),q&&e.anchorNode==null?e.addRange(q):te&&this.startGracePeriod()),this.rememberSelection()},un.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)},un.prototype.showMultipleSelections=function(e){re(this.cm.display.cursorDiv,e.cursors),re(this.cm.display.selectionDiv,e.selection)},un.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},un.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},un.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},un.prototype.blur=function(){this.div.blur()},un.prototype.getField=function(){return this.div},un.prototype.supportsTouch=function(){return!0},un.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ir(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)},un.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},un.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(R&&ee&&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=Io(t,e.anchorNode,e.anchorOffset),n=Io(t,e.focusNode,e.focusOffset);r&&n&&ir(t,function(){Jn(t.doc,Ir(r,n),Me),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},un.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=Ie(n.line-1,ht(e.doc,n.line-1).length)),i.ch==ht(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=Ie(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;n.line==t.viewFrom||(a=hn(e,n.line))==0?(o=Jt(t.view[0].line),s=t.view[0].node):(o=Jt(t.view[a].line),s=t.view[a-1].node.nextSibling);var l=hn(e,i.line),c,O;if(l==t.view.length-1?(c=t.viewTo-1,O=t.lineDiv.lastChild):(c=Jt(t.view[l+1].line)-1,O=t.view[l+1].node.previousSibling),!s)return!1;for(var L=e.doc.splitLines(tu(e,s,O,o,c)),q=Tr(e.doc,Ie(o,0),Ie(c,ht(e.doc,c).text.length));L.length>1&&q.length>1;)if(He(L)==He(q))L.pop(),q.pop(),c--;else if(L[0]==q[0])L.shift(),q.shift(),o++;else break;for(var G=0,we=0,De=L[0],ze=q[0],Ze=Math.min(De.length,ze.length);G<Ze&&De.charCodeAt(G)==ze.charCodeAt(G);)++G;for(var it=He(L),Qe=He(q),ot=Math.min(it.length-(L.length==1?G:0),Qe.length-(q.length==1?G:0));we<ot&&it.charCodeAt(it.length-we-1)==Qe.charCodeAt(Qe.length-we-1);)++we;if(L.length==1&&q.length==1&&o==n.line)for(;G&&G>n.ch&&it.charCodeAt(it.length-we-1)==Qe.charCodeAt(Qe.length-we-1);)G--,we++;L[L.length-1]=it.slice(0,it.length-we).replace(/^\u200b+/,""),L[0]=L[0].slice(G).replace(/\u200b+$/,"");var _t=Ie(o,G),yt=Ie(c,q.length?He(q).length-we:0);if(L.length>1||L[0]||kt(_t,yt))return ba(e.doc,L,_t,yt,"+input"),!0},un.prototype.ensurePolled=function(){this.forceCompositionEnd()},un.prototype.reset=function(){this.forceCompositionEnd()},un.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},un.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)},un.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ir(this.cm,function(){return ln(e.cm)})},un.prototype.setUneditable=function(e){e.contentEditable="false"},un.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Tn(this.cm,cs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},un.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},un.prototype.onContextMenu=function(){},un.prototype.resetPosition=function(){},un.prototype.needsContentAttribute=!0;function fl(e,t){var r=z(e,t.line);if(!r||r.hidden)return null;var n=ht(e.doc,t.line),i=f(r,n,t.line),a=mt(n,e.doc.direction),o="left";if(a){var s=et(a,t.ch);o=s%2?"right":"left"}var l=We(i.map,t.ch,o);return l.offset=l.collapse=="right"?l.end:l.start,l}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Ca(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,i){var a="",o=!1,s=e.doc.lineSeparator(),l=!1;function c(G){return function(we){return we.id==G}}function O(){o&&(a+=s,l&&(a+=s),o=l=!1)}function L(G){G&&(O(),a+=G)}function q(G){if(G.nodeType==1){var we=G.getAttribute("cm-text");if(we){L(we);return}var De=G.getAttribute("cm-marker"),ze;if(De){var Ze=e.findMarks(Ie(n,0),Ie(i+1,0),c(+De));Ze.length&&(ze=Ze[0].find(0))&&L(Tr(e.doc,ze.from,ze.to).join(s));return}if(G.getAttribute("contenteditable")=="false")return;var it=/^(pre|div|p|li|table|br)$/i.test(G.nodeName);if(!/^br$/i.test(G.nodeName)&&G.textContent.length==0)return;it&&O();for(var Qe=0;Qe<G.childNodes.length;Qe++)q(G.childNodes[Qe]);/^(pre|p)$/i.test(G.nodeName)&&(l=!0),it&&(o=!0)}else G.nodeType==3&&L(G.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(q(t),t==r);)t=t.nextSibling,l=!1;return a}function Io(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Ca(e.clipPos(Ie(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||!_(n,t))return Ca(Ie(Jt(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var a=e.rest?He(e.rest):e.line;return Ca(Ie(Jt(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 l=e.measure,c=l.maps;function O(ze,Ze,it){for(var Qe=-1;Qe<(c?c.length:0);Qe++)for(var ot=Qe<0?l.map:c[Qe],_t=0;_t<ot.length;_t+=3){var yt=ot[_t+2];if(yt==ze||yt==Ze){var Wt=Jt(Qe<0?e.line:e.rest[Qe]),pn=ot[_t]+it;return(it<0||yt!=ze)&&(pn=ot[_t+(it?1:0)]),Ie(Wt,pn)}}}var L=O(o,s,r);if(L)return Ca(L,i);for(var q=s.nextSibling,G=o?o.nodeValue.length-r:0;q;q=q.nextSibling){if(L=O(q,q.firstChild,0),L)return Ca(Ie(L.line,L.ch-G),i);G+=q.textContent.length}for(var we=s.previousSibling,De=r;we;we=we.previousSibling){if(L=O(we,we.firstChild,-1),L)return Ca(Ie(L.line,L.ch+De),i);De+=we.textContent.length}}var An=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new pe,this.hasSelection=!1,this.composing=null};An.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),T&&(i.style.width="0px"),Ee(i,"input",function(){N&&U>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Ee(i,"paste",function(o){if(Ke(n,o)||ol(o,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function a(o){if(Ke(n,o))return;if(n.somethingSelected())No({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var s=ll(n);No({lineWise:!0,text:s.text}),o.type=="cut"?n.setSelections(s.ranges,null,Me):(r.prevInput="",i.value=s.text.join(`
`),Be(i))}else return;o.type=="cut"&&(n.state.cutIncoming=+new Date)}Ee(i,"cut",a),Ee(i,"copy",a),Ee(e.scroller,"paste",function(o){if(jr(e,o)||Ke(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)}),Ee(e.lineSpace,"selectstart",function(o){jr(e,o)||h(o)}),Ee(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"})}}),Ee(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},An.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},An.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},An.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Mr(e);if(e.options.moveInputWithCursor){var i=zt(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},An.prototype.showSelection=function(e){var t=this.cm,r=t.display;re(r.cursorDiv,e.cursors),re(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},An.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&&Be(this.textarea),N&&U>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",N&&U>=9&&(this.hasSelection=null))},An.prototype.getField=function(){return this.textarea},An.prototype.supportsTouch=function(){return!1},An.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!K||ue()!=this.textarea))try{this.textarea.focus()}catch(e){}},An.prototype.blur=function(){this.textarea.blur()},An.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},An.prototype.receivedFocus=function(){this.slowPoll()},An.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()})},An.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)},An.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ct(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(N&&U>=9&&this.hasSelection===i||$&&/[\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 ir(t,function(){cs(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},An.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},An.prototype.onKeyPress=function(){N&&U>=9&&(this.hasSelection=null),this.fastPoll()},An.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Un(r,e),o=n.scroller.scrollTop;if(!a||ne)return;var s=r.options.resetSelectionOnContextMenu;s&&r.doc.sel.contains(a)==-1&&Tn(r,Jn)(r.doc,Ir(a),Me);var l=i.style.cssText,c=t.wrapper.style.cssText,O=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-O.top-5)+"px; left: "+(e.clientX-O.left-5)+`px;
z-index: 1000; background: `+(N?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var L;A&&(L=window.scrollY),n.input.focus(),A&&window.scrollTo(null,L),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=G,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function q(){if(i.selectionStart!=null){var De=r.somethingSelected(),ze="\u200B"+(De?i.value:"");i.value="\u21DA",i.value=ze,t.prevInput=De?"":"\u200B",i.selectionStart=1,i.selectionEnd=ze.length,n.selForContextMenu=r.doc.sel}}function G(){if(t.contextMenuPending!=G)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=c,i.style.cssText=l,N&&U<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=o),i.selectionStart!=null){(!N||N&&U<9)&&q();var De=0,ze=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?Tn(r,Ds)(r):De++<10?n.detectingSelectAll=setTimeout(ze,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ze,200)}}if(N&&U>=9&&q(),Te){x(e);var we=function(){ct(window,"mouseup",we),setTimeout(G,20)};Ee(window,"mouseup",we)}else setTimeout(G,50)},An.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},An.prototype.setUneditable=function(){},An.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?d(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=ue();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(Ee(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(l){}}t.finishInit=function(l){l.save=n,l.getTextArea=function(){return e},l.toTextArea=function(){l.toTextArea=isNaN,n(),e.parentNode.removeChild(l.getWrapperElement()),e.style.display="",e.form&&(ct(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var s=En(function(l){return e.parentNode.insertBefore(l,e.nextSibling)},t);return s}function iu(e){e.off=ct,e.on=Ee,e.wheelEventPixels=Ha,e.Doc=ur,e.splitLines=Kt,e.countColumn=W,e.findColumn=Re,e.isWordChar=Fe,e.Pass=qe,e.signal=Se,e.Line=fn,e.changeEnd=Ur,e.scrollbarModel=Wa,e.Pos=Ie,e.cmpPos=kt,e.modes=Ln,e.mimeModes=Pt,e.resolveMode=qn,e.getMode=br,e.modeExtensions=yr,e.extendMode=Ri,e.copyState=pr,e.startState=ti,e.innerMode=Wr,e.commands=to,e.keyMap=hi,e.keyName=Xs,e.isModifierKey=Ks,e.lookupKey=xa,e.normalizeKeyMap=Rl,e.StringStream=mn,e.SharedTextMarker=Qa,e.TextMarker=Di,e.LineWidget=Za,e.e_preventDefault=h,e.e_stopPropagation=p,e.e_stop=x,e.addClass=xe,e.contains=_,e.rmClass=se,e.keyNames=Ai}Yl(En),ql(En);var au="iter insert remove copy getEditor constructor".split(" ");for(var Uo in ur.prototype)ur.prototype.hasOwnProperty(Uo)&&ve(au,Uo)<0&&(En.prototype[Uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(ur.prototype[Uo]));return j(ur),En.inputStyles={textarea:An,contenteditable:un},En.defineMode=function(e){!En.defaults.mode&&e!="null"&&(En.defaults.mode=e),Qn.apply(this,arguments)},En.defineMIME=hr,En.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),En.defineMIME("text/plain","null"),En.defineExtension=function(e,t){En.prototype[e]=t},En.defineDocExtension=function(e,t){ur.prototype[e]=t},En.fromTextArea=ru,iu(En),En.version="5.58.2",En})},Y1PL:function(Tt,nt,m){"use strict";m.r(nt),m.d(nt,"ResizableTextArea",function(){return ve});var P=m("wx14"),fe=m("1OyB"),te=m("vuIU"),H=m("Ji7U"),v=m("LK+K"),he=m("q1tI"),N=m("VTBJ"),U=m("rePB"),A=m("Zm9Q"),be=m("Kwbf"),ee=m("c+Xe"),ne=m("m+aA"),Ce=m("bdgK"),ae=new Map;function V(Me){Me.forEach(function(Ve){var ke,Re=Ve.target;(ke=ae.get(Re))===null||ke===void 0||ke.forEach(function(Q){return Q(Re)})})}var T=new Ce.default(V),R=null,K=null;function $(Me,Ve){ae.has(Me)||(ae.set(Me,new Set),T.observe(Me)),ae.get(Me).add(Ve)}function me(Me,Ve){ae.has(Me)&&(ae.get(Me).delete(Ve),ae.get(Me).size||(T.unobserve(Me),ae.delete(Me)))}var Le=function(Me){Object(H.a)(ke,Me);var Ve=Object(v.a)(ke);function ke(){return Object(fe.a)(this,ke),Ve.apply(this,arguments)}return Object(te.a)(ke,[{key:"render",value:function(){return this.props.children}}]),ke}(he.Component),ce=he.createContext(null);function ge(Me){var Ve=Me.children,ke=Me.onBatchResize,Re=he.useRef(0),Q=he.useRef([]),X=he.useContext(ce),He=he.useCallback(function(at,pt,Ye){Re.current+=1;var rt=Re.current;Q.current.push({size:at,element:pt,data:Ye}),Promise.resolve().then(function(){rt===Re.current&&(ke==null||ke(Q.current),Q.current=[])}),X==null||X(at,pt,Ye)},[ke,X]);return he.createElement(ce.Provider,{value:He},Ve)}function Te(Me){var Ve=Me.children,ke=Me.disabled,Re=he.useRef(null),Q=he.useRef(null),X=he.useContext(ce),He=he.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),at=he.isValidElement(Ve)&&Object(ee.c)(Ve),pt=at?Ve.ref:null,Ye=he.useMemo(function(){return Object(ee.a)(pt,Re)},[pt,Re]),rt=he.useRef(Me);rt.current=Me;var je=he.useCallback(function(Fe){var $e=rt.current,tt=$e.onResize,Ge=$e.data,_e=Fe.getBoundingClientRect(),Pe=_e.width,st=_e.height,lt=Fe.offsetWidth,dt=Fe.offsetHeight,et=Math.floor(Pe),wt=Math.floor(st);if(He.current.width!==et||He.current.height!==wt||He.current.offsetWidth!==lt||He.current.offsetHeight!==dt){var mt={width:et,height:wt,offsetWidth:lt,offsetHeight:dt};He.current=mt;var ut=lt===Math.round(Pe)?Pe:lt,Ee=dt===Math.round(st)?st:dt,xt=Object(N.a)(Object(N.a)({},mt),{},{offsetWidth:ut,offsetHeight:Ee});X==null||X(xt,Fe,Ge),tt&&Promise.resolve().then(function(){tt(xt,Fe)})}},[]);return he.useEffect(function(){var Fe=Object(ne.a)(Re.current)||Object(ne.a)(Q.current);return Fe&&!ke&&$(Fe,je),function(){return me(Fe,je)}},[Re.current,ke]),he.createElement(Le,{ref:Q},at?he.cloneElement(Ve,{ref:Ye}):Ve)}var le="rc-observer-key";function se(Me){var Ve=Me.children,ke=Object(A.a)(Ve);return ke.map(function(Re,Q){var X=(Re==null?void 0:Re.key)||"".concat(le,"-").concat(Q);return he.createElement(Te,Object(P.a)({},Me,{key:X}),Re)})}se.Collection=ge;var Oe=se,re=m("bT9E"),w=m("TSYQ"),ie=m.n(w),Z=`
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
`,_=["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"],ue={},xe;function oe(Me){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ke=Me.getAttribute("id")||Me.getAttribute("data-reactid")||Me.getAttribute("name");if(Ve&&ue[ke])return ue[ke];var Re=window.getComputedStyle(Me),Q=Re.getPropertyValue("box-sizing")||Re.getPropertyValue("-moz-box-sizing")||Re.getPropertyValue("-webkit-box-sizing"),X=parseFloat(Re.getPropertyValue("padding-bottom"))+parseFloat(Re.getPropertyValue("padding-top")),He=parseFloat(Re.getPropertyValue("border-bottom-width"))+parseFloat(Re.getPropertyValue("border-top-width")),at=_.map(function(Ye){return"".concat(Ye,":").concat(Re.getPropertyValue(Ye))}).join(";"),pt={sizingStyle:at,paddingSize:X,borderSize:He,boxSizing:Q};return Ve&&ke&&(ue[ke]=pt),pt}function Be(Me){var Ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;xe||(xe=document.createElement("textarea"),xe.setAttribute("tab-index","-1"),xe.setAttribute("aria-hidden","true"),document.body.appendChild(xe)),Me.getAttribute("wrap")?xe.setAttribute("wrap",Me.getAttribute("wrap")):xe.removeAttribute("wrap");var Q=oe(Me,Ve),X=Q.paddingSize,He=Q.borderSize,at=Q.boxSizing,pt=Q.sizingStyle;xe.setAttribute("style","".concat(pt,";").concat(Z)),xe.value=Me.value||Me.placeholder||"";var Ye=Number.MIN_SAFE_INTEGER,rt=Number.MAX_SAFE_INTEGER,je=xe.scrollHeight,Fe;if(at==="border-box"?je+=He:at==="content-box"&&(je-=X),ke!==null||Re!==null){xe.value=" ";var $e=xe.scrollHeight-X;ke!==null&&(Ye=$e*ke,at==="border-box"&&(Ye=Ye+X+He),je=Math.max(Ye,je)),Re!==null&&(rt=$e*Re,at==="border-box"&&(rt=rt+X+He),Fe=je>rt?"":"hidden",je=Math.min(rt,je))}return{height:je,minHeight:Ye,maxHeight:rt,overflowY:Fe,resize:"none"}}var E=m("Gytx"),d=m.n(E),W;(function(Me){Me[Me.NONE=0]="NONE",Me[Me.RESIZING=1]="RESIZING",Me[Me.RESIZED=2]="RESIZED"})(W||(W={}));var pe=function(Me){Object(H.a)(ke,Me);var Ve=Object(v.a)(ke);function ke(Re){var Q;return Object(fe.a)(this,ke),Q=Ve.call(this,Re),Q.nextFrameActionId=void 0,Q.resizeFrameId=void 0,Q.textArea=void 0,Q.saveTextArea=function(X){Q.textArea=X},Q.handleResize=function(X){var He=Q.state.resizeStatus,at=Q.props,pt=at.autoSize,Ye=at.onResize;if(He!==W.NONE)return;typeof Ye=="function"&&Ye(X),pt&&Q.resizeOnNextFrame()},Q.resizeOnNextFrame=function(){cancelAnimationFrame(Q.nextFrameActionId),Q.nextFrameActionId=requestAnimationFrame(Q.resizeTextarea)},Q.resizeTextarea=function(){var X=Q.props.autoSize;if(!X||!Q.textArea)return;var He=X.minRows,at=X.maxRows,pt=Be(Q.textArea,!1,He,at);Q.setState({textareaStyles:pt,resizeStatus:W.RESIZING},function(){cancelAnimationFrame(Q.resizeFrameId),Q.resizeFrameId=requestAnimationFrame(function(){Q.setState({resizeStatus:W.RESIZED},function(){Q.resizeFrameId=requestAnimationFrame(function(){Q.setState({resizeStatus:W.NONE}),Q.fixFirefoxAutoScroll()})})})})},Q.renderTextArea=function(){var X=Q.props,He=X.prefixCls,at=He===void 0?"rc-textarea":He,pt=X.autoSize,Ye=X.onResize,rt=X.className,je=X.disabled,Fe=Q.state,$e=Fe.textareaStyles,tt=Fe.resizeStatus,Ge=Object(re.a)(Q.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),_e=ie()(at,rt,Object(U.a)({},"".concat(at,"-disabled"),je));"value"in Ge&&(Ge.value=Ge.value||"");var Pe=Object(N.a)(Object(N.a)(Object(N.a)({},Q.props.style),$e),tt===W.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return he.createElement(Oe,{onResize:Q.handleResize,disabled:!(pt||Ye)},he.createElement("textarea",Object(P.a)({},Ge,{className:_e,style:Pe,ref:Q.saveTextArea})))},Q.state={textareaStyles:{},resizeStatus:W.NONE},Q}return Object(te.a)(ke,[{key:"componentDidUpdate",value:function(Q){(Q.value!==this.props.value||!d()(Q.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 Q=this.textArea.selectionStart,X=this.textArea.selectionEnd;this.textArea.setSelectionRange(Q,X)}}catch(He){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ke}(he.Component),ve=pe,Ne=function(Me){Object(H.a)(ke,Me);var Ve=Object(v.a)(ke);function ke(Re){var Q;Object(fe.a)(this,ke),Q=Ve.call(this,Re),Q.resizableTextArea=void 0,Q.focus=function(){Q.resizableTextArea.textArea.focus()},Q.saveTextArea=function(He){Q.resizableTextArea=He},Q.handleChange=function(He){var at=Q.props.onChange;Q.setValue(He.target.value,function(){Q.resizableTextArea.resizeTextarea()}),at&&at(He)},Q.handleKeyDown=function(He){var at=Q.props,pt=at.onPressEnter,Ye=at.onKeyDown;He.keyCode===13&&pt&&pt(He),Ye&&Ye(He)};var X=typeof Re.value=="undefined"||Re.value===null?Re.defaultValue:Re.value;return Q.state={value:X},Q}return Object(te.a)(ke,[{key:"setValue",value:function(Q,X){"value"in this.props||this.setState({value:Q},X)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return he.createElement(ve,Object(P.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Q){return"value"in Q?{value:Q.value}:null}}]),ke}(he.Component),qe=nt.default=Ne},ZW9T:function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return Le});var P=m("k1fw"),fe=m("miYZ"),te=m("tsqr"),H=m("rAM+"),v=m("tJVT"),he=m("PpiC"),N=m("q1tI"),U=m.n(N),A=m("bdgK");function be(ce,ge,Te,le,se){var Oe=ge.getWordUntilPosition(Te),re={startLineNumber:Te.lineNumber,endLineNumber:Te.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},w=le.map(function(ie){return{label:ie,kind:ce.languages.CompletionItemKind.Keyword,insertText:ie,insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:re}});return se.map(function(ie){w.push(Object(P.a)(Object(P.a)({},ie),{},{range:re}))}),w}var ee=function(ce){var ge={label:"ifelse",kind:ce.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet},Te=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];ce.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(re,w){var ie=be(ce,re,w,Te,[ge]);return{suggestions:ie}}});var le=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];ce.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(re,w){var ie=[{label:"print",kind:ce.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet}],Z=be(ce,re,w,le,ie);return{suggestions:Z}}});var se=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];ce.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(re,w){var ie=[ge,{label:"main",kind:ce.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:ce.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:ce.languages.CompletionItemInsertTextRule.InsertAsSnippet}],Z=be(ce,re,w,se,ie);return{suggestions:Z}}})},ne="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",Ce=m("LvDl");function ae(ce){return/^\d+$/.test(ce)?"".concat(ce,"px"):ce}function V(){}var T=!1,R={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function K(){var ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ge=ce;if(Array.isArray(ce)){for(var Te=0;Te<ce.length;Te++){var le=R[ce[Te]];if(le)return le}return ge[0]}return R[ge]||ge}var $=null,me=nt.b=function(ce){var ge=ce.width,Te=ge===void 0?"100%":ge,le=ce.height,se=le===void 0?"100%":le,Oe=ce.value,re=ce.language,w=re===void 0?"javascript":re,ie=ce.style,Z=ie===void 0?{}:ie,_=ce.options,ue=_===void 0?{}:_,xe=ce.overrideServices,oe=xe===void 0?{}:xe,Be=ce.theme,E=Be===void 0?"vs-dark":Be,d=ce.onEditBlur,W=ce.onSave,pe=ce.autoHeight,ve=pe===void 0?!1:pe,Ne=ce.forbidCopy,qe=Ne===void 0?!1:Ne,Me=ce.onChange,Ve=Me===void 0?V:Me,ke=ce.editorDidMount,Re=ke===void 0?V:ke,Q=ce.onFocus,X=Q===void 0?V:Q,He=ce.filename,at=He===void 0?"educoder.txt":He,pt=Object(he.a)(ce,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Ye=Object(N.useRef)(),rt=Object(N.useRef)({}),je=Object(N.useRef)(),Fe=Object(N.useRef)(!1),$e=Object(N.useRef)(),tt=Object(N.useState)(!1),Ge=Object(v.a)(tt,2),_e=Ge[0],Pe=Ge[1];function st(){var b;return Ye.current&&(b=new A.default(function(x){var Y=Object(H.a)(x),de;try{for(Y.s();!(de=Y.n()).done;){var Ae=de.value;(Ae.target.offsetHeight>0||Ae.target.offsetWidth>0)&&rt.current.instance.layout()}}catch(gt){Y.e(gt)}finally{Y.f()}}),b.observe(Ye.current)),b}function lt(){te.b.warn(decodeURIComponent(ne))}var dt=function(){var x=rt.current.instance;if(Oe!=null&&x&&_e){var Y=x.getModel();Y&&Oe!==Y.getValue()&&(T=!0,Y.setValue(Oe),x.layout(),T=!1)}};Object(N.useEffect)(function(){je.current&&clearTimeout(je.current),je.current=setTimeout(function(){dt()},500)},[Oe,_e,rt.current]);function et(){var b=rt.current.instance;if(b){var x=b.getSelection(),Y=rt.current.pastePos||{},de=new $.Range(Y.startLineNumber||x.endLineNumber,Y.startColumn||x.endColumn,Y.endLineNumber||x.endLineNumber,Y.endColumn||x.endColumn);setTimeout(function(){b.executeEdits("",[{range:de,text:""}])},300)}}function wt(b){(window.navigator.platform.match("Mac")?b.metaKey:b.ctrlKey)&&b.keyCode==83&&(b.preventDefault(),W())}var mt=function(){if(ve&&rt.current.instance){var x=rt.current.instance.getContentHeight();h(x<se?se:x)}else h(se)};function ut(b){var x=document.createEvent("MouseEvents");x.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),b.dispatchEvent(x)}function Ee(b,x){var Y=window.URL||window.webkitURL||window,de=new Blob([x]),Ae=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ae.href=Y.createObjectURL(de),Ae.download=b,ut(Ae)}Object(N.useEffect)(function(){mt()},[mt]),Object(N.useEffect)(function(){Ye.current&&!_e&&m.e(26).then(m.t.bind(null,"M/lh",7)).then(function(b){try{$=b,rt.current.instance=$.editor.create(Ye.current,{value:Oe,language:K(w),theme:E,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},oe);var x=rt.current.instance;if(Re(x,$),setTimeout(function(){mt(),rt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ee(at||"educoder.txt",x.getValue())}})},500),rt.current.subscription=x.onDidChangeModelContent(function(de){Fe.current?clearTimeout($e.current):(mt(),Ve(x.getValue(),de)),$e.current=setTimeout(function(){Fe.current=!1},500)}),window.Monaco||ee($),qe&&(x.addCommand($.KeyMod.CtrlCmd|$.KeyMod.Shift|$.KeyCode.KEY_V,function(){return lt(),null}),x.addCommand($.KeyMod.CtrlCmd|$.KeyCode.KEY_C,function(){return lt(),null})),window.Monaco=$,d&&x.onDidBlurEditorWidget(function(){d(x.getValue())}),X&&x.onDidFocusEditorText(function(){X(x.getValue())}),qe){x.addCommand($.KeyMod.CtrlCmd|$.KeyCode.KEY_V,function(){return lt(),null}),x.onDidPaste(function(de){rt.current.pastePos=de});try{window.addEventListener("paste",et)}catch(de){}}var Y=st();return Pe(!0),function(){var de=rt.current.instance;de.dispose();var Ae=de.getModel();Ae&&Ae.dispose(),rt.current.subscription&&rt.current.subscription.dispose(),qe&&window.removeEventListener("paste",et),Y.unobserve(Ye.current)}}catch(de){}})},[]),Object(N.useEffect)(function(){var b=rt.current.instance;if(b&&_e)return document.addEventListener("keydown",wt,!1),function(){document.removeEventListener("keydown",wt)}},[W,_e]),Object(N.useEffect)(function(){var b=rt.current.instance;if(b&&_e){var x=K(w);$.editor.setModelLanguage(b.getModel(),x),console.log("language:",w,b.getModel(),x)}},[w,_e]),Object(N.useEffect)(function(){var b=rt.current.instance;b&&_e&&$.editor.setTheme(E)},[E,_e]),Object(N.useEffect)(function(){var b=rt.current.instance;b&&_e&&(b.updateOptions(Object(P.a)({},ue)),setTimeout(function(){b.getModel().updateOptions(Object(P.a)({},ue))},200))},[JSON.stringify(ue),_e]),Object(N.useEffect)(function(){var b=rt.current.instance;b&&_e&&b.layout()},[Te,se,_e]);var xt=Object(N.useState)(ae(Te)),ct=Object(v.a)(xt,2),Se=ct[0],Ke=ct[1],k=Object(N.useState)(ae(se)),D=Object(v.a)(k,2),j=D[0],h=D[1],p=Object(P.a)(Object(P.a)({},Z),{},{width:Se,height:j});return U.a.createElement("div",{className:"my-monaco-editor",ref:Ye,style:p})};function Le(ce){var ge=ce.width,Te=ge===void 0?"100%":ge,le=ce.height,se=le===void 0?"100%":le,Oe=ce.original,re=ce.modified,w=ce.language,ie=ce.options,Z=ie===void 0?{}:ie,_=Object(N.useRef)(),ue=Object(N.useState)(null),xe=Object(v.a)(ue,2),oe=xe[0],Be=xe[1];function E(ve){var Ne;return _.current&&(Ne=new A.default(function(qe){var Me=Object(H.a)(qe),Ve;try{for(Me.s();!(Ve=Me.n()).done;){var ke=Ve.value;(ke.target.offsetHeight>0||ke.target.offsetWidth>0)&&ve.layout()}}catch(Re){Me.e(Re)}finally{Me.f()}}),Ne.observe(_.current)),Ne}Object(N.useEffect)(function(){_.current&&m.e(26).then(m.t.bind(null,"M/lh",7)).then(function(ve){$=ve;var Ne=$.editor.createDiffEditor(_.current,Object(P.a)(Object(P.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Z),{},{wordWrap:!0}));Be(Ne);var qe=E(Ne);return function(){Ne.dispose();var Me=Ne.getModel();Me&&Me.dispose(),qe.unobserve(_.current)}})},[]),Object(N.useEffect)(function(){oe&&oe.setModel({original:$.editor.createModel(Oe,w),modified:$.editor.createModel(re,w)})},[Oe,re,w,oe]);var d=ae(Te),W=ae(se),pe={width:d,height:W};return U.a.createElement("div",{className:"my-diff-editor",ref:_,style:pe})}},ZpRC:function(Tt,nt,m){"use strict";function P(ee){return typeof ee=="object"&&ee!=null&&ee.nodeType===1}function fe(ee,ne){return(!ne||ee!=="hidden")&&ee!=="visible"&&ee!=="clip"}function te(ee,ne){if(ee.clientHeight<ee.scrollHeight||ee.clientWidth<ee.scrollWidth){var Ce=getComputedStyle(ee,null);return fe(Ce.overflowY,ne)||fe(Ce.overflowX,ne)||function(ae){var V=function(T){if(!T.ownerDocument||!T.ownerDocument.defaultView)return null;try{return T.ownerDocument.defaultView.frameElement}catch(R){return null}}(ae);return!!V&&(V.clientHeight<ae.scrollHeight||V.clientWidth<ae.scrollWidth)}(ee)}return!1}function H(ee,ne,Ce,ae,V,T,R,K){return T<ee&&R>ne||T>ee&&R<ne?0:T<=ee&&K<=Ce||R>=ne&&K>=Ce?T-ee-ae:R>ne&&K<Ce||T<ee&&K>Ce?R-ne+V:0}var v=function(ee,ne){var Ce=window,ae=ne.scrollMode,V=ne.block,T=ne.inline,R=ne.boundary,K=ne.skipOverflowHiddenElements,$=typeof R=="function"?R:function($e){return $e!==R};if(!P(ee))throw new TypeError("Invalid target");for(var me=document.scrollingElement||document.documentElement,Le=[],ce=ee;P(ce)&&$(ce);){if((ce=ce.parentElement)===me){Le.push(ce);break}ce!=null&&ce===document.body&&te(ce)&&!te(document.documentElement)||ce!=null&&te(ce,K)&&Le.push(ce)}for(var ge=Ce.visualViewport?Ce.visualViewport.width:innerWidth,Te=Ce.visualViewport?Ce.visualViewport.height:innerHeight,le=window.scrollX||pageXOffset,se=window.scrollY||pageYOffset,Oe=ee.getBoundingClientRect(),re=Oe.height,w=Oe.width,ie=Oe.top,Z=Oe.right,_=Oe.bottom,ue=Oe.left,xe=V==="start"||V==="nearest"?ie:V==="end"?_:ie+re/2,oe=T==="center"?ue+w/2:T==="end"?Z:ue,Be=[],E=0;E<Le.length;E++){var d=Le[E],W=d.getBoundingClientRect(),pe=W.height,ve=W.width,Ne=W.top,qe=W.right,Me=W.bottom,Ve=W.left;if(ae==="if-needed"&&ie>=0&&ue>=0&&_<=Te&&Z<=ge&&ie>=Ne&&_<=Me&&ue>=Ve&&Z<=qe)return Be;var ke=getComputedStyle(d),Re=parseInt(ke.borderLeftWidth,10),Q=parseInt(ke.borderTopWidth,10),X=parseInt(ke.borderRightWidth,10),He=parseInt(ke.borderBottomWidth,10),at=0,pt=0,Ye="offsetWidth"in d?d.offsetWidth-d.clientWidth-Re-X:0,rt="offsetHeight"in d?d.offsetHeight-d.clientHeight-Q-He:0;if(me===d)at=V==="start"?xe:V==="end"?xe-Te:V==="nearest"?H(se,se+Te,Te,Q,He,se+xe,se+xe+re,re):xe-Te/2,pt=T==="start"?oe:T==="center"?oe-ge/2:T==="end"?oe-ge:H(le,le+ge,ge,Re,X,le+oe,le+oe+w,w),at=Math.max(0,at+se),pt=Math.max(0,pt+le);else{at=V==="start"?xe-Ne-Q:V==="end"?xe-Me+He+rt:V==="nearest"?H(Ne,Me,pe,Q,He+rt,xe,xe+re,re):xe-(Ne+pe/2)+rt/2,pt=T==="start"?oe-Ve-Re:T==="center"?oe-(Ve+ve/2)+Ye/2:T==="end"?oe-qe+X+Ye:H(Ve,qe,ve,Re,X+Ye,oe,oe+w,w);var je=d.scrollLeft,Fe=d.scrollTop;xe+=Fe-(at=Math.max(0,Math.min(Fe+at,d.scrollHeight-pe+rt))),oe+=je-(pt=Math.max(0,Math.min(je+pt,d.scrollWidth-ve+Ye)))}Be.push({el:d,top:at,left:pt})}return Be};function he(ee){return ee===Object(ee)&&Object.keys(ee).length!==0}function N(ee,ne){ne===void 0&&(ne="auto");var Ce="scrollBehavior"in document.body.style;ee.forEach(function(ae){var V=ae.el,T=ae.top,R=ae.left;V.scroll&&Ce?V.scroll({top:T,left:R,behavior:ne}):(V.scrollTop=T,V.scrollLeft=R)})}function U(ee){return ee===!1?{block:"end",inline:"nearest"}:he(ee)?ee:{block:"start",inline:"nearest"}}function A(ee,ne){var Ce=!ee.ownerDocument.documentElement.contains(ee);if(he(ne)&&typeof ne.behavior=="function")return ne.behavior(Ce?[]:v(ee,ne));if(Ce)return;var ae=U(ne);return N(v(ee,ae),ae.behavior)}var be=nt.a=A},bT9E:function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return fe});var P=m("VTBJ");function fe(te,H){var v=Object(P.a)({},te);return Array.isArray(H)&&H.forEach(function(he){delete v[he]}),v}},c5Ni:function(Tt,nt,m){},dejd:function(Tt,nt,m){},dmUQ:function(Tt,nt,m){"use strict";var P=m("Ff2n"),fe=m("rePB"),te=m("1OyB"),H=m("vuIU"),v=m("Ji7U"),he=m("md7G"),N=m("foSv"),U=m("q1tI"),A=m.n(U),be=m("TSYQ"),ee=m.n(be),ne=m("4IlW");function Ce(re,w){var ie=Object.keys(re);if(Object.getOwnPropertySymbols){var Z=Object.getOwnPropertySymbols(re);w&&(Z=Z.filter(function(_){return Object.getOwnPropertyDescriptor(re,_).enumerable})),ie.push.apply(ie,Z)}return ie}function ae(re){for(var w=1;w<arguments.length;w++){var ie=arguments[w]!=null?arguments[w]:{};w%2?Ce(Object(ie),!0).forEach(function(Z){Object(fe.a)(re,Z,ie[Z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(re,Object.getOwnPropertyDescriptors(ie)):Ce(Object(ie)).forEach(function(Z){Object.defineProperty(re,Z,Object.getOwnPropertyDescriptor(ie,Z))})}return re}function V(re){var w=T();return function(){var Z=Object(N.a)(re),_;if(w){var ue=Object(N.a)(this).constructor;_=Reflect.construct(Z,arguments,ue)}else _=Z.apply(this,arguments);return Object(he.a)(this,_)}}function T(){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(re){return!1}}function R(){}function K(re){re.preventDefault()}var $=function(w){return w.replace(/[^\w.-]+/g,"")},me=200,Le=600,ce=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ge=function(w){return w!=null},Te=function(w,ie){return ie===w||typeof ie=="number"&&typeof w=="number"&&isNaN(ie)&&isNaN(w)},le=function(re){Object(v.a)(ie,re);var w=V(ie);function ie(Z){var _;Object(te.a)(this,ie),_=w.call(this,Z),_.onKeyDown=function(oe){var Be=_.props,E=Be.onKeyDown,d=Be.onPressEnter;if(oe.keyCode===ne.a.UP){var W=_.getRatio(oe);_.up(oe,W,null),_.stop()}else if(oe.keyCode===ne.a.DOWN){var pe=_.getRatio(oe);_.down(oe,pe,null),_.stop()}else oe.keyCode===ne.a.ENTER&&d&&d(oe);if(_.recordCursorPosition(),_.lastKeyCode=oe.keyCode,E){for(var ve=arguments.length,Ne=new Array(ve>1?ve-1:0),qe=1;qe<ve;qe++)Ne[qe-1]=arguments[qe];E.apply(void 0,[oe].concat(Ne))}},_.onKeyUp=function(oe){var Be=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),Be){for(var E=arguments.length,d=new Array(E>1?E-1:0),W=1;W<E;W++)d[W-1]=arguments[W];Be.apply(void 0,[oe].concat(d))}},_.onChange=function(oe){var Be=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(oe)),_.setState({inputValue:_.rawInput}),Be(_.toNumber(_.rawInput))},_.onMouseUp=function(){var oe=_.props.onMouseUp;_.recordCursorPosition(),oe&&oe.apply(void 0,arguments)},_.onFocus=function(){var oe;_.setState({focused:!0}),(oe=_.props).onFocus.apply(oe,arguments)},_.onBlur=function(){var oe=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var Be=_.getCurrentValidValue(_.state.inputValue),E=_.setValue(Be,R);if(oe){var d=_.input.value,W=_.getInputDisplayValue({focus:!1,value:E});_.input.value=W&&Number(W),oe.apply(void 0,arguments),_.input.value=d}},_.getRatio=function(oe){var Be=1;return oe.metaKey||oe.ctrlKey?Be=.1:oe.shiftKey&&(Be=10),Be},_.getFullNum=function(oe){return isNaN(oe)?oe:/e/i.test(String(oe))?Number(oe).toFixed(18).replace(/\.?0+$/,""):oe},_.getPrecision=function(oe){if(ge(_.props.precision))return _.props.precision;var Be=String(oe);if(Be.indexOf("e-")>=0)return parseInt(Be.slice(Be.indexOf("e-")+2),10);var E=0;return Be.indexOf(".")>=0&&(E=Be.length-Be.indexOf(".")-1),E},_.getInputDisplayValue=function(oe){var Be=oe||_.state,E=Be.focused,d=Be.inputValue,W=Be.value,pe;E?pe=d:pe=_.toPrecisionAsStep(W),pe==null&&(pe="");var ve=_.formatWrapper(pe);return ge(_.props.decimalSeparator)&&(ve=ve.toString().replace(".",_.props.decimalSeparator)),ve},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(oe){}},_.restoreByAfter=function(oe){if(oe===void 0)return!1;var Be=_.input.value,E=Be.lastIndexOf(oe);if(E===-1)return!1;var d=_.cursorBefore.length;return _.lastKeyCode===ne.a.DELETE&&_.cursorBefore.charAt(d-1)===oe[0]?(_.fixCaret(d,d),!0):E+oe.length===Be.length?(_.fixCaret(E,E),!0):!1},_.partRestoreByAfter=function(oe){return oe===void 0?!1:Array.prototype.some.call(oe,function(Be,E){var d=oe.substring(E);return _.restoreByAfter(d)})},_.isNotCompleteNumber=function(oe){return isNaN(oe)||oe===""||oe===null||oe&&oe.toString().indexOf(".")===oe.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(oe,Be,E){_.pressingUpOrDown=!0,_.step("down",oe,Be,E)},_.up=function(oe,Be,E){_.pressingUpOrDown=!0,_.step("up",oe,Be,E)},_.saveInput=function(oe){_.input=oe};var ue=Z.value;ue===void 0&&(ue=Z.defaultValue),_.state={focused:Z.autoFocus};var xe=_.getValidValue(_.toNumber(ue));return _.state=ae(ae({},_.state),{},{inputValue:_.toPrecisionAsStep(xe),value:xe}),_}return Object(H.a)(ie,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var ue=this.props,xe=ue.value,oe=ue.onChange,Be=ue.max,E=ue.min,d=this.state.focused;if(_){if(!Te(_.value,xe)||!Te(_.max,Be)||!Te(_.min,E)){var W=d?xe:this.getValidValue(xe),pe;this.pressingUpOrDown?pe=W:this.inputting?pe=this.rawInput:pe=this.toPrecisionAsStep(W),this.setState({value:W,inputValue:pe})}var ve="value"in this.props?xe:this.state.value;"max"in this.props&&_.max!==Be&&typeof ve=="number"&&ve>Be&&oe&&oe(Be),"min"in this.props&&_.min!==E&&typeof ve=="number"&&ve<E&&oe&&oe(E)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ne=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===ne.a.BACKSPACE?Ne=this.cursorStart-1:this.lastKeyCode===ne.a.DELETE&&(Ne=this.cursorStart):Ne=this.input.value.length,this.fixCaret(Ne,Ne)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case ne.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case ne.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(qe){}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(_){var ue=_;return ue===""?ue="":this.isNotCompleteNumber(parseFloat(ue))?ue=this.state.value:ue=this.getValidValue(ue),this.toNumber(ue)}},{key:"getValueFromEvent",value:function(_){var ue=_.target.value.trim().replace(/。/g,".");return ge(this.props.decimalSeparator)&&(ue=ue.replace(this.props.decimalSeparator,".")),ue}},{key:"getValidValue",value:function(_){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,oe=parseFloat(_);return isNaN(oe)?_:(oe<ue&&(oe=ue),oe>xe&&(oe=xe),oe)}},{key:"setValue",value:function(_,ue){var xe=this.props.precision,oe=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),Be=this.state.value,E=Be===void 0?null:Be,d=this.state.inputValue,W=d===void 0?null:d,pe=typeof oe=="number"?oe.toFixed(xe):"".concat(oe),ve=oe!==E||pe!=="".concat(W);return"value"in this.props?(W=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:W},ue)):this.setState({value:oe,inputValue:this.toPrecisionAsStep(_)},ue),ve&&this.props.onChange(oe),oe}},{key:"getMaxPrecision",value:function(_){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,xe=this.props,oe=xe.precision,Be=xe.step;if(ge(oe))return oe;var E=this.getPrecision(ue),d=this.getPrecision(Be),W=this.getPrecision(_);return _?Math.max(W,E+d):E+d}},{key:"getPrecisionFactor",value:function(_){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,xe=this.getMaxPrecision(_,ue);return Math.pow(10,xe)}},{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(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var ue=Math.abs(this.getMaxPrecision(_));return isNaN(ue)?_.toString():Number(_).toFixed(ue)}},{key:"toNumber",value:function(_){var ue=this.props.precision,xe=this.state.focused,oe=_&&_.length>16&&xe;return this.isNotCompleteNumber(_)||oe?_:ge(ue)?Math.round(_*Math.pow(10,ue))/Math.pow(10,ue):Number(_)}},{key:"upStep",value:function(_,ue){var xe=this.props.step,oe=this.getPrecisionFactor(_,ue),Be=Math.abs(this.getMaxPrecision(_,ue)),E=((oe*_+oe*xe*ue)/oe).toFixed(Be);return this.toNumber(E)}},{key:"downStep",value:function(_,ue){var xe=this.props.step,oe=this.getPrecisionFactor(_,ue),Be=Math.abs(this.getMaxPrecision(_,ue)),E=((oe*_-oe*xe*ue)/oe).toFixed(Be);return this.toNumber(E)}},{key:"step",value:function(_,ue){var xe=this,oe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Be=arguments.length>3?arguments[3]:void 0;this.stop(),ue&&(ue.persist(),ue.preventDefault());var E=this.props;if(E.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var W=this["".concat(_,"Step")](d,oe),pe=W>E.max||W<E.min;if(W>E.max?W=E.max:W<E.min&&(W=E.min),this.setValue(W,null),this.setState({focused:!0},function(){xe.pressingUpOrDown=!1}),pe)return;this.autoStepTimer=setTimeout(function(){xe[_](ue,oe,!0)},Be?me:Le)}},{key:"fixCaret",value:function(_,ue){if(_===void 0||ue===void 0||!this.input||!this.input.value)return;try{var xe=this.input.selectionStart,oe=this.input.selectionEnd;(_!==xe||ue!==oe)&&this.input.setSelectionRange(_,ue)}catch(Be){}}},{key:"render",value:function(){var _,ue=this.props,xe=ue.prefixCls,oe=ue.disabled,Be=ue.readOnly,E=ue.useTouch,d=ue.autoComplete,W=ue.upHandler,pe=ue.downHandler,ve=ue.className,Ne=ue.max,qe=ue.min,Me=ue.style,Ve=ue.title,ke=ue.onMouseEnter,Re=ue.onMouseLeave,Q=ue.onMouseOver,X=ue.onMouseOut,He=ue.required,at=ue.onClick,pt=ue.tabIndex,Ye=ue.type,rt=ue.placeholder,je=ue.id,Fe=ue.inputMode,$e=ue.pattern,tt=ue.step,Ge=ue.maxLength,_e=ue.autoFocus,Pe=ue.name,st=ue.onPaste,lt=ue.onInput,dt=Object(P.a)(ue,["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"]),et=this.state,wt=et.value,mt=et.focused,ut=ee()(xe,(_={},Object(fe.a)(_,ve,!!ve),Object(fe.a)(_,"".concat(xe,"-disabled"),oe),Object(fe.a)(_,"".concat(xe,"-focused"),mt),_)),Ee={};Object.keys(dt).forEach(function(x){(x.substr(0,5)==="data-"||x.substr(0,5)==="aria-"||x==="role")&&(Ee[x]=dt[x])});var xt=!Be&&!oe,ct=this.getInputDisplayValue(null),Se=(wt||wt===0)&&(isNaN(wt)||Number(wt)>=Ne),Ke=(wt||wt===0)&&(isNaN(wt)||Number(wt)<=qe),k=Se||oe||Be,D=Ke||oe||Be,j=ee()("".concat(xe,"-handler"),"".concat(xe,"-handler-up"),Object(fe.a)({},"".concat(xe,"-handler-up-disabled"),k)),h=ee()("".concat(xe,"-handler"),"".concat(xe,"-handler-down"),Object(fe.a)({},"".concat(xe,"-handler-down-disabled"),D)),p=E?{onTouchStart:k?R:this.up,onTouchEnd:this.stop}:{onMouseDown:k?R:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},b=E?{onTouchStart:D?R:this.down,onTouchEnd:this.stop}:{onMouseDown:D?R:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return A.a.createElement("div",{className:ut,style:Me,title:Ve,onMouseEnter:ke,onMouseLeave:Re,onMouseOver:Q,onMouseOut:X,onFocus:function(){return null},onBlur:function(){return null}},A.a.createElement("div",{className:"".concat(xe,"-handler-wrap")},A.a.createElement("span",Object.assign({unselectable:"on"},p,{role:"button","aria-label":"Increase Value","aria-disabled":k,className:j}),W||A.a.createElement("span",{unselectable:"on",className:"".concat(xe,"-handler-up-inner"),onClick:K})),A.a.createElement("span",Object.assign({unselectable:"on"},b,{role:"button","aria-label":"Decrease Value","aria-disabled":D,className:h}),pe||A.a.createElement("span",{unselectable:"on",className:"".concat(xe,"-handler-down-inner"),onClick:K}))),A.a.createElement("div",{className:"".concat(xe,"-input-wrap")},A.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":qe,"aria-valuemax":Ne,"aria-valuenow":wt,required:He,type:Ye,placeholder:rt,onPaste:st,onClick:at,onMouseUp:this.onMouseUp,className:"".concat(xe,"-input"),tabIndex:pt,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:xt?this.onKeyDown:R,onKeyUp:xt?this.onKeyUp:R,autoFocus:_e,maxLength:Ge,readOnly:Be,disabled:oe,max:Ne,min:qe,step:tt,name:Pe,title:Ve,id:je,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ct),pattern:$e,inputMode:Fe,onInput:lt},Ee))))}}]),ie}(A.a.Component);le.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ce,min:-ce,step:1,style:{},onChange:R,onKeyDown:R,onPressEnter:R,onFocus:R,onBlur:R,parser:$,required:!1,autoComplete:"off"};var se=le,Oe=nt.a=se},k3GJ:function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return mo});var P=m("rePB"),fe=m("ODXe"),te=m("Ff2n"),H=m("VTBJ"),v=m("q1tI"),he=m("TSYQ"),N=m.n(he),U=m("Zm9Q"),A=m("6cGi"),be=m("KQm4"),ee=m("xEkU"),ne=m.n(ee),Ce=m("t23M");function ae(y){var I=Object(v.useRef)(),B=Object(v.useRef)(!1);function C(){for(var u=arguments.length,g=new Array(u),f=0;f<u;f++)g[f]=arguments[f];B.current||(ne.a.cancel(I.current),I.current=ne()(function(){y.apply(void 0,g)}))}return Object(v.useEffect)(function(){return function(){B.current=!0,ne.a.cancel(I.current)}},[]),C}function V(y){var I=Object(v.useRef)([]),B=Object(v.useState)({}),C=Object(fe.a)(B,2),u=C[1],g=Object(v.useRef)(typeof y=="function"?y():y),f=ae(function(){var M=g.current;I.current.forEach(function(z){M=z(M)}),I.current=[],g.current=M,u({})});function S(M){I.current.push(M),f()}return[g.current,S]}var T=m("4IlW");function R(y,I){var B,C=y.prefixCls,u=y.id,g=y.active,f=y.rtl,S=y.tab,M=S.key,z=S.tab,F=S.disabled,J=S.closeIcon,ye=y.tabBarGutter,We=y.tabPosition,Ue=y.closable,Je=y.renderWrapper,St=y.removeAriaLabel,Ut=y.editable,Lt=y.onClick,jt=y.onRemove,Ft=y.onFocus,It="".concat(C,"-tab");v.useEffect(function(){return jt},[]);var Nt={};We==="top"||We==="bottom"?Nt[f?"marginLeft":"marginRight"]=ye:Nt.marginBottom=ye;var Xt=Ut&&Ue!==!1&&!F;function Bt(Et){if(F)return;Lt(Et)}function vn(Et){Et.preventDefault(),Et.stopPropagation(),Ut.onEdit("remove",{key:M,event:Et})}var zt=v.createElement("div",{key:M,ref:I,className:N()(It,(B={},Object(P.a)(B,"".concat(It,"-with-remove"),Xt),Object(P.a)(B,"".concat(It,"-active"),g),Object(P.a)(B,"".concat(It,"-disabled"),F),B)),style:Nt,onClick:Bt},v.createElement("div",{role:"tab","aria-selected":g,id:u&&"".concat(u,"-tab-").concat(M),className:"".concat(It,"-btn"),"aria-controls":u&&"".concat(u,"-panel-").concat(M),"aria-disabled":F,tabIndex:F?null:0,onClick:function(bt){bt.stopPropagation(),Bt(bt)},onKeyDown:function(bt){[T.a.SPACE,T.a.ENTER].includes(bt.which)&&(bt.preventDefault(),Bt(bt))},onFocus:Ft},z),Xt&&v.createElement("button",{type:"button","aria-label":St||"remove",tabIndex:0,className:"".concat(It,"-remove"),onClick:function(bt){bt.stopPropagation(),vn(bt)}},J||Ut.removeIcon||"\xD7"));return Je&&(zt=Je(zt)),zt}var K=v.forwardRef(R),$={width:0,height:0,left:0,top:0};function me(y,I,B){return Object(v.useMemo)(function(){for(var C,u=new Map,g=I.get((C=y[0])===null||C===void 0?void 0:C.key)||$,f=g.left+g.width,S=0;S<y.length;S+=1){var M=y[S].key,z=I.get(M);if(!z){var F;z=I.get((F=y[S-1])===null||F===void 0?void 0:F.key)||$}var J=u.get(M)||Object(H.a)({},z);J.right=f-J.left-J.width,u.set(M,J)}return u},[y.map(function(C){return C.key}).join("_"),I,B])}var Le={width:0,height:0,left:0,top:0,right:0};function ce(y,I,B,C,u){var g=u.tabs,f=u.tabPosition,S=u.rtl,M,z,F;["top","bottom"].includes(f)?(M="width",z=S?"right":"left",F=Math.abs(I.left)):(M="height",z="top",F=-I.top);var J=I[M],ye=B[M],We=C[M],Ue=J;return ye+We>J&&(Ue=J-We),Object(v.useMemo)(function(){if(!g.length)return[0,0];for(var Je=g.length,St=Je,Ut=0;Ut<Je;Ut+=1){var Lt=y.get(g[Ut].key)||Le;if(Lt[z]+Lt[M]>F+Ue){St=Ut-1;break}}for(var jt=0,Ft=Je-1;Ft>=0;Ft-=1){var It=y.get(g[Ft].key)||Le;if(It[z]<F){jt=Ft+1;break}}return[jt,St]},[y,F,Ue,f,g.map(function(Je){return Je.key}).join("_"),S])}var ge=m("wx14"),Te=m("1OyB"),le=m("vuIU"),se=m("JX7q"),Oe=m("Ji7U"),re=m("LK+K"),w=m("I8Z2"),ie=m("bT9E"),Z=m("2GS6"),_=m("Gytx"),ue=m.n(_),xe=m("U8pU"),oe=/iPhone/i,Be=/iPod/i,E=/iPad/i,d=/\bAndroid(?:.+)Mobile\b/i,W=/Android/i,pe=/\bAndroid(?:.+)SD4930UR\b/i,ve=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,Ne=/Windows Phone/i,qe=/\bWindows(?:.+)ARM\b/i,Me=/BlackBerry/i,Ve=/BB10/i,ke=/Opera Mini/i,Re=/\b(CriOS|Chrome)(?:.+)Mobile/i,Q=/Mobile(?:.+)Firefox\b/i;function X(y,I){return y.test(I)}function He(y){var I=y||(typeof navigator!="undefined"?navigator.userAgent:""),B=(I||"").split("[FBAN");if(typeof B[1]!="undefined"){var C=B,u=Object(fe.a)(C,1);I=u[0]}if(B=I.split("Twitter"),typeof B[1]!="undefined"){var g=B,f=Object(fe.a)(g,1);I=f[0]}var S={apple:{phone:X(oe,I)&&!X(Ne,I),ipod:X(Be,I),tablet:!X(oe,I)&&X(E,I)&&!X(Ne,I),device:(X(oe,I)||X(Be,I)||X(E,I))&&!X(Ne,I)},amazon:{phone:X(pe,I),tablet:!X(pe,I)&&X(ve,I),device:X(pe,I)||X(ve,I)},android:{phone:!X(Ne,I)&&X(pe,I)||!X(Ne,I)&&X(d,I),tablet:!X(Ne,I)&&!X(pe,I)&&!X(d,I)&&(X(ve,I)||X(W,I)),device:!X(Ne,I)&&(X(pe,I)||X(ve,I)||X(d,I)||X(W,I))||X(/\bokhttp\b/i,I)},windows:{phone:X(Ne,I),tablet:X(qe,I),device:X(Ne,I)||X(qe,I)},other:{blackberry:X(Me,I),blackberry10:X(Ve,I),opera:X(ke,I),firefox:X(Q,I),chrome:X(Re,I),device:X(Me,I)||X(Ve,I)||X(ke,I)||X(Q,I)||X(Re,I)},any:null,phone:null,tablet:null};return S.any=S.apple.device||S.android.device||S.windows.device||S.other.device,S.phone=S.apple.phone||S.android.phone||S.windows.phone,S.tablet=S.apple.tablet||S.android.tablet||S.windows.tablet,S}var at=Object(H.a)(Object(H.a)({},He()),{},{isMobile:He}),pt=at;function Ye(){}function rt(y,I,B){var C=I||"";return y.key||"".concat(C,"item_").concat(B)}function je(y){return"".concat(y,"-menu-")}function Fe(y,I){var B=-1;v.Children.forEach(y,function(C){B+=1,C&&C.type&&C.type.isMenuItemGroup?v.Children.forEach(C.props.children,function(u){B+=1,I(u,B)}):I(C,B)})}function $e(y,I,B){if(!y||B.find)return;v.Children.forEach(y,function(C){if(C){var u=C.type;if(!u||!(u.isSubMenu||u.isMenuItem||u.isMenuItemGroup))return;I.indexOf(C.key)!==-1?B.find=!0:C.props.children&&$e(C.props.children,I,B)}})}var tt=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],Ge=function(I){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,C=I&&typeof I.getBoundingClientRect=="function"&&I.getBoundingClientRect().width;if(C){if(B){var u=getComputedStyle(I),g=u.marginLeft,f=u.marginRight;C+=+g.replace("px","")+ +f.replace("px","")}C=+C.toFixed(6)}return C||0},_e=function(I,B,C){I&&Object(xe.a)(I.style)==="object"&&(I.style[B]=C)},Pe=function(){return pt.any},st=m("bdgK"),lt=m("i8i4"),dt=m.n(lt),et=m("wgJM"),wt=m("l4aY"),mt=m("m+aA"),ut=m("c+Xe"),Ee=m("zT1h"),xt=m("QC+M");function ct(y,I,B){return B?y[0]===I[0]:y[0]===I[0]&&y[1]===I[1]}function Se(y,I,B){var C=y[I]||{};return Object(H.a)(Object(H.a)({},C),B)}function Ke(y,I,B,C){for(var u=B.points,g=Object.keys(y),f=0;f<g.length;f+=1){var S=g[f];if(ct(y[S].points,u,C))return"".concat(I,"-placement-").concat(S)}return""}var k=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var y=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(y)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(y==null?void 0:y.substr(0,4)))},D=m("MNnm");function j(y,I){var B={};return B[y.toLowerCase()]=I.toLowerCase(),B["Webkit".concat(y)]="webkit".concat(I),B["Moz".concat(y)]="moz".concat(I),B["ms".concat(y)]="MS".concat(I),B["O".concat(y)]="o".concat(I.toLowerCase()),B}function h(y,I){var B={animationend:j("Animation","AnimationEnd"),transitionend:j("Transition","TransitionEnd")};return y&&("AnimationEvent"in I||delete B.animationend.animation,"TransitionEvent"in I||delete B.transitionend.transition),B}var p=h(Object(D.a)(),typeof window!="undefined"?window:{}),b={};if(Object(D.a)()){var x=document.createElement("div");b=x.style}var Y={};function de(y){if(Y[y])return Y[y];var I=p[y];if(I)for(var B=Object.keys(I),C=B.length,u=0;u<C;u+=1){var g=B[u];if(Object.prototype.hasOwnProperty.call(I,g)&&g in b)return Y[y]=I[g],Y[y]}return""}var Ae=de("animationend"),gt=de("transitionend"),Rt=!!(Ae&&gt),Ot=Ae||"animationend",On=gt||"transitionend";function Kt(y,I){if(!y)return null;if(Object(xe.a)(y)==="object"){var B=I.replace(/-\w/g,function(C){return C[1].toUpperCase()});return y[B]}return"".concat(y,"-").concat(I)}var Ct="none",Mn="appear",Qt="enter",jn="leave",Ln="none",Pt="prepare",Qn="start",hr="active",qn="end";function br(y){var I=Object(v.useRef)(!1),B=Object(v.useState)(y),C=Object(fe.a)(B,2),u=C[0],g=C[1];function f(S){I.current||g(S)}return Object(v.useEffect)(function(){return function(){I.current=!0}},[]),[u,f]}var yr=Object(D.a)()?v.useLayoutEffect:v.useEffect,Ri=yr,pr=function(){var y=v.useRef(null);function I(){et.a.cancel(y.current)}function B(C){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;I();var g=Object(et.a)(function(){u<=1?C({isCanceled:function(){return g!==y.current}}):B(C,u-1)});y.current=g}return v.useEffect(function(){return function(){I()}},[]),[B,I]},Wr=[Pt,Qn,hr,qn],ti=!1,mn=!0;function ht(y){return y===hr||y===qn}var Tr=function(y,I){var B=v.useState(Ln),C=Object(fe.a)(B,2),u=C[0],g=C[1],f=pr(),S=Object(fe.a)(f,2),M=S[0],z=S[1];function F(){g(Pt)}return Ri(function(){if(u!==Ln&&u!==qn){var J=Wr.indexOf(u),ye=Wr[J+1],We=I(u);We===ti?g(ye):M(function(Ue){function Je(){if(Ue.isCanceled())return;g(ye)}We===!0?Je():Promise.resolve(We).then(Je)})}},[y,u]),v.useEffect(function(){return function(){z()}},[]),[F,u]},mi=function(y){var I=Object(v.useRef)(),B=Object(v.useRef)(y);B.current=y;var C=v.useCallback(function(f){B.current(f)},[]);function u(f){f&&(f.removeEventListener(On,C),f.removeEventListener(Ot,C))}function g(f){I.current&&I.current!==f&&u(I.current),f&&f!==I.current&&(f.addEventListener(On,C),f.addEventListener(Ot,C),I.current=f)}return v.useEffect(function(){return function(){u(I.current)}},[]),[g,u]};function mr(y,I,B,C){var u=C.motionEnter,g=u===void 0?!0:u,f=C.motionAppear,S=f===void 0?!0:f,M=C.motionLeave,z=M===void 0?!0:M,F=C.motionDeadline,J=C.motionLeaveImmediately,ye=C.onAppearPrepare,We=C.onEnterPrepare,Ue=C.onLeavePrepare,Je=C.onAppearStart,St=C.onEnterStart,Ut=C.onLeaveStart,Lt=C.onAppearActive,jt=C.onEnterActive,Ft=C.onLeaveActive,It=C.onAppearEnd,Nt=C.onEnterEnd,Xt=C.onLeaveEnd,Bt=C.onVisibleChanged,vn=br(),zt=Object(fe.a)(vn,2),Et=zt[0],bt=zt[1],Ht=br(Ct),Gt=Object(fe.a)(Ht,2),ft=Gt[0],$t=Gt[1],gn=br(null),Zt=Object(fe.a)(gn,2),sn=Zt[0],an=Zt[1],_n=Object(v.useRef)(!1),In=Object(v.useRef)(null),yn=Object(v.useRef)(!1),Yn=Object(v.useRef)(null);function xr(){var cn=B();return cn||Yn.current}var rr=Object(v.useRef)(!1);function Un(cn){var nn=xr();if(cn&&!cn.deadline&&cn.target!==nn)return;var Fn;ft===Mn&&rr.current?Fn=It==null?void 0:It(nn,cn):ft===Qt&&rr.current?Fn=Nt==null?void 0:Nt(nn,cn):ft===jn&&rr.current&&(Fn=Xt==null?void 0:Xt(nn,cn)),Fn!==!1&&!yn.current&&($t(Ct),an(null))}var hn=mi(Un),ln=Object(fe.a)(hn,1),xn=ln[0],bn=v.useMemo(function(){var cn,nn,Fn;switch(ft){case"appear":return cn={},Object(P.a)(cn,Pt,ye),Object(P.a)(cn,Qn,Je),Object(P.a)(cn,hr,Lt),cn;case"enter":return nn={},Object(P.a)(nn,Pt,We),Object(P.a)(nn,Qn,St),Object(P.a)(nn,hr,jt),nn;case"leave":return Fn={},Object(P.a)(Fn,Pt,Ue),Object(P.a)(Fn,Qn,Ut),Object(P.a)(Fn,hr,Ft),Fn;default:return{}}},[ft]),Er=Tr(ft,function(cn){if(cn===Pt){var nn=bn[Pt];return nn?nn(xr()):ti}if(on in bn){var Fn;an(((Fn=bn[on])===null||Fn===void 0?void 0:Fn.call(bn,xr(),null))||null)}return on===hr&&(xn(xr()),F>0&&(clearTimeout(In.current),In.current=setTimeout(function(){Un({deadline:!0})},F))),mn}),Gr=Object(fe.a)(Er,2),$r=Gr[0],on=Gr[1],Mr=ht(on);rr.current=Mr,Ri(function(){bt(I);var cn=_n.current;if(_n.current=!0,!y)return;var nn;!cn&&I&&S&&(nn=Mn),cn&&I&&g&&(nn=Qt),(cn&&!I&&z||!cn&&J&&!I&&z)&&(nn=jn),nn&&($t(nn),$r())},[I]),Object(v.useEffect)(function(){(ft===Mn&&!S||ft===Qt&&!g||ft===jn&&!z)&&$t(Ct)},[S,g,z]),Object(v.useEffect)(function(){return function(){clearTimeout(In.current),yn.current=!0}},[]),Object(v.useEffect)(function(){Et!==void 0&&ft===Ct&&(Bt==null||Bt(Et))},[Et,ft]);var Yr=sn;return bn[Pt]&&on===Qn&&(Yr=Object(H.a)({transition:"none"},Yr)),[ft,on,Yr,Et!=null?Et:I]}var Jt=function(y){Object(Oe.a)(B,y);var I=Object(re.a)(B);function B(){return Object(Te.a)(this,B),I.apply(this,arguments)}return Object(le.a)(B,[{key:"render",value:function(){return this.props.children}}]),B}(v.Component),Dr=Jt;function Br(y){var I=y;Object(xe.a)(y)==="object"&&(I=y.transitionSupport);function B(u){return!!(u.motionName&&I)}var C=v.forwardRef(function(u,g){var f=u.visible,S=f===void 0?!0:f,M=u.removeOnLeave,z=M===void 0?!0:M,F=u.forceRender,J=u.children,ye=u.motionName,We=u.leavedClassName,Ue=u.eventProps,Je=B(u),St=Object(v.useRef)(),Ut=Object(v.useRef)();function Lt(){try{return Object(mt.a)(St.current||Ut.current)}catch($t){return null}}var jt=mr(Je,S,Lt,u),Ft=Object(fe.a)(jt,4),It=Ft[0],Nt=Ft[1],Xt=Ft[2],Bt=Ft[3],vn=v.useRef(Bt);Bt&&(vn.current=!0);var zt=Object(v.useRef)(g);zt.current=g;var Et=v.useCallback(function($t){St.current=$t,Object(ut.b)(zt.current,$t)},[]),bt,Ht=Object(H.a)(Object(H.a)({},Ue),{},{visible:S});if(!J)bt=null;else if(It===Ct||!B(u))Bt?bt=J(Object(H.a)({},Ht),Et):!z&&vn.current?bt=J(Object(H.a)(Object(H.a)({},Ht),{},{className:We}),Et):F?bt=J(Object(H.a)(Object(H.a)({},Ht),{},{style:{display:"none"}}),Et):bt=null;else{var Gt,ft;Nt===Pt?ft="prepare":ht(Nt)?ft="active":Nt===Qn&&(ft="start"),bt=J(Object(H.a)(Object(H.a)({},Ht),{},{className:N()(Kt(ye,It),(Gt={},Object(P.a)(Gt,Kt(ye,"".concat(It,"-").concat(ft)),ft),Object(P.a)(Gt,ye,typeof ye=="string"),Gt)),style:Xt}),Et)}return v.createElement(Dr,{ref:Ut},bt)});return C.displayName="CSSMotion",C}var zr=Br(Rt),Ie="add",kt="keep",Xe="remove",vi="removed";function gi(y){var I;return y&&Object(xe.a)(y)==="object"&&"key"in y?I=y:I={key:y},Object(H.a)(Object(H.a)({},I),{},{key:String(I.key)})}function Ar(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return y.map(gi)}function ni(){var y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],B=[],C=0,u=I.length,g=Ar(y),f=Ar(I);g.forEach(function(z){for(var F=!1,J=C;J<u;J+=1){var ye=f[J];if(ye.key===z.key){C<J&&(B=B.concat(f.slice(C,J).map(function(We){return Object(H.a)(Object(H.a)({},We),{},{status:Ie})})),C=J),B.push(Object(H.a)(Object(H.a)({},ye),{},{status:kt})),C+=1,F=!0;break}}F||B.push(Object(H.a)(Object(H.a)({},z),{},{status:Xe}))}),C<u&&(B=B.concat(f.slice(C).map(function(z){return Object(H.a)(Object(H.a)({},z),{},{status:Ie})})));var S={};B.forEach(function(z){var F=z.key;S[F]=(S[F]||0)+1});var M=Object.keys(S).filter(function(z){return S[z]>1});return M.forEach(function(z){B=B.filter(function(F){var J=F.key,ye=F.status;return J!==z||ye!==Xe}),B.forEach(function(F){F.key===z&&(F.status=kt)})}),B}var Mt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function _a(y){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:zr,B=function(C){Object(Oe.a)(g,C);var u=Object(re.a)(g);function g(){var f;return Object(Te.a)(this,g),f=u.apply(this,arguments),f.state={keyEntities:[]},f.removeKey=function(S){f.setState(function(M){var z=M.keyEntities;return{keyEntities:z.map(function(F){return F.key!==S?F:Object(H.a)(Object(H.a)({},F),{},{status:vi})})}})},f}return Object(le.a)(g,[{key:"render",value:function(){var S=this,M=this.state.keyEntities,z=this.props,F=z.component,J=z.children,ye=z.onVisibleChanged,We=Object(te.a)(z,["component","children","onVisibleChanged"]),Ue=F||v.Fragment,Je={};return Mt.forEach(function(St){Je[St]=We[St],delete We[St]}),delete We.keys,v.createElement(Ue,We,M.map(function(St){var Ut=St.status,Lt=Object(te.a)(St,["status"]),jt=Ut===Ie||Ut===kt;return v.createElement(I,Object(ge.a)({},Je,{key:Lt.key,visible:jt,eventProps:Lt,onVisibleChanged:function(It){ye==null||ye(It,{key:Lt.key}),It||S.removeKey(Lt.key)}}),J)}))}}],[{key:"getDerivedStateFromProps",value:function(S,M){var z=S.keys,F=M.keyEntities,J=Ar(z),ye=ni(F,J);return{keyEntities:ye.filter(function(We){var Ue=F.find(function(Je){var St=Je.key;return We.key===St});return!(Ue&&Ue.status===vi&&We.status===Xe)})}}}]),g}(v.Component);return B.defaultProps={component:"div"},B}var ea=_a(Rt),$n=zr;function er(y){var I=y.prefixCls,B=y.motion,C=y.animation,u=y.transitionName;return B||(C?{motionName:"".concat(I,"-").concat(C)}:u?{motionName:u}:null)}function ta(y){var I=y.prefixCls,B=y.visible,C=y.zIndex,u=y.mask,g=y.maskMotion,f=y.maskAnimation,S=y.maskTransitionName;if(!u)return null;var M={};return(g||S||f)&&(M=Object(H.a)({motionAppear:!0},er({motion:g,prefixCls:I,transitionName:S,animation:f}))),v.createElement($n,Object(ge.a)({},M,{visible:B,removeOnLeave:!0}),function(z){var F=z.className;return v.createElement("div",{style:{zIndex:C},className:N()("".concat(I,"-mask"),F)})})}var Pi=m("9mu1"),tr=m("o0o1"),ri=m.n(tr),na=m("HaE+"),ii=["measure","align",null,"motion"],Lr=function(y,I){var B=Object(v.useState)(null),C=Object(fe.a)(B,2),u=C[0],g=C[1],f=Object(v.useRef)(),S=Object(v.useRef)(!1);function M(J){S.current||g(J)}function z(){et.a.cancel(f.current)}function F(J){z(),f.current=Object(et.a)(function(){M(function(ye){switch(u){case"align":return"motion";case"motion":return"stable";default:}return ye}),J==null||J()})}return Object(v.useEffect)(function(){M("measure")},[y]),Object(v.useEffect)(function(){switch(u){case"measure":I();break;default:}u&&(f.current=Object(et.a)(Object(na.a)(ri.a.mark(function J(){var ye,We;return ri.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:ye=ii.indexOf(u),We=ii[ye+1],We&&ye!==-1&&M(We);case 3:case"end":return Je.stop()}},J)}))))},[u]),Object(v.useEffect)(function(){return function(){S.current=!0,z()}},[]),[u,F]},Rr=function(y){var I=v.useState({width:0,height:0}),B=Object(fe.a)(I,2),C=B[0],u=B[1];function g(S){u({width:S.offsetWidth,height:S.offsetHeight})}var f=v.useMemo(function(){var S={};if(y){var M=C.width,z=C.height;y.indexOf("height")!==-1&&z?S.height=z:y.indexOf("minHeight")!==-1&&z&&(S.minHeight=z),y.indexOf("width")!==-1&&M?S.width=M:y.indexOf("minWidth")!==-1&&M&&(S.minWidth=M)}return S},[y,C]);return[f,g]},ji=v.forwardRef(function(y,I){var B=y.visible,C=y.prefixCls,u=y.className,g=y.style,f=y.children,S=y.zIndex,M=y.stretch,z=y.destroyPopupOnHide,F=y.forceRender,J=y.align,ye=y.point,We=y.getRootDomNode,Ue=y.getClassNameFromAlign,Je=y.onAlign,St=y.onMouseEnter,Ut=y.onMouseLeave,Lt=y.onMouseDown,jt=y.onTouchStart,Ft=Object(v.useRef)(),It=Object(v.useRef)(),Nt=Object(v.useState)(),Xt=Object(fe.a)(Nt,2),Bt=Xt[0],vn=Xt[1],zt=Rr(M),Et=Object(fe.a)(zt,2),bt=Et[0],Ht=Et[1];function Gt(){M&&Ht(We())}var ft=Lr(B,Gt),$t=Object(fe.a)(ft,2),gn=$t[0],Zt=$t[1],sn=Object(v.useRef)();function an(){return ye||We}function _n(){var hn;(hn=Ft.current)===null||hn===void 0||hn.forceAlign()}function In(hn,ln){var xn=Ue(ln);Bt!==xn&&vn(xn),gn==="align"&&(Bt!==xn?Promise.resolve().then(function(){_n()}):Zt(function(){var bn;(bn=sn.current)===null||bn===void 0||bn.call(sn)}),Je==null||Je(hn,ln))}var yn=Object(H.a)({},er(y));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(hn){var ln=yn[hn];yn[hn]=function(xn,bn){return Zt(),ln==null?void 0:ln(xn,bn)}});function Yn(){return new Promise(function(hn){sn.current=hn})}v.useEffect(function(){!yn.motionName&&gn==="motion"&&Zt()},[yn.motionName,gn]),v.useImperativeHandle(I,function(){return{forceAlign:_n,getElement:function(){return It.current}}});var xr=Object(H.a)(Object(H.a)({},bt),{},{zIndex:S,opacity:gn==="motion"||gn==="stable"||!B?void 0:0,pointerEvents:gn==="stable"?void 0:"none"},g),rr=!0;(J==null?void 0:J.points)&&(gn==="align"||gn==="stable")&&(rr=!1);var Un=f;return v.Children.count(f)>1&&(Un=v.createElement("div",{className:"".concat(C,"-content")},f)),v.createElement($n,Object(ge.a)({visible:B,ref:It,leavedClassName:"".concat(C,"-hidden")},yn,{onAppearPrepare:Yn,onEnterPrepare:Yn,removeOnLeave:z,forceRender:F}),function(hn,ln){var xn=hn.className,bn=hn.style,Er=N()(C,u,Bt,xn);return v.createElement(Pi.a,{target:an(),key:"popup",ref:Ft,monitorWindowResize:!0,disabled:rr,align:J,onAlign:In},v.createElement("div",{ref:ln,className:Er,onMouseEnter:St,onMouseLeave:Ut,onMouseDownCapture:Lt,onTouchStartCapture:jt,style:Object(H.a)(Object(H.a)({},bn),xr)},Un))})});ji.displayName="PopupInner";var Ni=ji,Hr=v.forwardRef(function(y,I){var B=y.prefixCls,C=y.visible,u=y.zIndex,g=y.children,f=y.mobile;f=f===void 0?{}:f;var S=f.popupClassName,M=f.popupStyle,z=f.popupMotion,F=z===void 0?{}:z,J=f.popupRender,ye=v.useRef();v.useImperativeHandle(I,function(){return{forceAlign:function(){},getElement:function(){return ye.current}}});var We=Object(H.a)({zIndex:u},M),Ue=g;return v.Children.count(g)>1&&(Ue=v.createElement("div",{className:"".concat(B,"-content")},g)),J&&(Ue=J(Ue)),v.createElement($n,Object(ge.a)({visible:C,ref:ye,removeOnLeave:!0},F),function(Je,St){var Ut=Je.className,Lt=Je.style,jt=N()(B,S,Ut);return v.createElement("div",{ref:St,className:jt,style:Object(H.a)(Object(H.a)({},Lt),We)},Ue)})});Hr.displayName="MobilePopupInner";var Ii=Hr,ra=["visible","mobile"],lr=v.forwardRef(function(y,I){var B=y.visible,C=y.mobile,u=Object(te.a)(y,ra),g=Object(v.useState)(B),f=Object(fe.a)(g,2),S=f[0],M=f[1],z=Object(v.useState)(!1),F=Object(fe.a)(z,2),J=F[0],ye=F[1],We=Object(H.a)(Object(H.a)({},u),{},{visible:S});Object(v.useEffect)(function(){M(B),B&&C&&ye(k())},[B,C]);var Ue=J?v.createElement(Ii,Object(ge.a)({},We,{mobile:C,ref:I})):v.createElement(Ni,Object(ge.a)({},We,{ref:I}));return v.createElement("div",null,v.createElement(ta,We),Ue)});lr.displayName="Popup";var ia=lr,aa=v.createContext(null),ai=aa;function Sr(){}function oo(){return""}function Ui(y){return y?y.ownerDocument:window.document}var oi=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Fi(y){var I=function(B){Object(Oe.a)(u,B);var C=Object(re.a)(u);function u(g){var f;Object(Te.a)(this,u),f=C.call(this,g),f.popupRef=v.createRef(),f.triggerRef=v.createRef(),f.attachId=void 0,f.clickOutsideHandler=void 0,f.touchOutsideHandler=void 0,f.contextMenuOutsideHandler1=void 0,f.contextMenuOutsideHandler2=void 0,f.mouseDownTimeout=void 0,f.focusTime=void 0,f.preClickTime=void 0,f.preTouchTime=void 0,f.delayTimer=void 0,f.hasPopupMouseDown=void 0,f.onMouseEnter=function(M){var z=f.props.mouseEnterDelay;f.fireEvents("onMouseEnter",M),f.delaySetPopupVisible(!0,z,z?null:M)},f.onMouseMove=function(M){f.fireEvents("onMouseMove",M),f.setPoint(M)},f.onMouseLeave=function(M){f.fireEvents("onMouseLeave",M),f.delaySetPopupVisible(!1,f.props.mouseLeaveDelay)},f.onPopupMouseEnter=function(){f.clearDelayTimer()},f.onPopupMouseLeave=function(M){var z;if(M.relatedTarget&&!M.relatedTarget.setTimeout&&Object(wt.a)((z=f.popupRef.current)===null||z===void 0?void 0:z.getElement(),M.relatedTarget))return;f.delaySetPopupVisible(!1,f.props.mouseLeaveDelay)},f.onFocus=function(M){f.fireEvents("onFocus",M),f.clearDelayTimer(),f.isFocusToShow()&&(f.focusTime=Date.now(),f.delaySetPopupVisible(!0,f.props.focusDelay))},f.onMouseDown=function(M){f.fireEvents("onMouseDown",M),f.preClickTime=Date.now()},f.onTouchStart=function(M){f.fireEvents("onTouchStart",M),f.preTouchTime=Date.now()},f.onBlur=function(M){f.fireEvents("onBlur",M),f.clearDelayTimer(),f.isBlurToHide()&&f.delaySetPopupVisible(!1,f.props.blurDelay)},f.onContextMenu=function(M){M.preventDefault(),f.fireEvents("onContextMenu",M),f.setPopupVisible(!0,M)},f.onContextMenuClose=function(){f.isContextMenuToShow()&&f.close()},f.onClick=function(M){if(f.fireEvents("onClick",M),f.focusTime){var z;if(f.preClickTime&&f.preTouchTime?z=Math.min(f.preClickTime,f.preTouchTime):f.preClickTime?z=f.preClickTime:f.preTouchTime&&(z=f.preTouchTime),Math.abs(z-f.focusTime)<20)return;f.focusTime=0}f.preClickTime=0,f.preTouchTime=0,f.isClickToShow()&&(f.isClickToHide()||f.isBlurToHide())&&M&&M.preventDefault&&M.preventDefault();var F=!f.state.popupVisible;(f.isClickToHide()&&!F||F&&f.isClickToShow())&&f.setPopupVisible(!f.state.popupVisible,M)},f.onPopupMouseDown=function(){if(f.hasPopupMouseDown=!0,clearTimeout(f.mouseDownTimeout),f.mouseDownTimeout=window.setTimeout(function(){f.hasPopupMouseDown=!1},0),f.context){var M;(M=f.context).onPopupMouseDown.apply(M,arguments)}},f.onDocumentClick=function(M){if(f.props.mask&&!f.props.maskClosable)return;var z=M.target,F=f.getRootDomNode(),J=f.getPopupDomNode();(!Object(wt.a)(F,z)||f.isContextMenuOnly())&&!Object(wt.a)(J,z)&&!f.hasPopupMouseDown&&f.close()},f.getRootDomNode=function(){var M=f.props.getTriggerDOMNode;if(M)return M(f.triggerRef.current);try{var z=Object(mt.a)(f.triggerRef.current);if(z)return z}catch(F){}return dt.a.findDOMNode(Object(se.a)(f))},f.getPopupClassNameFromAlign=function(M){var z=[],F=f.props,J=F.popupPlacement,ye=F.builtinPlacements,We=F.prefixCls,Ue=F.alignPoint,Je=F.getPopupClassNameFromAlign;return J&&ye&&z.push(Ke(ye,We,M,Ue)),Je&&z.push(Je(M)),z.join(" ")},f.getComponent=function(){var M=f.props,z=M.prefixCls,F=M.destroyPopupOnHide,J=M.popupClassName,ye=M.onPopupAlign,We=M.popupMotion,Ue=M.popupAnimation,Je=M.popupTransitionName,St=M.popupStyle,Ut=M.mask,Lt=M.maskAnimation,jt=M.maskTransitionName,Ft=M.maskMotion,It=M.zIndex,Nt=M.popup,Xt=M.stretch,Bt=M.alignPoint,vn=M.mobile,zt=M.forceRender,Et=f.state,bt=Et.popupVisible,Ht=Et.point,Gt=f.getPopupAlign(),ft={};return f.isMouseEnterToShow()&&(ft.onMouseEnter=f.onPopupMouseEnter),f.isMouseLeaveToHide()&&(ft.onMouseLeave=f.onPopupMouseLeave),ft.onMouseDown=f.onPopupMouseDown,ft.onTouchStart=f.onPopupMouseDown,v.createElement(ia,Object(ge.a)({prefixCls:z,destroyPopupOnHide:F,visible:bt,point:Bt&&Ht,className:J,align:Gt,onAlign:ye,animation:Ue,getClassNameFromAlign:f.getPopupClassNameFromAlign},ft,{stretch:Xt,getRootDomNode:f.getRootDomNode,style:St,mask:Ut,zIndex:It,transitionName:Je,maskAnimation:Lt,maskTransitionName:jt,maskMotion:Ft,ref:f.popupRef,motion:We,mobile:vn,forceRender:zt}),typeof Nt=="function"?Nt():Nt)},f.attachParent=function(M){et.a.cancel(f.attachId);var z=f.props,F=z.getPopupContainer,J=z.getDocument,ye=f.getRootDomNode(),We;F?(ye||F.length===0)&&(We=F(ye)):We=J(f.getRootDomNode()).body,We?We.appendChild(M):f.attachId=Object(et.a)(function(){f.attachParent(M)})},f.getContainer=function(){var M=f.props.getDocument,z=M(f.getRootDomNode()).createElement("div");return z.style.position="absolute",z.style.top="0",z.style.left="0",z.style.width="100%",f.attachParent(z),z},f.setPoint=function(M){var z=f.props.alignPoint;if(!z||!M)return;f.setState({point:{pageX:M.pageX,pageY:M.pageY}})},f.handlePortalUpdate=function(){f.state.prevPopupVisible!==f.state.popupVisible&&f.props.afterPopupVisibleChange(f.state.popupVisible)},f.triggerContextValue={onPopupMouseDown:f.onPopupMouseDown};var S;return"popupVisible"in g?S=!!g.popupVisible:S=!!g.defaultPopupVisible,f.state={prevPopupVisible:S,popupVisible:S},oi.forEach(function(M){f["fire".concat(M)]=function(z){f.fireEvents(M,z)}}),f}return Object(le.a)(u,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var f=this.props,S=this.state;if(S.popupVisible){var M;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(M=f.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ee.a)(M,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(M=M||f.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ee.a)(M,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(M=M||f.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ee.a)(M,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ee.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),et.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var f;return((f=this.popupRef.current)===null||f===void 0?void 0:f.getElement())||null}},{key:"getPopupAlign",value:function(){var f=this.props,S=f.popupPlacement,M=f.popupAlign,z=f.builtinPlacements;return S&&z?Se(z,S,M):M}},{key:"setPopupVisible",value:function(f,S){var M=this.props.alignPoint,z=this.state.popupVisible;this.clearDelayTimer(),z!==f&&("popupVisible"in this.props||this.setState({popupVisible:f,prevPopupVisible:z}),this.props.onPopupVisibleChange(f)),M&&S&&f&&this.setPoint(S)}},{key:"delaySetPopupVisible",value:function(f,S,M){var z=this,F=S*1e3;if(this.clearDelayTimer(),F){var J=M?{pageX:M.pageX,pageY:M.pageY}:null;this.delayTimer=window.setTimeout(function(){z.setPopupVisible(f,J),z.clearDelayTimer()},F)}else this.setPopupVisible(f,M)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(f){var S=this.props.children.props,M=this.props;return S[f]&&M[f]?this["fire".concat(f)]:S[f]||M[f]}},{key:"isClickToShow",value:function(){var f=this.props,S=f.action,M=f.showAction;return S.indexOf("click")!==-1||M.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var f=this.props.action;return f==="contextMenu"||f.length===1&&f[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var f=this.props,S=f.action,M=f.showAction;return S.indexOf("contextMenu")!==-1||M.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var f=this.props,S=f.action,M=f.hideAction;return S.indexOf("click")!==-1||M.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var f=this.props,S=f.action,M=f.showAction;return S.indexOf("hover")!==-1||M.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var f=this.props,S=f.action,M=f.hideAction;return S.indexOf("hover")!==-1||M.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var f=this.props,S=f.action,M=f.showAction;return S.indexOf("focus")!==-1||M.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var f=this.props,S=f.action,M=f.hideAction;return S.indexOf("focus")!==-1||M.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var f;(f=this.popupRef.current)===null||f===void 0||f.forceAlign()}}},{key:"fireEvents",value:function(f,S){var M=this.props.children.props[f];M&&M(S);var z=this.props[f];z&&z(S)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var f=this.state.popupVisible,S=this.props,M=S.children,z=S.forceRender,F=S.alignPoint,J=S.className,ye=S.autoDestroy,We=v.Children.only(M),Ue={key:"trigger"};this.isContextMenuToShow()?Ue.onContextMenu=this.onContextMenu:Ue.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(Ue.onClick=this.onClick,Ue.onMouseDown=this.onMouseDown,Ue.onTouchStart=this.onTouchStart):(Ue.onClick=this.createTwoChains("onClick"),Ue.onMouseDown=this.createTwoChains("onMouseDown"),Ue.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(Ue.onMouseEnter=this.onMouseEnter,F&&(Ue.onMouseMove=this.onMouseMove)):Ue.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?Ue.onMouseLeave=this.onMouseLeave:Ue.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(Ue.onFocus=this.onFocus,Ue.onBlur=this.onBlur):(Ue.onFocus=this.createTwoChains("onFocus"),Ue.onBlur=this.createTwoChains("onBlur"));var Je=N()(We&&We.props&&We.props.className,J);Je&&(Ue.className=Je);var St=Object(H.a)({},Ue);Object(ut.c)(We)&&(St.ref=Object(ut.a)(this.triggerRef,We.ref));var Ut=v.cloneElement(We,St),Lt;return(f||this.popupRef.current||z)&&(Lt=v.createElement(y,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!f&&ye&&(Lt=null),v.createElement(ai.Provider,{value:this.triggerContextValue},Ut,Lt)}}],[{key:"getDerivedStateFromProps",value:function(f,S){var M=f.popupVisible,z={};return M!==void 0&&S.popupVisible!==M&&(z.popupVisible=M,z.prevPopupVisible=S.popupVisible),z}}]),u}(v.Component);return I.contextType=ai,I.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:oo,getDocument:Ui,onPopupVisibleChange:Sr,afterPopupVisibleChange:Sr,onPopupAlign:Sr,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},I}var Kr=Fi(xt.a),nr={adjustX:1,adjustY:1},Wi={topLeft:{points:["bl","tl"],overflow:nr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:nr,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:nr,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:nr,offset:[4,0]}},Bi={topLeft:{points:["bl","tl"],overflow:nr,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:nr,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:nr,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:nr,offset:[4,0]}},bi=Wi,si=0,_r={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},Pr=function(I,B,C){var u=je(B),g=I.getState();I.setState({defaultActiveFirst:Object(H.a)(Object(H.a)({},g.defaultActiveFirst),{},Object(P.a)({},u,C))})},zi=function(y){Object(Oe.a)(B,y);var I=Object(re.a)(B);function B(C){var u;Object(Te.a)(this,B),u=I.call(this,C),u.onDestroy=function(F){u.props.onDestroy(F)},u.onKeyDown=function(F){var J=F.keyCode,ye=u.menuInstance,We=u.props.store,Ue=u.getVisible();if(J===T.a.ENTER)return u.onTitleClick(F),Pr(We,u.props.eventKey,!0),!0;if(J===T.a.RIGHT)return Ue?ye.onKeyDown(F):(u.triggerOpenChange(!0),Pr(We,u.props.eventKey,!0)),!0;if(J===T.a.LEFT){var Je;if(Ue)Je=ye.onKeyDown(F);else return;return Je||(u.triggerOpenChange(!1),Je=!0),Je}return Ue&&(J===T.a.UP||J===T.a.DOWN)?ye.onKeyDown(F):void 0},u.onOpenChange=function(F){u.props.onOpenChange(F)},u.onPopupVisibleChange=function(F){u.triggerOpenChange(F,F?"mouseenter":"mouseleave")},u.onMouseEnter=function(F){var J=u.props,ye=J.eventKey,We=J.onMouseEnter,Ue=J.store;Pr(Ue,u.props.eventKey,!1),We({key:ye,domEvent:F})},u.onMouseLeave=function(F){var J=u.props,ye=J.parentMenu,We=J.eventKey,Ue=J.onMouseLeave;ye.subMenuInstance=Object(se.a)(u),Ue({key:We,domEvent:F})},u.onTitleMouseEnter=function(F){var J=u.props,ye=J.eventKey,We=J.onItemHover,Ue=J.onTitleMouseEnter;We({key:ye,hover:!0}),Ue({key:ye,domEvent:F})},u.onTitleMouseLeave=function(F){var J=u.props,ye=J.parentMenu,We=J.eventKey,Ue=J.onItemHover,Je=J.onTitleMouseLeave;ye.subMenuInstance=Object(se.a)(u),Ue({key:We,hover:!1}),Je({key:We,domEvent:F})},u.onTitleClick=function(F){var J=Object(se.a)(u),ye=J.props;if(ye.onTitleClick({key:ye.eventKey,domEvent:F}),ye.triggerSubMenuAction==="hover")return;u.triggerOpenChange(!u.getVisible(),"click"),Pr(ye.store,u.props.eventKey,!1)},u.onSubMenuClick=function(F){typeof u.props.onClick=="function"&&u.props.onClick(u.addKeyPath(F))},u.onSelect=function(F){u.props.onSelect(F)},u.onDeselect=function(F){u.props.onDeselect(F)},u.getPrefixCls=function(){return"".concat(u.props.rootPrefixCls,"-submenu")},u.getActiveClassName=function(){return"".concat(u.getPrefixCls(),"-active")},u.getDisabledClassName=function(){return"".concat(u.getPrefixCls(),"-disabled")},u.getSelectedClassName=function(){return"".concat(u.getPrefixCls(),"-selected")},u.getOpenClassName=function(){return"".concat(u.props.rootPrefixCls,"-submenu-open")},u.getVisible=function(){return u.state.isOpen},u.getMode=function(){return u.state.mode},u.saveMenuInstance=function(F){u.menuInstance=F},u.addKeyPath=function(F){return Object(H.a)(Object(H.a)({},F),{},{keyPath:(F.keyPath||[]).concat(u.props.eventKey)})},u.triggerOpenChange=function(F,J){var ye=u.props.eventKey,We=function(){u.onOpenChange({key:ye,item:Object(se.a)(u),trigger:J,open:F})};J==="mouseenter"?u.mouseenterTimeout=setTimeout(function(){We()},0):We()},u.isChildrenSelected=function(){var F={find:!1};return $e(u.props.children,u.props.selectedKeys,F),F.find},u.isInlineMode=function(){return u.getMode()==="inline"},u.adjustWidth=function(){if(!u.subMenuTitle||!u.menuInstance)return;var F=lt.findDOMNode(u.menuInstance);if(F.offsetWidth>=u.subMenuTitle.offsetWidth)return;F.style.minWidth="".concat(u.subMenuTitle.offsetWidth,"px")},u.saveSubMenuTitle=function(F){u.subMenuTitle=F},u.getBaseProps=function(){var F=Object(se.a)(u),J=F.props,ye=u.getMode();return{mode:ye==="horizontal"?"vertical":ye,visible:u.getVisible(),level:J.level+1,inlineIndent:J.inlineIndent,focusable:!1,onClick:u.onSubMenuClick,onSelect:u.onSelect,onDeselect:u.onDeselect,onDestroy:u.onDestroy,selectedKeys:J.selectedKeys,eventKey:"".concat(J.eventKey,"-menu-"),openKeys:J.openKeys,motion:J.motion,onOpenChange:u.onOpenChange,subMenuOpenDelay:J.subMenuOpenDelay,parentMenu:Object(se.a)(u),subMenuCloseDelay:J.subMenuCloseDelay,forceSubMenuRender:J.forceSubMenuRender,triggerSubMenuAction:J.triggerSubMenuAction,builtinPlacements:J.builtinPlacements,defaultActiveFirst:J.store.getState().defaultActiveFirst[je(J.eventKey)],multiple:J.multiple,prefixCls:J.rootPrefixCls,id:u.internalMenuId,manualRef:u.saveMenuInstance,itemIcon:J.itemIcon,expandIcon:J.expandIcon,direction:J.direction}},u.getMotion=function(F,J){var ye=Object(se.a)(u),We=ye.haveRendered,Ue=u.props,Je=Ue.motion,St=Ue.rootPrefixCls,Ut=Object(H.a)(Object(H.a)({},Je),{},{leavedClassName:"".concat(St,"-hidden"),removeOnLeave:!1,motionAppear:We||!J||F!=="inline"});return Ut};var g=C.store,f=C.eventKey,S=g.getState(),M=S.defaultActiveFirst;u.isRootMenu=!1;var z=!1;return M&&(z=M[f]),Pr(g,f,z),u.state={mode:C.mode,isOpen:C.isOpen},u}return Object(le.a)(B,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var u=this,g=this.props,f=g.mode,S=g.parentMenu,M=g.manualRef,z=g.isOpen,F=function(){u.setState({mode:f,isOpen:z})},J=z!==this.state.isOpen,ye=f!==this.state.mode;if((ye||J)&&(et.a.cancel(this.updateStateRaf),ye?this.updateStateRaf=Object(et.a)(F):F()),M&&M(this),f!=="horizontal"||!(S==null?void 0:S.isRootMenu)||!z)return;this.minWidthTimeout=setTimeout(function(){return u.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var u=this.props,g=u.onDestroy,f=u.eventKey;g&&g(f),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),et.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(u,g){var f=this.getBaseProps();return v.createElement(vr,Object(ge.a)({},f,{id:this.internalMenuId,className:u,style:g}),this.props.children)}},{key:"renderChildren",value:function(){var u=this,g=this.getBaseProps(),f=g.mode,S=g.visible,M=g.forceSubMenuRender,z=g.direction,F=this.getMotion(f,S);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||S||M,!this.haveOpened)return v.createElement("div",null);var J=N()("".concat(g.prefixCls,"-sub"),Object(P.a)({},"".concat(g.prefixCls,"-rtl"),z==="rtl"));return this.isInlineMode()?v.createElement($n,Object(ge.a)({visible:g.visible,forceRender:M},F),function(ye){var We=ye.className,Ue=ye.style,Je=N()(J,We);return u.renderPopupMenu(Je,Ue)}):this.renderPopupMenu(J)}},{key:"render",value:function(){var u,g,f,S=Object(H.a)({},this.props),M=this.getVisible(),z=this.getPrefixCls(),F=this.isInlineMode(),J=this.getMode(),ye=N()(z,"".concat(z,"-").concat(J),(u={},Object(P.a)(u,S.className,!!S.className),Object(P.a)(u,this.getOpenClassName(),M),Object(P.a)(u,this.getActiveClassName(),S.active||M&&!F),Object(P.a)(u,this.getDisabledClassName(),S.disabled),Object(P.a)(u,this.getSelectedClassName(),this.isChildrenSelected()),u));this.internalMenuId||(S.eventKey?this.internalMenuId="".concat(S.eventKey,"$Menu"):(si+=1,this.internalMenuId="$__$".concat(si,"$Menu")));var We={},Ue={},Je={};S.disabled||(We={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},Ue={onClick:this.onTitleClick},Je={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var St={},Ut=S.direction,Lt=Ut==="rtl";F&&(Lt?St.paddingRight=S.inlineIndent*S.level:St.paddingLeft=S.inlineIndent*S.level);var jt={};this.getVisible()&&(jt={"aria-owns":this.internalMenuId});var Ft=null;J!=="horizontal"&&(Ft=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(Ft=v.createElement(this.props.expandIcon,Object(H.a)({},this.props))));var It=v.createElement("div",Object(ge.a)({ref:this.saveSubMenuTitle,style:St,className:"".concat(z,"-title"),role:"button"},Je,Ue,{"aria-expanded":M},jt,{"aria-haspopup":"true",title:typeof S.title=="string"?S.title:void 0}),S.title,Ft||v.createElement("i",{className:"".concat(z,"-arrow")})),Nt=this.renderChildren(),Xt=((g=S.parentMenu)===null||g===void 0?void 0:g.isRootMenu)?S.parentMenu.props.getPopupContainer:function(an){return an.parentNode},Bt=_r[J],vn=S.popupOffset?{offset:S.popupOffset}:{},zt=N()((f={},Object(P.a)(f,S.popupClassName,S.popupClassName&&!F),Object(P.a)(f,"".concat(z,"-rtl"),Lt),f)),Et=S.disabled,bt=S.triggerSubMenuAction,Ht=S.subMenuOpenDelay,Gt=S.forceSubMenuRender,ft=S.subMenuCloseDelay,$t=S.builtinPlacements;tt.forEach(function(an){return delete S[an]}),delete S.onClick;var gn=Lt?Object(H.a)(Object(H.a)({},Bi),$t):Object(H.a)(Object(H.a)({},Wi),$t);delete S.direction;var Zt=this.getBaseProps(),sn=F?null:this.getMotion(Zt.mode,Zt.visible);return v.createElement("li",Object(ge.a)({},S,We,{className:ye,role:"menuitem"}),v.createElement(Kr,{prefixCls:z,popupClassName:N()("".concat(z,"-popup"),zt),getPopupContainer:Xt,builtinPlacements:gn,popupPlacement:Bt,popupVisible:F?!1:M,popupAlign:vn,popup:F?null:Nt,action:Et||F?[]:[bt],mouseEnterDelay:Ht,mouseLeaveDelay:ft,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:Gt,popupMotion:sn},It),F?Nt:null)}}]),B}(v.Component);zi.defaultProps={onMouseEnter:Ye,onMouseLeave:Ye,onTitleMouseEnter:Ye,onTitleMouseLeave:Ye,onTitleClick:Ye,manualRef:Ye,mode:"vertical",title:""};var Hi=Object(w.b)(function(y,I){var B=y.openKeys,C=y.activeKey,u=y.selectedKeys,g=I.eventKey,f=I.subMenuKey;return{isOpen:B.indexOf(g)>-1,active:C[f]===g,selectedKeys:u}})(zi);Hi.isSubMenu=!0;var Ki=Hi,ka="menuitem-overflowed",Ma=.5,vt=function(y){Object(Oe.a)(B,y);var I=Object(re.a)(B);function B(){var C;return Object(Te.a)(this,B),C=I.apply(this,arguments),C.resizeObserver=null,C.mutationObserver=null,C.originalTotalWidth=0,C.overflowedItems=[],C.menuItemSizes=[],C.cancelFrameId=null,C.state={lastVisibleIndex:void 0},C.childRef=v.createRef(),C.getMenuItemNodes=function(){var u=C.props.prefixCls,g=C.childRef.current;return g?[].slice.call(g.children).filter(function(f){return f.className.split(" ").indexOf("".concat(u,"-overflowed-submenu"))<0}):[]},C.getOverflowedSubMenuItem=function(u,g,f){var S=C.props,M=S.overflowedIndicator,z=S.level,F=S.mode,J=S.prefixCls,ye=S.theme;if(z!==1||F!=="horizontal")return null;var We=C.props.children[0],Ue=We.props,Je=Ue.children,St=Ue.title,Ut=Ue.style,Lt=Object(te.a)(Ue,["children","title","style"]),jt=Object(H.a)({},Ut),Ft="".concat(u,"-overflowed-indicator"),It="".concat(u,"-overflowed-indicator");g.length===0&&f!==!0?jt=Object(H.a)(Object(H.a)({},jt),{},{display:"none"}):f&&(jt=Object(H.a)(Object(H.a)({},jt),{},{visibility:"hidden",position:"absolute"}),Ft="".concat(Ft,"-placeholder"),It="".concat(It,"-placeholder"));var Nt=ye?"".concat(J,"-").concat(ye):"",Xt={};return tt.forEach(function(Bt){Lt[Bt]!==void 0&&(Xt[Bt]=Lt[Bt])}),v.createElement(Ki,Object(ge.a)({title:M,className:"".concat(J,"-overflowed-submenu"),popupClassName:Nt},Xt,{key:Ft,eventKey:It,disabled:!1,style:jt}),g)},C.setChildrenWidthAndResize=function(){if(C.props.mode!=="horizontal")return;var u=C.childRef.current;if(!u)return;var g=u.children;if(!g||g.length===0)return;var f=u.children[g.length-1];_e(f,"display","inline-block");var S=C.getMenuItemNodes(),M=S.filter(function(z){return z.className.split(" ").indexOf(ka)>=0});M.forEach(function(z){_e(z,"display","inline-block")}),C.menuItemSizes=S.map(function(z){return Ge(z,!0)}),M.forEach(function(z){_e(z,"display","none")}),C.overflowedIndicatorWidth=Ge(u.children[u.children.length-1],!0),C.originalTotalWidth=C.menuItemSizes.reduce(function(z,F){return z+F},0),C.handleResize(),_e(f,"display","none")},C.handleResize=function(){if(C.props.mode!=="horizontal")return;var u=C.childRef.current;if(!u)return;var g=Ge(u);C.overflowedItems=[];var f=0,S;C.originalTotalWidth>g+Ma&&(S=-1,C.menuItemSizes.forEach(function(M){f+=M,f+C.overflowedIndicatorWidth<=g&&(S+=1)})),C.setState({lastVisibleIndex:S})},C}return Object(le.a)(B,[{key:"componentDidMount",value:function(){var u=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var g=this.childRef.current;if(!g)return;this.resizeObserver=new st.default(function(f){f.forEach(function(){var S=u.cancelFrameId;cancelAnimationFrame(S),u.cancelFrameId=requestAnimationFrame(u.setChildrenWidthAndResize)})}),[].slice.call(g.children).concat(g).forEach(function(f){u.resizeObserver.observe(f)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){u.resizeObserver.disconnect(),[].slice.call(g.children).concat(g).forEach(function(f){u.resizeObserver.observe(f)}),u.setChildrenWidthAndResize()}),this.mutationObserver.observe(g,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(u){var g=this,f=this.state.lastVisibleIndex;return(u||[]).reduce(function(S,M,z){var F=M;if(g.props.mode==="horizontal"){var J=g.getOverflowedSubMenuItem(M.props.eventKey,[]);f!==void 0&&g.props.className.indexOf("".concat(g.props.prefixCls,"-root"))!==-1&&(z>f&&(F=v.cloneElement(M,{style:{display:"none"},eventKey:"".concat(M.props.eventKey,"-hidden"),className:"".concat(ka)})),z===f+1&&(g.overflowedItems=u.slice(f+1).map(function(We){return v.cloneElement(We,{key:We.props.eventKey,mode:"vertical-left"})}),J=g.getOverflowedSubMenuItem(M.props.eventKey,g.overflowedItems)));var ye=[].concat(Object(be.a)(S),[J,F]);return z===u.length-1&&ye.push(g.getOverflowedSubMenuItem(M.props.eventKey,[],!0)),ye}return[].concat(Object(be.a)(S),[F])},[])}},{key:"render",value:function(){var u=this.props,g=u.visible,f=u.prefixCls,S=u.overflowedIndicator,M=u.mode,z=u.level,F=u.tag,J=u.children,ye=u.theme,We=Object(te.a)(u,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),Ue=F;return v.createElement(Ue,Object(ge.a)({ref:this.childRef},We),this.renderChildren(J))}}]),B}(v.Component);vt.defaultProps={tag:"div",className:""};var Dt=vt;function At(y){return y.length?y.every(function(I){return!!I.props.disabled}):!0}function qt(y,I,B){var C=y.getState();y.setState({activeKey:Object(H.a)(Object(H.a)({},C.activeKey),{},Object(P.a)({},I,B))})}function Yt(y){return y.eventKey||"0-menu-"}function rn(y,I){var B=I,C=y.children,u=y.eventKey;if(B){var g;if(Fe(C,function(f,S){f&&f.props&&!f.props.disabled&&B===rt(f,u,S)&&(g=!0)}),g)return B}return B=null,y.defaultActiveFirst&&Fe(C,function(f,S){!B&&f&&!f.props.disabled&&(B=rt(f,u,S))}),B}function wn(y){if(!y)return;var I=this.instanceArray.indexOf(y);I!==-1?this.instanceArray[I]=y:this.instanceArray.push(y)}var dn=function(y){Object(Oe.a)(B,y);var I=Object(re.a)(B);function B(C){var u;return Object(Te.a)(this,B),u=I.call(this,C),u.onKeyDown=function(g,f){var S=g.keyCode,M;if(u.getFlatInstanceArray().forEach(function(F){F&&F.props.active&&F.onKeyDown&&(M=F.onKeyDown(g))}),M)return 1;var z=null;return(S===T.a.UP||S===T.a.DOWN)&&(z=u.step(S===T.a.UP?-1:1)),z?(g.preventDefault(),qt(u.props.store,Yt(u.props),z.props.eventKey),typeof f=="function"&&f(z),1):void 0},u.onItemHover=function(g){var f=g.key,S=g.hover;qt(u.props.store,Yt(u.props),S?f:null)},u.onDeselect=function(g){u.props.onDeselect(g)},u.onSelect=function(g){u.props.onSelect(g)},u.onClick=function(g){u.props.onClick(g)},u.onOpenChange=function(g){u.props.onOpenChange(g)},u.onDestroy=function(g){u.props.onDestroy(g)},u.getFlatInstanceArray=function(){return u.instanceArray},u.step=function(g){var f=u.getFlatInstanceArray(),S=u.props.store.getState().activeKey[Yt(u.props)],M=f.length;if(!M)return null;g<0&&(f=f.concat().reverse());var z=-1;if(f.every(function(We,Ue){return We&&We.props.eventKey===S?(z=Ue,!1):!0}),!u.props.defaultActiveFirst&&z!==-1&&At(f.slice(z,M-1)))return;var F=(z+1)%M,J=F;do{var ye=f[J];if(!ye||ye.props.disabled)J=(J+1)%M;else return ye}while(J!==F);return null},u.renderCommonMenuItem=function(g,f,S){var M=u.props.store.getState(),z=Object(se.a)(u),F=z.props,J=rt(g,F.eventKey,f),ye=g.props;if(!ye||typeof g.type=="string")return g;var We=J===M.activeKey,Ue=Object(H.a)(Object(H.a)({mode:ye.mode||F.mode,level:F.level,inlineIndent:F.inlineIndent,renderMenuItem:u.renderMenuItem,rootPrefixCls:F.prefixCls,index:f,parentMenu:F.parentMenu,manualRef:ye.disabled?void 0:Object(Z.a)(g.ref,wn.bind(Object(se.a)(u))),eventKey:J,active:!ye.disabled&&We,multiple:F.multiple,onClick:function(St){(ye.onClick||Ye)(St),u.onClick(St)},onItemHover:u.onItemHover,motion:F.motion,subMenuOpenDelay:F.subMenuOpenDelay,subMenuCloseDelay:F.subMenuCloseDelay,forceSubMenuRender:F.forceSubMenuRender,onOpenChange:u.onOpenChange,onDeselect:u.onDeselect,onSelect:u.onSelect,builtinPlacements:F.builtinPlacements,itemIcon:ye.itemIcon||u.props.itemIcon,expandIcon:ye.expandIcon||u.props.expandIcon},S),{},{direction:F.direction});return(F.mode==="inline"||Pe())&&(Ue.triggerSubMenuAction="click"),v.cloneElement(g,Object(H.a)(Object(H.a)({},Ue),{},{key:J||f}))},u.renderMenuItem=function(g,f,S){if(!g)return null;var M=u.props.store.getState(),z={openKeys:M.openKeys,selectedKeys:M.selectedKeys,triggerSubMenuAction:u.props.triggerSubMenuAction,subMenuKey:S};return u.renderCommonMenuItem(g,f,z)},C.store.setState({activeKey:Object(H.a)(Object(H.a)({},C.store.getState().activeKey),{},Object(P.a)({},C.eventKey,rn(C,C.activeKey)))}),u.instanceArray=[],u}return Object(le.a)(B,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(u){return this.props.visible||u.visible||this.props.className!==u.className||!ue()(this.props.style,u.style)}},{key:"componentDidUpdate",value:function(u){var g=this.props,f="activeKey"in g?g.activeKey:g.store.getState().activeKey[Yt(g)],S=rn(g,f);if(S!==f)qt(g.store,Yt(g),S);else if("activeKey"in u){var M=rn(u,u.activeKey);S!==M&&qt(g.store,Yt(g),S)}}},{key:"render",value:function(){var u=this,g=Object(ge.a)({},this.props);this.instanceArray=[];var f=N()(g.prefixCls,g.className,"".concat(g.prefixCls,"-").concat(g.mode)),S={className:f,role:g.role||"menu"};g.id&&(S.id=g.id),g.focusable&&(S.tabIndex=0,S.onKeyDown=this.onKeyDown);var M=g.prefixCls,z=g.eventKey,F=g.visible,J=g.level,ye=g.mode,We=g.overflowedIndicator,Ue=g.theme;return tt.forEach(function(Je){return delete g[Je]}),delete g.onClick,v.createElement(Dt,Object(ge.a)({},g,{prefixCls:M,mode:ye,tag:"ul",level:J,theme:Ue,visible:F,overflowedIndicator:We},S),Object(U.a)(g.children).map(function(Je,St){return u.renderMenuItem(Je,St,z||"0-menu-")}))}}]),B}(v.Component);dn.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:Ye};var Hn=Object(w.b)()(dn),vr=Hn,fn=m("Kwbf");function Vr(y,I,B){var C=y.prefixCls,u=y.motion,g=y.defaultMotions,f=g===void 0?{}:g,S=y.openAnimation,M=y.openTransitionName,z=I.switchingModeFromInline;if(u)return u;if(Object(xe.a)(S)==="object"&&S)Object(fn.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof S=="string")return{motionName:"".concat(C,"-open-").concat(S)};if(M)return{motionName:M};var F=f[B];return F||(z?null:f.other)}var Nn=function(y){Object(Oe.a)(B,y);var I=Object(re.a)(B);function B(C){var u;Object(Te.a)(this,B),u=I.call(this,C),u.onSelect=function(S){var M=Object(se.a)(u),z=M.props;if(z.selectable){var F=u.store.getState(),J=F.selectedKeys,ye=S.key;z.multiple?J=J.concat([ye]):J=[ye],"selectedKeys"in z||u.store.setState({selectedKeys:J}),z.onSelect(Object(H.a)(Object(H.a)({},S),{},{selectedKeys:J}))}},u.onClick=function(S){var M=u.getRealMenuMode(),z=Object(se.a)(u),F=z.store,J=z.props.onOpenChange;M!=="inline"&&!("openKeys"in u.props)&&(F.setState({openKeys:[]}),J([])),u.props.onClick(S)},u.onKeyDown=function(S,M){u.innerMenu.getWrappedInstance().onKeyDown(S,M)},u.onOpenChange=function(S){var M=Object(se.a)(u),z=M.props,F=u.store.getState().openKeys.concat(),J=!1,ye=function(Ue){var Je=!1;if(Ue.open)Je=F.indexOf(Ue.key)===-1,Je&&F.push(Ue.key);else{var St=F.indexOf(Ue.key);Je=St!==-1,Je&&F.splice(St,1)}J=J||Je};Array.isArray(S)?S.forEach(ye):ye(S),J&&("openKeys"in u.props||u.store.setState({openKeys:F}),z.onOpenChange(F))},u.onDeselect=function(S){var M=Object(se.a)(u),z=M.props;if(z.selectable){var F=u.store.getState().selectedKeys.concat(),J=S.key,ye=F.indexOf(J);ye!==-1&&F.splice(ye,1),"selectedKeys"in z||u.store.setState({selectedKeys:F}),z.onDeselect(Object(H.a)(Object(H.a)({},S),{},{selectedKeys:F}))}},u.onMouseEnter=function(S){u.restoreModeVerticalFromInline();var M=u.props.onMouseEnter;M&&M(S)},u.onTransitionEnd=function(S){var M=S.propertyName==="width"&&S.target===S.currentTarget,z=S.target.className,F=Object.prototype.toString.call(z)==="[object SVGAnimatedString]"?z.animVal:z,J=S.propertyName==="font-size"&&F.indexOf("anticon")>=0;(M||J)&&u.restoreModeVerticalFromInline()},u.setInnerMenu=function(S){u.innerMenu=S},u.isRootMenu=!0;var g=C.defaultSelectedKeys,f=C.defaultOpenKeys;return"selectedKeys"in C&&(g=C.selectedKeys||[]),"openKeys"in C&&(f=C.openKeys||[]),u.store=Object(w.c)({selectedKeys:g,openKeys:f,activeKey:{"0-menu-":rn(C,C.activeKey)}}),u.state={switchingModeFromInline:!1,prevProps:C,inlineOpenKeys:[],store:u.store},u}return Object(le.a)(B,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(u){var g=this.props,f=g.siderCollapsed,S=g.inlineCollapsed,M=g.onOpenChange;(!u.inlineCollapsed&&S||!u.siderCollapsed&&f)&&M([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var u=this.props.collapsedWidth,g=this.store,f=this.prevOpenKeys,S=this.getInlineCollapsed()&&(u===0||u==="0"||u==="0px");S?(this.prevOpenKeys=g.getState().openKeys.concat(),this.store.setState({openKeys:[]})):f&&(this.store.setState({openKeys:f}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var u=this.props.mode,g=this.state.switchingModeFromInline,f=this.getInlineCollapsed();return g&&f?"inline":f?"vertical":u}},{key:"getInlineCollapsed",value:function(){var u=this.props,g=u.inlineCollapsed,f=u.siderCollapsed;return f!==void 0?f:g}},{key:"restoreModeVerticalFromInline",value:function(){var u=this.state.switchingModeFromInline;u&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var u=Object(H.a)({},Object(ie.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),g=this.getRealMenuMode();return u.className+=" ".concat(u.prefixCls,"-root"),u.direction==="rtl"&&(u.className+=" ".concat(u.prefixCls,"-rtl")),u=Object(H.a)(Object(H.a)({},u),{},{mode:g,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Vr(this.props,this.state,g)}),delete u.openAnimation,delete u.openTransitionName,v.createElement(w.a,{store:this.store},v.createElement(vr,Object(ge.a)({},u,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(u,g){var f=g.prevProps,S=g.store,M=S.getState(),z={},F={prevProps:u};return f.mode==="inline"&&u.mode!=="inline"&&(F.switchingModeFromInline=!0),"openKeys"in u?z.openKeys=u.openKeys||[]:((u.inlineCollapsed&&!f.inlineCollapsed||u.siderCollapsed&&!f.siderCollapsed)&&(F.switchingModeFromInline=!0,F.inlineOpenKeys=M.openKeys,z.openKeys=[]),(!u.inlineCollapsed&&f.inlineCollapsed||!u.siderCollapsed&&f.siderCollapsed)&&(z.openKeys=g.inlineOpenKeys,F.inlineOpenKeys=[])),Object.keys(z).length&&S.setState(z),F}}]),B}(v.Component);Nn.defaultProps={selectable:!0,onClick:Ye,onSelect:Ye,onOpenChange:Ye,onDeselect:Ye,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:v.createElement("span",null,"\xB7\xB7\xB7")};var Xr=Nn,kr=function(y){Object(Oe.a)(B,y);var I=Object(re.a)(B);function B(){var C;return Object(Te.a)(this,B),C=I.apply(this,arguments),C.onKeyDown=function(u){var g=u.keyCode;return g===T.a.ENTER?(C.onClick(u),!0):void 0},C.onMouseLeave=function(u){var g=C.props,f=g.eventKey,S=g.onItemHover,M=g.onMouseLeave;S({key:f,hover:!1}),M({key:f,domEvent:u})},C.onMouseEnter=function(u){var g=C.props,f=g.eventKey,S=g.onItemHover,M=g.onMouseEnter;S({key:f,hover:!0}),M({key:f,domEvent:u})},C.onClick=function(u){var g=C.props,f=g.eventKey,S=g.multiple,M=g.onClick,z=g.onSelect,F=g.onDeselect,J=g.isSelected,ye={key:f,keyPath:[f],item:Object(se.a)(C),domEvent:u};M(ye),S?J?F(ye):z(ye):J||z(ye)},C.saveNode=function(u){C.node=u},C}return Object(le.a)(B,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var u=this.props;u.onDestroy&&u.onDestroy(u.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var u,g=Object(H.a)({},this.props),f=N()(this.getPrefixCls(),g.className,(u={},Object(P.a)(u,this.getActiveClassName(),!g.disabled&&g.active),Object(P.a)(u,this.getSelectedClassName(),g.isSelected),Object(P.a)(u,this.getDisabledClassName(),g.disabled),u)),S=Object(H.a)(Object(H.a)({},g.attribute),{},{title:typeof g.title=="string"?g.title:void 0,className:f,role:g.role||"menuitem","aria-disabled":g.disabled});g.role==="option"?S=Object(H.a)(Object(H.a)({},S),{},{role:"option","aria-selected":g.isSelected}):(g.role===null||g.role==="none")&&(S.role="none");var M={onClick:g.disabled?null:this.onClick,onMouseLeave:g.disabled?null:this.onMouseLeave,onMouseEnter:g.disabled?null:this.onMouseEnter},z=Object(H.a)({},g.style);g.mode==="inline"&&(g.direction==="rtl"?z.paddingRight=g.inlineIndent*g.level:z.paddingLeft=g.inlineIndent*g.level),tt.forEach(function(J){return delete g[J]}),delete g.direction;var F=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(F=v.createElement(this.props.itemIcon,this.props)),v.createElement("li",Object(ge.a)({},Object(ie.a)(g,["onClick","onMouseEnter","onMouseLeave","onSelect"]),S,M,{style:z,ref:this.saveNode}),g.children,F)}}]),B}(v.Component);kr.isMenuItem=!0,kr.defaultProps={onSelect:Ye,onMouseEnter:Ye,onMouseLeave:Ye,manualRef:Ye};var yi=Object(w.b)(function(y,I){var B=y.activeKey,C=y.selectedKeys,u=I.eventKey,g=I.subMenuKey;return{active:B[g]===u,isSelected:Array.isArray(C)?C.indexOf(u)!==-1:C===u}})(kr),so=yi,Ta=function(y){Object(Oe.a)(B,y);var I=Object(re.a)(B);function B(){var C;return Object(Te.a)(this,B),C=I.apply(this,arguments),C.renderInnerMenuItem=function(u){var g=C.props,f=g.renderMenuItem,S=g.index;return f(u,S,C.props.subMenuKey)},C}return Object(le.a)(B,[{key:"render",value:function(){var u=Object(ge.a)({},this.props),g=u.className,f=g===void 0?"":g,S=u.rootPrefixCls,M="".concat(S,"-item-group-title"),z="".concat(S,"-item-group-list"),F=u.title,J=u.children;return tt.forEach(function(ye){return delete u[ye]}),delete u.direction,v.createElement("li",Object(ge.a)({},u,{onClick:function(We){return We.stopPropagation()},className:"".concat(f," ").concat(S,"-item-group")}),v.createElement("div",{className:M,title:typeof F=="string"?F:void 0},F),v.createElement("ul",{className:z},v.Children.map(J,this.renderInnerMenuItem)))}}]),B}(v.Component);Ta.isMenuItemGroup=!0,Ta.defaultProps={disabled:!0};var ps=Ta,lo=function(I){var B=I.className,C=I.rootPrefixCls,u=I.style;return v.createElement("li",{className:"".concat(B," ").concat(C,"-item-divider"),style:u})};lo.defaultProps={disabled:!0,className:"",style:{}};var ms=lo,uo=Xr,Fo=m("eDIo");function co(y,I){var B=y.prefixCls,C=y.editable,u=y.locale,g=y.style;return!C||C.showAdd===!1?null:v.createElement("button",{ref:I,type:"button",className:"".concat(B,"-nav-add"),style:g,"aria-label":(u==null?void 0:u.addAriaLabel)||"Add tab",onClick:function(S){C.onEdit("add",{event:S})}},C.addIcon||"+")}var Vi=v.forwardRef(co);function xi(y,I){var B=y.prefixCls,C=y.id,u=y.tabs,g=y.locale,f=y.mobile,S=y.moreIcon,M=S===void 0?"More":S,z=y.moreTransitionName,F=y.style,J=y.className,ye=y.editable,We=y.tabBarGutter,Ue=y.rtl,Je=y.onTabClick,St=Object(v.useState)(!1),Ut=Object(fe.a)(St,2),Lt=Ut[0],jt=Ut[1],Ft=Object(v.useState)(null),It=Object(fe.a)(Ft,2),Nt=It[0],Xt=It[1],Bt="".concat(C,"-more-popup"),vn="".concat(B,"-dropdown"),zt=Nt!==null?"".concat(Bt,"-").concat(Nt):null,Et=g==null?void 0:g.dropdownAriaLabel,bt=v.createElement(uo,{onClick:function(sn){var an=sn.key,_n=sn.domEvent;Je(an,_n),jt(!1)},id:Bt,tabIndex:-1,role:"listbox","aria-activedescendant":zt,selectedKeys:[Nt],"aria-label":Et!==void 0?Et:"expanded dropdown"},u.map(function(Zt){return v.createElement(so,{key:Zt.key,id:"".concat(Bt,"-").concat(Zt.key),role:"option","aria-controls":C&&"".concat(C,"-panel-").concat(Zt.key),disabled:Zt.disabled},Zt.tab)}));function Ht(Zt){for(var sn=u.filter(function(Yn){return!Yn.disabled}),an=sn.findIndex(function(Yn){return Yn.key===Nt})||0,_n=sn.length,In=0;In<_n;In+=1){an=(an+Zt+_n)%_n;var yn=sn[an];if(!yn.disabled){Xt(yn.key);return}}}function Gt(Zt){var sn=Zt.which;if(!Lt){[T.a.DOWN,T.a.SPACE,T.a.ENTER].includes(sn)&&(jt(!0),Zt.preventDefault());return}switch(sn){case T.a.UP:Ht(-1),Zt.preventDefault();break;case T.a.DOWN:Ht(1),Zt.preventDefault();break;case T.a.ESC:jt(!1);break;case T.a.SPACE:case T.a.ENTER:Nt!==null&&Je(Nt,Zt);break}}Object(v.useEffect)(function(){var Zt=document.getElementById(zt);Zt&&Zt.scrollIntoView&&Zt.scrollIntoView(!1)},[Nt]),Object(v.useEffect)(function(){Lt||Xt(null)},[Lt]);var ft=Object(P.a)({},Ue?"marginLeft":"marginRight",We);u.length||(ft.visibility="hidden",ft.order=1);var $t=N()(Object(P.a)({},"".concat(vn,"-rtl"),Ue)),gn=f?null:v.createElement(Fo.a,{prefixCls:vn,overlay:bt,trigger:["hover"],visible:Lt,transitionName:z,onVisibleChange:jt,overlayClassName:$t,mouseEnterDelay:.1,mouseLeaveDelay:.1},v.createElement("button",{type:"button",className:"".concat(B,"-nav-more"),style:ft,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":Bt,id:"".concat(C,"-more"),"aria-expanded":Lt,onKeyDown:Gt},M));return v.createElement("div",{className:N()("".concat(B,"-nav-operations"),J),style:F,ref:I},gn,v.createElement(Vi,{prefixCls:B,locale:g,editable:ye}))}var Wo=v.forwardRef(xi),Da=Object(v.createContext)(null),Bo=.1,Ei=.01,Sn=20,fo=Math.pow(.995,Sn);function ho(){var y=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(y)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(y.substr(0,4)))}function Xi(y,I){var B=Object(v.useState)(),C=Object(fe.a)(B,2),u=C[0],g=C[1],f=Object(v.useState)(0),S=Object(fe.a)(f,2),M=S[0],z=S[1],F=Object(v.useState)(0),J=Object(fe.a)(F,2),ye=J[0],We=J[1],Ue=Object(v.useState)(),Je=Object(fe.a)(Ue,2),St=Je[0],Ut=Je[1],Lt=Object(v.useRef)();function jt(Et){var bt=Et.touches[0],Ht=bt.screenX,Gt=bt.screenY;g({x:Ht,y:Gt}),window.clearInterval(Lt.current)}function Ft(Et){if(!u)return;Et.preventDefault();var bt=Et.touches[0],Ht=bt.screenX,Gt=bt.screenY;g({x:Ht,y:Gt});var ft=Ht-u.x,$t=Gt-u.y;I(ft,$t);var gn=Date.now();z(gn),We(gn-M),Ut({x:ft,y:$t})}function It(){if(!u)return;if(g(null),Ut(null),St){var Et=St.x/ye,bt=St.y/ye,Ht=Math.abs(Et),Gt=Math.abs(bt);if(Math.max(Ht,Gt)<Bo)return;var ft=Et,$t=bt;Lt.current=window.setInterval(function(){if(Math.abs(ft)<Ei&&Math.abs($t)<Ei){window.clearInterval(Lt.current);return}ft*=fo,$t*=fo,I(ft*Sn,$t*Sn)},Sn)}}var Nt=Object(v.useRef)(0),Xt=Object(v.useRef)(!1),Bt=Object(v.useRef)();function vn(Et){var bt=Et.deltaX,Ht=Et.deltaY,Gt=0,ft=Math.abs(bt),$t=Math.abs(Ht);ft===$t?Gt=Bt.current==="x"?bt:Ht:ft>$t?(Gt=bt,Bt.current="x"):(Gt=Ht,Bt.current="y");var gn=Date.now();gn-Nt.current>100&&(Xt.current=!1),(I(-Gt,-Gt)||Xt.current)&&(Et.preventDefault(),Xt.current=!0),Nt.current=gn}var zt=Object(v.useRef)(null);zt.current={onTouchStart:jt,onTouchMove:Ft,onTouchEnd:It,onWheel:vn},v.useEffect(function(){function Et(ft){zt.current.onTouchStart(ft)}function bt(ft){zt.current.onTouchMove(ft)}function Ht(ft){zt.current.onTouchEnd(ft)}function Gt(ft){zt.current.onWheel(ft)}return document.addEventListener("touchmove",bt,{passive:!1}),document.addEventListener("touchend",Ht,{passive:!1}),y.current.addEventListener("touchstart",Et,{passive:!1}),y.current.addEventListener("wheel",Gt),function(){document.removeEventListener("touchmove",bt),document.removeEventListener("touchend",Ht)}},[])}function zo(){var y=Object(v.useRef)(new Map);function I(C){return y.current.has(C)||y.current.set(C,v.createRef()),y.current.get(C)}function B(C){y.current.delete(C)}return[I,B]}function Aa(y,I){var B=v.useRef(y),C=v.useState({}),u=Object(fe.a)(C,2),g=u[1];function f(S){var M=typeof S=="function"?S(B.current):S;M!==B.current&&I(M,B.current),B.current=M,g({})}return[B.current,f]}var po=function(I){var B=I.position,C=I.prefixCls,u=I.extra;if(!u)return null;var g,f=u;return B==="right"&&(g=f.right||!f.left&&f||null),B==="left"&&(g=f.left||null),g?v.createElement("div",{className:"".concat(C,"-extra-content")},g):null};function La(y,I){var B,C=v.useContext(Da),u=C.prefixCls,g=C.tabs,f=y.className,S=y.style,M=y.id,z=y.animated,F=y.activeKey,J=y.rtl,ye=y.extra,We=y.editable,Ue=y.locale,Je=y.tabPosition,St=y.tabBarGutter,Ut=y.children,Lt=y.onTabClick,jt=y.onTabScroll,Ft=Object(v.useRef)(),It=Object(v.useRef)(),Nt=Object(v.useRef)(),Xt=Object(v.useRef)(),Bt=zo(),vn=Object(fe.a)(Bt,2),zt=vn[0],Et=vn[1],bt=Je==="top"||Je==="bottom",Ht=Aa(0,function(tn,Vt){bt&&jt&&jt({direction:tn>Vt?"left":"right"})}),Gt=Object(fe.a)(Ht,2),ft=Gt[0],$t=Gt[1],gn=Aa(0,function(tn,Vt){!bt&&jt&&jt({direction:tn>Vt?"top":"bottom"})}),Zt=Object(fe.a)(gn,2),sn=Zt[0],an=Zt[1],_n=Object(v.useState)(0),In=Object(fe.a)(_n,2),yn=In[0],Yn=In[1],xr=Object(v.useState)(0),rr=Object(fe.a)(xr,2),Un=rr[0],hn=rr[1],ln=Object(v.useState)(0),xn=Object(fe.a)(ln,2),bn=xn[0],Er=xn[1],Gr=Object(v.useState)(0),$r=Object(fe.a)(Gr,2),on=$r[0],Mr=$r[1],Yr=Object(v.useState)(null),cn=Object(fe.a)(Yr,2),nn=cn[0],Fn=cn[1],go=Object(v.useState)(null),Na=Object(fe.a)(go,2),Jr=Na[0],Ci=Na[1],oa=Object(v.useState)(0),Ia=Object(fe.a)(oa,2),sa=Ia[0],Vo=Ia[1],Xo=Object(v.useState)(0),bo=Object(fe.a)(Xo,2),Ua=bo[0],Fa=bo[1],Oi=V(new Map),Si=Object(fe.a)(Oi,2),Go=Si[0],la=Si[1],Gi=me(g,Go,yn),_i="".concat(u,"-nav-operations-hidden"),ki=0,wr=0;bt?J?(ki=0,wr=Math.max(0,yn-nn)):(ki=Math.min(0,nn-yn),wr=0):(ki=Math.min(0,Jr-Un),wr=0);function li(tn){return tn<ki?[ki,!1]:tn>wr?[wr,!1]:[tn,!0]}var Zr=Object(v.useRef)(),$i=Object(v.useState)(),ui=Object(fe.a)($i,2),ua=ui[0],Wa=ui[1];function ca(){Wa(Date.now())}function Ba(){window.clearTimeout(Zr.current)}Xi(Ft,function(tn,Vt){var Wn=!1;function ar(Mi,Nr){Mi(function(Zi){var qr=li(Zi+Nr),Bn=Object(fe.a)(qr,2),ha=Bn[0],Ha=Bn[1];return Wn=Ha,ha})}if(bt){if(nn>=yn)return Wn;ar($t,tn)}else{if(Jr>=Un)return Wn;ar(an,Vt)}return Ba(),ca(),Wn}),Object(v.useEffect)(function(){return Ba(),ua&&(Zr.current=window.setTimeout(function(){Wa(0)},100)),Ba},[ua]);function Qr(){var tn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:F,Vt=Gi.get(tn);if(!Vt)return;if(bt){var Wn=ft;J?Vt.right<ft?Wn=Vt.right:Vt.right+Vt.width>ft+nn&&(Wn=Vt.right+Vt.width-nn):Vt.left<-ft?Wn=-Vt.left:Vt.left+Vt.width>-ft+nn&&(Wn=-(Vt.left+Vt.width-nn)),an(0),$t(li(Wn)[0])}else{var ar=sn;Vt.top<-sn?ar=-Vt.top:Vt.top+Vt.height>-sn+Jr&&(ar=-(Vt.top+Vt.height-Jr)),$t(0),an(li(ar)[0])}}var ci=ce(Gi,{width:nn,height:Jr,left:ft,top:sn},{width:bn,height:on},{width:sa,height:Ua},Object(H.a)(Object(H.a)({},y),{},{tabs:g})),yo=Object(fe.a)(ci,2),$o=yo[0],Yo=yo[1],Jo=g.map(function(tn){var Vt=tn.key;return v.createElement(K,{id:M,prefixCls:u,key:Vt,rtl:J,tab:tn,closable:tn.closable,editable:We,active:Vt===F,tabPosition:Je,tabBarGutter:St,renderWrapper:Ut,removeAriaLabel:Ue==null?void 0:Ue.removeAriaLabel,ref:zt(Vt),onClick:function(ar){Lt(Vt,ar)},onRemove:function(){Et(Vt)},onFocus:function(){Qr(Vt),ca(),J||(Ft.current.scrollLeft=0),Ft.current.scrollTop=0}})}),za=ae(function(){var tn,Vt,Wn,ar,Mi,Nr,Zi,qr,Bn,ha=((tn=Ft.current)===null||tn===void 0?void 0:tn.offsetWidth)||0,Ha=((Vt=Ft.current)===null||Vt===void 0?void 0:Vt.offsetHeight)||0,Ka=((Wn=Xt.current)===null||Wn===void 0?void 0:Wn.offsetWidth)||0,or=((ar=Xt.current)===null||ar===void 0?void 0:ar.offsetHeight)||0,en=((Mi=Nt.current)===null||Mi===void 0?void 0:Mi.offsetWidth)||0,Or=((Nr=Nt.current)===null||Nr===void 0?void 0:Nr.offsetHeight)||0;Fn(ha),Ci(Ha),Vo(Ka),Fa(or);var Ir=(((Zi=It.current)===null||Zi===void 0?void 0:Zi.offsetWidth)||0)-Ka,Ur=(((qr=It.current)===null||qr===void 0?void 0:qr.offsetHeight)||0)-or;Yn(Ir),hn(Ur);var Va=(Bn=Nt.current)===null||Bn===void 0?void 0:Bn.className.includes(_i);Er(Ir-(Va?0:en)),Mr(Ur-(Va?0:Or)),la(function(){var pa=new Map;return g.forEach(function(Oo){var So=Oo.key,fi=zt(So).current;fi&&pa.set(So,{width:fi.offsetWidth,height:fi.offsetHeight,left:fi.offsetLeft,top:fi.offsetTop})}),pa})}),Zo=g.slice(0,$o),ir=g.slice(Yo+1),Tn=[].concat(Object(be.a)(Zo),Object(be.a)(ir)),Xn=Object(v.useState)(),Dn=Object(fe.a)(Xn,2),Yi=Dn[0],Qo=Dn[1],Cr=Gi.get(F),xo=Object(v.useRef)();function Eo(){ne.a.cancel(xo.current)}Object(v.useEffect)(function(){var tn={};return Cr&&(bt?(J?tn.right=Cr.right:tn.left=Cr.left,tn.width=Cr.width):(tn.top=Cr.top,tn.height=Cr.height)),Eo(),xo.current=ne()(function(){Qo(tn)}),Eo},[Cr,bt,J]),Object(v.useEffect)(function(){Qr()},[F,Cr,Gi,bt]),Object(v.useEffect)(function(){za()},[J,St,F,g.map(function(tn){return tn.key}).join("_")]);var wo=!!Tn.length,di="".concat(u,"-nav-wrap"),da,Ji,Co,fa;return bt?J?(Ji=ft>0,da=ft+nn<yn):(da=ft<0,Ji=-ft+nn<yn):(Co=sn<0,fa=-sn+Jr<Un),v.createElement("div",{ref:I,role:"tablist",className:N()("".concat(u,"-nav"),f),style:S,onKeyDown:function(){ca()}},v.createElement(po,{position:"left",extra:ye,prefixCls:u}),v.createElement(Ce.a,{onResize:za},v.createElement("div",{className:N()(di,(B={},Object(P.a)(B,"".concat(di,"-ping-left"),da),Object(P.a)(B,"".concat(di,"-ping-right"),Ji),Object(P.a)(B,"".concat(di,"-ping-top"),Co),Object(P.a)(B,"".concat(di,"-ping-bottom"),fa),B)),ref:Ft},v.createElement(Ce.a,{onResize:za},v.createElement("div",{ref:It,className:"".concat(u,"-nav-list"),style:{transform:"translate(".concat(ft,"px, ").concat(sn,"px)"),transition:ua?"none":void 0}},Jo,v.createElement(Vi,{ref:Xt,prefixCls:u,locale:Ue,editable:We,style:{visibility:wo?"hidden":null}}),v.createElement("div",{className:N()("".concat(u,"-ink-bar"),Object(P.a)({},"".concat(u,"-ink-bar-animated"),z.inkBar)),style:Yi}))))),v.createElement(Wo,Object.assign({},y,{ref:Nt,prefixCls:u,tabs:Tn,className:!wo&&_i})),v.createElement(po,{position:"right",extra:ye,prefixCls:u}))}var Ra=v.forwardRef(La);function Ho(y){var I=y.id,B=y.activeKey,C=y.animated,u=y.tabPosition,g=y.rtl,f=y.destroyInactiveTabPane,S=v.useContext(Da),M=S.prefixCls,z=S.tabs,F=C.tabPane,J=z.findIndex(function(ye){return ye.key===B});return v.createElement("div",{className:N()("".concat(M,"-content-holder"))},v.createElement("div",{className:N()("".concat(M,"-content"),"".concat(M,"-content-").concat(u),Object(P.a)({},"".concat(M,"-content-animated"),F)),style:J&&F?Object(P.a)({},g?"marginRight":"marginLeft","-".concat(J,"00%")):null},z.map(function(ye){return v.cloneElement(ye.node,{key:ye.key,prefixCls:M,tabKey:ye.key,id:I,animated:F,active:ye.key===B,destroyInactiveTabPane:f})})))}function mo(y){var I=y.prefixCls,B=y.forceRender,C=y.className,u=y.style,g=y.id,f=y.active,S=y.animated,M=y.destroyInactiveTabPane,z=y.tabKey,F=y.children,J=v.useState(B),ye=Object(fe.a)(J,2),We=ye[0],Ue=ye[1];v.useEffect(function(){f?Ue(!0):M&&Ue(!1)},[f,M]);var Je={};return f||(S?(Je.visibility="hidden",Je.height=0,Je.overflowY="hidden"):Je.display="none"),v.createElement("div",{id:g&&"".concat(g,"-panel-").concat(z),role:"tabpanel",tabIndex:f?0:-1,"aria-labelledby":g&&"".concat(g,"-tab-").concat(z),"aria-hidden":!f,style:Object(H.a)(Object(H.a)({},Je),u),className:N()("".concat(I,"-tabpane"),f&&"".concat(I,"-tabpane-active"),C)},(f||We||B)&&F)}var Pa=0;function vo(y){return Object(U.a)(y).map(function(I){if(v.isValidElement(I)){var B=I.key!==void 0?String(I.key):void 0;return Object(H.a)(Object(H.a)({key:B},I.props),{},{node:I})}return null}).filter(function(I){return I})}function Ko(y,I){var B,C=y.id,u=y.prefixCls,g=u===void 0?"rc-tabs":u,f=y.className,S=y.children,M=y.direction,z=y.activeKey,F=y.defaultActiveKey,J=y.editable,ye=y.animated,We=y.tabPosition,Ue=We===void 0?"top":We,Je=y.tabBarGutter,St=y.tabBarStyle,Ut=y.tabBarExtraContent,Lt=y.locale,jt=y.moreIcon,Ft=y.moreTransitionName,It=y.destroyInactiveTabPane,Nt=y.renderTabBar,Xt=y.onChange,Bt=y.onTabClick,vn=y.onTabScroll,zt=Object(te.a)(y,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Et=vo(S),bt=M==="rtl",Ht;ye===!1?Ht={inkBar:!1,tabPane:!1}:Ht=Object(H.a)({inkBar:!0,tabPane:!1},ye!==!0?ye:null);var Gt=Object(v.useState)(!1),ft=Object(fe.a)(Gt,2),$t=ft[0],gn=ft[1];Object(v.useEffect)(function(){gn(ho())},[]);var Zt=Object(A.a)(function(){var on;return(on=Et[0])===null||on===void 0?void 0:on.key},{value:z,defaultValue:F}),sn=Object(fe.a)(Zt,2),an=sn[0],_n=sn[1],In=Object(v.useState)(function(){return Et.findIndex(function(on){return on.key===an})}),yn=Object(fe.a)(In,2),Yn=yn[0],xr=yn[1];Object(v.useEffect)(function(){var on=Et.findIndex(function(Yr){return Yr.key===an});if(on===-1){var Mr;on=Math.max(0,Math.min(Yn,Et.length-1)),_n((Mr=Et[on])===null||Mr===void 0?void 0:Mr.key)}xr(on)},[Et.map(function(on){return on.key}).join("_"),an,Yn]);var rr=Object(A.a)(null,{value:C}),Un=Object(fe.a)(rr,2),hn=Un[0],ln=Un[1],xn=Ue;$t&&!["left","right"].includes(Ue)&&(xn="top"),Object(v.useEffect)(function(){C||(ln("rc-tabs-".concat(Pa)),Pa+=1)},[]);function bn(on,Mr){Bt==null||Bt(on,Mr),_n(on),Xt==null||Xt(on)}var Er={id:hn,activeKey:an,animated:Ht,tabPosition:xn,rtl:bt,mobile:$t},Gr,$r=Object(H.a)(Object(H.a)({},Er),{},{editable:J,locale:Lt,moreIcon:jt,moreTransitionName:Ft,tabBarGutter:Je,onTabClick:bn,onTabScroll:vn,extra:Ut,style:St,panes:S});return Nt?Gr=Nt($r,Ra):Gr=v.createElement(Ra,Object.assign({},$r)),v.createElement(Da.Provider,{value:{tabs:Et,prefixCls:g}},v.createElement("div",Object.assign({ref:I,id:C,className:N()(g,"".concat(g,"-").concat(xn),(B={},Object(P.a)(B,"".concat(g,"-mobile"),$t),Object(P.a)(B,"".concat(g,"-editable"),J),Object(P.a)(B,"".concat(g,"-rtl"),bt),B),f)},zt),Gr,v.createElement(Ho,Object.assign({destroyInactiveTabPane:It},Er,{animated:Ht}))))}var wi=v.forwardRef(Ko);wi.TabPane=mo;var jr=wi,ja=nt.b=jr},kSUc:function(Tt,nt,m){},lZu9:function(Tt,nt,m){(function(P){P(m("VrN/"),m("1eCo"),m("8EBN"))})(function(P){"use strict";P.defineMode("markdown",function(fe,te){var H=P.getMode(fe,"text/html"),v=H.name=="null";function he(E){if(P.findModeByName){var d=P.findModeByName(E);d&&(E=d.mime||d.mimes[0])}var W=P.getMode(fe,E);return W.name=="null"?null:W}te.highlightFormatting===void 0&&(te.highlightFormatting=!1),te.maxBlockquoteDepth===void 0&&(te.maxBlockquoteDepth=0),te.taskLists===void 0&&(te.taskLists=!1),te.strikethrough===void 0&&(te.strikethrough=!1),te.emoji===void 0&&(te.emoji=!1),te.fencedCodeBlockHighlighting===void 0&&(te.fencedCodeBlockHighlighting=!0),te.fencedCodeBlockDefaultMode===void 0&&(te.fencedCodeBlockDefaultMode="text/plain"),te.xml===void 0&&(te.xml=!0),te.tokenTypeOverrides===void 0&&(te.tokenTypeOverrides={});var N={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 U in N)N.hasOwnProperty(U)&&te.tokenTypeOverrides[U]&&(N[U]=te.tokenTypeOverrides[U]);var A=/^([*\-_])(?:\s*\1){2,}\s*$/,be=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,ee=/^\[(x| )\](?=\s)/i,ne=te.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Ce=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ae=/^[^#!\[\]*_\\<>` "'(~:]+/,V=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,T=/^\s*\[[^\]]+?\]:.*$/,R=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,K=" ";function $(E,d,W){return d.f=d.inline=W,W(E,d)}function me(E,d,W){return d.f=d.block=W,W(E,d)}function Le(E){return!E||!/\S/.test(E.string)}function ce(E){if(E.linkTitle=!1,E.linkHref=!1,E.linkText=!1,E.em=!1,E.strong=!1,E.strikethrough=!1,E.quote=0,E.indentedCode=!1,E.f==Te){var d=v;if(!d){var W=P.innerMode(H,E.htmlState);d=W.mode.name=="xml"&&W.state.tagStart===null&&!W.state.context&&W.state.tokenize.isInText}d&&(E.f=re,E.block=ge,E.htmlState=null)}return E.trailingSpace=0,E.trailingSpaceNewLine=!1,E.prevLine=E.thisLine,E.thisLine={stream:null},null}function ge(E,d){var W=E.column()===d.indentation,pe=Le(d.prevLine.stream),ve=d.indentedCode,Ne=d.prevLine.hr,qe=d.list!==!1,Me=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var Ve=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,qe)){for(d.list=null;Ve<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=Ve-d.listStack[d.listStack.length-1])}var ke=!pe&&!Ne&&!d.prevLine.header&&(!qe||!ve)&&!d.prevLine.fencedCodeEnd,Re=(d.list===!1||Ne||pe)&&d.indentation<=Me&&E.match(A),Q=null;if(d.indentationDiff>=4&&(ve||d.prevLine.fencedCodeEnd||d.prevLine.header||pe))return E.skipToEnd(),d.indentedCode=!0,N.code;if(E.eatSpace())return null;if(W&&d.indentation<=Me&&(Q=E.match(ne))&&Q[1].length<=6)return d.quote=0,d.header=Q[1].length,d.thisLine.header=!0,te.highlightFormatting&&(d.formatting="header"),d.f=d.inline,se(d);if(d.indentation<=Me&&E.eat(">"))return d.quote=W?1:d.quote+1,te.highlightFormatting&&(d.formatting="quote"),E.eatSpace(),se(d);if(!Re&&!d.setext&&W&&d.indentation<=Me&&(Q=E.match(be))){var X=Q[1]?"ol":"ul";return d.indentation=Ve+E.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,te.taskLists&&E.match(ee,!1)&&(d.taskList=!0),d.f=d.inline,te.highlightFormatting&&(d.formatting=["list","list-"+X]),se(d)}else{if(W&&d.indentation<=Me&&(Q=E.match(V,!0)))return d.quote=0,d.fencedEndRE=new RegExp(Q[1]+"+ *$"),d.localMode=te.fencedCodeBlockHighlighting&&he(Q[2]||te.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=P.startState(d.localMode)),d.f=d.block=le,te.highlightFormatting&&(d.formatting="code-block"),d.code=-1,se(d);if(d.setext||(!ke||!qe)&&!d.quote&&d.list===!1&&!d.code&&!Re&&!T.test(E.string)&&(Q=E.lookAhead(1))&&(Q=Q.match(Ce)))return d.setext?(d.header=d.setext,d.setext=0,E.skipToEnd(),te.highlightFormatting&&(d.formatting="header")):(d.header=Q[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,se(d);if(Re)return E.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,N.hr;if(E.peek()==="[")return $(E,d,ue)}return $(E,d,d.inline)}function Te(E,d){var W=H.token(E,d.htmlState);if(!v){var pe=P.innerMode(H,d.htmlState);(pe.mode.name=="xml"&&pe.state.tagStart===null&&!pe.state.context&&pe.state.tokenize.isInText||d.md_inside&&E.current().indexOf(">")>-1)&&(d.f=re,d.block=ge,d.htmlState=null)}return W}function le(E,d){var W=d.listStack[d.listStack.length-1]||0,pe=d.indentation<W,ve=W+3;if(d.fencedEndRE&&d.indentation<=ve&&(pe||E.match(d.fencedEndRE))){te.highlightFormatting&&(d.formatting="code-block");var Ne;return pe||(Ne=se(d)),d.localMode=d.localState=null,d.block=ge,d.f=re,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,pe?me(E,d,d.block):Ne}else return d.localMode?d.localMode.token(E,d.localState):(E.skipToEnd(),N.code)}function se(E){var d=[];if(E.formatting){d.push(N.formatting),typeof E.formatting=="string"&&(E.formatting=[E.formatting]);for(var W=0;W<E.formatting.length;W++)d.push(N.formatting+"-"+E.formatting[W]),E.formatting[W]==="header"&&d.push(N.formatting+"-"+E.formatting[W]+"-"+E.header),E.formatting[W]==="quote"&&(!te.maxBlockquoteDepth||te.maxBlockquoteDepth>=E.quote?d.push(N.formatting+"-"+E.formatting[W]+"-"+E.quote):d.push("error"))}if(E.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(E.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(E.linkHref?d.push(N.linkHref,"url"):(E.strong&&d.push(N.strong),E.em&&d.push(N.em),E.strikethrough&&d.push(N.strikethrough),E.emoji&&d.push(N.emoji),E.linkText&&d.push(N.linkText),E.code&&d.push(N.code),E.image&&d.push(N.image),E.imageAltText&&d.push(N.imageAltText,"link"),E.imageMarker&&d.push(N.imageMarker)),E.header&&d.push(N.header,N.header+"-"+E.header),E.quote&&(d.push(N.quote),!te.maxBlockquoteDepth||te.maxBlockquoteDepth>=E.quote?d.push(N.quote+"-"+E.quote):d.push(N.quote+"-"+te.maxBlockquoteDepth)),E.list!==!1){var pe=(E.listStack.length-1)%3;pe?pe===1?d.push(N.list2):d.push(N.list3):d.push(N.list1)}return E.trailingSpaceNewLine?d.push("trailing-space-new-line"):E.trailingSpace&&d.push("trailing-space-"+(E.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function Oe(E,d){return E.match(ae,!0)?se(d):void 0}function re(E,d){var W=d.text(E,d);if(typeof W!="undefined")return W;if(d.list)return d.list=null,se(d);if(d.taskList){var pe=E.match(ee,!0)[1]===" ";return pe?d.taskOpen=!0:d.taskClosed=!0,te.highlightFormatting&&(d.formatting="task"),d.taskList=!1,se(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&E.match(/^#+$/,!0))return te.highlightFormatting&&(d.formatting="header"),se(d);var ve=E.next();if(d.linkTitle){d.linkTitle=!1;var Ne=ve;ve==="("&&(Ne=")"),Ne=(Ne+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var qe="^\\s*(?:[^"+Ne+"\\\\]+|\\\\\\\\|\\\\.)"+Ne;if(E.match(new RegExp(qe),!0))return N.linkHref}if(ve==="`"){var Me=d.formatting;te.highlightFormatting&&(d.formatting="code"),E.eatWhile("`");var Ve=E.current().length;if(d.code==0&&(!d.quote||Ve==1))return d.code=Ve,se(d);if(Ve==d.code){var ke=se(d);return d.code=0,ke}else return d.formatting=Me,se(d)}else if(d.code)return se(d);if(ve==="\\"&&(E.next(),te.highlightFormatting)){var Re=se(d),Q=N.formatting+"-escape";return Re?Re+" "+Q:Q}if(ve==="!"&&E.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,te.highlightFormatting&&(d.formatting="image"),se(d);if(ve==="["&&d.imageMarker&&E.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,te.highlightFormatting&&(d.formatting="image"),se(d);if(ve==="]"&&d.imageAltText){te.highlightFormatting&&(d.formatting="image");var Re=se(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=ie,Re}if(ve==="["&&!d.image)return d.linkText&&E.match(/^.*?\]/)||(d.linkText=!0,te.highlightFormatting&&(d.formatting="link")),se(d);if(ve==="]"&&d.linkText){te.highlightFormatting&&(d.formatting="link");var Re=se(d);return d.linkText=!1,d.inline=d.f=E.match(/\(.*?\)| ?\[.*?\]/,!1)?ie:re,Re}if(ve==="<"&&E.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=w,te.highlightFormatting&&(d.formatting="link");var Re=se(d);return Re?Re+=" ":Re="",Re+N.linkInline}if(ve==="<"&&E.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=w,te.highlightFormatting&&(d.formatting="link");var Re=se(d);return Re?Re+=" ":Re="",Re+N.linkEmail}if(te.xml&&ve==="<"&&E.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var X=E.string.indexOf(">",E.pos);if(X!=-1){var He=E.string.substring(E.start,X);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(He)&&(d.md_inside=!0)}return E.backUp(1),d.htmlState=P.startState(H),me(E,d,Te)}if(te.xml&&ve==="<"&&E.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(ve==="*"||ve==="_"){for(var at=1,pt=E.pos==1?" ":E.string.charAt(E.pos-2);at<3&&E.eat(ve);)at++;var Ye=E.peek()||" ",rt=!/\s/.test(Ye)&&(!R.test(Ye)||/\s/.test(pt)||R.test(pt)),je=!/\s/.test(pt)&&(!R.test(pt)||/\s/.test(Ye)||R.test(Ye)),Fe=null,$e=null;if(at%2&&(!d.em&&rt&&(ve==="*"||!je||R.test(pt))?Fe=!0:d.em==ve&&je&&(ve==="*"||!rt||R.test(Ye))&&(Fe=!1)),at>1&&(!d.strong&&rt&&(ve==="*"||!je||R.test(pt))?$e=!0:d.strong==ve&&je&&(ve==="*"||!rt||R.test(Ye))&&($e=!1)),$e!=null||Fe!=null){te.highlightFormatting&&(d.formatting=Fe==null?"strong":$e==null?"em":"strong em"),Fe===!0&&(d.em=ve),$e===!0&&(d.strong=ve);var ke=se(d);return Fe===!1&&(d.em=!1),$e===!1&&(d.strong=!1),ke}}else if(ve===" "&&(E.eat("*")||E.eat("_"))){if(E.peek()===" ")return se(d);E.backUp(1)}if(te.strikethrough){if(ve==="~"&&E.eatWhile(ve)){if(d.strikethrough){te.highlightFormatting&&(d.formatting="strikethrough");var ke=se(d);return d.strikethrough=!1,ke}else if(E.match(/^[^\s]/,!1))return d.strikethrough=!0,te.highlightFormatting&&(d.formatting="strikethrough"),se(d)}else if(ve===" "&&E.match(/^~~/,!0)){if(E.peek()===" ")return se(d);E.backUp(2)}}if(te.emoji&&ve===":"&&E.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,te.highlightFormatting&&(d.formatting="emoji");var tt=se(d);return d.emoji=!1,tt}return ve===" "&&(E.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),se(d)}function w(E,d){var W=E.next();if(W===">"){d.f=d.inline=re,te.highlightFormatting&&(d.formatting="link");var pe=se(d);return pe?pe+=" ":pe="",pe+N.linkInline}return E.match(/^[^>]+/,!0),N.linkInline}function ie(E,d){if(E.eatSpace())return null;var W=E.next();return W==="("||W==="["?(d.f=d.inline=_(W==="("?")":"]"),te.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,se(d)):"error"}var Z={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(E){return function(d,W){var pe=d.next();if(pe===E){W.f=W.inline=re,te.highlightFormatting&&(W.formatting="link-string");var ve=se(W);return W.linkHref=!1,ve}return d.match(Z[E]),W.linkHref=!0,se(W)}}function ue(E,d){return E.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=xe,E.next(),te.highlightFormatting&&(d.formatting="link"),d.linkText=!0,se(d)):$(E,d,re)}function xe(E,d){if(E.match(/^\]:/,!0)){d.f=d.inline=oe,te.highlightFormatting&&(d.formatting="link");var W=se(d);return d.linkText=!1,W}return E.match(/^([^\]\\]|\\.)+/,!0),N.linkText}function oe(E,d){return E.eatSpace()?null:(E.match(/^[^\s]+/,!0),E.peek()===void 0?d.linkTitle=!0:E.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),d.f=d.inline=re,N.linkHref+" url")}var Be={startState:function(){return{f:ge,prevLine:{stream:null},thisLine:{stream:null},block:ge,htmlState:null,indentation:0,inline:re,text:Oe,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(E){return{f:E.f,prevLine:E.prevLine,thisLine:E.thisLine,block:E.block,htmlState:E.htmlState&&P.copyState(H,E.htmlState),indentation:E.indentation,localMode:E.localMode,localState:E.localMode?P.copyState(E.localMode,E.localState):null,inline:E.inline,text:E.text,formatting:!1,linkText:E.linkText,linkTitle:E.linkTitle,linkHref:E.linkHref,code:E.code,em:E.em,strong:E.strong,strikethrough:E.strikethrough,emoji:E.emoji,header:E.header,setext:E.setext,hr:E.hr,taskList:E.taskList,list:E.list,listStack:E.listStack.slice(0),quote:E.quote,indentedCode:E.indentedCode,trailingSpace:E.trailingSpace,trailingSpaceNewLine:E.trailingSpaceNewLine,md_inside:E.md_inside,fencedEndRE:E.fencedEndRE}},token:function(E,d){if(d.formatting=!1,E!=d.thisLine.stream){if(d.header=0,d.hr=!1,E.match(/^\s*$/,!0))return ce(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:E},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=Te)){var W=E.match(/^\s*/,!0)[0].replace(/\t/g,K).length;if(d.indentation=W,d.indentationDiff=null,W>0)return null}}return d.f(E,d)},innerMode:function(E){return E.block==Te?{state:E.htmlState,mode:H}:E.localState?{state:E.localState,mode:E.localMode}:{state:E,mode:Be}},indent:function(E,d,W){return E.block==Te&&H.indent?H.indent(E.htmlState,d,W):E.localState&&E.localMode.indent?E.localMode.indent(E.localState,d,W):P.Pass},blankLine:ce,getType:se,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Be},"xml"),P.defineMIME("text/markdown","markdown"),P.defineMIME("text/x-markdown","markdown")})},nuEh:function(Tt,nt,m){"use strict";var P=m("T2oS"),fe=m("W9HT"),te=m("q1tI"),H=m.n(te),v=m("F8wB"),he=m.n(v),N=function(A){var be=A.loading;return be?H.a.createElement("div",{className:he.a.loading},H.a.createElement(fe.a,null)):H.a.createElement(H.a.Fragment,null)};nt.a=N},osHv:function(Tt,nt,m){(function(P){P(m("VrN/"))})(function(P){"use strict";var fe=P.Pos;function te(R,K){return R.line-K.line||R.ch-K.ch}var H="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",v=H+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",he=new RegExp("<(/?)(["+H+"]["+v+"]*)","g");function N(R,K,$,me){this.line=K,this.ch=$,this.cm=R,this.text=R.getLine(K),this.min=me?Math.max(me.from,R.firstLine()):R.firstLine(),this.max=me?Math.min(me.to-1,R.lastLine()):R.lastLine()}function U(R,K){var $=R.cm.getTokenTypeAt(fe(R.line,K));return $&&/\btag\b/.test($)}function A(R){return R.line>=R.max?void 0:(R.ch=0,R.text=R.cm.getLine(++R.line),!0)}function be(R){return R.line<=R.min?void 0:(R.text=R.cm.getLine(--R.line),R.ch=R.text.length,!0)}function ee(R){for(;;){var K=R.text.indexOf(">",R.ch);if(K==-1){if(A(R))continue;return}if(!U(R,K+1)){R.ch=K+1;continue}var $=R.text.lastIndexOf("/",K),me=$>-1&&!/\S/.test(R.text.slice($+1,K));return R.ch=K+1,me?"selfClose":"regular"}}function ne(R){for(;;){var K=R.ch?R.text.lastIndexOf("<",R.ch-1):-1;if(K==-1){if(be(R))continue;return}if(!U(R,K+1)){R.ch=K;continue}he.lastIndex=K,R.ch=K;var $=he.exec(R.text);if($&&$.index==K)return $}}function Ce(R){for(;;){he.lastIndex=R.ch;var K=he.exec(R.text);if(!K){if(A(R))continue;return}if(!U(R,K.index+1)){R.ch=K.index+1;continue}return R.ch=K.index+K[0].length,K}}function ae(R){for(;;){var K=R.ch?R.text.lastIndexOf(">",R.ch-1):-1;if(K==-1){if(be(R))continue;return}if(!U(R,K+1)){R.ch=K;continue}var $=R.text.lastIndexOf("/",K),me=$>-1&&!/\S/.test(R.text.slice($+1,K));return R.ch=K+1,me?"selfClose":"regular"}}function V(R,K){for(var $=[];;){var me=Ce(R),Le,ce=R.line,ge=R.ch-(me?me[0].length:0);if(!me||!(Le=ee(R)))return;if(Le=="selfClose")continue;if(me[1]){for(var Te=$.length-1;Te>=0;--Te)if($[Te]==me[2]){$.length=Te;break}if(Te<0&&(!K||K==me[2]))return{tag:me[2],from:fe(ce,ge),to:fe(R.line,R.ch)}}else $.push(me[2])}}function T(R,K){for(var $=[];;){var me=ae(R);if(!me)return;if(me=="selfClose"){ne(R);continue}var Le=R.line,ce=R.ch,ge=ne(R);if(!ge)return;if(ge[1])$.push(ge[2]);else{for(var Te=$.length-1;Te>=0;--Te)if($[Te]==ge[2]){$.length=Te;break}if(Te<0&&(!K||K==ge[2]))return{tag:ge[2],from:fe(R.line,R.ch),to:fe(Le,ce)}}}}P.registerHelper("fold","xml",function(R,K){for(var $=new N(R,K.line,0);;){var me=Ce($);if(!me||$.line!=K.line)return;var Le=ee($);if(!Le)return;if(!me[1]&&Le!="selfClose"){var ce=fe($.line,$.ch),ge=V($,me[2]);return ge&&te(ge.from,ce)>0?{from:ce,to:ge.from}:null}}}),P.findMatchingTag=function(R,K,$){var me=new N(R,K.line,K.ch,$);if(me.text.indexOf(">")==-1&&me.text.indexOf("<")==-1)return;var Le=ee(me),ce=Le&&fe(me.line,me.ch),ge=Le&&ne(me);if(!Le||!ge||te(me,K)>0)return;var Te={from:fe(me.line,me.ch),to:ce,tag:ge[2]};return Le=="selfClose"?{open:Te,close:null,at:"open"}:ge[1]?{open:T(me,ge[2]),close:Te,at:"close"}:(me=new N(R,ce.line,ce.ch,$),{open:Te,close:V(me,ge[2]),at:"open"})},P.findEnclosingTag=function(R,K,$,me){for(var Le=new N(R,K.line,K.ch,$);;){var ce=T(Le,me);if(!ce)break;var ge=new N(R,K.line,K.ch,$),Te=V(ge,ce.tag);if(Te)return{open:ce,close:Te}}},P.scanForClosingTag=function(R,K,$,me){var Le=new N(R,K.line,K.ch,me?{from:0,to:me}:null);return V(Le,$)}})},p5ED:function(Tt,nt,m){"use strict";var P=m("+L6B"),fe=m("2/Rp"),te=m("5Dmo"),H=m("3S7+"),v=m("k1fw"),he=m("tJVT"),N=m("q1tI"),U=m.n(N),A=m("vHTk"),be=m.n(A),ee=m("yEEn"),ne=m("ZW9T"),Ce=m("1vsH");nt.a=function(ae){var V=ae.name,T=ae.data,R=ae.theme,K=ae.type,$=ae.filename,me=ae.monacoEditor,Le=ae.className,ce=ae.style,ge=ae.close,Te=ae.onClose,le=ae.hasMask,se=Object(N.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Oe=Object(he.a)(se,2),re=Oe[0],w=Oe[1],ie=Object(N.useState)(""),Z=Object(he.a)(ie,2),_=Z[0],ue=Z[1],xe=Object(N.useRef)();$&&(me.filename=$),Object(N.useEffect)(function(){var E,d,W=(E=document.cookie)===null||E===void 0||((d=E.replace(/\s/g,""))===null||d===void 0)?void 0:d.split(";");W==null||W.map(function(pe){var ve=pe.split("=");ve[0]==="_educoder_session"&&ue(ve[1])})},[]);var oe=function(){if(T.startsWith("http")||T.startsWith("/")){Be();return}Object(Ce.x)($||"educoder",T,$)},Be=function(){Object(Ce.v)($||V,T)};return U.a.createElement("div",{style:Object(v.a)({},ce||{}),className:"".concat(le&&be.a.bgBlack," ").concat(K?be.a.wrp:"hide")},ge&&U.a.createElement("div",{className:be.a.close,ref:xe},U.a.createElement(H.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return xe.current}},U.a.createElement("span",{onClick:Be},U.a.createElement("i",{className:"icon-quxiaozhiding"}))),U.a.createElement(H.a,{title:"\u5173\u95ED",getPopupContainer:function(){return xe.current}},U.a.createElement("span",{className:"",onClick:Te},U.a.createElement("i",{className:"icon-guanbi1"})))),U.a.createElement("div",{className:"".concat(be.a[Le]," ").concat(Le," ").concat(be.a.monaco," ").concat(K==="txt"?"show":"hide")},K==="txt"&&U.a.createElement(ne.b,me)),K==="audio"&&U.a.createElement("audio",{src:"".concat(T!=null&&T.startsWith("/")||(T==null?void 0:T.indexOf("https://"))>-1?T:"data:audio/mp3;base64,").concat(T),autoPlay:!0}),K==="video"&&U.a.createElement(U.a.Fragment,null,T!=null&&T.startsWith("/")?U.a.createElement("video",{controls:!0,src:"".concat(T),autoPlay:!0}):U.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(T),autoPlay:!0})),K==="pdf"&&U.a.createElement("embed",{className:be.a.embed,src:T}),K==="image"&&U.a.createElement(U.a.Fragment,null,U.a.createElement("img",{src:"".concat(T!=null&&T.startsWith("/")||(T==null?void 0:T.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(T)})),K==="other"&&U.a.createElement("div",null,U.a.createElement(fe.a,{type:"primary",size:"large",onClick:oe},U.a.createElement(ee.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(K==="download"||K==="office")&&U.a.createElement(fe.a,{type:"primary",size:"large",onClick:oe},U.a.createElement(ee.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Tt,nt,m){},"rAM+":function(Tt,nt,m){"use strict";m.d(nt,"a",function(){return fe});var P=m("Qw5x");function fe(te,H){var v;if(typeof Symbol=="undefined"||te[Symbol.iterator]==null){if(Array.isArray(te)||(v=Object(P.a)(te))||H&&te&&typeof te.length=="number"){v&&(te=v);var he=0,N=function(){};return{s:N,n:function(){return he>=te.length?{done:!0}:{done:!1,value:te[he++]}},e:function(ne){throw ne},f:N}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U=!0,A=!1,be;return{s:function(){v=te[Symbol.iterator]()},n:function(){var ne=v.next();return U=ne.done,ne},e:function(ne){A=!0,be=ne},f:function(){try{!U&&v.return!=null&&v.return()}finally{if(A)throw be}}}}},rUJ1:function(Tt,nt){const m=/[&<>"']/,P=/[&<>"']/g,fe=/[<>"']|&(?!#?\w+;)/,te=/[<>"']|&(?!#?\w+;)/g,H={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},v=le=>H[le];function he(le,se){if(se){if(m.test(le))return le.replace(P,v)}else if(fe.test(le))return le.replace(te,v);return le}const N=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function U(le){return le.replace(N,(se,Oe)=>(Oe=Oe.toLowerCase(),Oe==="colon"?":":Oe.charAt(0)==="#"?Oe.charAt(1)==="x"?String.fromCharCode(parseInt(Oe.substring(2),16)):String.fromCharCode(+Oe.substring(1)):""))}const A=/(^|[^\[])\^/g;function be(le,se){le=le.source||le,se=se||"";const Oe={replace:(re,w)=>(w=w.source||w,w=w.replace(A,"$1"),le=le.replace(re,w),Oe),getRegex:()=>new RegExp(le,se)};return Oe}const ee=/[^\w:]/g,ne=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ce(le,se,Oe){if(le){let re;try{re=decodeURIComponent(U(Oe)).replace(ee,"").toLowerCase()}catch(w){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}se&&!ne.test(Oe)&&(Oe=K(se,Oe));try{Oe=encodeURI(Oe).replace(/%25/g,"%")}catch(re){return null}return Oe}const ae={},V=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,R=/^([^:]+:\/*[^/]*)[\s\S]*$/;function K(le,se){ae[" "+le]||(V.test(le)?ae[" "+le]=le+"/":ae[" "+le]=ce(le,"/",!0)),le=ae[" "+le];const Oe=le.indexOf(":")===-1;return se.substring(0,2)==="//"?Oe?se:le.replace(T,"$1")+se:se.charAt(0)==="/"?Oe?se:le.replace(R,"$1")+se:le+se}const $={exec:function(){}};function me(le){let se=1,Oe,re;for(;se<arguments.length;se++){Oe=arguments[se];for(re in Oe)Object.prototype.hasOwnProperty.call(Oe,re)&&(le[re]=Oe[re])}return le}function Le(le,se){const Oe=le.replace(/\|/g,(ie,Z,_)=>{let ue=!1,xe=Z;for(;--xe>=0&&_[xe]==="\\";)ue=!ue;return ue?"|":" |"}),re=Oe.split(/ \|/);let w=0;if(re.length>se)re.splice(se);else for(;re.length<se;)re.push("");for(;w<re.length;w++)re[w]=re[w].trim().replace(/\\\|/g,"|");return re}function ce(le,se,Oe){const re=le.length;if(re===0)return"";let w=0;for(;w<re;){const ie=le.charAt(re-w-1);if(ie===se&&!Oe)w++;else if(ie!==se&&Oe)w++;else break}return le.substr(0,re-w)}function ge(le,se){if(le.indexOf(se[1])===-1)return-1;const Oe=le.length;let re=0,w=0;for(;w<Oe;w++)if(le[w]==="\\")w++;else if(le[w]===se[0])re++;else if(le[w]===se[1]&&(re--,re<0))return w;return-1}function Te(le){le&&le.sanitize&&!le.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")}Tt.exports={escape:he,unescape:U,edit:be,cleanUrl:Ce,resolveUrl:K,noopTest:$,merge:me,splitCells:Le,rtrim:ce,findClosingBracket:ge,checkSanitizeDeprecation:Te}},t23M:function(Tt,nt,m){"use strict";var P=m("VTBJ"),fe=m("1OyB"),te=m("vuIU"),H=m("Ji7U"),v=m("LK+K"),he=m("q1tI"),N=m.n(he),U=m("m+aA"),A=m("Zm9Q"),be=m("Kwbf"),ee=m("c+Xe"),ne=m("bdgK"),Ce="rc-observer-key",ae=function(V){Object(H.a)(R,V);var T=Object(v.a)(R);function R(){var K;return Object(fe.a)(this,R),K=T.apply(this,arguments),K.resizeObserver=null,K.childNode=null,K.currentElement=null,K.state={width:0,height:0,offsetHeight:0,offsetWidth:0},K.onResize=function($){var me=K.props.onResize,Le=$[0].target,ce=Le.getBoundingClientRect(),ge=ce.width,Te=ce.height,le=Le.offsetWidth,se=Le.offsetHeight,Oe=Math.floor(ge),re=Math.floor(Te);if(K.state.width!==Oe||K.state.height!==re||K.state.offsetWidth!==le||K.state.offsetHeight!==se){var w={width:Oe,height:re,offsetWidth:le,offsetHeight:se};K.setState(w),me&&Promise.resolve().then(function(){me(Object(P.a)(Object(P.a)({},w),{},{offsetWidth:le,offsetHeight:se}))})}},K.setChildNode=function($){K.childNode=$},K}return Object(te.a)(R,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var $=this.props.disabled;if($){this.destroyObserver();return}var me=Object(U.a)(this.childNode||this),Le=me!==this.currentElement;Le&&(this.destroyObserver(),this.currentElement=me),!this.resizeObserver&&me&&(this.resizeObserver=new ne.default(this.onResize),this.resizeObserver.observe(me))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var $=this.props.children,me=Object(A.a)($);if(me.length>1)Object(be.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(me.length===0)return Object(be.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var Le=me[0];if(he.isValidElement(Le)&&Object(ee.c)(Le)){var ce=Le.ref;me[0]=he.cloneElement(Le,{ref:Object(ee.a)(ce,this.setChildNode)})}return me.length===1?me[0]:me.map(function(ge,Te){return!he.isValidElement(ge)||"key"in ge&&ge.key!==null?ge:he.cloneElement(ge,{key:"".concat(Ce,"-").concat(Te)})})}}]),R}(he.Component);ae.displayName="ResizeObserver",nt.a=ae},vHTk:function(Tt,nt,m){Tt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);