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.
345 lines
584 KiB
345 lines
584 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[228,7,17],{"+NIl":function(Qe,We,b){(function(P){P(b("VrN/"))})(function(P){"use strict";P.defineMode("stex",function(le,X){"use strict";function ae(H,O){H.cmdState.push(O)}function te(H){return H.cmdState.length>0?H.cmdState[H.cmdState.length-1]:null}function K(H){var O=H.cmdState.pop();O&&O.closeBracket()}function S(H){for(var O=H.cmdState,G=O.length-1;G>=0;G--){var N=O[G];if(N.name=="DEFAULT")continue;return N}return{styleIdentifier:function(){return null}}}function L(H,O,G){return function(){this.name=H,this.bracketNo=0,this.style=O,this.styles=G,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=L("importmodule","tag",["string","builtin"]),A.documentclass=L("documentclass","tag",["","atom"]),A.usepackage=L("usepackage","tag",["atom"]),A.begin=L("begin","tag",["atom"]),A.end=L("end","tag",["atom"]),A.label=L("label","tag",["atom"]),A.ref=L("ref","tag",["atom"]),A.eqref=L("eqref","tag",["atom"]),A.cite=L("cite","tag",["atom"]),A.bibitem=L("bibitem","tag",["atom"]),A.Bibitem=L("Bibitem","tag",["atom"]),A.RBibitem=L("RBibitem","tag",["atom"]),A.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function W(H,O){H.f=O}function k(H,O){var G;if(H.match(/^\\[a-zA-Z@]+/)){var N=H.current().slice(1);return G=A.hasOwnProperty(N)?A[N]:A.DEFAULT,G=new G,ae(O,G),W(O,V),G.style}if(H.match(/^\\[$&%#{}_]/))return"tag";if(H.match(/^\\[,;!\/\\]/))return"tag";if(H.match("\\["))return W(O,function(Q,Le){return E(Q,Le,"\\]")}),"keyword";if(H.match("\\("))return W(O,function(Q,Le){return E(Q,Le,"\\)")}),"keyword";if(H.match("$$"))return W(O,function(Q,Le){return E(Q,Le,"$$")}),"keyword";if(H.match("$"))return W(O,function(Q,Le){return E(Q,Le,"$")}),"keyword";var ie=H.next();if(ie=="%")return H.skipToEnd(),"comment";if(ie=="}"||ie=="]"){if(G=te(O),G)G.closeBracket(ie),W(O,V);else return"error";return"bracket"}else return ie=="{"||ie=="["?(G=A.DEFAULT,G=new G,ae(O,G),"bracket"):/\d/.test(ie)?(H.eatWhile(/[\w.%]/),"atom"):(H.eatWhile(/[\w\-_]/),G=S(O),G.name=="begin"&&(G.argument=H.current()),G.styleIdentifier())}function E(H,O,G){if(H.eatSpace())return null;if(G&&H.match(G))return W(O,k),"keyword";if(H.match(/^\\[a-zA-Z@]+/))return"tag";if(H.match(/^[a-zA-Z]+/))return"variable-2";if(H.match(/^\\[$&%#{}_]/))return"tag";if(H.match(/^\\[,;!\/]/))return"tag";if(H.match(/^[\^_&]/))return"tag";if(H.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(H.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var N=H.next();return N=="{"||N=="}"||N=="["||N=="]"||N=="("||N==")"?"bracket":N=="%"?(H.skipToEnd(),"comment"):"error"}function V(H,O){var G=H.peek(),N;return G=="{"||G=="["?(N=te(O),N.openBracket(G),H.eat(G),W(O,k),"bracket"):/[ \t\r]/.test(G)?(H.eat(G),null):(W(O,k),K(O),k(H,O))}return{startState:function(){var H=X.inMathMode?function(O,G){return E(O,G)}:k;return{cmdState:[],f:H}},copyState:function(H){return{cmdState:H.cmdState.slice(),f:H.f}},token:function(H,O){return O.f(H,O)},blankLine:function(H){H.f=k,H.cmdState.length=0},lineComment:"%"}}),P.defineMIME("text/x-stex","stex"),P.defineMIME("text/x-latex","stex")})},"19Vz":function(Qe,We,b){(function(P){P(b("VrN/"))})(function(P){P.defineOption("placeholder","",function(L,A,W){var k=W&&W!=P.Init;if(A&&!k)L.on("blur",te),L.on("change",K),L.on("swapDoc",K),P.on(L.getInputField(),"compositionupdate",L.state.placeholderCompose=function(){ae(L)}),K(L);else if(!A&&k){L.off("blur",te),L.off("change",K),L.off("swapDoc",K),P.off(L.getInputField(),"compositionupdate",L.state.placeholderCompose),le(L);var E=L.getWrapperElement();E.className=E.className.replace(" CodeMirror-empty","")}A&&!L.hasFocus()&&te(L)});function le(L){L.state.placeholder&&(L.state.placeholder.parentNode.removeChild(L.state.placeholder),L.state.placeholder=null)}function X(L){le(L);var A=L.state.placeholder=document.createElement("pre");A.style.cssText="height: 0; overflow: visible",A.style.direction=L.getOption("direction"),A.className="CodeMirror-placeholder CodeMirror-line-like";var W=L.getOption("placeholder");typeof W=="string"&&(W=document.createTextNode(W)),A.appendChild(W),L.display.lineSpace.insertBefore(A,L.display.lineSpace.firstChild)}function ae(L){setTimeout(function(){var A=!1,W=L.getInputField();W.nodeName=="TEXTAREA"?A=!W.value:L.lineCount()==1&&(A=!/[^\u200b]/.test(W.querySelector(".CodeMirror-line").textContent)),A?X(L):le(L)},20)}function te(L){S(L)&&X(L)}function K(L){var A=L.getWrapperElement(),W=S(L);A.className=A.className.replace(" CodeMirror-empty","")+(W?" CodeMirror-empty":""),W?X(L):le(L)}function S(L){return L.lineCount()===1&&L.getLine(0)===""}})},"1eCo":function(Qe,We,b){(function(P){P(b("VrN/"))})(function(P){"use strict";var le={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},X={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};P.defineMode("xml",function(ae,te){var K=ae.indentUnit,S={},L=te.htmlMode?le:X;for(var A in L)S[A]=L[A];for(var A in te)S[A]=te[A];var W,k;function E(T,se){function q(J){return se.tokenize=J,J(T,se)}var x=T.next();if(x=="<")return T.eat("!")?T.eat("[")?T.match("CDATA[")?q(O("atom","]]>")):null:T.match("--")?q(O("comment","-->")):T.match("DOCTYPE",!0,!0)?(T.eatWhile(/[\w\._\-]/),q(G(1))):null:T.eat("?")?(T.eatWhile(/[\w\._\-]/),se.tokenize=O("meta","?>"),"meta"):(W=T.eat("/")?"closeTag":"openTag",se.tokenize=V,"tag bracket");if(x=="&"){var D;return T.eat("#")?T.eat("x")?D=T.eatWhile(/[a-fA-F\d]/)&&T.eat(";"):D=T.eatWhile(/[\d]/)&&T.eat(";"):D=T.eatWhile(/[\w\.\-:]/)&&T.eat(";"),D?"atom":"error"}else return T.eatWhile(/[^&<]/),null}E.isInText=!0;function V(T,se){var q=T.next();if(q==">"||q=="/"&&T.eat(">"))return se.tokenize=E,W=q==">"?"endTag":"selfcloseTag","tag bracket";if(q=="=")return W="equals",null;if(q=="<"){se.tokenize=E,se.state=Le,se.tagName=se.tagStart=null;var x=se.tokenize(T,se);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(q)?(se.tokenize=H(q),se.stringStartCol=T.column(),se.tokenize(T,se)):(T.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function H(T){var se=function(q,x){for(;!q.eol();)if(q.next()==T){x.tokenize=V;break}return"string"};return se.isInAttribute=!0,se}function O(T,se){return function(q,x){for(;!q.eol();){if(q.match(se)){x.tokenize=E;break}q.next()}return T}}function G(T){return function(se,q){for(var x;(x=se.next())!=null;){if(x=="<")return q.tokenize=G(T+1),q.tokenize(se,q);if(x==">")if(T==1){q.tokenize=E;break}else return q.tokenize=G(T-1),q.tokenize(se,q)}return"meta"}}function N(T,se,q){this.prev=T.context,this.tagName=se,this.indent=T.indented,this.startOfLine=q,(S.doNotIndent.hasOwnProperty(se)||T.context&&T.context.noIndent)&&(this.noIndent=!0)}function ie(T){T.context&&(T.context=T.context.prev)}function Q(T,se){for(var q;;){if(!T.context)return;if(q=T.context.tagName,!S.contextGrabbers.hasOwnProperty(q)||!S.contextGrabbers[q].hasOwnProperty(se))return;ie(T)}}function Le(T,se,q){return T=="openTag"?(q.tagStart=se.column(),He):T=="closeTag"?ue:Le}function He(T,se,q){return T=="word"?(q.tagName=se.current(),k="tag",oe):S.allowMissingTagName&&T=="endTag"?(k="tag bracket",oe(T,se,q)):(k="error",He)}function ue(T,se,q){if(T=="word"){var x=se.current();return q.context&&q.context.tagName!=x&&S.implicitlyClosed.hasOwnProperty(q.context.tagName)&&ie(q),q.context&&q.context.tagName==x||S.matchClosing===!1?(k="tag",ye):(k="tag error",Oe)}else return S.allowMissingTagName&&T=="endTag"?(k="tag bracket",ye(T,se,q)):(k="error",Oe)}function ye(T,se,q){return T!="endTag"?(k="error",ye):(ie(q),Le)}function Oe(T,se,q){return k="error",ye(T,se,q)}function oe(T,se,q){if(T=="word")return k="attribute",pe;if(T=="endTag"||T=="selfcloseTag"){var x=q.tagName,D=q.tagStart;return q.tagName=q.tagStart=null,T=="selfcloseTag"||S.autoSelfClosers.hasOwnProperty(x)?Q(q,x):(Q(q,x),q.context=new N(q,x,D==q.indented)),Le}return k="error",oe}function pe(T,se,q){return T=="equals"?_e:(S.allowMissing||(k="error"),oe(T,se,q))}function _e(T,se,q){return T=="string"?ce:T=="word"&&S.allowUnquoted?(k="string",oe):(k="error",oe(T,se,q))}function ce(T,se,q){return T=="string"?ce:oe(T,se,q)}return{startState:function(T){var se={tokenize:E,state:Le,indented:T||0,tagName:null,tagStart:null,context:null};return T!=null&&(se.baseIndent=T),se},token:function(T,se){if(!se.tagName&&T.sol()&&(se.indented=T.indentation()),T.eatSpace())return null;W=null;var q=se.tokenize(T,se);return(q||W)&&q!="comment"&&(k=null,se.state=se.state(W||q,T,se),k&&(q=k=="error"?q+" error":k)),q},indent:function(T,se,q){var x=T.context;if(T.tokenize.isInAttribute)return T.tagStart==T.indented?T.stringStartCol+1:T.indented+K;if(x&&x.noIndent)return P.Pass;if(T.tokenize!=V&&T.tokenize!=E)return q?q.match(/^(\s*)/)[0].length:0;if(T.tagName)return S.multilineTagIndentPastTag!==!1?T.tagStart+T.tagName.length+2:T.tagStart+K*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/<!\[CDATA\[/.test(se))return 0;var D=se&&/^<(\/)?([\w_:\.-]*)/.exec(se);if(D&&D[1])for(;x;)if(x.tagName==D[2]){x=x.prev;break}else if(S.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(D)for(;x;){var J=S.contextGrabbers[x.tagName];if(J&&J.hasOwnProperty(D[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+K:T.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(T){T.state==_e&&(T.state=oe)},xmlCurrentTag:function(T){return T.tagName?{name:T.tagName,close:T.type=="closeTag"}:null},xmlCurrentContext:function(T){for(var se=[],q=T.context;q;q=q.prev)q.tagName&&se.push(q.tagName);return se.reverse()}}}),P.defineMIME("text/xml","xml"),P.defineMIME("application/xml","xml"),P.mimeModes.hasOwnProperty("text/html")||P.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"389U":function(Qe,We,b){"use strict";b.r(We);var P=b("+L6B"),le=b("2/Rp"),X=b("oBTY"),ae=b("giR+"),te=b("fyUT"),K=b("5Dmo"),S=b("3S7+"),L=b("sRBo"),A=b("kaz8"),W=b("2qtc"),k=b("kLXV"),E=b("miYZ"),V=b("tsqr"),H=b("k1fw"),O=b("9og8"),G=b("tJVT"),N=b("PpiC"),ie=b("5NDa"),Q=b("5rEg"),Le=b("OaEy"),He=b("2fM7"),ue=b("WmNS"),ye=b.n(ue),Oe=b("q1tI"),oe=b.n(Oe),pe=b("9kvl"),_e=b("Ot1p"),ce=b("HBuW"),T=b("LvDl"),se=b.n(T),q=b("bNIU"),x=b.n(q),D=b("9ZNV"),J=b("fnXi"),j=b("nuEh"),me=b("UqFu"),w=He.a.Option,m=Q.a.TextArea,Y=function(fe){var Ue=fe.shixunsDetail,Fe=fe.dispatch,be=fe.match,Se=fe.practiceSetting,xe=Object(N.a)(fe,["shixunsDetail","dispatch","match","practiceSetting"]),Ee=Object(Oe.useState)({}),$=Object(G.a)(Ee,2),I=$[0],Ie=$[1],ot=Object(Oe.useState)([]),ct=Object(G.a)(ot,2),Xe=ct[0],Je=ct[1],Te=Object(Oe.useState)(!1),Be=Object(G.a)(Te,2),Ye=Be[0],tt=Be[1],Ke=Object(Oe.useRef)(null),Pe=Object(Oe.useRef)({editData:null,answerList:null}),ze=Object(Oe.useState)(!0),vt=Object(G.a)(ze,2),st=vt[0],nt=vt[1];Object(Oe.useEffect)(function(){qe()},[]),Object(Oe.useEffect)(function(){ve()},[I,Xe]);var qe=function(){var de=Object(O.a)(ye.a.mark(function ge(){return ye.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return nt(!0),R.next=3,ft();case 3:return R.next=5,at();case 5:nt(!1);case 6:case"end":return R.stop()}},ge)}));return function(){return de.apply(this,arguments)}}(),ft=function(){var de=Object(O.a)(ye.a.mark(function ge(){var z;return ye.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,Object(ce.G)({id:be.params.id,challengeId:be.params.challengesId,tab:2});case 2:z=U.sent,Pe.current.editData=z,z&&Ie(z);case 5:case"end":return U.stop()}},ge)}));return function(){return de.apply(this,arguments)}}(),at=function(){var de=Object(O.a)(ye.a.mark(function ge(){var z,R;return ye.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,Object(ce.H)({id:be.params.id,challengeId:be.params.challengesId});case 2:z=v.sent,R=z.map(function(y){return Object(H.a)(Object(H.a)({},y),{},{contents:Object(me.a)(y.contents)})}),Pe.current.answerList=R,z&&Je(R);case 6:case"end":return v.stop()}},ge)}));return function(){return de.apply(this,arguments)}}(),it=function(){var de=Object(O.a)(ye.a.mark(function ge(){var z,R,U;return ye.a.wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(tt(!0),z=Xe.map(function(C){return C.score}),R=z.reduce(function(C,_){return C+_},0),!(R!==100&&Xe!==null&&Xe!==void 0&&Xe.length)){y.next=7;break}return tt(!1),V.b.info("\u6D4B\u8BD5\u96C6\u7684\u8BC4\u5206\u5360\u6BD4\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E100"),y.abrupt("return");case 7:if(Xe.every(function(C){return C.name})){y.next=11;break}return tt(!1),V.b.info("\u8BF7\u5148\u586B\u5199\u6837\u4F8B\u4EE3\u7801\u540D\u79F0"),y.abrupt("return");case 11:if(Xe.every(function(C){return C.contents})){y.next=15;break}return tt(!1),V.b.info("\u8BF7\u5148\u586B\u5199\u6837\u4F8B\u4EE3\u7801\u5185\u5BB9"),y.abrupt("return");case 15:return y.next=17,Object(ce.Kb)({id:be.params.id,challengeId:be.params.challengesId,challenge_answer:Xe,hide_answer:I==null?void 0:I.hide_answer,disable_copy:I==null?void 0:I.disable_copy});case 17:U=y.sent,tt(!1),Fe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}}),U!=null&&U.message&&V.b.info(U.message),U.status===1&&pe.d.push("/shixuns/".concat(be.params.id,"/edit/").concat(be.params.challengesId,"/tab=4"));case 22:case"end":return y.stop()}},ge)}));return function(){return de.apply(this,arguments)}}(),ve=function(){clearTimeout(Ke.current),Ke.current=setTimeout(mt,500)},mt=function(){!Object(T.isEqual)(Pe.current.editData,I)||!Object(T.isEqual)(Pe.current.answerList,Xe)?Fe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!0}}):Fe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})},et=function(){var ge,z=function(){pe.d.push("/shixuns/".concat(be.params.id,"/challenges")),Fe({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};Se!=null&&(ge=Se.sideBar)!==null&&ge!==void 0&&ge.confirmLeave?k.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(){z()}}):z()};return oe.a.createElement("section",{className:x.a.bg},oe.a.createElement("div",{className:x.a.formWrap},oe.a.createElement(J.a,{activeIndex:2}),oe.a.createElement("div",{className:x.a.check},oe.a.createElement("div",null,oe.a.createElement(A.a,{checked:I==null?void 0:I.hide_answer,onChange:function(ge){return Ie(Object(H.a)(Object(H.a)({},I),{},{hide_answer:ge.target.checked}))}},"\u9690\u85CF\u6837\u4F8B\u4EE3\u7801\u6A21\u5757")),oe.a.createElement("div",null,oe.a.createElement(A.a,{checked:I==null?void 0:I.disable_copy,onChange:function(ge){return Ie(Object(H.a)(Object(H.a)({},I),{},{disable_copy:ge.target.checked}))}},"\u7981\u6B62\u590D\u5236\u6837\u4F8B\u4EE3\u7801"))),oe.a.createElement("div",{className:x.a.fieldWrap},oe.a.createElement("p",null,"\u53EF\u4EE5\u5C06\u6837\u4F8B\u4EE3\u7801\u5206\u7EA7\u8BBE\u7F6E\uFF0C\u8BA9\u5B66\u5458\u81EA\u884C\u9009\u62E9\u7EA7\u522B\uFF0C\u6BCF\u7EA7\u67E5\u770B\u540E\u6309\u7167\u6BD4\u4F8B\u6263\u5206\u503C\uFF08\u5B66\u5458\u5DF2\u5B8C\u6210\u4EFB\u52A1\u518D\u67E5\u770B\uFF0C\u5219\u4E0D\u5F71\u54CD\u5B66\u5458\u5DF2\u83B7\u5F97\u7684\u6210\u7EE9\uFF09"),oe.a.createElement("p",null,"\u793A\u4F8B\uFF1A\u7EA7\u522B1\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD425%\uFF1B\u7EA7\u522B2\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD435%\uFF1B\u7EA7\u522B3\uFF0C\u6263\u51CF\u5206\u503C\u5360\u6BD440%\uFF1B"),oe.a.createElement("p",null,"\u82E5\u5B66\u5458\u9009\u62E9\u67E5\u770B\u7EA7\u522B1\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF25%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B2\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF60%\u7684\u5206\u503C\uFF1B\u9009\u62E9\u67E5\u770B\u7EA7\u522B3\u7684\u7B54\u6848\uFF0C\u5C06\u88AB\u6263\u51CF100%\u7684\u5206\u503C\u3002"),Xe==null?void 0:Xe.map(function(de,ge){return oe.a.createElement("div",{key:ge,className:"mt30 pb5"},oe.a.createElement("div",{className:x.a.flexRow},oe.a.createElement("b",{className:"font16"},"\u7EA7\u522B\uFF1A",ge+1),oe.a.createElement("div",{className:"tr flex1"},oe.a.createElement(S.a,{placement:"bottom",title:"\u5220\u9664"},oe.a.createElement("span",{className:"font14 c-red current",onClick:function(){var R=Xe.filter(function(y,C){return C!==ge}),U=Math.floor(100/R.length),v=U+100%R.length;R=R.map(function(y,C){return C===R.length-1?Object(H.a)(Object(H.a)({},y),{},{score:v}):Object(H.a)(Object(H.a)({},y),{},{score:U})}),Je(R)}},"\u5220\xA0\u9664")))),oe.a.createElement("div",{className:x.a.contentWrap},oe.a.createElement("div",{className:x.a.flexRow},oe.a.createElement("div",null,oe.a.createElement("p",{className:"font16"},"\u540D\u79F0\uFF1A"),oe.a.createElement(Q.a,{bordered:!1,value:de.name,onChange:function(R){var U=Xe.map(function(v,y){return y===ge?Object(H.a)(Object(H.a)({},v),{},{name:R.target.value}):v});Je(U)}})),oe.a.createElement("div",{className:"ml10"},oe.a.createElement("p",{className:"font16"},"\u6263\u51CF\u5206\u503C\u5360\u6BD4\uFF1A"),oe.a.createElement(te.a,{min:0,max:100,value:de.score,onChange:function(R){var U=Xe.map(function(v,y){return y===ge?Object(H.a)(Object(H.a)({},v),{},{score:R}):v});Je(U)}})))),oe.a.createElement("div",{className:"mt10 mb10"},oe.a.createElement("div",{className:"font16 mb20"},"\u5185\u5BB9\uFF1A"),oe.a.createElement(_e.a,{placeholder:"\u5EFA\u8BAE\u63D0\u4F9B\u5305\u62EC\u6587\u4EF6\u6240\u6709\u4EE3\u7801\u7684\u6837\u4F8B\u4EE3\u7801",defaultValue:de.contents,onChange:function(R){var U=Xe.map(function(v,y){return y===ge?Object(H.a)(Object(H.a)({},v),{},{contents:R}):v});Je(U)}})))}),oe.a.createElement("div",null,oe.a.createElement(le.a,{type:"primary",size:"large",ghost:!0,style:{width:200},className:"mt10",onClick:function(){var ge=[].concat(Object(X.a)(Xe),[{name:"\u89E3\u9898\u601D\u8DEF".concat(Xe.length+1),contents:"",score:0,id:null,level:null}]),z=Math.floor(100/ge.length),R=z+100%ge.length;ge=ge.map(function(U,v){return v===ge.length-1?Object(H.a)(Object(H.a)({},U),{},{score:R}):Object(H.a)(Object(H.a)({},U),{},{score:z})}),Je(ge)}},"\u65B0\u589E\u6837\u4F8B\u4EE3\u7801")))),oe.a.createElement(D.a,{onOk:it,className:"customFixedButton",onCancel:et,loading:Ye}),oe.a.createElement(j.a,{loading:st}))};We.default=Object(pe.a)(function(we){var fe=we.shixunsDetail,Ue=we.newCourse,Fe=we.globalSetting,be=we.practiceSetting;return{shixunsDetail:fe,newCourse:Ue,globalSetting:Fe,practiceSetting:be}})(Y)},"7Cbv":function(Qe,We,b){"use strict";var P=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),le=new Uint8Array(16);function X(){if(!P)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return P(le)}var ae=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function te(V){return typeof V=="string"&&ae.test(V)}for(var K=te,S=[],L=0;L<256;++L)S.push((L+256).toString(16).substr(1));function A(V){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=(S[V[H+0]]+S[V[H+1]]+S[V[H+2]]+S[V[H+3]]+"-"+S[V[H+4]]+S[V[H+5]]+"-"+S[V[H+6]]+S[V[H+7]]+"-"+S[V[H+8]]+S[V[H+9]]+"-"+S[V[H+10]]+S[V[H+11]]+S[V[H+12]]+S[V[H+13]]+S[V[H+14]]+S[V[H+15]]).toLowerCase();if(!K(O))throw TypeError("Stringified UUID is invalid");return O}var W=A;function k(V,H,O){V=V||{};var G=V.random||(V.rng||X)();if(G[6]=G[6]&15|64,G[8]=G[8]&63|128,H){O=O||0;for(var N=0;N<16;++N)H[O+N]=G[N];return H}return W(G)}var E=We.a=k},"7ahc":function(Qe,We,b){"use strict";b.d(We,"a",function(){return He});var P=b("k1fw"),le=b("0Owb"),X=b("+L6B"),ae=b("2/Rp"),te=b("y8nQ"),K=b("Vl3Y"),S=b("tJVT"),L=b("OaEy"),A=b("2fM7"),W=b("q1tI"),k=b.n(W),E=b("VrN/"),V=b.n(E),H=b("p77/"),O=b.n(H),G=b("c5Ni"),N=b.n(G),ie=A.a.Option,Q={labelCol:{span:4},wrapperCol:{span:20}},Le={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};We.b=function(ue){var ye=ue.callback,Oe=ue.onCancel,oe=Object(W.useState)("python"),pe=Object(S.a)(oe,2),_e=pe[0],ce=pe[1];function T(q){ce(Le[q][1])}function se(q){ye(q)}return k.a.createElement(K.a,Object(le.a)({},Q,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:se}),k.a.createElement(K.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},k.a.createElement(A.a,{onChange:T},Object.keys(Le).map(function(q){return k.a.createElement(ie,{key:q,value:q},Le[q][0])}))),k.a.createElement(K.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},k.a.createElement(He,{mode:_e})),k.a.createElement("div",{className:"flex-container flex-end"},k.a.createElement(ae.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),k.a.createElement(ae.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))};function He(ue){var ye=ue.value,Oe=ue.onChange,oe=ue.mode,pe=ue.options,_e=pe===void 0?{}:pe,ce=Object(W.useRef)(),T=Object(W.useState)(),se=Object(S.a)(T,2),q=se[0],x=se[1];return Object(W.useEffect)(function(){if(q){function D(J){var j=J.getValue();Oe&&Oe(j)}return q.on("change",D),function(){q.off("change",D)}}},[q,Oe]),Object(W.useEffect)(function(){q&&q.setOption("mode",oe)},[q,oe]),Object(W.useEffect)(function(){q&&((ye!==q.getValue()||ye==="")&&setTimeout(function(){q.setValue(ye||" ")},300))},[q,ye]),Object(W.useEffect)(function(){if(ce.current&&!q){var D=V.a.fromTextArea(ce.current,Object(P.a)({mode:oe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_e));x(D)}},[ce.current,q]),k.a.createElement("div",{className:"my-codemirror-container"},k.a.createElement("textarea",{ref:ce}))}},"7ixt":function(Qe,We,b){"use strict";b.d(We,"a",function(){return X});var P={adjustX:1,adjustY:1},le=[0,0],X={left:{points:["cr","cl"],overflow:P,offset:[-4,0],targetOffset:le},right:{points:["cl","cr"],overflow:P,offset:[4,0],targetOffset:le},top:{points:["bc","tc"],overflow:P,offset:[0,-4],targetOffset:le},bottom:{points:["tc","bc"],overflow:P,offset:[0,4],targetOffset:le},topLeft:{points:["bl","tl"],overflow:P,offset:[0,-4],targetOffset:le},leftTop:{points:["tr","tl"],overflow:P,offset:[-4,0],targetOffset:le},topRight:{points:["br","tr"],overflow:P,offset:[0,-4],targetOffset:le},rightTop:{points:["tl","tr"],overflow:P,offset:[4,0],targetOffset:le},bottomRight:{points:["tr","br"],overflow:P,offset:[0,4],targetOffset:le},rightBottom:{points:["bl","br"],overflow:P,offset:[4,0],targetOffset:le},bottomLeft:{points:["tl","bl"],overflow:P,offset:[0,4],targetOffset:le},leftBottom:{points:["br","bl"],overflow:P,offset:[-4,0],targetOffset:le}},ae=X},"8EBN":function(Qe,We,b){(function(P){P(b("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 le=0;le<P.modeInfo.length;le++){var X=P.modeInfo[le];X.mimes&&(X.mime=X.mimes[0])}P.findModeByMIME=function(ae){ae=ae.toLowerCase();for(var te=0;te<P.modeInfo.length;te++){var K=P.modeInfo[te];if(K.mime==ae)return K;if(K.mimes){for(var S=0;S<K.mimes.length;S++)if(K.mimes[S]==ae)return K}}if(/\+xml$/.test(ae))return P.findModeByMIME("application/xml");if(/\+json$/.test(ae))return P.findModeByMIME("application/json")},P.findModeByExtension=function(ae){ae=ae.toLowerCase();for(var te=0;te<P.modeInfo.length;te++){var K=P.modeInfo[te];if(K.ext){for(var S=0;S<K.ext.length;S++)if(K.ext[S]==ae)return K}}},P.findModeByFileName=function(ae){for(var te=0;te<P.modeInfo.length;te++){var K=P.modeInfo[te];if(K.file&&K.file.test(ae))return K}var S=ae.lastIndexOf("."),L=S>-1&&ae.substring(S+1,ae.length);if(L)return P.findModeByExtension(L)},P.findModeByName=function(ae){ae=ae.toLowerCase();for(var te=0;te<P.modeInfo.length;te++){var K=P.modeInfo[te];if(K.name.toLowerCase()==ae)return K;if(K.alias){for(var S=0;S<K.alias.length;S++)if(K.alias[S].toLowerCase()==ae)return K}}}})},"8hTe":function(Qe,We,b){Qe.exports={button:"button___1wy9m"}},"93VE":function(Qe,We,b){},"9Bee":function(Qe,We,b){"use strict";var P=b("DYRE"),le=b("zeV3"),X=b("+L6B"),ae=b("2/Rp"),te=b("k1fw"),K=b("9og8"),S=b("tJVT"),L=b("WmNS"),A=b.n(L),W=b("q1tI"),k=b.n(W),E=b("vg9a"),V=b("DlQD"),H=b.n(V),O=b("rUJ1");function G(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(p){var h=p.match(/^\s+/);if(h===null)return p;var F=Object(S.a)(h,1),ke=F[0];return ke.length>=u.length?p.slice(u.length):p}).join(`
|
|
`)}var N=[],ie=["<ul>"],Q=new H.a.Renderer,Le=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function He(){N.length=0,ie=["<ul>"]}var ue={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ye(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var p=c[o];u.push("<li><a href='#"+p.anchor+"'>"+p.text+"</a>"),o++;var h=[];return o=ye(c,o,p.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(F){u.push(F)}),u.push("</ul>")),u.push("</li>"),o=ye(c,o,a,u),o}function Oe(){return ye(N,0,0,ie),ie.push("</ul>"),ie.join("")}var oe={heading:function(o){var a=Le.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],p=G(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var F=ce(),ke=p;p=F,T[F]={type:"block",expression:ke}}return{type:"code",raw:u,lang:h,text:p}}}},pe=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_e=0,ce=function(){return"__special_katext_id_".concat(_e++,"__")},T={};function se(){return T}function q(){_e=0,T={}}function x(c){return c=c.replace(pe,function(o,a){var u=ce();return T[u]={type:"inline",expression:a},u}),c}var D=Q.listitem;Q.listitem=function(c){return D(x(c))};var J=Q.paragraph;Q.paragraph=function(c){return J(x(c))};var j=Q.tablecell;Q.tablecell=function(c,o){return j(x(c),o)},Q.code=function(c,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(c,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?c:Object(O.escape)(c,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(O.escape)(c,!0))+"</code></pre>"},Q.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return N.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},H.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),H.a.use({tokenizer:oe,renderer:Q});var me=H.a,w=b("SJMd"),m=b("ulZh"),Y=b.n(m),we=b("m3rI"),fe=b("Oy/b"),Ue=b("p5ED"),Fe=b("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var be=function(c,o){return(be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(c,o)};function Se(c,o){function a(){this.constructor=c}be(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function xe(c,o,a,u){return new(a||(a=Promise))(function(p,h){function F(lt){try{re(u.next(lt))}catch(Me){h(Me)}}function ke(lt){try{re(u.throw(lt))}catch(Me){h(Me)}}function re(lt){var Me;lt.done?p(lt.value):(Me=lt.value,Me instanceof a?Me:new a(function(wt){wt(Me)})).then(F,ke)}re((u=u.apply(c,o||[])).next())})}function Ee(c,o){var a,u,p,h,F={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return h={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function ke(re){return function(lt){return function(Me){if(a)throw new TypeError("Generator is already executing.");for(;F;)try{if(a=1,u&&(p=2&Me[0]?u.return:Me[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,Me[1])).done)return p;switch(u=0,p&&(Me=[2&Me[0],p.value]),Me[0]){case 0:case 1:p=Me;break;case 4:return F.label++,{value:Me[1],done:!1};case 5:F.label++,u=Me[1],Me=[0];continue;case 7:Me=F.ops.pop(),F.trys.pop();continue;default:if(!(p=F.trys,(p=p.length>0&&p[p.length-1])||Me[0]!==6&&Me[0]!==2)){F=0;continue}if(Me[0]===3&&(!p||Me[1]>p[0]&&Me[1]<p[3])){F.label=Me[1];break}if(Me[0]===6&&F.label<p[1]){F.label=p[1],p=Me;break}if(p&&F.label<p[2]){F.label=p[2],F.ops.push(Me);break}p[2]&&F.ops.pop(),F.trys.pop();continue}Me=o.call(c,F)}catch(wt){Me=[6,wt],u=0}finally{a=p=0}if(5&Me[0])throw Me[1];return{value:Me[0]?Me[1]:void 0,done:!0}}([re,lt])}}}function $(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),p=0;for(o=0;o<a;o++)for(var h=arguments[o],F=0,ke=h.length;F<ke;F++,p++)u[p]=h[F];return u}var I=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var h=p[u],F=h[0],ke=h[1];o.setAttribute(F,ke)}},c.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&c.setAttributes(p,u),p},c.createLine=function(o,a,u,p,h){var F=document.createElementNS("http://www.w3.org/2000/svg","line");return F.setAttribute("x1",o.toString()),F.setAttribute("y1",a.toString()),F.setAttribute("x2",u.toString()),F.setAttribute("y2",p.toString()),h&&c.setAttributes(F,h),F},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(p,u),p},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,p,h,F,ke){var re=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(re,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",h.toString()],["refY",F.toString()]]),re.appendChild(ke),re},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c}(),Ie=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),ot=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var p=this;return new Promise(function(h){var F=u!==void 0?u:document.createElement("canvas");o===null&&(p.markersOnly=!0,p.naturalSize=!1);var ke=document.createElementNS("http://www.w3.org/2000/svg","svg");ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),ke.setAttribute("width",a.width.baseVal.valueAsString),ke.setAttribute("height",a.height.baseVal.valueAsString),ke.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),ke.innerHTML=a.innerHTML,p.naturalSize===!0?(ke.width.baseVal.value=o.naturalWidth,ke.height.baseVal.value=o.naturalHeight):p.width!==void 0&&p.height!==void 0&&(ke.width.baseVal.value=p.width,ke.height.baseVal.value=p.height),F.width=ke.width.baseVal.value,F.height=ke.height.baseVal.value;var re=ke.outerHTML,lt=F.getContext("2d");p.markersOnly!==!0&<.drawImage(o,0,0,F.width,F.height);var Me=window.URL,wt=new Image(F.width,F.height);wt.setAttribute("crossOrigin","anonymous");var Pt=new Blob([re],{type:"image/svg+xml"}),Wt=Me.createObjectURL(Pt);wt.onload=function(){lt.drawImage(wt,0,0),Me.revokeObjectURL(Wt);var Wn=F.toDataURL(p.imageType,p.imageQuality);h(Wn)},wt.src=Wt})},c}(),ct=function(){},Xe=function(){function c(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),c.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},c.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},c.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new Je("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Je("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Je("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Te("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Te("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),Je=function(c,o){this.selector=c,this.style=o},Te=function(c,o){this.localName=c,this.style=o},Be=function(){function c(o,a,u,p,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=p,this.styles=h,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return c.prototype.show=function(o){var a=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(h){var F=document.createElement("div");F.className=""+a.toolbarButtonStyleClass.name,F.setAttribute("data-type-name",h.typeName),F.innerHTML=h.icon,F.addEventListener("click",function(){a.markerToolbarButtonClicked(F,h)}),a.buttons.push(F),a.markerButtons.push(F)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var p=document.createElement("div");p.className=this.toolbarBlockStyleClass.name,p.style.whiteSpace="nowrap",p.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(p),this.addActionButton(p,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(p,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a<this.markerButtons.length;a++)a<o||a===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[a]):(a===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[a]))}},c.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},c.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(a){a.className=a.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),a.className=a.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),a.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},c.prototype.addActionButton=function(o,a,u){var p=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){p.actionToolbarButtonClicked(h,u)}),u){case"select":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":h.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":h.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":h.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(h),this.buttons.push(h)},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Te("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Te("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Te("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Te("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Te("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Te("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Te("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Je("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Je("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},c.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},c.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},c.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},c.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},c.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},c}(),Ye=function(){function c(o,a,u,p){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=p,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new Te("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Te("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Te("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Te("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Te("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Te("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Te("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
|
|
padding: `+a+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Je("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Je("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},c.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},c.prototype.setPanelButtons=function(o){var a,u,p=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(h){var F;h.uiStyleSettings=p.uiStyleSettings;var ke=document.createElement("div");ke.className=p.toolboxButtonStyleClass.name+" "+((F=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&F!==void 0?F:p.toolboxButtonStyleColorsClass.name),ke.innerHTML=h.icon,ke.title=h.title,ke.addEventListener("click",function(){p.panelButtonClick(h)}),p.panelButtons.push(ke),p.buttonRow.appendChild(ke)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var p=o.getUi();p.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(p),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(h,F){var ke,re;h.className=a.toolboxButtonStyleClass.name+" "+(F===u?""+((ke=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ke!==void 0?ke:a.toolboxActiveButtonStyleColorsClass.name):""+((re=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&re!==void 0?re:a.toolboxButtonStyleColorsClass.name))})},c}(),tt=function(c,o){this.title=c,this.icon=o},Ke=function(c){function o(a,u,p,h){var F=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return F.colors=[],F.addTransparent=!1,F.colorBoxes=[],F.colors=u,F.currentColor=p,F.setCurrentColor=F.setCurrentColor.bind(F),F.getColorBox=F.getColorBox.bind(F),F}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(p){var h=a.getColorBox(p);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,p=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-p,F=document.createElement("div");F.style.display="inline-block",F.style.boxSizing="content-box",F.style.width=h-2+"px",F.style.height=h-2+"px",F.style.padding="1px",F.style.marginRight="2px",F.style.marginBottom="2px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderRadius=(h+2)/2+"px",F.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){u.setCurrentColor(a,F)});var ke=document.createElement("div");return ke.style.display="inline-block",ke.style.width=h-2+"px",ke.style.height=h-2+"px",ke.style.backgroundColor=a,ke.style.borderRadius=h/2+"px",a==="transparent"&&(ke.style.fill=this.uiStyleSettings.toolboxAccentColor,ke.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),F.appendChild(ke),F},o.prototype.setCurrentColor=function(a,u){var p=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(tt),Pe=function(){function c(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(c.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(o){return!1},Object.defineProperty(c.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},c.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},c.prototype.pointerDown=function(o,a){},c.prototype.dblClick=function(o,a){},c.prototype.manipulate=function(o){},c.prototype.pointerUp=function(o){this.stateChanged()},c.prototype.dispose=function(){},c.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},c.prototype.getState=function(){return{typeName:c.typeName,state:this.state,notes:this.notes}},c.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},c.prototype.scale=function(o,a){},c.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},c.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},c.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},c.typeName="MarkerBase",c}(),ze=function(){function c(){this.findGripByVisual=this.findGripByVisual.bind(this)}return c.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},c}(),vt=function(){function c(){this.GRIP_SIZE=10,this.visual=I.createGroup(),this.visual.appendChild(I.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(I.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c}(),st=function(){function c(){}return c.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},c.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},c}(),nt=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(I.createTransform()),h.setupControlBox(),h}return Se(o,c),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=I.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var p=this.unrotatePoint(a);if(this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.offsetX=p.x-this.left,this.offsetY=p.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var F=this.container.transform.baseVal.getItem(0);F.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(F,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,p=this.manipulationStartWidth,h=this.manipulationStartTop,F=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,p=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:p=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:h=this.manipulationStartTop+a.y-this.manipulationStartY,F=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:F=this.manipulationStartHeight+a.y-this.manipulationStartY}p>=0?(this.left=u,this.width=p):(this.left=u+p,this.width=-p),F>=0?(this.top=h,this.height=F):(this.top=h+F,this.height=-F),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),p=I.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var p=I.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=I.createGroup();var a=I.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=I.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=I.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new ze,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var a=this.controlBox.transform.baseVal.getItem(0);a.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(a,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},o.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},o.prototype.createGrip=function(){var a=new vt;return a.visual.transform.baseVal.appendItem(I.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,p=u,h=(this.width+this.CB_DISTANCE)/2-a/2,F=(this.height+this.CB_DISTANCE)/2-a/2,ke=this.height+this.CB_DISTANCE-a/2,re=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,p),this.positionGrip(this.controlGrips.topCenter.visual,h,p),this.positionGrip(this.controlGrips.topRight.visual,re,p),this.positionGrip(this.controlGrips.centerLeft.visual,u,F),this.positionGrip(this.controlGrips.centerRight.visual,re,F),this.positionGrip(this.controlGrips.bottomLeft.visual,u,ke),this.positionGrip(this.controlGrips.bottomCenter.visual,h,ke),this.positionGrip(this.controlGrips.bottomRight.visual,re,ke),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,p-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,p){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,p),a.transform.baseVal.replaceItem(h,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:st.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:st.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var p=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:p.x*a,y:p.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Pe),qe=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=I.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),I.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&I.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&I.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&I.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&I.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(nt),ft=function(c){function o(a,u,p,h){var F=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return F.widths=[],F.widthBoxes=[],F.widths=u,F.currentWidth=p,F.setCurrentWidth=F.setCurrentWidth.bind(F),F}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(p){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=p===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(p,h)}),u.appendChild(h);var F=document.createElement("div");F.innerText=p.toString(),F.style.marginRight="5px",h.appendChild(F);var ke=document.createElement("div");ke.style.minHeight="20px",ke.style.flexGrow="2",ke.style.display="flex",ke.style.alignItems="center";var re=document.createElement("hr");re.style.minWidth="20px",re.style.border="0px",re.style.borderTop=p+"px solid "+a.uiStyleSettings.toolboxColor,re.style.flexGrow="2",ke.appendChild(re),h.appendChild(ke),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var p=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(tt),at=function(c){function o(a,u,p,h){var F=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return F.styles=[],F.styleBoxes=[],F.styles=u,F.currentStyle=p,F.setCurrentStyle=F.setCurrentStyle.bind(F),F}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(p){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=p===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(p,h)}),u.appendChild(h);var F=document.createElement("div");F.style.minHeight="20px",F.style.flexGrow="2",F.style.overflow="hidden";var ke=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(p!==""?'stroke-dasharray="'+p+'"':"")+` />
|
|
</svg>`;F.innerHTML=ke,h.appendChild(F),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var p=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(tt),it=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.strokeColor=p.defaultColor,h.strokeWidth=p.defaultStrokeWidth,h.strokeDasharray=p.defaultStrokeDasharray,h.strokePanel=new Ke("Line color",p.defaultColorSet,p.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new ft("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new at("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Se(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(qe),ve=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},mt=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return Se(o,c),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=I.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var a=new vt;return a.visual.transform.baseVal.appendItem(I.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,p){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,p),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Pe),et=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=p.defaultColor,h.strokeWidth=p.defaultStrokeWidth,h.strokeDasharray=p.defaultStrokeDasharray,h.strokePanel=new Ke("Line color",p.defaultColorSet,p.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new ft("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new at("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=I.createGroup(),this.selectorLine=I.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=I.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),I.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),I.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),I.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(mt),de=function(c){function o(a,u,p,h){var F=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return F.fonts=[],F.fontBoxes=[],F.fonts=u,F.currentFont=p,F.setCurrentFont=F.setCurrentFont.bind(F),F}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(p){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=p===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(p,h)}),u.appendChild(h);var F=document.createElement("div");F.style.display="flex",F.style.minHeight="20px",F.style.flexGrow="2",F.style.fontFamily=p,F.style.overflow="hidden";var ke=document.createElement("div");ke.style.whiteSpace="nowrap",ke.style.overflow="hidden",ke.style.textOverflow="ellipsis",ke.innerHTML="The quick brown fox jumps over the lazy dog",F.appendChild(ke),h.appendChild(F),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var p=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(tt),ge=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=p.defaultColor,h.fontFamily=p.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new Ke("Color",p.defaultColorSet,p.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new de("Font",p.defaultFontFamilies,p.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return Se(o,c),o.prototype.ownsTarget=function(a){if(c.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(p){p===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=I.createGroup(),this.bgRectangle=I.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=I.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(I.createTransform()),this.textElement.transform.baseVal.appendItem(I.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){a.textElement.appendChild(I.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var p=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(p,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),p=0,h=0;return u.width>0&&u.height>0&&(p=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:p,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),p=this.getTextPosition(u);p.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+p.x+"px, "+p.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(p.x,p.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(I.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),I.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),c.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var p=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(p)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),p=this.textElement.getBBox(),h={x:p.width*a,y:p.height*a};u.x-=h.x/2,u.y-=h.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){c.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&I.setAttributes(this.textElement,[["fill",a]]),this.color=a,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(a)},o.prototype.setFont=function(a){this.textElement&&I.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(nt),z=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=p.defaultColor,h.lineWidth=p.defaultStrokeWidth,h.pixelRatio=p.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new Ke("Color",p.defaultColorSet,p.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new ft("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=I.createGroup(),this.drawingImage=I.createImage(),this.visual.appendChild(this.drawingImage);var a=I.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(a.x,a.y),this.drawing=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),I.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),I.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):c.prototype.pointerUp.call(this,a)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],p=u[0],h=u[1],F=u[2],ke=u[3],re=!1,lt=0;lt<this.canvasElement.height;lt++)for(var Me=0;Me<this.canvasElement.width;Me++)a.data[lt*this.canvasElement.width*4+4*Me+3]>0&&(re=!0,lt<h&&(h=lt),Me<p&&(p=Me),lt>ke&&(ke=lt),Me>F&&(F=Me));if(re){this.left=p/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(F-p)/this.pixelRatio,this.height=(ke-h)/this.pixelRatio;var wt=document.createElement("canvas");wt.width=F-p,wt.height=ke-h,wt.getContext("2d").putImageData(this.canvasContext.getImageData(p,h,F-p,ke-h),0,0),this.drawingImgUrl=wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){I.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),I.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),c.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(nt),R=function(c){function o(a,u,p){var h=c.call(this,a,p||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var p=function(ke){var re="both";switch(ke){case 0:re="both";break;case 1:re="start";break;case 2:re="end";break;case 3:re="none"}var lt=document.createElement("div");if(lt.style.display="flex",lt.style.flexGrow="2",lt.style.alignItems="center",lt.style.justifyContent="space-between",lt.style.padding="5px",lt.style.borderWidth="2px",lt.style.borderStyle="solid",lt.style.borderColor=re===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",lt.addEventListener("click",function(){a.setCurrentType(re,lt)}),u.appendChild(lt),re==="both"||re==="start"){var Me=document.createElement("div");Me.style.display="flex",Me.style.alignItems="center",Me.style.minHeight="20px",Me.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Me.style.marginLeft="5px",lt.appendChild(Me)}var wt=document.createElement("div");wt.style.display="flex",wt.style.alignItems="center",wt.style.minHeight="20px",wt.style.flexGrow="2";var Pt=document.createElement("hr");if(Pt.style.minWidth="20px",Pt.style.border="0px",Pt.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),Pt.style.flexGrow="2",wt.appendChild(Pt),lt.appendChild(wt),re==="both"||re==="end"){var Wt=document.createElement("div");Wt.style.display="flex",Wt.style.alignItems="center",Wt.style.minHeight="20px",Wt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Wt.style.marginRight="5px",lt.appendChild(Wt)}h.typeBoxes.push(lt)},h=this,F=0;F<4;F++)p(F);return u},o.prototype.setCurrentType=function(a,u){var p=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?p.uiStyleSettings!==void 0?p.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(tt),U=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new R("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var p=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-p/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+p/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=I.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(I.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=I.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(I.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",I.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),I.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var p=this.arrow2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(p,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(et),v=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.fillColor=p.defaultFillColor,h.strokeWidth=0,h.fillPanel=new Ke("Color",p.defaultColorSet,p.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return Se(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(qe),y=function(c){function o(a,u,p,h){var F=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return F.opacities=[],F.opacityBoxes=[],F.opacities=u,F.currentOpacity=p,F.setCurrentOpacity=F.setCurrentOpacity.bind(F),F}return Se(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(p){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=p===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(p,h)}),u.appendChild(h);var F=document.createElement("div");F.innerText=100*p+"%",h.appendChild(F),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var p=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(tt),C=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=p.defaultHighlightColor,h.strokeWidth=0,h.opacity=p.defaultHighlightOpacity,h.fillPanel=new Ke("Color",p.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new y("Opacity",p.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return Se(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&I.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',o}(v),_='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',ne=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=p.defaultStrokeColor,h.bgColor=p.defaultFillColor,h.fontFamily=p.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new Ke("Text color",p.defaultColorSet,h.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new Ke("Fill color",p.defaultColorSet,h.bgColor,_),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new de("Font",p.defaultFontFamilies,p.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new vt,h.tipGrip.visual.transform.baseVal.appendItem(I.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return Se(o,c),o.prototype.ownsTarget=function(a){return c.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){I.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=I.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&c.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,c.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";c.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else c.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(I.setAttributes(this.bgRectangle,[["fill",a]]),I.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),p=this.height/5;a&&(this.tipPosition={x:u+p/2,y:this.height+20});var h=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+p,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?h<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-p},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+p,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-p})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){I.setAttributes(this.tip,[["points",this.getTipPoints()]]);var a=this.tipGrip.visual.transform.baseVal.getItem(0);a.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(a,0)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.select=function(){this.positionTip(),c.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,c.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(ge),he=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=p.defaultColor,h.strokeWidth=p.defaultStrokeWidth,h.strokeDasharray=p.defaultStrokeDasharray,h.fillColor=p.defaultFillColor,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.setOpacity=h.setOpacity.bind(h),h.createVisual=h.createVisual.bind(h),h.strokePanel=new Ke("Line color",$(p.defaultColorSet,["transparent"]),p.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new Ke("Fill color",$(p.defaultColorSet,["transparent"]),h.fillColor,_),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new ft("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new at("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new y("Opacity",p.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=I.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),I.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&I.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&I.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&I.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&I.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&I.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(nt),Ne=function(c){function o(a,u,p){return c.call(this,a,u,p)||this}return Se(o,c),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=I.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(I.createTransform()),this.visual.appendChild(this.tip1),this.tip2=I.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(I.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(I.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),I.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var p=this.tip2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(p,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(et),yt=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.strokePanel.colors=p.defaultColorSet,h.fillColor="transparent",h}return Se(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(he),_t=function(){function c(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),c.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},c.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},c.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},c.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},c.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},c}(),Re=function(c){function o(a,u,p){var h=c.call(this,a,u,p)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=p.defaultColor,h.strokeWidth=p.defaultStrokeWidth,h.strokeDasharray=p.defaultStrokeDasharray,h.strokePanel=new Ke("Line color",p.defaultColorSet,p.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new ft("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new at("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Se(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=I.createGroup(),this.selectorCurve=I.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=I.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),I.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),I.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),I.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=I.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=I.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),c.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,c.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(mt),Et=function(){function c(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),pt=function(c){function o(a,u,p){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=p,h}return Se(o,c),o}(Et),$e=function(c){function o(a,u,p){p===void 0&&(p=!1);var h=c.call(this,a,p)||this;return h.marker=u,h}return Se(o,c),o}(Et),Dt=function(){function c(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return c.prototype.addEventListener=function(o,a){this[o].push(a)},c.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},c}(),Lt=function(){function c(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ve,this._isOpen=!1,this.undoRedoManager=new _t,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Dt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new Xe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(c.prototype,"ALL_MARKER_TYPES",{get:function(){return[it,z,U,ge,yt,he,C,ne,Ne,v,et,Re]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[it,z,U,ge,he,C,ne]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[it,z,U,ge,C]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var p=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});p!==void 0&&a._availableMarkerTypes.push(p)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ie.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&ct.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ct.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Et(o))})},c.prototype.render=function(){return xe(this,void 0,void 0,function(){var o;return Ee(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new ot).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},c.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(p){var h=new Et(a,!0);p(h),h.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(p){return p(new Et(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},c.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},c.prototype.removeRenderEventListener=function(o){},c.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},c.prototype.removeCloseEventListener=function(o){},c.prototype.setupResizeObserver=function(){var o=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return o.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,p=a/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,p),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,p=this;this._currentMarker&&this._currentMarker instanceof ge?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==p._currentMarker&&h.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},c.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},c.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},c.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},c.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=I.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},c.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},c.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},c.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},c.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},c.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},c.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},c.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},c.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var o=document.createElement("a");o.href="https://markerjs.com/",o.target="_blank",o.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},c.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Be(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ye(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},c.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},c.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},c.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(p){var h=new $e(o,o._currentMarker,!0);p(h),h.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(p){return p(new $e(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(F){var ke=new $e(o,void 0,!0);F(ke),ke.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(F){var ke=p.markers[F];p.setCurrentMarker(p.markers[F]),p._currentMarker.dispose(),p.markerImage.removeChild(p._currentMarker.container),p.markers.splice(p.markers.indexOf(p._currentMarker),1),p.eventListeners.markerdelete.forEach(function(re){return re(new $e(o,ke))})},p=this,h=this.markers.length-1;h>=0;h--)u(h);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},c.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var p=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),p<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new Et(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new Et(o))})}},c.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},c.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new Et(o))}))},c.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},c.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new Et(o))}))},c.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},c.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},c.prototype.startRenderAndClose=function(){return xe(this,void 0,void 0,function(){var o,a,u=this;return Ee(this,function(p){switch(p.label){case 0:return[4,this.render()];case 1:return o=p.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new pt(u,o,a))}),this.close(!0),[2]}})})},c.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},c.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var p=a._availableMarkerTypes.find(function(F){return F.typeName===u.typeName});if(p!==void 0){var h=a.addNewMarker(p);h.restoreState(u),a.markers.push(h)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new Et(a))})},c.prototype.addNewMarker=function(o){var a=I.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},c.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(p){return p.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(a),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(a.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(p){return p(new $e(u,u._currentMarker))}))},c.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof z&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(z):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new $e(a,a._currentMarker))})},c.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},c.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},c.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new $e(a,o))})},c.prototype.setCurrentMarker=function(o){var a=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new $e(a,a._currentMarker))})),this._currentMarker=o,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new $e(a,a._currentMarker))}))},c.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},c.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},c.prototype.onPointerMove=function(o){this.touchPoints!==1&&o.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||o.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(o.clientX,o.clientY)):this.zoomLevel>1&&this.panTo({x:o.clientX,y:o.clientY}))},c.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},c.prototype.addLicenseKey=function(o){Ie.addKey(o)},c.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},c.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},c.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new Et(o))}))},c.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new Et(o))}))},c.instanceCounter=0,c}();/* **********************************
|
|
cropro version 1.2.0
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
copyright Alan Mendelevich
|
|
see README and LICENSE for details
|
|
********************************** *//*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var Vt=function(c,o){return(Vt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(c,o)};function Bt(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=c}Vt(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function kt(c,o,a,u){return new(a||(a=Promise))(function(p,h){function F(lt){try{re(u.next(lt))}catch(Me){h(Me)}}function ke(lt){try{re(u.throw(lt))}catch(Me){h(Me)}}function re(lt){var Me;lt.done?p(lt.value):(Me=lt.value,Me instanceof a?Me:new a(function(wt){wt(Me)})).then(F,ke)}re((u=u.apply(c,o||[])).next())})}function mn(c,o){var a,u,p,h,F={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return h={next:ke(0),throw:ke(1),return:ke(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function ke(re){return function(lt){return function(Me){if(a)throw new TypeError("Generator is already executing.");for(;F;)try{if(a=1,u&&(p=2&Me[0]?u.return:Me[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,Me[1])).done)return p;switch(u=0,p&&(Me=[2&Me[0],p.value]),Me[0]){case 0:case 1:p=Me;break;case 4:return F.label++,{value:Me[1],done:!1};case 5:F.label++,u=Me[1],Me=[0];continue;case 7:Me=F.ops.pop(),F.trys.pop();continue;default:if(!(p=F.trys,(p=p.length>0&&p[p.length-1])||Me[0]!==6&&Me[0]!==2)){F=0;continue}if(Me[0]===3&&(!p||Me[1]>p[0]&&Me[1]<p[3])){F.label=Me[1];break}if(Me[0]===6&&F.label<p[1]){F.label=p[1],p=Me;break}if(p&&F.label<p[2]){F.label=p[2],F.ops.push(Me);break}p[2]&&F.ops.pop(),F.trys.pop();continue}Me=o.call(c,F)}catch(wt){Me=[6,wt],u=0}finally{a=p=0}if(5&Me[0])throw Me[1];return{value:Me[0]?Me[1]:void 0,done:!0}}([re,lt])}}}var sn=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),dt=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var h=p[u],F=h[0],ke=h[1];o.setAttribute(F,ke)}},c.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&c.setAttributes(p,u),p},c.createLine=function(o,a,u,p,h){var F=document.createElementNS("http://www.w3.org/2000/svg","line");return F.setAttribute("x1",o.toString()),F.setAttribute("y1",a.toString()),F.setAttribute("x2",u.toString()),F.setAttribute("y2",p.toString()),h&&c.setAttributes(F,h),F},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(p,u),p},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,p,h,F,ke){var re=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(re,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",h.toString()],["refY",F.toString()]]),re.appendChild(ke),re},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&c.setAttributes(u,a),u},c.getHollowRectanglePath=function(o,a,u,p,h,F,ke,re){return"M"+o+","+a+"V"+(a+p)+"H"+(o+u)+"V"+a+"H"+h+"V"+F+"H"+(h+ke)+"V"+(F+re)+"H"+h+"V"+a+"Z"},c}(),En=function(){function c(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),c.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},c.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},c.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new ln("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ln("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ln("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new gn("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new gn("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),ln=function(c,o){this.selector=c,this.style=o},gn=function(c,o){this.localName=c,this.style=o},_n=function(){function c(){this.blocks=[],this.display=""}return c.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},c.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},c.prototype.getUI=function(){var o=document.createElement("div");return o.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,o.style.display=this.display,this.blocks.forEach(function(a){return o.appendChild(a.getUI())}),o},c}(),li=function(){function c(){}return c.prototype.getUI=function(){var o=document.createElement("div");if(o.className=this.className,this.minWidth!==void 0&&(o.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":o.style.justifyContent="flex-start";break;case"center":o.style.justifyContent="center";break;case"end":o.style.justifyContent="flex-end"}return o.style.whiteSpace="nowrap",o},c}(),Xn=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.buttons=[],a}return Bt(o,c),o.prototype.addButton=function(a){a.className=this.buttonClassName,a.colorsClassName=this.buttonColorsClassName,a.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(li),Nt=function(){function c(o,a){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=a,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(c.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){var o=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return o.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},c.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},c.prototype.hide=function(){this._isHidden=!0},c}(),ut=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.elements=[],a}return Bt(o,c),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(li),Fn=function(){function c(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(c.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),c.prototype.getVerticalLength=function(o){return o/this.ratio},c.prototype.getHorizontalLength=function(o){return o*this.ratio},c}(),ui=function(){function c(){}return c.getIcon=function(o,a){if(o>0&&a>0){var u=new Fn(o,a),p=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),F=document.createElementNS("http://www.w3.org/2000/svg","svg");F.setAttribute("xmlns","http://www.w3.org/2000/svg"),F.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(F);var ke=dt.createDefs();F.appendChild(ke);var re=dt.createElement("clipPath",[["id","text-bg-clip"]]);ke.appendChild(re);var lt=dt.createPath(dt.getHollowRectanglePath((24-p)/2,(24-h)/2,p,h,(24-p)/2+2,(24-h)/2+2,p-4,h-4));F.appendChild(lt);var Me=dt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Me.appendChild(dt.createTSpan(o+":"+a)),F.appendChild(Me);var wt=Me.getBBox();dt.setAttributes(Me,[["x",((24-wt.width)/2).toString()],["y",((24-wt.height)/2-wt.y).toString()]]);var Pt=dt.createPath(dt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(wt.width))/2,(24-Math.ceil(wt.height))/2,Math.ceil(wt.width),Math.ceil(wt.height)));return re.appendChild(Pt),dt.setAttributes(lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(F),F.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},c}(),Tn=function(c){function o(a,u,p){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=p,h}return Bt(o,c),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Nt),Ot=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=dt.createGroup(),this.visual.appendChild(dt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(dt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return dt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Kn=function(){function c(o,a,u,p){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=a,this.margin=u,this.container=p,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(c.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&dt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=dt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=dt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(dt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(dt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.cropRectElement=dt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},c.prototype.setCropRectangle=function(o){this.cropRect=o;var a=Object.assign({},this.cropRect);this.zoomFactor!==1&&(a.width=this.cropRect.width*this.zoomFactor,a.height=this.cropRect.height*this.zoomFactor,a.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-a.width/2,a.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),dt.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(h,F){var ke=a.y+u*(F+1);dt.setAttributes(h,[["x1",""+a.x],["y1",""+ke],["x2",""+(a.x+a.width)],["y2",""+ke]])});var p=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,F){var ke=a.x+p*(F+1);dt.setAttributes(h,[["x1",""+ke],["y1",""+a.y],["x2",""+ke],["y2",""+(a.y+a.height)]])}),dt.setAttributes(this.cropShadeElement,[["d",dt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},c.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},c.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},c.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},c.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,p=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+u<this.margin&&(u=this.margin-a.x),a.x+=u,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=p,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=p}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},c.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),p=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<p/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=p,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},c.prototype.getRescaledRect=function(o,a,u,p,h,F){var ke=u/o,re=p/a;return{x:(h.x-F)*ke+F,y:(h.y-F)*re+F,width:h.width*ke,height:h.height*re}},c.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},c}(),hi=function(){function c(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();dt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},c.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var p=u%5==0?this.height/3:this.height/6;a+="h4v"+-p+"h1v"+p}a+="v1H0Z",this.scaleShape=dt.createPath(a);var h=dt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=dt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=dt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var F=dt.createTSpan("");return F.innerHTML="°",this.angleLabelElement.appendChild(F),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),vi=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,p,h,F,ke){var re=this;return new Promise(function(lt){var Me=document.createElement("canvas");Me.width=o.width.baseVal.value-2*p,Me.height=o.height.baseVal.value-2*p;var wt=1,Pt=1;re.naturalSize===!0?(wt=a.naturalWidth/(o.width.baseVal.value-2*p)/F,Pt=a.naturalHeight/(o.height.baseVal.value-2*p)/ke,Me.width=a.naturalWidth/F,Me.height=a.naturalHeight/ke):re.width!==void 0&&re.height!==void 0&&(wt=re.width/u.width,Pt=re.height/u.height,Me.width*=wt,Me.height*=Pt);var Wt=Me.getContext("2d");Wt.translate(Me.width/2,Me.height/2),Wt.rotate(h*Math.PI/180),Wt.scale(F,ke),Wt.translate(-Me.width/2,-Me.height/2),Wt.drawImage(a,0,0,Me.width,Me.height);var Wn=document.createElement("canvas");Wn.width=u.width*wt,Wn.height=u.height*Pt,Wn.getContext("2d").putImageData(Wt.getImageData((u.x-p)*wt,(u.y-p)*Pt,u.width*wt,u.height*Pt),0,0),lt(Wn.toDataURL(re.imageType,re.imageQuality))})},c}(),De=function(){function c(o){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=c.instanceCounter++,this.styles=new En(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},c.prototype.show=function(){this.showUI(),this.open()},c.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",dt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},c.prototype.resize=function(o,a){this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},c.prototype.setEditingTarget=function(){var o=document.createElement("canvas");o.width=this.target.naturalWidth,o.height=this.target.naturalHeight,o.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var a=o.toDataURL();dt.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},c.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left-this.CANVAS_MARGIN,this.top=o.top-a.top-this.CANVAS_MARGIN},c.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=dt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=dt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=dt.createGroup(),this.editingTargetRotationScaleContainer=dt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=dt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=dt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=dt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},c.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},c.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=dt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Kn(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},c.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,a=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=o+"px "+a+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-a+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},c.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},c.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},c.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,a=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new _n,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new Xn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Pt){var Wt=new Nt(ui.getIcon(Pt.horizontal,Pt.vertical),Pt.horizontal===0&&Pt.vertical===0?"FREE":Pt.horizontal+":"+Pt.vertical);Wt.onClick=function(){return o.ratioButtonClicked(Pt)},u.push(Wt)}),this.aspectRatioButton=new Tn(ui.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var p=new Nt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");p.isActive=this.isGridVisible,p.onClick=function(){o.isGridVisible=!o.isGridVisible,p.isActive=o.isGridVisible},a.addButton(p);var h=new Nt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!sn.isLicensed){var F=new ut;this.topToolbar.addElementBlock(F);var ke=document.createElement("div");ke.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var re=document.createElement("a");re.style.color="currentColor",re.href="https://markerjs.com/products/cropro",re.target="_blank",re.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',ke.appendChild(re),F.addElement(ke)}var lt=new Xn;lt.minWidth=3*this.toolbarHeight+"px",lt.contentAlign="end",this.topToolbar.addButtonBlock(lt);var Me=new Nt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");Me.onClick=this.startRenderAndClose,lt.addButton(Me),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Me.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var wt=new Nt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");wt.onClick=this.close,lt.addButton(wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new _n,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new Xn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Nt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var p=new Nt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");p.onClick=this.rotateRightButtonClicked,a.addButton(p);var h=new ut;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new hi("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(lt){o.rotateBy(lt),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var F=new Xn;F.minWidth=2*this.toolbarHeight+"px",F.contentAlign="end",this.bottomToolbar.addButtonBlock(F);var ke=new Nt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");ke.onClick=this.flipHorizontallyButtonClicked,F.addButton(ke);var re=new Nt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");re.onClick=this.flipVerticallyButtonClicked,F.addButton(re)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ui.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Fn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},c.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return kt(this,void 0,void 0,function(){var o,a;return mn(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(p){return p(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return kt(this,void 0,void 0,function(){var o;return mn(this,function(a){switch(a.label){case 0:return(o=new vi).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),dt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new gn("toolbar",`
|
|
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
overflow: hidden;
|
|
line-height: 0px;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new gn("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new gn("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new gn("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*o)+`px;
|
|
height: `+(this.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new gn("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new gn("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new ln("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ln("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new gn("toolbar_dropdown",`
|
|
position: absolute;
|
|
max-width: `+4*this.toolbarHeight+`px;
|
|
z-index: 20;
|
|
white-space: normal;
|
|
box-sizing: content-box;
|
|
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
|
|
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
|
|
line-height: 0px;
|
|
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new gn("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new gn("toolbar_straightener_block",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
|
|
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new gn("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*o)+`px;
|
|
padding: `+o+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new gn("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},c.instanceCounter=0,c}(),Ct=b("8hTe"),ti=b.n(Ct),ci=/<pre[^>]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Oi=We.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,p=u===void 0?!1:u,h=c.className,F=c.showTextOnly,ke=c.showLines,re=c.replaces,lt=c.zoomImg,Me=c.hasMask,wt=c.style,Pt=wt===void 0?{}:wt,Wt=c.stylesPrev,Wn=Wt===void 0?{}:Wt,Hn=String(a),un=Object(W.useRef)(),Yn=Object(W.useRef)(),Xi=Object(W.useState)(""),Ln=Object(S.a)(Xi,2),Mn=Ln[0],ni=Ln[1],yi=Object(W.useState)("office"),Jn=Object(S.a)(yi,2),ii=Jn[0],zn=Jn[1],fr=function(){var jt=new De(Yn.current);jt.displayMode="popup",jt.addRenderEventListener(function(){var vn=Object(K.a)(A.a.mark(function Ut(yn){var Kt;return A.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return un.current.style.display="none",rn.next=3,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yn}});case 3:Kt=rn.sent,Kt!=null&&Kt.id&&re(Yn.current.getAttribute("src").replace(we.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return rn.stop()}},Ut)}));return function(Ut){return vn.apply(this,arguments)}}()),jt.show()},Ki=function(){var jt=new Lt(Yn.current);jt.settings.displayMode="popup",jt.addEventListener("render",function(){var vn=Object(K.a)(A.a.mark(function Ut(yn){var Kt;return A.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:if(un.current.style.display="none",!Yn.current){rn.next=6;break}return rn.next=4,Object(Fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yn.dataUrl}});case 4:Kt=rn.sent,Kt!=null&&Kt.id&&re(Yn.current.getAttribute("src").replace(we.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return rn.stop()}},Ut)}));return function(Ut){return vn.apply(this,arguments)}}()),jt.show(),window.markerArea=jt},Nn=Object(W.useMemo)(function(){try{var qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,jt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,vn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hn=Hn.replace(qt,"("+we.a.API_SERVER+"/api/attachments/").replace(jt,'"'+we.a.API_SERVER+"/api/attachments/").replace(vn,'"'+we.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,`
|
|
`),Hn=Hn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(bi){}var Ut=me(Hn),yn=se();if(Hn.match(/\[TOC\]/)&&(Ut=Ut.replace("<p>[TOC]</p>",Oe()),He()),Ut=Ut.replace(/(__special_katext_id_\d+__)/g,function(bi,rn){var on=yn[rn],ri=on.type,xi=on.expression;return Object(fe.renderToString)(di(xi)||"",{displayMode:ri==="block",throwOnError:!1,output:"html"})}),Ut=Ut.replace(/▁/g,"\u2581\u2581\u2581"),q(),F){var Kt=document.createElement("div");return Kt.innerHTML=Ut,Kt.innerText}return setTimeout(function(){return Di()},500),Ut},[Hn]),In=Object(W.useRef)();ue.WebkitLineClamp=ke,ke&&(Pt=Object(te.a)(Object(te.a)({},Pt),ue));function Ri(qt){var jt=qt.target;if(jt.tagName.toUpperCase()==="IMG"){if(lt){var vn=jt.getAttribute("src");ni(vn),zn("image")}}else if(jt.tagName.toUpperCase()==="A"){var Ut=jt.getAttribute("href");if(Ut.indexOf("office")>-1)qt.preventDefault(),ni(Ut),zn("office");else if(Ut.indexOf("application/pdf")>-1)qt.preventDefault(),ni(Ut),zn("pdf");else if(Ut.indexOf("type=text")>-1)qt.preventDefault(),ni(Ut),zn("html");else if(Ut.startsWith("#")){qt.preventDefault();var yn=document.getElementById(Ut.replace("#",""));yn&&yn.scrollIntoView(!0)}}}var Di=function(){var jt,vn=(jt=In.current)===null||jt===void 0?void 0:jt.querySelectorAll("video");vn==null||vn.forEach(function(Ut){if(Ut.oncontextmenu=function(){return!1},Ut.src.indexOf(".m3u8")>-1&&!Ut.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var yn=new Y.a;yn.loadSource(Ut.src),yn.attachMedia(Ut)}}})};Object(W.useEffect)(function(){if(In.current&&Nn&&(Nn.match(ci)&&window.PR.prettyPrint()),In.current)return In.current.addEventListener("click",Ri),function(){In.current.removeEventListener("click",Ri),q(),He()}},[Nn,In.current,Ri]);var Pi=function(jt){if(!p)return;jt.target.nodeName==="IMG"?(un.current.style.display="flex",un.current.style.width=jt.target.clientWidth+"px",un.current.style.height=jt.target.clientHeight+"px",un.current.style.top=jt.target.offsetTop+"px",un.current.style.left=jt.target.offsetLeft+"px",Yn.current.src=jt.target.getAttribute("src")):un.current.style.display="none"};return k.a.createElement("div",{style:{position:"relative"}},k.a.createElement("div",{ref:In,style:Object(te.a)({},Pt),className:"".concat(h||""," markdown-body ").concat(ti.a.mdBody),onMouseOver:Pi,dangerouslySetInnerHTML:{__html:Nn}}),k.a.createElement("div",{ref:un,className:ti.a.button},k.a.createElement(le.a,null,k.a.createElement(ae.a,{onClick:function(){return fr()}},"\u88C1\u526A"),k.a.createElement(ae.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),k.a.createElement("img",{ref:Yn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),k.a.createElement(Ue.a,{close:!0,data:Mn,hasMask:Me,type:Mn!=null&&Mn.length?ii:"",style:Object(te.a)({},Wn),onClose:function(){return ni("")}}))}},"9VGf":function(Qe,We,b){"use strict";b.d(We,"a",function(){return X});var P=b("q1tI"),le=b.n(P);function X(ae,te){var K=Object(P.useRef)();Object(P.useEffect)(function(){K.current=ae}),Object(P.useEffect)(function(){function S(){K.current()}if(te!==null){var L=setInterval(S,te);return function(){return clearInterval(L)}}},[te])}},"9ZNV":function(Qe,We,b){"use strict";b.d(We,"a",function(){return W});var P=b("0Owb"),le=b("+L6B"),X=b("2/Rp"),ae=b("q1tI"),te=b.n(ae),K=b("UUDw"),S=b.n(K),L=b("TSYQ"),A=b.n(L),W=function(E){var V=E.cancelText,H=V===void 0?"\u53D6\u6D88":V,O=E.okText,G=O===void 0?"\u786E\u5B9A":O,N=E.loading,ie=N===void 0?!1:N,Q=E.hasOkBtn,Le=Q===void 0?!0:Q,He=E.okButtonProps,ue=He===void 0?{}:He,ye=E.onCancel,Oe=ye===void 0?function(){}:ye,oe=E.onOk,pe=oe===void 0?function(){}:oe,_e=E.className,ce=_e===void 0?"":_e;return te.a.createElement("div",{className:A()(S.a.buttonFixed,ce)},te.a.createElement("div",{className:S.a.buttonWrap},te.a.createElement(X.a,{size:"large",className:"".concat(S.a.button," mr20"),onClick:Oe},H),Le&&te.a.createElement(X.a,Object(P.a)({size:"large",type:"primary",className:"".concat(S.a.button," mr20"),loading:ie,onClick:pe},ue),G)))}},Bd2K:function(Qe,We,b){(function(P){P(b("VrN/"),b("osHv"))})(function(P){P.defineOption("autoCloseTags",!1,function(A,W,k){if(k!=P.Init&&k&&A.removeKeyMap("autoCloseTags"),!W)return;var E={name:"autoCloseTags"};(typeof W!="object"||W.whenClosing!==!1)&&(E["'/'"]=function(V){return K(V)}),(typeof W!="object"||W.whenOpening!==!1)&&(E["'>'"]=function(V){return ae(V)}),A.addKeyMap(E)});var le=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],X=["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 ae(A){if(A.getOption("disableInput"))return P.Pass;for(var W=A.listSelections(),k=[],E=A.getOption("autoCloseTags"),V=0;V<W.length;V++){if(!W[V].empty())return P.Pass;var H=W[V].head,O=A.getTokenAt(H),G=P.innerMode(A.getMode(),O.state),N=G.state,ie=G.mode.xmlCurrentTag&&G.mode.xmlCurrentTag(N),Q=ie&&ie.name;if(!Q)return P.Pass;var Le=G.mode.configuration=="html",He=typeof E=="object"&&E.dontCloseTags||Le&&le,ue=typeof E=="object"&&E.indentTags||Le&&X;O.end>H.ch&&(Q=Q.slice(0,Q.length-O.end+H.ch));var ye=Q.toLowerCase();if(!Q||O.type=="string"&&(O.end!=H.ch||!/[\"\']/.test(O.string.charAt(O.string.length-1))||O.string.length==1)||O.type=="tag"&&ie.close||O.string.indexOf("/")==H.ch-O.start-1||He&&S(He,ye)>-1||L(A,G.mode.xmlCurrentContext&&G.mode.xmlCurrentContext(N)||[],Q,H,!0))return P.Pass;var Oe=typeof E=="object"&&E.emptyTags;if(Oe&&S(Oe,Q)>-1){k[V]={text:"/>",newPos:P.Pos(H.line,H.ch+2)};continue}var oe=ue&&S(ue,ye)>-1;k[V]={indent:oe,text:">"+(oe?`
|
|
|
|
`:"")+"</"+Q+">",newPos:oe?P.Pos(H.line+1,0):P.Pos(H.line,H.ch+1)}}for(var pe=typeof E=="object"&&E.dontIndentOnAutoClose,V=W.length-1;V>=0;V--){var _e=k[V];A.replaceRange(_e.text,W[V].head,W[V].anchor,"+insert");var ce=A.listSelections().slice(0);ce[V]={head:_e.newPos,anchor:_e.newPos},A.setSelections(ce),!pe&&_e.indent&&(A.indentLine(_e.newPos.line,null,!0),A.indentLine(_e.newPos.line+1,null,!0))}}function te(A,W){for(var k=A.listSelections(),E=[],V=W?"/":"</",H=A.getOption("autoCloseTags"),O=typeof H=="object"&&H.dontIndentOnSlash,G=0;G<k.length;G++){if(!k[G].empty())return P.Pass;var N=k[G].head,ie=A.getTokenAt(N),Q=P.innerMode(A.getMode(),ie.state),Le=Q.state;if(W&&(ie.type=="string"||ie.string.charAt(0)!="<"||ie.start!=N.ch-1))return P.Pass;var He,ue=Q.mode.name!="xml"&&A.getMode().name=="htmlmixed";if(ue&&Q.mode.name=="javascript")He=V+"script";else if(ue&&Q.mode.name=="css")He=V+"style";else{var ye=Q.mode.xmlCurrentContext&&Q.mode.xmlCurrentContext(Le);if(!ye||ye.length&&L(A,ye,ye[ye.length-1],N))return P.Pass;He=V+ye[ye.length-1]}A.getLine(N.line).charAt(ie.end)!=">"&&(He+=">"),E[G]=He}if(A.replaceSelections(E),k=A.listSelections(),!O)for(var G=0;G<k.length;G++)(G==k.length-1||k[G].head.line<k[G+1].head.line)&&A.indentLine(k[G].head.line)}function K(A){return A.getOption("disableInput")?P.Pass:te(A,!0)}P.commands.closeTag=function(A){return te(A)};function S(A,W){if(A.indexOf)return A.indexOf(W);for(var k=0,E=A.length;k<E;++k)if(A[k]==W)return k;return-1}function L(A,W,k,E,V){if(!P.scanForClosingTag)return!1;var H=Math.min(A.lastLine()+1,E.line+500),O=P.scanForClosingTag(A,E,null,H);if(!O||O.tag!=k)return!1;for(var G=V?1:0,N=W.length-1;N>=0&&W[N]==k;N--)++G;E=O.to;for(var N=1;N<G;N++){var ie=P.scanForClosingTag(A,E,null,H);if(!ie||ie.tag!=k)return!1;E=ie.to}return!0}})},BjJ7:function(Qe,We,b){"use strict";b.d(We,"d",function(){return le}),b.d(We,"c",function(){return X}),b.d(We,"e",function(){return ae}),b.d(We,"b",function(){return te}),b.d(We,"a",function(){return S});var P=b("m3rI");function le(L){var A=!0;if(L.length>0){for(var W=0;W<L.length;W++)if(L[W].compile_success==0||!L[W].compile_success){A=!1;break}}else A=!1;return A}function X(L){for(var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",W=[],k=0;k<L.length;k++){var E=L[k],V=A?"".concat(A,"/").concat(E.name):"".concat(E.name);W.push({title:E.name,isLeaf:!(E.type==="tree"),key:V})}return W}function ae(L,A,W){for(var k=0;k<L.length;k++){var E=L[k];if(E.key===A){E.children=W;break}E.children&&ae(E.children,A,W)}return L}function te(L,A,W){var k;return function(){var E=this,V=arguments,H=function(){k=null,W||L.apply(E,V)},O=W&&!k;clearTimeout(k),k=setTimeout(H,A),O&&L.apply(E,V)}}var K=!0,S=P.a.API_SERVER},"C+DQ":function(Qe,We,b){},D1Df:function(Qe,We,b){"use strict";function P(x){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(J){return typeof J}:P=function(J){return J&&typeof Symbol=="function"&&J.constructor===Symbol&&J!==Symbol.prototype?"symbol":typeof J},P(x)}function le(){return le=Object.assign||function(x){for(var D=1;D<arguments.length;D++){var J=arguments[D];for(var j in J)Object.prototype.hasOwnProperty.call(J,j)&&(x[j]=J[j])}return x},le.apply(this,arguments)}function X(x,D){var J=Object.keys(x);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(x);D&&(j=j.filter(function(me){return Object.getOwnPropertyDescriptor(x,me).enumerable})),J.push.apply(J,j)}return J}function ae(x){for(var D=1;D<arguments.length;D++){var J=arguments[D]!=null?arguments[D]:{};D%2?X(J,!0).forEach(function(j){O(x,j,J[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(J)):X(J).forEach(function(j){Object.defineProperty(x,j,Object.getOwnPropertyDescriptor(J,j))})}return x}function te(x,D){if(x==null)return{};var J=K(x,D),j,me;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(x);for(me=0;me<w.length;me++){if(j=w[me],D.indexOf(j)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(x,j))continue;J[j]=x[j]}}return J}function K(x,D){if(x==null)return{};var J={},j=Object.keys(x),me,w;for(w=0;w<j.length;w++){if(me=j[w],D.indexOf(me)>=0)continue;J[me]=x[me]}return J}function S(x,D){if(!(x instanceof D))throw new TypeError("Cannot call a class as a function")}function L(x,D){for(var J=0;J<D.length;J++){var j=D[J];j.enumerable=j.enumerable||!1,j.configurable=!0,"value"in j&&(j.writable=!0),Object.defineProperty(x,j.key,j)}}function A(x,D,J){return D&&L(x.prototype,D),J&&L(x,J),x}function W(x,D){return D&&(P(D)==="object"||typeof D=="function")?D:E(x)}function k(x){return k=Object.setPrototypeOf?Object.getPrototypeOf:function(J){return J.__proto__||Object.getPrototypeOf(J)},k(x)}function E(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function V(x,D){if(typeof D!="function"&&D!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(D&&D.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),D&&H(x,D)}function H(x,D){return H=Object.setPrototypeOf||function(j,me){return j.__proto__=me,j},H(x,D)}function O(x,D,J){return D in x?Object.defineProperty(x,D,{value:J,enumerable:!0,configurable:!0,writable:!0}):x[D]=J,x}var G=b("q1tI"),N=b("17x9"),ie=b("H38U"),Q=b("aRTE");function Le(x){for(var D="",J=0;J<x.length;J++){var j=x.charCodeAt(J);j<128?D+=String.fromCharCode(j):j<2048?(D+=String.fromCharCode(192|j>>6),D+=String.fromCharCode(128|j&63)):j<55296||j>=57344?(D+=String.fromCharCode(224|j>>12),D+=String.fromCharCode(128|j>>6&63),D+=String.fromCharCode(128|j&63)):(J++,j=65536+((j&1023)<<10|x.charCodeAt(J)&1023),D+=String.fromCharCode(240|j>>18),D+=String.fromCharCode(128|j>>12&63),D+=String.fromCharCode(128|j>>6&63),D+=String.fromCharCode(128|j&63))}return D}var He={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},ue={},ye=4,Oe=.1;function oe(x){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,J=[];return x.forEach(function(j,me){var w=null;j.forEach(function(m,Y){if(!m&&w!==null){J.push("M".concat(w+D," ").concat(me+D,"h").concat(Y-w,"v1H").concat(w+D,"z")),w=null;return}if(Y===j.length-1){if(!m)return;w===null?J.push("M".concat(Y+D,",").concat(me+D," h1v1H").concat(Y+D,"z")):J.push("M".concat(w+D,",").concat(me+D," h").concat(Y+1-w,"v1H").concat(w+D,"z"));return}m&&w===null&&(w=Y)})}),J.join("")}function pe(x,D){return x.slice().map(function(J,j){return j<D.y||j>=D.y+D.h?J:J.map(function(me,w){return w<D.x||w>=D.x+D.w?me:!1})})}function _e(x,D){var J=x.imageSettings,j=x.size,me=x.includeMargin;if(J==null)return null;var w=me?ye:0,m=D.length+w*2,Y=Math.floor(j*Oe),we=m/j,fe=(J.width||Y)*we,Ue=(J.height||Y)*we,Fe=J.x==null?D.length/2-fe/2:J.x*we,be=J.y==null?D.length/2-Ue/2:J.y*we,Se=null;if(J.excavate){var xe=Math.floor(Fe),Ee=Math.floor(be),$=Math.ceil(fe+Fe-xe),I=Math.ceil(Ue+be-Ee);Se={x:xe,y:Ee,w:$,h:I}}return{x:Fe,y:be,h:Ue,w:fe,excavation:Se}}var ce=function(){try{new Path2D().addPath(new Path2D)}catch(x){return!1}return!0}(),T=function(x){V(D,x);function D(){var J,j;S(this,D);for(var me=arguments.length,w=new Array(me),m=0;m<me;m++)w[m]=arguments[m];return j=W(this,(J=k(D)).call.apply(J,[this].concat(w))),O(E(j),"_canvas",void 0),O(E(j),"_image",void 0),O(E(j),"state",{imgLoaded:!1}),O(E(j),"handleImageLoad",function(){j.setState({imgLoaded:!0})}),j}return A(D,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var j=this.props,me=j.value,w=j.size,m=j.level,Y=j.bgColor,we=j.fgColor,fe=j.includeMargin,Ue=j.imageSettings,Fe=new ie(-1,Q[m]);if(Fe.addData(Le(me)),Fe.make(),this._canvas!=null){var be=this._canvas,Se=be.getContext("2d");if(!Se)return;var xe=Fe.modules;if(xe===null)return;var Ee=fe?ye:0,$=xe.length+Ee*2,I=_e(this.props,xe);Ue!=null&&I!=null&&(I.excavation!=null&&(xe=pe(xe,I.excavation)));var Ie=window.devicePixelRatio||1;be.height=be.width=w*Ie;var ot=w/$*Ie;Se.scale(ot,ot),Se.fillStyle=Y,Se.fillRect(0,0,$,$),Se.fillStyle=we,ce?Se.fill(new Path2D(oe(xe,Ee))):xe.forEach(function(ct,Xe){ct.forEach(function(Je,Te){Je&&Se.fillRect(Te+Ee,Xe+Ee,1,1)})}),this.state.imgLoaded&&this._image&&I!=null&&Se.drawImage(this._image,I.x+Ee,I.y+Ee,I.w,I.h)}}},{key:"render",value:function(){var j=this,me=this.props,w=me.value,m=me.size,Y=me.level,we=me.bgColor,fe=me.fgColor,Ue=me.style,Fe=me.includeMargin,be=me.imageSettings,Se=te(me,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),xe=ae({height:m,width:m},Ue),Ee=null,$=be&&be.src;return be!=null&&$!=null&&(Ee=G.createElement("img",{src:$,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(Ie){return j._image=Ie}})),G.createElement(G.Fragment,null,G.createElement("canvas",le({style:xe,height:m,width:m,ref:function(Ie){return j._canvas=Ie}},Se)),Ee)}}]),D}(G.PureComponent);O(T,"defaultProps",He);var se=function(x){V(D,x);function D(){return S(this,D),W(this,k(D).apply(this,arguments))}return A(D,[{key:"render",value:function(){var j=this.props,me=j.value,w=j.size,m=j.level,Y=j.bgColor,we=j.fgColor,fe=j.includeMargin,Ue=j.imageSettings,Fe=te(j,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),be=new ie(-1,Q[m]);be.addData(Le(me)),be.make();var Se=be.modules;if(Se===null)return null;var xe=fe?ye:0,Ee=Se.length+xe*2,$=_e(this.props,Se),I=null;Ue!=null&&$!=null&&($.excavation!=null&&(Se=pe(Se,$.excavation)),I=G.createElement("image",{xlinkHref:Ue.src,height:$.h,width:$.w,x:$.x+xe,y:$.y+xe,preserveAspectRatio:"none"}));var Ie=oe(Se,xe);return G.createElement("svg",le({shapeRendering:"crispEdges",height:w,width:w,viewBox:"0 0 ".concat(Ee," ").concat(Ee)},Fe),G.createElement("path",{fill:Y,d:"M0,0 h".concat(Ee,"v").concat(Ee,"H0z")}),G.createElement("path",{fill:we,d:Ie}),I)}}]),D}(G.PureComponent);O(se,"defaultProps",He);var q=function(D){var J=D.renderAs,j=te(D,["renderAs"]),me=J==="svg"?se:T;return G.createElement(me,j)};q.defaultProps=ae({renderAs:"canvas"},He),Qe.exports=q},DlQD:function(Qe,We,b){(function(P,le){Qe.exports=le()})(this,function(){"use strict";function P(z,R){for(var U=0;U<R.length;U++){var v=R[U];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(z,v.key,v)}}function le(z,R,U){return R&&P(z.prototype,R),U&&P(z,U),z}function X(z,R){if(!z)return;if(typeof z=="string")return ae(z,R);var U=Object.prototype.toString.call(z).slice(8,-1);if(U==="Object"&&z.constructor&&(U=z.constructor.name),U==="Map"||U==="Set")return Array.from(z);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return ae(z,R)}function ae(z,R){(R==null||R>z.length)&&(R=z.length);for(var U=0,v=new Array(R);U<R;U++)v[U]=z[U];return v}function te(z,R){var U;if(typeof Symbol=="undefined"||z[Symbol.iterator]==null){if(Array.isArray(z)||(U=X(z))||R&&z&&typeof z.length=="number"){U&&(z=U);var v=0;return function(){return v>=z.length?{done:!0}:{done:!1,value:z[v++]}}}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 U=z[Symbol.iterator](),U.next.bind(U)}function K(z,R){return R={exports:{}},z(R,R.exports),R.exports}var S=K(function(z){function R(){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 U(v){z.exports.defaults=v}z.exports={defaults:R(),getDefaults:R,changeDefaults:U}}),L=S.defaults,A=S.getDefaults,W=S.changeDefaults,k=/[&<>"']/,E=/[&<>"']/g,V=/[<>"']|&(?!#?\w+;)/,H=/[<>"']|&(?!#?\w+;)/g,O={"&":"&","<":"<",">":">",'"':""","'":"'"},G=function(R){return O[R]};function N(z,R){if(R){if(k.test(z))return z.replace(E,G)}else if(V.test(z))return z.replace(H,G);return z}var ie=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Q(z){return z.replace(ie,function(R,U){return U=U.toLowerCase(),U==="colon"?":":U.charAt(0)==="#"?U.charAt(1)==="x"?String.fromCharCode(parseInt(U.substring(2),16)):String.fromCharCode(+U.substring(1)):""})}var Le=/(^|[^\[])\^/g;function He(z,R){z=z.source||z,R=R||"";var U={replace:function(y,C){return C=C.source||C,C=C.replace(Le,"$1"),z=z.replace(y,C),U},getRegex:function(){return new RegExp(z,R)}};return U}var ue=/[^\w:]/g,ye=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Oe(z,R,U){if(z){var v;try{v=decodeURIComponent(Q(U)).replace(ue,"").toLowerCase()}catch(y){return null}if(v.indexOf("javascript:")===0||v.indexOf("vbscript:")===0||v.indexOf("data:")===0)return null}R&&!ye.test(U)&&(U=T(R,U));try{U=encodeURI(U).replace(/%25/g,"%")}catch(y){return null}return U}var oe={},pe=/^[^:]+:\/*[^/]*$/,_e=/^([^:]+:)[\s\S]*$/,ce=/^([^:]+:\/*[^/]*)[\s\S]*$/;function T(z,R){oe[" "+z]||(pe.test(z)?oe[" "+z]=z+"/":oe[" "+z]=D(z,"/",!0)),z=oe[" "+z];var U=z.indexOf(":")===-1;return R.substring(0,2)==="//"?U?R:z.replace(_e,"$1")+R:R.charAt(0)==="/"?U?R:z.replace(ce,"$1")+R:z+R}var se={exec:function(){}};function q(z){for(var R=1,U,v;R<arguments.length;R++){U=arguments[R];for(v in U)Object.prototype.hasOwnProperty.call(U,v)&&(z[v]=U[v])}return z}function x(z,R){var U=z.replace(/\|/g,function(C,_,ne){for(var he=!1,Ne=_;--Ne>=0&&ne[Ne]==="\\";)he=!he;return he?"|":" |"}),v=U.split(/ \|/),y=0;if(v.length>R)v.splice(R);else for(;v.length<R;)v.push("");for(;y<v.length;y++)v[y]=v[y].trim().replace(/\\\|/g,"|");return v}function D(z,R,U){var v=z.length;if(v===0)return"";for(var y=0;y<v;){var C=z.charAt(v-y-1);if(C===R&&!U)y++;else if(C!==R&&U)y++;else break}return z.substr(0,v-y)}function J(z,R){if(z.indexOf(R[1])===-1)return-1;for(var U=z.length,v=0,y=0;y<U;y++)if(z[y]==="\\")y++;else if(z[y]===R[0])v++;else if(z[y]===R[1]&&(v--,v<0))return y;return-1}function j(z){z&&z.sanitize&&!z.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 me={escape:N,unescape:Q,edit:He,cleanUrl:Oe,resolveUrl:T,noopTest:se,merge:q,splitCells:x,rtrim:D,findClosingBracket:J,checkSanitizeDeprecation:j},w=S.defaults,m=me.rtrim,Y=me.splitCells,we=me.escape,fe=me.findClosingBracket;function Ue(z,R,U){var v=R.href,y=R.title?we(R.title):null,C=z[1].replace(/\\([\[\]])/g,"$1");return z[0].charAt(0)!=="!"?{type:"link",raw:U,href:v,title:y,text:C}:{type:"image",raw:U,href:v,title:y,text:we(C)}}function Fe(z,R){var U=z.match(/^(\s+)(?:```)/);if(U===null)return R;var v=U[1];return R.split(`
|
|
`).map(function(y){var C=y.match(/^\s+/);if(C===null)return y;var _=C[0];return _.length>=v.length?y.slice(v.length):y}).join(`
|
|
`)}var be=function(){function z(U){this.options=U||w}var R=z.prototype;return R.space=function(v){var y=this.rules.block.newline.exec(v);if(y)return y[0].length>1?{type:"space",raw:y[0]}:{raw:`
|
|
`}},R.code=function(v,y){var C=this.rules.block.code.exec(v);if(C){var _=y[y.length-1];if(_&&_.type==="paragraph")return{raw:C[0],text:C[0].trimRight()};var ne=C[0].replace(/^ {4}/gm,"");return{type:"code",raw:C[0],codeBlockStyle:"indented",text:this.options.pedantic?ne:m(ne,`
|
|
`)}}},R.fences=function(v){var y=this.rules.block.fences.exec(v);if(y){var C=y[0],_=Fe(C,y[3]||"");return{type:"code",raw:C,lang:y[2]?y[2].trim():y[2],text:_}}},R.heading=function(v){var y=this.rules.block.heading.exec(v);if(y)return{type:"heading",raw:y[0],depth:y[1].length,text:y[2]}},R.nptable=function(v){var y=this.rules.block.nptable.exec(v);if(y){var C={type:"table",header:Y(y[1].replace(/^ *| *\| *$/g,"")),align:y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:y[3]?y[3].replace(/\n$/,"").split(`
|
|
`):[],raw:y[0]};if(C.header.length===C.align.length){var _=C.align.length,ne;for(ne=0;ne<_;ne++)/^ *-+: *$/.test(C.align[ne])?C.align[ne]="right":/^ *:-+: *$/.test(C.align[ne])?C.align[ne]="center":/^ *:-+ *$/.test(C.align[ne])?C.align[ne]="left":C.align[ne]=null;for(_=C.cells.length,ne=0;ne<_;ne++)C.cells[ne]=Y(C.cells[ne],C.header.length);return C}}},R.hr=function(v){var y=this.rules.block.hr.exec(v);if(y)return{type:"hr",raw:y[0]}},R.blockquote=function(v){var y=this.rules.block.blockquote.exec(v);if(y){var C=y[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:y[0],text:C}}},R.list=function(v){var y=this.rules.block.list.exec(v);if(y){for(var C=y[0],_=y[2],ne=_.length>1,he=_[_.length-1]===")",Ne={type:"list",raw:C,ordered:ne,start:ne?+_.slice(0,-1):"",loose:!1,items:[]},yt=y[0].match(this.rules.block.item),_t=!1,Re,Et,pt,$e,Dt,Lt,Vt,Bt=yt.length,kt=0;kt<Bt;kt++)Re=yt[kt],C=Re,Et=Re.length,Re=Re.replace(/^ *([*+-]|\d+[.)]) */,""),~Re.indexOf(`
|
|
`)&&(Et-=Re.length,Re=this.options.pedantic?Re.replace(/^ {1,4}/gm,""):Re.replace(new RegExp("^ {1,"+Et+"}","gm"),"")),kt!==Bt-1&&(pt=this.rules.block.bullet.exec(yt[kt+1])[0],(ne?pt.length===1||!he&&pt[pt.length-1]===")":pt.length>1||this.options.smartLists&&pt!==_)&&($e=yt.slice(kt+1).join(`
|
|
`),Ne.raw=Ne.raw.substring(0,Ne.raw.length-$e.length),kt=Bt-1)),Dt=_t||/\n\n(?!\s*$)/.test(Re),kt!==Bt-1&&(_t=Re.charAt(Re.length-1)===`
|
|
`,Dt||(Dt=_t)),Dt&&(Ne.loose=!0),Lt=/^\[[ xX]\] /.test(Re),Vt=void 0,Lt&&(Vt=Re[1]!==" ",Re=Re.replace(/^\[[ xX]\] +/,"")),Ne.items.push({type:"list_item",raw:C,task:Lt,checked:Vt,loose:Dt,text:Re});return Ne}},R.html=function(v){var y=this.rules.block.html.exec(v);if(y)return{type:this.options.sanitize?"paragraph":"html",raw:y[0],pre:!this.options.sanitizer&&(y[1]==="pre"||y[1]==="script"||y[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(y[0]):we(y[0]):y[0]}},R.def=function(v){var y=this.rules.block.def.exec(v);if(y){y[3]&&(y[3]=y[3].substring(1,y[3].length-1));var C=y[1].toLowerCase().replace(/\s+/g," ");return{tag:C,raw:y[0],href:y[2],title:y[3]}}},R.table=function(v){var y=this.rules.block.table.exec(v);if(y){var C={type:"table",header:Y(y[1].replace(/^ *| *\| *$/g,"")),align:y[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:y[3]?y[3].replace(/\n$/,"").split(`
|
|
`):[]};if(C.header.length===C.align.length){C.raw=y[0];var _=C.align.length,ne;for(ne=0;ne<_;ne++)/^ *-+: *$/.test(C.align[ne])?C.align[ne]="right":/^ *:-+: *$/.test(C.align[ne])?C.align[ne]="center":/^ *:-+ *$/.test(C.align[ne])?C.align[ne]="left":C.align[ne]=null;for(_=C.cells.length,ne=0;ne<_;ne++)C.cells[ne]=Y(C.cells[ne].replace(/^ *\| *| *\| *$/g,""),C.header.length);return C}}},R.lheading=function(v){var y=this.rules.block.lheading.exec(v);if(y)return{type:"heading",raw:y[0],depth:y[2].charAt(0)==="="?1:2,text:y[1]}},R.paragraph=function(v){var y=this.rules.block.paragraph.exec(v);if(y)return{type:"paragraph",raw:y[0],text:y[1].charAt(y[1].length-1)===`
|
|
`?y[1].slice(0,-1):y[1]}},R.text=function(v,y){var C=this.rules.block.text.exec(v);if(C){var _=y[y.length-1];return _&&_.type==="text"?{raw:C[0],text:C[0]}:{type:"text",raw:C[0],text:C[0]}}},R.escape=function(v){var y=this.rules.inline.escape.exec(v);if(y)return{type:"escape",raw:y[0],text:we(y[1])}},R.tag=function(v,y,C){var _=this.rules.inline.tag.exec(v);if(_)return!y&&/^<a /i.test(_[0])?y=!0:y&&/^<\/a>/i.test(_[0])&&(y=!1),!C&&/^<(pre|code|kbd|script)(\s|>)/i.test(_[0])?C=!0:C&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(_[0])&&(C=!1),{type:this.options.sanitize?"text":"html",raw:_[0],inLink:y,inRawBlock:C,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_[0]):we(_[0]):_[0]}},R.link=function(v){var y=this.rules.inline.link.exec(v);if(y){var C=fe(y[2],"()");if(C>-1){var _=y[0].indexOf("!")===0?5:4,ne=_+y[1].length+C;y[2]=y[2].substring(0,C),y[0]=y[0].substring(0,ne).trim(),y[3]=""}var he=y[2],Ne="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(he);yt?(he=yt[1],Ne=yt[3]):Ne=""}else Ne=y[3]?y[3].slice(1,-1):"";he=he.trim().replace(/^<([\s\S]*)>$/,"$1");var _t=Ue(y,{href:he&&he.replace(this.rules.inline._escapes,"$1"),title:Ne&&Ne.replace(this.rules.inline._escapes,"$1")},y[0]);return _t}},R.reflink=function(v,y){var C;if((C=this.rules.inline.reflink.exec(v))||(C=this.rules.inline.nolink.exec(v))){var _=(C[2]||C[1]).replace(/\s+/g," ");if(_=y[_.toLowerCase()],!_||!_.href){var ne=C[0].charAt(0);return{type:"text",raw:ne,text:ne}}var he=Ue(C,_,C[0]);return he}},R.strong=function(v,y,C){C===void 0&&(C="");var _=this.rules.inline.strong.start.exec(v);if(_&&(!_[1]||_[1]&&(C===""||this.rules.inline.punctuation.exec(C)))){y=y.slice(-1*v.length);var ne=_[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ne.lastIndex=0;for(var he;(_=ne.exec(y))!=null;)if(he=this.rules.inline.strong.middle.exec(y.slice(0,_.index+3)),he)return{type:"strong",raw:v.slice(0,he[0].length),text:v.slice(2,he[0].length-2)}}},R.em=function(v,y,C){C===void 0&&(C="");var _=this.rules.inline.em.start.exec(v);if(_&&(!_[1]||_[1]&&(C===""||this.rules.inline.punctuation.exec(C)))){y=y.slice(-1*v.length);var ne=_[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ne.lastIndex=0;for(var he;(_=ne.exec(y))!=null;)if(he=this.rules.inline.em.middle.exec(y.slice(0,_.index+2)),he)return{type:"em",raw:v.slice(0,he[0].length),text:v.slice(1,he[0].length-1)}}},R.codespan=function(v){var y=this.rules.inline.code.exec(v);if(y){var C=y[2].replace(/\n/g," "),_=/[^ ]/.test(C),ne=C.startsWith(" ")&&C.endsWith(" ");return _&&ne&&(C=C.substring(1,C.length-1)),C=we(C,!0),{type:"codespan",raw:y[0],text:C}}},R.br=function(v){var y=this.rules.inline.br.exec(v);if(y)return{type:"br",raw:y[0]}},R.del=function(v){var y=this.rules.inline.del.exec(v);if(y)return{type:"del",raw:y[0],text:y[1]}},R.autolink=function(v,y){var C=this.rules.inline.autolink.exec(v);if(C){var _,ne;return C[2]==="@"?(_=we(this.options.mangle?y(C[1]):C[1]),ne="mailto:"+_):(_=we(C[1]),ne=_),{type:"link",raw:C[0],text:_,href:ne,tokens:[{type:"text",raw:_,text:_}]}}},R.url=function(v,y){var C;if(C=this.rules.inline.url.exec(v)){var _,ne;if(C[2]==="@")_=we(this.options.mangle?y(C[0]):C[0]),ne="mailto:"+_;else{var he;do he=C[0],C[0]=this.rules.inline._backpedal.exec(C[0])[0];while(he!==C[0]);_=we(C[0]),C[1]==="www."?ne="http://"+_:ne=_}return{type:"link",raw:C[0],text:_,href:ne,tokens:[{type:"text",raw:_,text:_}]}}},R.inlineText=function(v,y,C){var _=this.rules.inline.text.exec(v);if(_){var ne;return y?ne=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(_[0]):we(_[0]):_[0]:ne=we(this.options.smartypants?C(_[0]):_[0]),{type:"text",raw:_[0],text:ne}}},z}(),Se=me.noopTest,xe=me.edit,Ee=me.merge,$={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:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};$._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,$._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,$.def=xe($.def).replace("label",$._label).replace("title",$._title).getRegex(),$.bullet=/(?:[*+-]|\d{1,9}[.)])/,$.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,$.item=xe($.item,"gm").replace(/bull/g,$.bullet).getRegex(),$.list=xe($.list).replace(/bull/g,$.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$.def.source+")").getRegex(),$._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",$._comment=/<!--(?!-?>)[\s\S]*?-->/,$.html=xe($.html,"i").replace("comment",$._comment).replace("tag",$._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$.paragraph=xe($._paragraph).replace("hr",$.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",$._tag).getRegex(),$.blockquote=xe($.blockquote).replace("paragraph",$.paragraph).getRegex(),$.normal=Ee({},$),$.gfm=Ee({},$.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*|$)"}),$.gfm.nptable=xe($.gfm.nptable).replace("hr",$.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",$._tag).getRegex(),$.gfm.table=xe($.gfm.table).replace("hr",$.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",$._tag).getRegex(),$.pedantic=Ee({},$.normal,{html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$._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:Se,paragraph:xe($.normal._paragraph).replace("hr",$.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",$.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var I={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,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:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};I._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",I.punctuation=xe(I.punctuation).replace(/punctuation/g,I._punctuation).getRegex(),I._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",I._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",I.em.start=xe(I.em.start).replace(/punctuation/g,I._punctuation).getRegex(),I.em.middle=xe(I.em.middle).replace(/punctuation/g,I._punctuation).replace(/overlapSkip/g,I._overlapSkip).getRegex(),I.em.endAst=xe(I.em.endAst,"g").replace(/punctuation/g,I._punctuation).getRegex(),I.em.endUnd=xe(I.em.endUnd,"g").replace(/punctuation/g,I._punctuation).getRegex(),I.strong.start=xe(I.strong.start).replace(/punctuation/g,I._punctuation).getRegex(),I.strong.middle=xe(I.strong.middle).replace(/punctuation/g,I._punctuation).replace(/blockSkip/g,I._blockSkip).getRegex(),I.strong.endAst=xe(I.strong.endAst,"g").replace(/punctuation/g,I._punctuation).getRegex(),I.strong.endUnd=xe(I.strong.endUnd,"g").replace(/punctuation/g,I._punctuation).getRegex(),I.blockSkip=xe(I._blockSkip,"g").getRegex(),I.overlapSkip=xe(I._overlapSkip,"g").getRegex(),I._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,I._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,I._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])?)+(?![-_])/,I.autolink=xe(I.autolink).replace("scheme",I._scheme).replace("email",I._email).getRegex(),I._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,I.tag=xe(I.tag).replace("comment",$._comment).replace("attribute",I._attribute).getRegex(),I._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,I._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,I._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,I.link=xe(I.link).replace("label",I._label).replace("href",I._href).replace("title",I._title).getRegex(),I.reflink=xe(I.reflink).replace("label",I._label).getRegex(),I.reflinkSearch=xe(I.reflinkSearch,"g").replace("reflink",I.reflink).replace("nolink",I.nolink).getRegex(),I.normal=Ee({},I),I.pedantic=Ee({},I.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:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",I._label).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",I._label).getRegex()}),I.gfm=Ee({},I.normal,{escape:xe(I.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),I.gfm.url=xe(I.gfm.url,"i").replace("email",I.gfm._extended_email).getRegex(),I.breaks=Ee({},I.gfm,{br:xe(I.br).replace("{2,}","*").getRegex(),text:xe(I.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ie={block:$,inline:I},ot=S.defaults,ct=Ie.block,Xe=Ie.inline;function Je(z){return z.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 Te(z){var R="",U,v,y=z.length;for(U=0;U<y;U++)v=z.charCodeAt(U),Math.random()>.5&&(v="x"+v.toString(16)),R+="&#"+v+";";return R}var Be=function(){function z(U){this.tokens=[],this.tokens.links=Object.create(null),this.options=U||ot,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var v={block:ct.normal,inline:Xe.normal};this.options.pedantic?(v.block=ct.pedantic,v.inline=Xe.pedantic):this.options.gfm&&(v.block=ct.gfm,this.options.breaks?v.inline=Xe.breaks:v.inline=Xe.gfm),this.tokenizer.rules=v}z.lex=function(v,y){var C=new z(y);return C.lex(v)};var R=z.prototype;return R.lex=function(v){return v=v.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(v,this.tokens,!0),this.inline(this.tokens),this.tokens},R.blockTokens=function(v,y,C){y===void 0&&(y=[]),C===void 0&&(C=!0),v=v.replace(/^ +$/gm,"");for(var _,ne,he,Ne;v;){if(_=this.tokenizer.space(v)){v=v.substring(_.raw.length),_.type&&y.push(_);continue}if(_=this.tokenizer.code(v,y)){v=v.substring(_.raw.length),_.type?y.push(_):(Ne=y[y.length-1],Ne.raw+=`
|
|
`+_.raw,Ne.text+=`
|
|
`+_.text);continue}if(_=this.tokenizer.fences(v)){v=v.substring(_.raw.length),y.push(_);continue}if(_=this.tokenizer.heading(v)){v=v.substring(_.raw.length),y.push(_);continue}if(_=this.tokenizer.nptable(v)){v=v.substring(_.raw.length),y.push(_);continue}if(_=this.tokenizer.hr(v)){v=v.substring(_.raw.length),y.push(_);continue}if(_=this.tokenizer.blockquote(v)){v=v.substring(_.raw.length),_.tokens=this.blockTokens(_.text,[],C),y.push(_);continue}if(_=this.tokenizer.list(v)){for(v=v.substring(_.raw.length),he=_.items.length,ne=0;ne<he;ne++)_.items[ne].tokens=this.blockTokens(_.items[ne].text,[],!1);y.push(_);continue}if(_=this.tokenizer.html(v)){v=v.substring(_.raw.length),y.push(_);continue}if(C&&(_=this.tokenizer.def(v))){v=v.substring(_.raw.length),this.tokens.links[_.tag]||(this.tokens.links[_.tag]={href:_.href,title:_.title});continue}if(_=this.tokenizer.table(v)){v=v.substring(_.raw.length),y.push(_);continue}if(_=this.tokenizer.lheading(v)){v=v.substring(_.raw.length),y.push(_);continue}if(C&&(_=this.tokenizer.paragraph(v))){v=v.substring(_.raw.length),y.push(_);continue}if(_=this.tokenizer.text(v,y)){v=v.substring(_.raw.length),_.type?y.push(_):(Ne=y[y.length-1],Ne.raw+=`
|
|
`+_.raw,Ne.text+=`
|
|
`+_.text);continue}if(v){var yt="Infinite loop on byte: "+v.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return y},R.inline=function(v){var y,C,_,ne,he,Ne,yt=v.length;for(y=0;y<yt;y++){Ne=v[y];switch(Ne.type){case"paragraph":case"text":case"heading":{Ne.tokens=[],this.inlineTokens(Ne.text,Ne.tokens);break}case"table":{for(Ne.tokens={header:[],cells:[]},ne=Ne.header.length,C=0;C<ne;C++)Ne.tokens.header[C]=[],this.inlineTokens(Ne.header[C],Ne.tokens.header[C]);for(ne=Ne.cells.length,C=0;C<ne;C++)for(he=Ne.cells[C],Ne.tokens.cells[C]=[],_=0;_<he.length;_++)Ne.tokens.cells[C][_]=[],this.inlineTokens(he[_],Ne.tokens.cells[C][_]);break}case"blockquote":{this.inline(Ne.tokens);break}case"list":{for(ne=Ne.items.length,C=0;C<ne;C++)this.inline(Ne.items[C].tokens);break}}}return v},R.inlineTokens=function(v,y,C,_,ne){y===void 0&&(y=[]),C===void 0&&(C=!1),_===void 0&&(_=!1),ne===void 0&&(ne="");var he,Ne=v,yt;if(this.tokens.links){var _t=Object.keys(this.tokens.links);if(_t.length>0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(Ne))!=null;)_t.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(Ne=Ne.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(Ne))!=null;)Ne=Ne.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Ne.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;v;){if(he=this.tokenizer.escape(v)){v=v.substring(he.raw.length),y.push(he);continue}if(he=this.tokenizer.tag(v,C,_)){v=v.substring(he.raw.length),C=he.inLink,_=he.inRawBlock,y.push(he);continue}if(he=this.tokenizer.link(v)){v=v.substring(he.raw.length),he.type==="link"&&(he.tokens=this.inlineTokens(he.text,[],!0,_)),y.push(he);continue}if(he=this.tokenizer.reflink(v,this.tokens.links)){v=v.substring(he.raw.length),he.type==="link"&&(he.tokens=this.inlineTokens(he.text,[],!0,_)),y.push(he);continue}if(he=this.tokenizer.strong(v,Ne,ne)){v=v.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],C,_),y.push(he);continue}if(he=this.tokenizer.em(v,Ne,ne)){v=v.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],C,_),y.push(he);continue}if(he=this.tokenizer.codespan(v)){v=v.substring(he.raw.length),y.push(he);continue}if(he=this.tokenizer.br(v)){v=v.substring(he.raw.length),y.push(he);continue}if(he=this.tokenizer.del(v)){v=v.substring(he.raw.length),he.tokens=this.inlineTokens(he.text,[],C,_),y.push(he);continue}if(he=this.tokenizer.autolink(v,Te)){v=v.substring(he.raw.length),y.push(he);continue}if(!C&&(he=this.tokenizer.url(v,Te))){v=v.substring(he.raw.length),y.push(he);continue}if(he=this.tokenizer.inlineText(v,_,Je)){v=v.substring(he.raw.length),ne=he.raw.slice(-1),y.push(he);continue}if(v){var Re="Infinite loop on byte: "+v.charCodeAt(0);if(this.options.silent){console.error(Re);break}else throw new Error(Re)}}return y},le(z,null,[{key:"rules",get:function(){return{block:ct,inline:Xe}}}]),z}(),Ye=S.defaults,tt=me.cleanUrl,Ke=me.escape,Pe=function(){function z(U){this.options=U||Ye}var R=z.prototype;return R.code=function(v,y,C){var _=(y||"").match(/\S*/)[0];if(this.options.highlight){var ne=this.options.highlight(v,_);ne!=null&&ne!==v&&(C=!0,v=ne)}return _?'<pre><code class="'+this.options.langPrefix+Ke(_,!0)+'">'+(C?v:Ke(v,!0))+`</code></pre>
|
|
`:"<pre><code>"+(C?v:Ke(v,!0))+`</code></pre>
|
|
`},R.blockquote=function(v){return`<blockquote>
|
|
`+v+`</blockquote>
|
|
`},R.html=function(v){return v},R.heading=function(v,y,C,_){return this.options.headerIds?"<h"+y+' id="'+this.options.headerPrefix+_.slug(C)+'">'+v+"</h"+y+`>
|
|
`:"<h"+y+">"+v+"</h"+y+`>
|
|
`},R.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},R.list=function(v,y,C){var _=y?"ol":"ul",ne=y&&C!==1?' start="'+C+'"':"";return"<"+_+ne+`>
|
|
`+v+"</"+_+`>
|
|
`},R.listitem=function(v){return"<li>"+v+`</li>
|
|
`},R.checkbox=function(v){return"<input "+(v?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},R.paragraph=function(v){return"<p>"+v+`</p>
|
|
`},R.table=function(v,y){return y&&(y="<tbody>"+y+"</tbody>"),`<table>
|
|
<thead>
|
|
`+v+`</thead>
|
|
`+y+`</table>
|
|
`},R.tablerow=function(v){return`<tr>
|
|
`+v+`</tr>
|
|
`},R.tablecell=function(v,y){var C=y.header?"th":"td",_=y.align?"<"+C+' align="'+y.align+'">':"<"+C+">";return _+v+"</"+C+`>
|
|
`},R.strong=function(v){return"<strong>"+v+"</strong>"},R.em=function(v){return"<em>"+v+"</em>"},R.codespan=function(v){return"<code>"+v+"</code>"},R.br=function(){return this.options.xhtml?"<br/>":"<br>"},R.del=function(v){return"<del>"+v+"</del>"},R.link=function(v,y,C){if(v=tt(this.options.sanitize,this.options.baseUrl,v),v===null)return C;var _='<a href="'+Ke(v)+'"';return y&&(_+=' title="'+y+'"'),_+=">"+C+"</a>",_},R.image=function(v,y,C){if(v=tt(this.options.sanitize,this.options.baseUrl,v),v===null)return C;var _='<img src="'+v+'" alt="'+C+'"';return y&&(_+=' title="'+y+'"'),_+=this.options.xhtml?"/>":">",_},R.text=function(v){return v},z}(),ze=function(){function z(){}var R=z.prototype;return R.strong=function(v){return v},R.em=function(v){return v},R.codespan=function(v){return v},R.del=function(v){return v},R.html=function(v){return v},R.text=function(v){return v},R.link=function(v,y,C){return""+C},R.image=function(v,y,C){return""+C},R.br=function(){return""},z}(),vt=function(){function z(){this.seen={}}var R=z.prototype;return R.slug=function(v){var y=v.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(y)){var C=y;do this.seen[C]++,y=C+"-"+this.seen[C];while(this.seen.hasOwnProperty(y))}return this.seen[y]=0,y},z}(),st=S.defaults,nt=me.unescape,qe=function(){function z(U){this.options=U||st,this.options.renderer=this.options.renderer||new Pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ze,this.slugger=new vt}z.parse=function(v,y){var C=new z(y);return C.parse(v)};var R=z.prototype;return R.parse=function(v,y){y===void 0&&(y=!0);var C="",_,ne,he,Ne,yt,_t,Re,Et,pt,$e,Dt,Lt,Vt,Bt,kt,mn,sn,dt,En=v.length;for(_=0;_<En;_++){$e=v[_];switch($e.type){case"space":continue;case"hr":{C+=this.renderer.hr();continue}case"heading":{C+=this.renderer.heading(this.parseInline($e.tokens),$e.depth,nt(this.parseInline($e.tokens,this.textRenderer)),this.slugger);continue}case"code":{C+=this.renderer.code($e.text,$e.lang,$e.escaped);continue}case"table":{for(Et="",Re="",Ne=$e.header.length,ne=0;ne<Ne;ne++)Re+=this.renderer.tablecell(this.parseInline($e.tokens.header[ne]),{header:!0,align:$e.align[ne]});for(Et+=this.renderer.tablerow(Re),pt="",Ne=$e.cells.length,ne=0;ne<Ne;ne++){for(_t=$e.tokens.cells[ne],Re="",yt=_t.length,he=0;he<yt;he++)Re+=this.renderer.tablecell(this.parseInline(_t[he]),{header:!1,align:$e.align[he]});pt+=this.renderer.tablerow(Re)}C+=this.renderer.table(Et,pt);continue}case"blockquote":{pt=this.parse($e.tokens),C+=this.renderer.blockquote(pt);continue}case"list":{for(Dt=$e.ordered,Lt=$e.start,Vt=$e.loose,Ne=$e.items.length,pt="",ne=0;ne<Ne;ne++)kt=$e.items[ne],mn=kt.checked,sn=kt.task,Bt="",kt.task&&(dt=this.renderer.checkbox(mn),Vt?kt.tokens.length>0&&kt.tokens[0].type==="text"?(kt.tokens[0].text=dt+" "+kt.tokens[0].text,kt.tokens[0].tokens&&kt.tokens[0].tokens.length>0&&kt.tokens[0].tokens[0].type==="text"&&(kt.tokens[0].tokens[0].text=dt+" "+kt.tokens[0].tokens[0].text)):kt.tokens.unshift({type:"text",text:dt}):Bt+=dt),Bt+=this.parse(kt.tokens,Vt),pt+=this.renderer.listitem(Bt,sn,mn);C+=this.renderer.list(pt,Dt,Lt);continue}case"html":{C+=this.renderer.html($e.text);continue}case"paragraph":{C+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(pt=$e.tokens?this.parseInline($e.tokens):$e.text;_+1<En&&v[_+1].type==="text";)$e=v[++_],pt+=`
|
|
`+($e.tokens?this.parseInline($e.tokens):$e.text);C+=y?this.renderer.paragraph(pt):pt;continue}default:{var ln='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(ln);return}else throw new Error(ln)}}}return C},R.parseInline=function(v,y){y=y||this.renderer;var C="",_,ne,he=v.length;for(_=0;_<he;_++){ne=v[_];switch(ne.type){case"escape":{C+=y.text(ne.text);break}case"html":{C+=y.html(ne.text);break}case"link":{C+=y.link(ne.href,ne.title,this.parseInline(ne.tokens,y));break}case"image":{C+=y.image(ne.href,ne.title,ne.text);break}case"strong":{C+=y.strong(this.parseInline(ne.tokens,y));break}case"em":{C+=y.em(this.parseInline(ne.tokens,y));break}case"codespan":{C+=y.codespan(ne.text);break}case"br":{C+=y.br();break}case"del":{C+=y.del(this.parseInline(ne.tokens,y));break}case"text":{C+=y.text(ne.text);break}default:{var Ne='Token with "'+ne.type+'" type was not found.';if(this.options.silent){console.error(Ne);return}else throw new Error(Ne)}}}return C},z}(),ft=me.merge,at=me.checkSanitizeDeprecation,it=me.escape,ve=S.getDefaults,mt=S.changeDefaults,et=S.defaults;function de(z,R,U){if(typeof z=="undefined"||z===null)throw new Error("marked(): input parameter is undefined or null");if(typeof z!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(z)+", string expected");if(typeof R=="function"&&(U=R,R=null),R=ft({},de.defaults,R||{}),at(R),U){var v=R.highlight,y;try{y=Be.lex(z,R)}catch(he){return U(he)}var C=function(Ne){var yt;if(!Ne)try{yt=qe.parse(y,R)}catch(_t){Ne=_t}return R.highlight=v,Ne?U(Ne):U(null,yt)};if(!v||v.length<3)return C();if(delete R.highlight,!y.length)return C();var _=0;de.walkTokens(y,function(he){he.type==="code"&&(_++,setTimeout(function(){v(he.text,he.lang,function(Ne,yt){if(Ne)return C(Ne);yt!=null&&yt!==he.text&&(he.text=yt,he.escaped=!0),_--,_===0&&C()})},0))}),_===0&&C();return}try{var ne=Be.lex(z,R);return R.walkTokens&&de.walkTokens(ne,R.walkTokens),qe.parse(ne,R)}catch(he){if(he.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,R.silent)return"<p>An error occurred:</p><pre>"+it(he.message+"",!0)+"</pre>";throw he}}de.options=de.setOptions=function(z){return ft(de.defaults,z),mt(de.defaults),de},de.getDefaults=ve,de.defaults=et,de.use=function(z){var R=ft({},z);if(z.renderer&&function(){var v=de.defaults.renderer||new Pe,y=function(ne){var he=v[ne];v[ne]=function(){for(var Ne=arguments.length,yt=new Array(Ne),_t=0;_t<Ne;_t++)yt[_t]=arguments[_t];var Re=z.renderer[ne].apply(v,yt);return Re===!1&&(Re=he.apply(v,yt)),Re}};for(var C in z.renderer)y(C);R.renderer=v}(),z.tokenizer&&function(){var v=de.defaults.tokenizer||new be,y=function(ne){var he=v[ne];v[ne]=function(){for(var Ne=arguments.length,yt=new Array(Ne),_t=0;_t<Ne;_t++)yt[_t]=arguments[_t];var Re=z.tokenizer[ne].apply(v,yt);return Re===!1&&(Re=he.apply(v,yt)),Re}};for(var C in z.tokenizer)y(C);R.tokenizer=v}(),z.walkTokens){var U=de.defaults.walkTokens;R.walkTokens=function(v){z.walkTokens(v),U&&U(v)}}de.setOptions(R)},de.walkTokens=function(z,R){for(var U=te(z),v;!(v=U()).done;){var y=v.value;R(y);switch(y.type){case"table":{for(var C=te(y.tokens.header),_;!(_=C()).done;){var ne=_.value;de.walkTokens(ne,R)}for(var he=te(y.tokens.cells),Ne;!(Ne=he()).done;)for(var yt=Ne.value,_t=te(yt),Re;!(Re=_t()).done;){var Et=Re.value;de.walkTokens(Et,R)}break}case"list":{de.walkTokens(y.items,R);break}default:y.tokens&&de.walkTokens(y.tokens,R)}}},de.Parser=qe,de.parser=qe.parse,de.Renderer=Pe,de.TextRenderer=ze,de.Lexer=Be,de.lexer=Be.lex,de.Tokenizer=be,de.Slugger=vt,de.parse=de;var ge=de;return ge})},ELLl:function(Qe,We,b){(function(P){P(b("VrN/"))})(function(P){var le={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},X=P.Pos;P.defineOption("autoCloseBrackets",!1,function(O,G,N){N&&N!=P.Init&&(O.removeKeyMap(te),O.state.closeBrackets=null),G&&(K(ae(G,"pairs")),O.state.closeBrackets=G,O.addKeyMap(te))});function ae(O,G){return G=="pairs"&&typeof O=="string"?O:typeof O=="object"&&O[G]!=null?O[G]:le[G]}var te={Backspace:A,Enter:W};function K(O){for(var G=0;G<O.length;G++){var N=O.charAt(G),ie="'"+N+"'";te[ie]||(te[ie]=S(N))}}K(le.pairs+"`");function S(O){return function(G){return E(G,O)}}function L(O){var G=O.state.closeBrackets;if(!G||G.override)return G;var N=O.getModeAt(O.getCursor());return N.closeBrackets||G}function A(O){var G=L(O);if(!G||O.getOption("disableInput"))return P.Pass;for(var N=ae(G,"pairs"),ie=O.listSelections(),Q=0;Q<ie.length;Q++){if(!ie[Q].empty())return P.Pass;var Le=V(O,ie[Q].head);if(!Le||N.indexOf(Le)%2!=0)return P.Pass}for(var Q=ie.length-1;Q>=0;Q--){var He=ie[Q].head;O.replaceRange("",X(He.line,He.ch-1),X(He.line,He.ch+1),"+delete")}}function W(O){var G=L(O),N=G&&ae(G,"explode");if(!N||O.getOption("disableInput"))return P.Pass;for(var ie=O.listSelections(),Q=0;Q<ie.length;Q++){if(!ie[Q].empty())return P.Pass;var Le=V(O,ie[Q].head);if(!Le||N.indexOf(Le)%2!=0)return P.Pass}O.operation(function(){var He=O.lineSeparator()||`
|
|
`;O.replaceSelection(He+He,null),O.execCommand("goCharLeft"),ie=O.listSelections();for(var ue=0;ue<ie.length;ue++){var ye=ie[ue].head.line;O.indentLine(ye,null,!0),O.indentLine(ye+1,null,!0)}})}function k(O){var G=P.cmpPos(O.anchor,O.head)>0;return{anchor:new X(O.anchor.line,O.anchor.ch+(G?-1:1)),head:new X(O.head.line,O.head.ch+(G?1:-1))}}function E(O,G){var N=L(O);if(!N||O.getOption("disableInput"))return P.Pass;var ie=ae(N,"pairs"),Q=ie.indexOf(G);if(Q==-1)return P.Pass;for(var Le=ae(N,"closeBefore"),He=ae(N,"triples"),ue=ie.charAt(Q+1)==G,ye=O.listSelections(),Oe=Q%2==0,oe,pe=0;pe<ye.length;pe++){var _e=ye[pe],ce=_e.head,T,se=O.getRange(ce,X(ce.line,ce.ch+1));if(Oe&&!_e.empty())T="surround";else if((ue||!Oe)&&se==G)ue&&H(O,ce)?T="both":He.indexOf(G)>=0&&O.getRange(ce,X(ce.line,ce.ch+3))==G+G+G?T="skipThree":T="skip";else if(ue&&ce.ch>1&&He.indexOf(G)>=0&&O.getRange(X(ce.line,ce.ch-2),ce)==G+G){if(ce.ch>2&&/\bstring/.test(O.getTokenTypeAt(X(ce.line,ce.ch-2))))return P.Pass;T="addFour"}else if(ue){var q=ce.ch==0?" ":O.getRange(X(ce.line,ce.ch-1),ce);if(!P.isWordChar(se)&&q!=G&&!P.isWordChar(q))T="both";else return P.Pass}else if(Oe&&(se.length===0||/\s/.test(se)||Le.indexOf(se)>-1))T="both";else return P.Pass;if(!oe)oe=T;else if(oe!=T)return P.Pass}var x=Q%2?ie.charAt(Q-1):G,D=Q%2?G:ie.charAt(Q+1);O.operation(function(){if(oe=="skip")O.execCommand("goCharRight");else if(oe=="skipThree")for(var J=0;J<3;J++)O.execCommand("goCharRight");else if(oe=="surround"){for(var j=O.getSelections(),J=0;J<j.length;J++)j[J]=x+j[J]+D;O.replaceSelections(j,"around"),j=O.listSelections().slice();for(var J=0;J<j.length;J++)j[J]=k(j[J]);O.setSelections(j)}else oe=="both"?(O.replaceSelection(x+D,null),O.triggerElectric(x+D),O.execCommand("goCharLeft")):oe=="addFour"&&(O.replaceSelection(x+x+x+x,"before"),O.execCommand("goCharRight"))})}function V(O,G){var N=O.getRange(X(G.line,G.ch-1),X(G.line,G.ch+1));return N.length==2?N:null}function H(O,G){var N=O.getTokenAt(X(G.line,G.ch+1));return/\bstring/.test(N.type)&&N.start==G.ch&&(G.ch==0||!/\bstring/.test(O.getTokenTypeAt(G)))}})},F8wB:function(Qe,We,b){Qe.exports={loading:"loading___1SIOG"}},Gytx:function(Qe,We){Qe.exports=function(P,le,X,ae){var te=X?X.call(ae,P,le):void 0;if(te!==void 0)return!!te;if(P===le)return!0;if(typeof P!="object"||!P||typeof le!="object"||!le)return!1;var K=Object.keys(P),S=Object.keys(le);if(K.length!==S.length)return!1;for(var L=Object.prototype.hasOwnProperty.bind(le),A=0;A<K.length;A++){var W=K[A];if(!L(W))return!1;var k=P[W],E=le[W];if(te=X?X.call(ae,k,E,W):void 0,te===!1||te===void 0&&k!==E)return!1}return!0}},H38U:function(Qe,We,b){var P=b("f4xo"),le=b("rcnY"),X=b("wU8J"),ae=b("Iq15"),te=b("dWSS");function K(L,A){this.typeNumber=L,this.errorCorrectLevel=A,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var S=K.prototype;S.addData=function(L){var A=new P(L);this.dataList.push(A),this.dataCache=null},S.isDark=function(L,A){if(L<0||this.moduleCount<=L||A<0||this.moduleCount<=A)throw new Error(L+","+A);return this.modules[L][A]},S.getModuleCount=function(){return this.moduleCount},S.make=function(){if(this.typeNumber<1){var L=1;for(L=1;L<40;L++){for(var A=le.getRSBlocks(L,this.errorCorrectLevel),W=new X,k=0,E=0;E<A.length;E++)k+=A[E].dataCount;for(var E=0;E<this.dataList.length;E++){var V=this.dataList[E];W.put(V.mode,4),W.put(V.getLength(),ae.getLengthInBits(V.mode,L)),V.write(W)}if(W.getLengthInBits()<=k*8)break}this.typeNumber=L}this.makeImpl(!1,this.getBestMaskPattern())},S.makeImpl=function(L,A){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var W=0;W<this.moduleCount;W++){this.modules[W]=new Array(this.moduleCount);for(var k=0;k<this.moduleCount;k++)this.modules[W][k]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(L,A),this.typeNumber>=7&&this.setupTypeNumber(L),this.dataCache==null&&(this.dataCache=K.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,A)},S.setupPositionProbePattern=function(L,A){for(var W=-1;W<=7;W++){if(L+W<=-1||this.moduleCount<=L+W)continue;for(var k=-1;k<=7;k++){if(A+k<=-1||this.moduleCount<=A+k)continue;0<=W&&W<=6&&(k==0||k==6)||0<=k&&k<=6&&(W==0||W==6)||2<=W&&W<=4&&2<=k&&k<=4?this.modules[L+W][A+k]=!0:this.modules[L+W][A+k]=!1}}},S.getBestMaskPattern=function(){for(var L=0,A=0,W=0;W<8;W++){this.makeImpl(!0,W);var k=ae.getLostPoint(this);(W==0||L>k)&&(L=k,A=W)}return A},S.createMovieClip=function(L,A,W){var k=L.createEmptyMovieClip(A,W),E=1;this.make();for(var V=0;V<this.modules.length;V++)for(var H=V*E,O=0;O<this.modules[V].length;O++){var G=O*E,N=this.modules[V][O];N&&(k.beginFill(0,100),k.moveTo(G,H),k.lineTo(G+E,H),k.lineTo(G+E,H+E),k.lineTo(G,H+E),k.endFill())}return k},S.setupTimingPattern=function(){for(var L=8;L<this.moduleCount-8;L++){if(this.modules[L][6]!=null)continue;this.modules[L][6]=L%2==0}for(var A=8;A<this.moduleCount-8;A++){if(this.modules[6][A]!=null)continue;this.modules[6][A]=A%2==0}},S.setupPositionAdjustPattern=function(){for(var L=ae.getPatternPosition(this.typeNumber),A=0;A<L.length;A++)for(var W=0;W<L.length;W++){var k=L[A],E=L[W];if(this.modules[k][E]!=null)continue;for(var V=-2;V<=2;V++)for(var H=-2;H<=2;H++)V==-2||V==2||H==-2||H==2||V==0&&H==0?this.modules[k+V][E+H]=!0:this.modules[k+V][E+H]=!1}},S.setupTypeNumber=function(L){for(var A=ae.getBCHTypeNumber(this.typeNumber),W=0;W<18;W++){var k=!L&&(A>>W&1)==1;this.modules[Math.floor(W/3)][W%3+this.moduleCount-8-3]=k}for(var W=0;W<18;W++){var k=!L&&(A>>W&1)==1;this.modules[W%3+this.moduleCount-8-3][Math.floor(W/3)]=k}},S.setupTypeInfo=function(L,A){for(var W=this.errorCorrectLevel<<3|A,k=ae.getBCHTypeInfo(W),E=0;E<15;E++){var V=!L&&(k>>E&1)==1;E<6?this.modules[E][8]=V:E<8?this.modules[E+1][8]=V:this.modules[this.moduleCount-15+E][8]=V}for(var E=0;E<15;E++){var V=!L&&(k>>E&1)==1;E<8?this.modules[8][this.moduleCount-E-1]=V:E<9?this.modules[8][15-E-1+1]=V:this.modules[8][15-E-1]=V}this.modules[this.moduleCount-8][8]=!L},S.mapData=function(L,A){for(var W=-1,k=this.moduleCount-1,E=7,V=0,H=this.moduleCount-1;H>0;H-=2)for(H==6&&H--;;){for(var O=0;O<2;O++)if(this.modules[k][H-O]==null){var G=!1;V<L.length&&(G=(L[V]>>>E&1)==1);var N=ae.getMask(A,k,H-O);N&&(G=!G),this.modules[k][H-O]=G,E--,E==-1&&(V++,E=7)}if(k+=W,k<0||this.moduleCount<=k){k-=W,W=-W;break}}},K.PAD0=236,K.PAD1=17,K.createData=function(L,A,W){for(var k=le.getRSBlocks(L,A),E=new X,V=0;V<W.length;V++){var H=W[V];E.put(H.mode,4),E.put(H.getLength(),ae.getLengthInBits(H.mode,L)),H.write(E)}for(var O=0,V=0;V<k.length;V++)O+=k[V].dataCount;if(E.getLengthInBits()>O*8)throw new Error("code length overflow. ("+E.getLengthInBits()+">"+O*8+")");for(E.getLengthInBits()+4<=O*8&&E.put(0,4);E.getLengthInBits()%8!=0;)E.putBit(!1);for(;!(E.getLengthInBits()>=O*8);){if(E.put(K.PAD0,8),E.getLengthInBits()>=O*8)break;E.put(K.PAD1,8)}return K.createBytes(E,k)},K.createBytes=function(L,A){for(var W=0,k=0,E=0,V=new Array(A.length),H=new Array(A.length),O=0;O<A.length;O++){var G=A[O].dataCount,N=A[O].totalCount-G;k=Math.max(k,G),E=Math.max(E,N),V[O]=new Array(G);for(var ie=0;ie<V[O].length;ie++)V[O][ie]=255&L.buffer[ie+W];W+=G;var Q=ae.getErrorCorrectPolynomial(N),Le=new te(V[O],Q.getLength()-1),He=Le.mod(Q);H[O]=new Array(Q.getLength()-1);for(var ie=0;ie<H[O].length;ie++){var ue=ie+He.getLength()-H[O].length;H[O][ie]=ue>=0?He.get(ue):0}}for(var ye=0,ie=0;ie<A.length;ie++)ye+=A[ie].totalCount;for(var Oe=new Array(ye),oe=0,ie=0;ie<k;ie++)for(var O=0;O<A.length;O++)ie<V[O].length&&(Oe[oe++]=V[O][ie]);for(var ie=0;ie<E;ie++)for(var O=0;O<A.length;O++)ie<H[O].length&&(Oe[oe++]=H[O][ie]);return Oe},Qe.exports=K},HmJG:function(Qe,We,b){},Iq15:function(Qe,We,b){var P=b("nVVt"),le=b("dWSS"),X=b("dQei"),ae={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},te={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(K){for(var S=K<<10;te.getBCHDigit(S)-te.getBCHDigit(te.G15)>=0;)S^=te.G15<<te.getBCHDigit(S)-te.getBCHDigit(te.G15);return(K<<10|S)^te.G15_MASK},getBCHTypeNumber:function(K){for(var S=K<<12;te.getBCHDigit(S)-te.getBCHDigit(te.G18)>=0;)S^=te.G18<<te.getBCHDigit(S)-te.getBCHDigit(te.G18);return K<<12|S},getBCHDigit:function(K){for(var S=0;K!=0;)S++,K>>>=1;return S},getPatternPosition:function(K){return te.PATTERN_POSITION_TABLE[K-1]},getMask:function(K,S,L){switch(K){case ae.PATTERN000:return(S+L)%2==0;case ae.PATTERN001:return S%2==0;case ae.PATTERN010:return L%3==0;case ae.PATTERN011:return(S+L)%3==0;case ae.PATTERN100:return(Math.floor(S/2)+Math.floor(L/3))%2==0;case ae.PATTERN101:return S*L%2+S*L%3==0;case ae.PATTERN110:return(S*L%2+S*L%3)%2==0;case ae.PATTERN111:return(S*L%3+(S+L)%2)%2==0;default:throw new Error("bad maskPattern:"+K)}},getErrorCorrectPolynomial:function(K){for(var S=new le([1],0),L=0;L<K;L++)S=S.multiply(new le([1,X.gexp(L)],0));return S},getLengthInBits:function(K,S){if(1<=S&&S<10)switch(K){case P.MODE_NUMBER:return 10;case P.MODE_ALPHA_NUM:return 9;case P.MODE_8BIT_BYTE:return 8;case P.MODE_KANJI:return 8;default:throw new Error("mode:"+K)}else if(S<27)switch(K){case P.MODE_NUMBER:return 12;case P.MODE_ALPHA_NUM:return 11;case P.MODE_8BIT_BYTE:return 16;case P.MODE_KANJI:return 10;default:throw new Error("mode:"+K)}else if(S<41)switch(K){case P.MODE_NUMBER:return 14;case P.MODE_ALPHA_NUM:return 13;case P.MODE_8BIT_BYTE:return 16;case P.MODE_KANJI:return 12;default:throw new Error("mode:"+K)}else throw new Error("type:"+S)},getLostPoint:function(K){for(var S=K.getModuleCount(),L=0,A=0;A<S;A++)for(var W=0;W<S;W++){for(var k=0,E=K.isDark(A,W),V=-1;V<=1;V++){if(A+V<0||S<=A+V)continue;for(var H=-1;H<=1;H++){if(W+H<0||S<=W+H)continue;if(V==0&&H==0)continue;E==K.isDark(A+V,W+H)&&k++}}k>5&&(L+=3+k-5)}for(var A=0;A<S-1;A++)for(var W=0;W<S-1;W++){var O=0;K.isDark(A,W)&&O++,K.isDark(A+1,W)&&O++,K.isDark(A,W+1)&&O++,K.isDark(A+1,W+1)&&O++,(O==0||O==4)&&(L+=3)}for(var A=0;A<S;A++)for(var W=0;W<S-6;W++)K.isDark(A,W)&&!K.isDark(A,W+1)&&K.isDark(A,W+2)&&K.isDark(A,W+3)&&K.isDark(A,W+4)&&!K.isDark(A,W+5)&&K.isDark(A,W+6)&&(L+=40);for(var W=0;W<S;W++)for(var A=0;A<S-6;A++)K.isDark(A,W)&&!K.isDark(A+1,W)&&K.isDark(A+2,W)&&K.isDark(A+3,W)&&K.isDark(A+4,W)&&!K.isDark(A+5,W)&&K.isDark(A+6,W)&&(L+=40);for(var G=0,W=0;W<S;W++)for(var A=0;A<S;A++)K.isDark(A,W)&&G++;var N=Math.abs(100*G/S/S-50)/5;return L+=N*10,L}};Qe.exports=te},LdHM:function(Qe,We,b){"use strict";b.d(We,"b",function(){return Le}),b.d(We,"a",function(){return ue});var P=b("1OyB"),le=b("vuIU"),X=b("Ji7U"),ae=b("LK+K"),te=b("q1tI"),K=b("rePB"),S=b("Ff2n"),L=b("ODXe"),A=b("4IlW"),W=b("bX4T"),k=b("YrtM"),E=b("TSYQ"),V=b.n(E),H=b("+nKL"),O=b("8OUc"),G=function(Y,we){var fe=Y.prefixCls,Ue=Y.id,Fe=Y.flattenOptions,be=Y.childrenAsData,Se=Y.values,xe=Y.searchValue,Ee=Y.multiple,$=Y.defaultActiveFirstOption,I=Y.height,Ie=Y.itemHeight,ot=Y.notFoundContent,ct=Y.open,Xe=Y.menuItemSelectedIcon,Je=Y.virtual,Te=Y.onSelect,Be=Y.onToggleOpen,Ye=Y.onActiveValue,tt=Y.onScroll,Ke=Y.onMouseEnter,Pe="".concat(fe,"-item"),ze=Object(k.a)(function(){return Fe},[ct,Fe],function(ge,z){return z[0]&&ge[1]!==z[1]}),vt=te.useRef(null),st=function(z){z.preventDefault()},nt=function(z){vt.current&&vt.current.scrollTo({index:z})},qe=function(z){for(var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,U=ze.length,v=0;v<U;v+=1){var y=(z+v*R+U)%U,C=ze[y],_=C.group,ne=C.data;if(!_&&!ne.disabled)return y}return-1},ft=te.useState(function(){return qe(0)}),at=Object(L.a)(ft,2),it=at[0],ve=at[1],mt=function(z){ve(z);var R=ze[z];if(!R){Ye(null,-1);return}Ye(R.data.value,z)};te.useEffect(function(){mt($!==!1?qe(0):-1)},[ze.length,xe]),te.useEffect(function(){var ge=setTimeout(function(){if(!Ee&&ct&&Se.size===1){var z=Array.from(Se)[0],R=ze.findIndex(function(U){var v=U.data;return v.value===z});mt(R),nt(R)}});return function(){return clearTimeout(ge)}},[ct]);var et=function(z){z!==void 0&&Te(z,{selected:!Se.has(z)}),Ee||Be(!1)};if(te.useImperativeHandle(we,function(){return{onKeyDown:function(z){var R=z.which;switch(R){case A.a.UP:case A.a.DOWN:{var U=0;if(R===A.a.UP?U=-1:R===A.a.DOWN&&(U=1),U!==0){var v=qe(it+U,U);nt(v),mt(v)}break}case A.a.ENTER:{var y=ze[it];y&&!y.data.disabled?et(y.data.value):et(void 0),ct&&z.preventDefault();break}case A.a.ESC:Be(!1)}},onKeyUp:function(){},scrollTo:function(z){nt(z)}}}),ze.length===0)return te.createElement("div",{role:"listbox",id:"".concat(Ue,"_list"),className:"".concat(Pe,"-empty"),onMouseDown:st},ot);function de(ge){var z=ze[ge];if(!z)return null;var R=z.data||{},U=R.value,v=R.label,y=R.children,C=Object(W.a)(R,!0),_=be?y:v;return z?te.createElement("div",Object.assign({"aria-label":typeof _=="string"?_:null},C,{key:ge,role:"option",id:"".concat(Ue,"_list_").concat(ge),"aria-selected":Se.has(U)}),U):null}return te.createElement(te.Fragment,null,te.createElement("div",{role:"listbox",id:"".concat(Ue,"_list"),style:{height:0,width:0,overflow:"hidden"}},de(it-1),de(it),de(it+1)),te.createElement(H.a,{itemKey:"key",ref:vt,data:ze,height:I,itemHeight:Ie,fullHeight:!1,onMouseDown:st,onScroll:tt,virtual:Je,onMouseEnter:Ke},function(ge,z){var R,U=ge.group,v=ge.groupOption,y=ge.data,C=y.label,_=y.key;if(U)return te.createElement("div",{className:V()(Pe,"".concat(Pe,"-group"))},C!==void 0?C:_);var ne=y.disabled,he=y.value,Ne=y.title,yt=y.children,_t=y.style,Re=y.className,Et=Object(S.a)(y,["disabled","value","title","children","style","className"]),pt=Se.has(he),$e="".concat(Pe,"-option"),Dt=V()(Pe,$e,Re,(R={},Object(K.a)(R,"".concat($e,"-grouped"),v),Object(K.a)(R,"".concat($e,"-active"),it===z&&!ne),Object(K.a)(R,"".concat($e,"-disabled"),ne),Object(K.a)(R,"".concat($e,"-selected"),pt),R)),Lt=be?yt:C,Vt=!Xe||typeof Xe=="function"||pt;return te.createElement("div",Object.assign({},Et,{"aria-selected":pt,className:Dt,title:Ne,onMouseMove:function(){if(it===z||ne)return;mt(z)},onClick:function(){ne||et(he)},style:_t}),te.createElement("div",{className:"".concat($e,"-content")},Lt||he),te.isValidElement(Xe)||pt,Vt&&te.createElement(O.a,{className:"".concat(Pe,"-option-state"),customizeIcon:Xe,customizeIconProps:{isSelected:pt}},pt?"\u2713":null))}))},N=te.forwardRef(G);N.displayName="OptionList";var ie=N,Q=function(){return null};Q.isSelectOption=!0;var Le=Q,He=function(){return null};He.isSelectOptGroup=!0;var ue=He,ye=b("VTBJ"),Oe=b("Zm9Q");function oe(m){var Y=m.key,we=m.props,fe=we.children,Ue=we.value,Fe=Object(S.a)(we,["children","value"]);return Object(ye.a)({key:Y,value:Ue!==void 0?Ue:Y,children:fe},Fe)}function pe(m){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Oe.a)(m).map(function(we,fe){if(!te.isValidElement(we)||!we.type)return null;var Ue=we.type.isSelectOptGroup,Fe=we.key,be=we.props,Se=be.children,xe=Object(S.a)(be,["children"]);return Y||!Ue?oe(we):Object(ye.a)(Object(ye.a)({key:"__RC_SELECT_GRP__".concat(Fe===null?fe:Fe,"__"),label:Fe},xe),{},{options:pe(Se)})}).filter(function(we){return we})}var _e=b("2Qr1"),ce=b("qNPg"),T=b("U8pU"),se=b("Kwbf"),q=b("WKfj");function x(m){var Y=m.mode,we=m.options,fe=m.children,Ue=m.backfill,Fe=m.allowClear,be=m.placeholder,Se=m.getInputElement,xe=m.showSearch,Ee=m.onSearch,$=m.defaultOpen,I=m.autoFocus,Ie=m.labelInValue,ot=m.value,ct=m.inputValue,Xe=m.optionLabelProp,Je=Y==="multiple"||Y==="tags",Te=xe!==void 0?xe:Je||Y==="combobox",Be=we||pe(fe);if(Object(se.a)(Y!=="tags"||Be.every(function(Pe){return!Pe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var Ye=Be.some(function(Pe){return Pe.options?Pe.options.some(function(ze){return typeof("value"in ze?ze.value:ze.key)=="number"}):typeof("value"in Pe?Pe.value:Pe.key)=="number"});Object(se.a)(!Ye,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(se.a)(Y!=="combobox"||!Xe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(se.a)(Y==="combobox"||!Ue,"`backfill` only works with `combobox` mode."),Object(se.a)(Y==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(se.b)(Y!=="combobox"||!Se||!Fe||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ee&&!Te&&Y!=="combobox"&&Y!=="tags"&&Object(se.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(se.b)(!$||I,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),ot!=null){var tt=Object(q.d)(ot);Object(se.a)(!Ie||tt.every(function(Pe){return Object(T.a)(Pe)==="object"&&("key"in Pe||"value"in Pe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(se.a)(!Je||Array.isArray(ot),"`value` should be array when `mode` is `multiple` or `tags`")}if(fe){var Ke=null;Object(Oe.a)(fe).some(function(Pe){if(!te.isValidElement(Pe)||!Pe.type)return!1;var ze=Pe.type;if(ze.isSelectOption)return!1;if(ze.isSelectOptGroup){var vt=Object(Oe.a)(Pe.props.children).every(function(st){return!te.isValidElement(st)||!Pe.type||st.type.isSelectOption?!0:(Ke=st.type,!1)});return!vt}return Ke=ze,!0}),Ke&&Object(se.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ke.displayName||Ke.name||Ke,"`.")),Object(se.a)(ct===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var D=x,J=Object(ce.a)({prefixCls:"rc-select",components:{optionList:ie},convertChildrenToData:pe,flattenOptions:_e.d,getLabeledValue:_e.e,filterOptions:_e.b,isValueDisabled:_e.g,findValueOption:_e.c,warningProps:D,fillOptionsWithMissingValue:_e.a}),j=function(m){Object(X.a)(we,m);var Y=Object(ae.a)(we);function we(){var fe;return Object(P.a)(this,we),fe=Y.apply(this,arguments),fe.selectRef=te.createRef(),fe.focus=function(){fe.selectRef.current.focus()},fe.blur=function(){fe.selectRef.current.blur()},fe}return Object(le.a)(we,[{key:"render",value:function(){return te.createElement(J,Object.assign({ref:this.selectRef},this.props))}}]),we}(te.Component);j.Option=Le,j.OptGroup=ue;var me=j,w=We.c=me},M8RZ:function(Qe,We,b){"use strict";b.d(We,"a",function(){return A});var P=b("fWQN"),le=b("mtLc"),X=b("yKVA"),ae=b("879j"),te=b("q1tI"),K=b.n(te),S=b("i8i4"),L=b.n(S),A=function(W){Object(X.a)(E,W);var k=Object(ae.a)(E);function E(V){var H;Object(P.a)(this,E),H=k.call(this,V);var O=window.document;return H.node=O.createElement("div"),O.body.appendChild(H.node),H}return Object(le.a)(E,[{key:"render",value:function(){var H=this.props.children;return Object(S.createPortal)(H,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),E}(K.a.Component)},OLES:function(Qe,We,b){"use strict";var P=b("U8pU"),le=b("VTBJ"),X=b("Ff2n"),ae=b("q1tI"),te=b("uciX"),K=b("7ixt"),S=function(V){var H=V.overlay,O=V.prefixCls,G=V.id,N=V.overlayInnerStyle;return ae.createElement("div",{className:"".concat(O,"-inner"),id:G,role:"tooltip",style:N},typeof H=="function"?H():H)},L=S,A=function(V,H){var O=V.overlayClassName,G=V.trigger,N=G===void 0?["hover"]:G,ie=V.mouseEnterDelay,Q=ie===void 0?0:ie,Le=V.mouseLeaveDelay,He=Le===void 0?.1:Le,ue=V.overlayStyle,ye=V.prefixCls,Oe=ye===void 0?"rc-tooltip":ye,oe=V.children,pe=V.onVisibleChange,_e=V.afterVisibleChange,ce=V.transitionName,T=V.animation,se=V.placement,q=se===void 0?"right":se,x=V.align,D=x===void 0?{}:x,J=V.destroyTooltipOnHide,j=J===void 0?!1:J,me=V.defaultVisible,w=V.getTooltipContainer,m=V.overlayInnerStyle,Y=Object(X.a)(V,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),we=Object(ae.useRef)(null);Object(ae.useImperativeHandle)(H,function(){return we.current});var fe=Object(le.a)({},Y);"visible"in V&&(fe.popupVisible=V.visible);var Ue=function(){var Ee=V.arrowContent,$=Ee===void 0?null:Ee,I=V.overlay,Ie=V.id;return[ae.createElement("div",{className:"".concat(Oe,"-arrow"),key:"arrow"},$),ae.createElement(L,{key:"content",prefixCls:Oe,id:Ie,overlay:I,overlayInnerStyle:m})]},Fe=!1,be=!1;if(typeof j=="boolean")Fe=j;else if(j&&Object(P.a)(j)==="object"){var Se=j.keepParent;Fe=Se===!0,be=Se===!1}return ae.createElement(te.a,Object.assign({popupClassName:O,prefixCls:Oe,popup:Ue,action:N,builtinPlacements:K.a,popupPlacement:q,ref:we,popupAlign:D,getPopupContainer:w,onPopupVisibleChange:pe,afterPopupVisibleChange:_e,popupTransitionName:ce,popupAnimation:T,defaultPopupVisible:me,destroyPopupOnHide:Fe,autoDestroy:be,mouseLeaveDelay:He,popupStyle:ue,mouseEnterDelay:Q},fe),oe)},W=Object(ae.forwardRef)(A),k=We.a=W},Ot1p:function(Qe,We,b){"use strict";var P=b("2qtc"),le=b("kLXV"),X=b("rAM+"),ae=b("miYZ"),te=b("tsqr"),K=b("9og8"),S=b("tJVT"),L=b("jrin"),A=b("WmNS"),W=b.n(A),k=b("q1tI"),E=b.n(k),V=b("VrN/"),H=b.n(V),O=b("bdgK"),G=b("p77/"),N=b("Bd2K"),ie=b("ELLl"),Q=b("19Vz"),Le=b("lZu9"),He=b("+NIl"),ue=b("kSUc"),ye=b("9Bee"),Oe=function(Re){var Et=Re.value,pt=Et===void 0?"":Et,$e=Re.className,Dt=Re.showTextOnly,Lt=Re.showLines,Vt=Re.style,Bt=Vt===void 0?{}:Vt,kt=Object(k.useMemo)(function(){return""},[pt]);return E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{dangerouslySetInnerHTML:{__html:kt}}))},oe=b("Q9mQ"),pe=b("diRs"),_e=b("0Owb"),ce=b("dejd"),T=b("C+DQ"),se=b("D1Df"),q=b.n(se),x=b("1vsH"),D=b("m3rI"),J=[{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 j(Re){var Et=Re.onActionCallback,pt=Re.title,$e=Re.icon,Dt=Re.actionName,Lt=Re.className,Vt=Lt===void 0?"":Lt,Bt=Re.children;function kt(){Et(Dt)}return E.a.createElement("a",{title:pt,className:Vt,onClick:kt},E.a.createElement("i",{className:"md-iconfont ".concat($e)}),Bt)}var me=function(Re){var Et=Re.watch,pt=Re.showNullButton,$e=Re.onActionCallback,Dt=Re.fullScreen,Lt=Re.insertTemp,Vt=Re.hidetoolBar,Bt=Re.uuid,kt=Re.setOpenPhones,mn=Object(x.E)("_educoder_session_login"),sn=Object(x.E)("_educoder_session"),dt=[].concat(J,[{title:"".concat(Et?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Et?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return E.a.createElement("ul",{className:"markdown-toolbar-container"},!Vt&&dt.map(function(En,ln){return E.a.createElement("li",{key:ln},En.actionName?E.a.createElement(j,Object(_e.a)({},En,{onActionCallback:$e})):E.a.createElement("span",{className:"v-line"}))}),pt?E.a.createElement("li",null,E.a.createElement(j,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:$e},E.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Lt&&E.a.createElement("li",null,E.a.createElement(j,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Lt),onActionCallback:$e},E.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),E.a.createElement("li",null,E.a.createElement(pe.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:E.a.createElement("div",null,E.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+mn+"&_educoder_session="+sn+"&key="+Bt+"&api="+encodeURIComponent(D.a.API_SERVER)),E.a.createElement(q.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+mn+"&_educoder_session="+sn+"&key="+Bt+"&api="+encodeURIComponent(D.a.API_SERVER)}))},E.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return kt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),E.a.createElement("li",{className:"btn-full-screen"},E.a.createElement(j,{icon:"".concat(Dt?"icon-shrink":"icon-enlarge"),title:Dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:$e})))},w=b("M8RZ"),m=b("+L6B"),Y=b("2/Rp"),we=b("y8nQ"),fe=b("Vl3Y"),Ue=b("5NDa"),Fe=b("5rEg"),be={labelCol:{span:4},wrapperCol:{span:20}},Se=function(Re){var Et=Re.callback,pt=Re.onCancel;function $e(Dt){Et(Dt)}return E.a.createElement(fe.a,Object(_e.a)({},be,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:$e}),E.a.createElement(fe.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},E.a.createElement(Fe.a,null)),E.a.createElement(fe.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},E.a.createElement(Fe.a,null)),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(Y.a,{type:"ghost",onClick:pt},"\u53D6\u6D88")))},xe=b("7ahc"),Ee=b("k1fw"),$=b("HmJG"),I=b("BjJ7"),Ie=fe.a.useForm,ot={width:280,marginRight:10},ct={labelCol:{span:5},wrapperCol:{span:19}},Xe=function(Re){var Et=Re.callback,pt=Re.onCancel,$e=Ie(),Dt=Object(S.a)($e,1),Lt=Dt[0],Vt=Object(k.useRef)();function Bt(sn){Et(Object(Ee.a)(Object(Ee.a)({},sn),{},{name:Vt.current}))}function kt(sn,dt){Lt.setFieldsValue({src:"/api/attachments/".concat(sn.id,"?type=").concat(sn.content_type),type:dt.type})}function mn(sn){var dt=sn.target.files[0];Vt.current=dt.name,Te(dt,kt)}return E.a.createElement(fe.a,Object(_e.a)({form:Lt},ct,{className:"upload-image-panel",onFinish:Bt}),E.a.createElement(fe.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},E.a.createElement("div",{className:"flex-container"},E.a.createElement(fe.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},E.a.createElement(Fe.a,{style:ot})),E.a.createElement(Je,{onFileChange:mn}))),E.a.createElement(fe.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},E.a.createElement(Fe.a,{style:{width:264}})),E.a.createElement(fe.a.Item,{style:{textAlign:"right"}},E.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(Y.a,{type:"ghost",onClick:pt},"\u53D6\u6D88")))};function Je(Re){var Et=Re.onFileChange;return E.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",E.a.createElement("input",{type:"file",onChange:Et}))}function Te(Re,Et){if(!Re)throw new String("\u6CA1\u6709\u6587\u4EF6");var pt=new FormData;pt.append("editormd-image-file",Re),pt.append("file_param_name","editormd-image-file"),pt.append("byxhr","true");var $e=new window.XMLHttpRequest;$e.withCredentials=!0,$e.addEventListener("load",function(Dt){Et(JSON.parse(Dt.target.responseText),Re)},!1),$e.addEventListener("error",function(Dt){console.error(Dt)},!1),$e.open("POST","".concat(I.a,"/api/attachments.json")),$e.send(pt)}var Be=b("giR+"),Ye=b("fyUT"),tt=b("7Kak"),Ke=b("9yH6"),Pe=Ke.a.Group,ze={margin:"0 8px"},vt=function(Re){var Et=Re.callback,pt=Re.onCancel;function $e(Dt){Et(Dt)}return E.a.createElement(fe.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:$e},E.a.createElement("div",{className:"flex-container"},E.a.createElement("span",{style:ze},"\u5355\u5143\u683C\u6570\uFF1A"),E.a.createElement("span",{style:ze},"\u884C\u6570"),E.a.createElement(fe.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},E.a.createElement(Ye.a,null)),E.a.createElement("span",{style:ze},"\u5217\u6570"),E.a.createElement(fe.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},E.a.createElement(Ye.a,null))),E.a.createElement("div",{className:"flex-container",style:{marginTop:12}},E.a.createElement("span",{style:ze},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),E.a.createElement(fe.a.Item,{name:"align"},E.a.createElement(Pe,null,E.a.createElement(Ke.a,{value:"default"},E.a.createElement("i",{className:"fa fa-align-justify"})),E.a.createElement(Ke.a,{value:"left"},E.a.createElement("i",{className:"fa fa-align-left"})),E.a.createElement(Ke.a,{value:"center"},E.a.createElement("i",{className:"fa fa-align-center"})),E.a.createElement(Ke.a,{value:"right"},E.a.createElement("i",{className:"fa fa-align-right"}))))),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(Y.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(Y.a,{type:"ghost",onClick:pt},"\u53D6\u6D88")))},st=b("ErOA"),nt=b("7Cbv"),qe="link",ft="upload-image",at="code-block",it="add-table",ve="------------",mt={default:ve,left:":".concat(ve),center:":".concat(ve,":"),right:"".concat(ve,":")},et=b("9VGf"),de,ge;function z(){}var R=0,U=1e4,v="\u2581",y=`
|
|
**\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 C(Re){return/^\d+$/.test(Re)?"".concat(Re,"px"):Re}var _=navigator.platform.toUpperCase().indexOf("MAC")>=0,ne=_?"Cmd":"Ctrl",he=["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"],Ne=(de={},Object(L.a)(de,ne+"-B","bold"),Object(L.a)(de,ne+"-I","italic"),de),yt=(ge={},Object(L.a)(ge,qe,"\u6DFB\u52A0\u94FE\u63A5"),Object(L.a)(ge,at,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(L.a)(ge,ft,"\u6DFB\u52A0\u6587\u4EF6"),Object(L.a)(ge,it,"\u6DFB\u52A0\u8868\u683C"),ge),_t=We.a=function(Re){var Et=Re.defaultValue,pt=Et===void 0?"":Et,$e=Re.onChange,Dt=Re.width,Lt=Dt===void 0?"100%":Dt,Vt=Re.height,Bt=Vt===void 0?400:Vt,kt=Re.miniToolbar,mn=kt===void 0?!1:kt,sn=Re.isFocus,dt=sn===void 0?!1:sn,En=Re.watch,ln=Re.insertTemp,gn=Re.mode,_n=gn===void 0?"markdown":gn,li=Re.id,Xn=li===void 0?"markdown-editor-id":li,Nt=Re.showResizeBar,ut=Nt===void 0?!1:Nt,Fn=Re.noStorage,ui=Fn===void 0?!1:Fn,Tn=Re.showNullButton,Ot=Tn===void 0?!1:Tn,Kn=Re.hidetoolBar,hi=Kn===void 0?!1:Kn,vi=Re.fullScreen,De=vi===void 0?!1:vi,Ct=Re.onBlur,ti=Re.onCMBeforeChange,ci=Re.onFullScreen,di=Re.className,Oi=di===void 0?"":di,c=Re.disablePaste,o=c===void 0?!1:c,a=Re.placeholder,u=a===void 0?"":a,p=Re.values,h=p===void 0?"":p,F=Object(k.useState)(null),ke=Object(S.a)(F,2),re=ke[0],lt=ke[1],Me=Object(k.useState)(pt),wt=Object(S.a)(Me,2),Pt=wt[0],Wt=wt[1],Wn=Object(k.useState)(En),Hn=Object(S.a)(Wn,2),un=Hn[0],Yn=Hn[1],Xi=Object(k.useState)(De),Ln=Object(S.a)(Xi,2),Mn=Ln[0],ni=Ln[1],yi=Object(k.useState)(""),Jn=Object(S.a)(yi,2),ii=Jn[0],zn=Jn[1],fr=Object(k.useState)(0),Ki=Object(S.a)(fr,2),Nn=Ki[0],In=Ki[1],Ri=Object(k.useState)(Bt),Di=Object(S.a)(Ri,2),Pi=Di[0],qt=Di[1],jt=Object(k.useState)(!1),vn=Object(S.a)(jt,2),Ut=vn[0],yn=vn[1],Kt=Object(k.useRef)(Object(nt.a)()),bi=Object(k.useRef)(!1),rn=Object(k.useRef)(),on=Object(k.useRef)(),ri=Object(k.useRef)(),xi=Object(k.useRef)(),Ci=Object(k.useRef)(),Ur=function(){var ht=Object(K.a)(W.a.mark(function St(){var bt,Mt;return W.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(st.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Kt.current}});case 2:Mt=Ht.sent,Mt!=null&&(bt=Mt.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",re,on),Mt.attachments.map(function(Rt){Rt.content_type.indexOf("image")>-1?re.replaceSelection(".concat(Rt.content_type,")")):Rt.content_type.indexOf("video")>-1?re.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Rt.content_type.indexOf("pdf")>-1?re.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,'&disposition=inline" target="_blank">').concat(Rt.name,"</a>")):re.replaceSelection("[".concat(Rt.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}));case 4:case"end":return Ht.stop()}},St)}));return function(){return ht.apply(this,arguments)}}();Object(k.useEffect)(function(){Wt(h),re==null||re.setValue(h)},[h]),Object(k.useEffect)(function(){ci==null||ci(Mn)},[Mn]),Object(k.useEffect)(function(){if(on.current){var ht=H.a.fromTextArea(on.current,{mode:_n,lineNumbers:!mn,lineWrapping:!0,value:pt,autoCloseTags:!0,autoCloseBrackets:!0});dt&&ht.focus();function St(bt,Mt){if(o){Mt.preventDefault();return}var It=Mt.clipboardData;if(It){var Ht=It.types.toString(),Rt=It.items;if(Ht==="Files"||It.types.indexOf("Files")>-1){if(Mt.preventDefault(),_n=="stex")return;try{var Jt,hn=Rt[1];((Jt=Rt[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(hn=Rt[0]);var At=hn.getAsFile(),Ni=At.name.split(".").pop();Te(At,function(zt){if(zt.id){var bn,Xt,$n;(At==null||((bn=At.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?ht.replaceSelection(".concat(zt.content_type,")")):(At==null||((Xt=At.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(At==null||(($n=At.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?ht.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(At.type,'&disposition=inline" target="_blank">').concat(At.name,"</a>")):he.includes(Ni)?ht.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(At.name,"</a>")):ht.replaceSelection("[".concat(At.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})}catch(zt){te.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ht.on("paste",St),ht.on("dragleave",function(bt,Mt){ri.current.classList.remove("mouse-hover-md")}),ht.on("dragover",function(bt,Mt){ri.current.classList.add("mouse-hover-md")}),ht.on("drop",function(bt,Mt){ri.current.classList.add("mouse-hover-md");var It;if(It=Mt.dataTransfer.files,It.length>0){Mt.preventDefault(),Mt.stopPropagation();for(var Ht=function(hn){var At=It[hn],Ni=At.name.split(".").pop();Te(At,function(zt){if(zt.id){var bn,Xt,$n;(At==null||((bn=At.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?ht.replaceSelection(".concat(zt.content_type,")")):(At==null||((Xt=At.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?ht.replaceSelection('<video width="100%" controls src="'.concat(D.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(At==null||(($n=At.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?ht.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(At.type,'&disposition=inline" target="_blank">').concat(At.name,"</a>")):he.includes(Ni)?ht.replaceSelection('<a href="'.concat(D.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(At.name,"</a>")):ht.replaceSelection("[".concat(At.name,"](").concat(D.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})},Rt=0;Rt<It.length;Rt++)Ht(Rt)}}),lt(ht),function(){ht.off("paste",St)}}},[]);var Zn=Object(k.useCallback)(function(){if(ri.current)try{}catch(ht){console.log(ht,"---- to set md editor body height")}},[Pi,ri,Mn]);Object(k.useEffect)(function(){function ht(){var bt=new O.default(function(Mt){var It=Object(X.a)(Mt),Ht;try{for(It.s();!(Ht=It.n()).done;){var Rt=Ht.value;(Rt.target.offsetHeight>0||Rt.target.offsetWidth>0)&&(Zn(),re.setSize("100%","100%"),re.refresh())}}catch(Jt){It.e(Jt)}finally{It.f()}});return bt.observe(on.current.parentElement),bt}if(re){var St=ht();return function(){St.unobserve(on.current.parentElement)}}},[re,Zn]),Object(k.useEffect)(function(){if(re){for(var ht=[],St=function(){var Rt=Mt[bt];It=Object(S.a)(Rt,2);var Jt=It[0],hn=It[1],At=Object(L.a)({},Jt,function(){Yi(hn)});ht.push(At),re.addKeyMap(At)},bt=0,Mt=Object.entries(Ne);bt<Mt.length;bt++){var It;St()}return rn.current=setInterval(function(){bi.current&&Ur()},4e3),function(){clearInterval(rn.current);var Ht=Object(X.a)(ht),Rt;try{for(Ht.s();!(Rt=Ht.n()).done;){var Jt=Rt.value;re.removeKeyMap(Jt)}}catch(hn){Ht.e(hn)}finally{Ht.f()}}}},[re]),Object(k.useEffect)(function(){De!==Mn&&ni(De)},[De]),Object(et.a)(function(){if(!ui&&Nn>0){var ht=new Date().getTime(),St=window.sessionStorage.getItem(Xn);ht>=Nn+U&&(!St||St!==Pt)&&(window.sessionStorage.setItem(Xn,Pt),yn(!0))}},U),Object(k.useEffect)(function(){Yn(En)},[re,En]),Object(k.useEffect)(function(){re&&(dt&&re.focus())},[re,dt]),Object(k.useEffect)(function(){if(un&&re){var ht=re.getScrollerElement();function St(bt){var Mt=bt.target;if(Ci.current){var It=Mt.scrollTop/Mt.scrollHeight;Ci.current.scrollTop=Ci.current.scrollHeight*It}}return ht.addEventListener("scroll",St),function(){ht.removeEventListener("scroll",St)}}},[re,un]),Object(k.useEffect)(function(){if(re&&ti){function ht(St,bt){ti(St,bt)}return re.on("beforeChange",ht),function(){re.off("beforeChange",ht)}}},[re,ti]),Object(k.useEffect)(function(){if(re&&Ct){function ht(){Ct(re.getValue())}return re.on("blur",ht),function(){re.off("blur",ht)}}},[re,Ct]),Object(k.useEffect)(function(){if(re){function ht(St){var bt=St.getValue();Wt(bt),In(new Date().getTime()),St.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),$e&&$e(bt)}return re.on("change",ht),function(){re.off("change",ht)}}},[re,$e]),Object(k.useEffect)(function(){re&&(pt==null?(re.setValue(""),Wt("")):pt!==re.getValue()&&(re.setValue(pt),Wt(pt),re.setCursor(re.lineCount(),0)))},[re,pt]);var Yi=Object(k.useCallback)(function(ht){var St=re.getCursor(),bt=re.getSelection(),Mt=bt.split(`
|
|
`);switch(ht){case"bold":return re.replaceSelection("**"+bt+"**"),bt===""&&re.setCursor(St.line,St.ch+2),re.focus();case"italic":return re.replaceSelection("*"+bt+"*"),bt===""&&re.setCursor(St.line,St.ch+1),re.focus();case"code":return re.replaceSelection("`"+bt+"`"),bt===""&&re.setCursor(St.line,St.ch+1),re.focus();case"inline-latex":return re.replaceSelection("`$$"+bt+"$$`"),bt===""&&re.setCursor(St.line,St.ch+3),re.focus();case"latex":return re.replaceSelection("```latex\n"+bt+"\n```"),re.setCursor(St.line+1,bt.length+1),re.focus();case"line-break":return re.replaceSelection(`<br/>
|
|
`),re.focus();case"list-ul":return bt===""?re.replaceSelection("- "+bt):re.replaceSelection(Mt.map(function(It){return It===""?"":"- ".concat(It)}).join(`
|
|
`)),re.focus();case"list-ol":return bt===""?re.replaceSelection("1. "+bt):re.replaceSelection(Mt.map(function(It,Ht){return It===""?"":"".concat(Ht+1,". ").concat(It)}).join(`
|
|
`)),re.focus();case"add-null-ch":return bt===""&&re.setCursor(St.line,St.ch+1),re.replaceSelection(v),re.focus();case"inster-template-1":return bt===""&&re.setCursor(St.line,St.ch),re.replaceSelection(y),re.focus();case"eraser":return re.setValue(""),re.focus();case"trigger-watch":return Yn(!un),re.focus();case"trigger-full-screen":return ni(!Mn),re.focus();case qe:zn(qe);return;case at:zn(at);return;case ft:zn(ft);return;case it:zn(it);return;default:throw new Error}},[re,un,Mn]),Bn=Object(k.useCallback)(function(ht){zn("");switch(ii){case qe:var St=ht.title,bt=ht.link;return re.replaceSelection("[".concat(St,"](").concat(bt,")")),re.focus();case at:var Mt=ht.language,It=ht.content;return re.replaceSelection(["```"+Mt,It,"```"].join(`
|
|
`)),re.focus();case ft:var Ht=ht.src,Rt=ht.alt,Jt=ht.name;return Ht.indexOf("type=image")>-1?re.replaceSelection(".concat(Ht,' "').concat(Rt||"",'" )')):Ht.indexOf("type=application/pdf")>-1?re.replaceSelection('<a href="'.concat(Ht,'&disposition=inline" target="_blank">').concat(Jt,"</a>")):re.replaceSelection('<a href="'.concat(Ht,'" target="_blank">').concat(Jt,"</a>")),re.focus();case it:for(var hn=ht.row,At=ht.col,Ni=ht.align,zt=`
|
|
`,bn=0;bn<hn;bn++){for(var Xt=[],$n=[],pr=0;pr<At;pr++)bn===1&&$n.push(mt[Ni]),Xt.push(" ");bn===1&&(zt+="| ".concat($n.join(" | "),` |
|
|
`)),zt+="| ".concat(Xt.join(At===1?"":" | "),` |
|
|
`)}return re.replaceSelection(zt+`
|
|
`),re.focus();default:throw new Error}},[re,ii]),$i=Object(k.useMemo)(function(){switch(ii){case qe:return E.a.createElement(Se,{callback:Bn,onCancel:fi});case at:return E.a.createElement(xe.b,{callback:Bn,onCancel:fi});case ft:return E.a.createElement(Xe,{callback:Bn,onCancel:fi});case it:return E.a.createElement(vt,{callback:Bn,onCancel:fi});default:return null}},[ii]);function fi(){zn("")}Object(k.useEffect)(function(){if(xi.current){var ht=xi.current,St=!1,bt=0;function Mt(Rt){St=!0,bt=Rt.pageY}function It(){St=!1}function Ht(Rt){if(St){var Jt=Rt.pageY-bt;Jt<0&&(Jt=0),Jt>300&&(Jt=300);var hn=Bt+Jt+"px";qt(hn)}}return ht.addEventListener("mousedown",Mt),document.addEventListener("mousemove",Ht),document.addEventListener("mouseup",It),function(){ht.removeEventListener("mousedown",Mt),document.removeEventListener("mousemove",Ht),document.removeEventListener("mouseup",It)}}},[re,xi]),Object(k.useEffect)(function(){qt(Bt)},[Bt]);var wi=C(Lt),uo=C(Pi),ho={width:wi,height:uo},Zo=Object(k.useMemo)(function(){if(Nn){var ht=new Date(Nn),St=ht.getHours(),bt=ht.getMinutes(),Mt=ht.getSeconds();return St=St<10?"0"+St:St,bt=bt<10?"0"+bt:bt,Mt=Mt<10?"0"+Mt:Mt,"".concat(St,":").concat(bt,":").concat(Mt)}return 0},[Nn]);function Qo(){window.sessionStorage.removeItem(Xn),yn(!1),In(0)}function co(){yn(!1),In(0),re.setValue(window.sessionStorage.getItem(Xn))}function Fr(ht,St){var bt=re.getValue();bt=bt.replace(ht,St),Wt(bt),re==null||re.setValue(bt)}return E.a.createElement(k.Fragment,null,E.a.createElement("div",{className:"markdown-editor-wrapper",ref:ri},E.a.createElement("div",{className:"markdown-editor-container ".concat(Oi," ").concat(un?"on-preview":""," ").concat(mn?"mini":""," ").concat(Mn?"full-screen":""),style:ho},E.a.createElement(me,{insertTemp:ln,watch:un,fullScreen:Mn,showNullButton:Ot,onActionCallback:Yi,hidetoolBar:hi,uuid:Kt.current,setOpenPhones:function(){bi.current=!0}}),E.a.createElement("div",{className:"markdown-editor-body"},E.a.createElement("div",{className:"codemirror-container"},E.a.createElement("textarea",{ref:on,placeholder:u})),un?E.a.createElement("div",{ref:Ci,className:"preview-container"},_n==="stex"&&E.a.createElement(Oe,{value:Pt}),_n!=="stex"&&E.a.createElement(ye.a,{edit:!0,value:Pt,replaces:Fr})):null))),ut?E.a.createElement("a",{ref:xi,className:"editor-resize"}):null,E.a.createElement(w.a,null,yt[ii]?E.a.createElement(le.a,{centered:!0,title:yt[ii],visible:!0,onCancel:fi,footer:null},$i):null))}},SJMd:function(Qe,We){/**
|
|
* @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 b,P,le,X=!1,ae,te;window.PR_SHOULD_USE_CONTINUATION=!0;var K,S;(function(){var L=window,A=["break,continue,do,else,for,if,return,while"],W=[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"],k=[W,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],E=[k,"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"],V=[k,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],H=[k,"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"],O="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",G=[k,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],N="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",ie=[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"],Q=[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"],Le=[A,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],He=[E,H,V,G,N,ie,Q,Le],ue=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ye="str",Oe="kwd",oe="com",pe="typ",_e="lit",ce="pun",T="pln",se="tag",q="dec",x="src",D="atn",J="atv",j="nocode",me="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function w(Te){for(var Be=0,Ye=!1,tt=!1,Ke=0,Pe=Te.length;Ke<Pe;++Ke){var ze=Te[Ke];if(ze.ignoreCase)tt=!0;else if(/[a-z]/i.test(ze.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ye=!0,tt=!1;break}}var vt={b:8,t:9,n:10,v:11,f:12,r:13};function st(it){var ve=it.charCodeAt(0);if(ve!==92)return ve;var mt=it.charAt(1);return ve=vt[mt],ve||("0"<=mt&&mt<="7"?parseInt(it.substring(1),8):mt==="u"||mt==="x"?parseInt(it.substring(2),16):it.charCodeAt(1))}function nt(it){if(it<32)return(it<16?"\\x0":"\\x")+it.toString(16);var ve=String.fromCharCode(it);return ve==="\\"||ve==="-"||ve==="]"||ve==="^"?"\\"+ve:ve}function qe(it){var ve=it.substring(1,it.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")),mt=[],et=ve[0]==="^",de=["["];et&&de.push("^");for(var ge=et?1:0,z=ve.length;ge<z;++ge){var R=ve[ge];if(/\\[bdsw]/i.test(R))de.push(R);else{var U=st(R),v;ge+2<z&&ve[ge+1]==="-"?(v=st(ve[ge+2]),ge+=2):v=U,mt.push([U,v]),v<65||U>122||(v<65||U>90||mt.push([Math.max(65,U)|32,Math.min(v,90)|32]),v<97||U>122||mt.push([Math.max(97,U)&~32,Math.min(v,122)&~32]))}}mt.sort(function(ne,he){return ne[0]-he[0]||he[1]-ne[1]});for(var y=[],C=[],ge=0;ge<mt.length;++ge){var _=mt[ge];_[0]<=C[1]+1?C[1]=Math.max(C[1],_[1]):y.push(C=_)}for(var ge=0;ge<y.length;++ge){var _=y[ge];de.push(nt(_[0])),_[1]>_[0]&&(_[1]+1>_[0]&&de.push("-"),de.push(nt(_[1])))}return de.push("]"),de.join("")}function ft(it){for(var ve=it.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")),mt=ve.length,et=[],de=0,ge=0;de<mt;++de){var z=ve[de];if(z==="(")++ge;else if(z.charAt(0)==="\\"){var R=+z.substring(1);R&&(R<=ge?et[R]=-1:ve[de]=nt(R))}}for(var de=1;de<et.length;++de)et[de]===-1&&(et[de]=++Be);for(var de=0,ge=0;de<mt;++de){var z=ve[de];if(z==="(")++ge,et[ge]||(ve[de]="(?:");else if(z.charAt(0)==="\\"){var R=+z.substring(1);R&&R<=ge&&(ve[de]="\\"+et[R])}}for(var de=0;de<mt;++de)ve[de]==="^"&&ve[de+1]!=="^"&&(ve[de]="");if(it.ignoreCase&&Ye)for(var de=0;de<mt;++de){var z=ve[de],U=z.charAt(0);z.length>=2&&U==="["?ve[de]=qe(z):U!=="\\"&&(ve[de]=z.replace(/[a-zA-Z]/g,function(C){var _=C.charCodeAt(0);return"["+String.fromCharCode(_&~32,_|32)+"]"}))}return ve.join("")}for(var at=[],Ke=0,Pe=Te.length;Ke<Pe;++Ke){var ze=Te[Ke];if(ze.global||ze.multiline)throw new Error(""+ze);at.push("(?:"+ft(ze)+")")}return new RegExp(at.join("|"),tt?"gi":"g")}function m(Te,Be){var Ye=/(?:^|\s)nocode(?:\s|$)/,tt=[],Ke=0,Pe=[],ze=0;function vt(st){var nt=st.nodeType;if(nt==1){if(Ye.test(st.className))return;for(var qe=st.firstChild;qe;qe=qe.nextSibling)vt(qe);var ft=st.nodeName.toLowerCase();(ft==="br"||ft==="li")&&(tt[ze]=`
|
|
`,Pe[ze<<1]=Ke++,Pe[ze++<<1|1]=st)}else if(nt==3||nt==4){var at=st.nodeValue;at.length&&(Be?at=at.replace(/\r\n?/g,`
|
|
`):at=at.replace(/[ \t\r\n]+/g," "),tt[ze]=at,Pe[ze<<1]=Ke,Ke+=at.length,Pe[ze++<<1|1]=st)}}return vt(Te),{sourceCode:tt.join("").replace(/\n$/,""),spans:Pe}}function Y(Te,Be,Ye,tt,Ke){if(!Ye)return;var Pe={sourceNode:Te,pre:1,langExtension:null,numberLines:null,sourceCode:Ye,spans:null,basePos:Be,decorations:null};tt(Pe),Ke.push.apply(Ke,Pe.decorations)}var we=/\S/;function fe(Te){for(var Be=void 0,Ye=Te.firstChild;Ye;Ye=Ye.nextSibling){var tt=Ye.nodeType;Be=tt===1?Be?Te:Ye:tt===3&&we.test(Ye.nodeValue)?Te:Be}return Be===Te?void 0:Be}function Ue(Te,Be){var Ye={},tt;(function(){for(var ze=Te.concat(Be),vt=[],st={},nt=0,qe=ze.length;nt<qe;++nt){var ft=ze[nt],at=ft[3];if(at)for(var it=at.length;--it>=0;)Ye[at.charAt(it)]=ft;var ve=ft[1],mt=""+ve;st.hasOwnProperty(mt)||(vt.push(ve),st[mt]=null)}vt.push(/[\0-\uffff]/),tt=w(vt)})();var Ke=Be.length,Pe=function(ze){for(var vt=ze.sourceCode,st=ze.basePos,nt=ze.sourceNode,qe=[st,T],ft=0,at=vt.match(tt)||[],it={},ve=0,mt=at.length;ve<mt;++ve){var et=at[ve],de=it[et],ge=void 0,z;if(typeof de=="string")z=!1;else{var R=Ye[et.charAt(0)];if(R)ge=et.match(R[1]),de=R[0];else{for(var U=0;U<Ke;++U)if(R=Be[U],ge=et.match(R[1]),ge){de=R[0];break}ge||(de=T)}z=de.length>=5&&de.substring(0,5)==="lang-",z&&!(ge&&typeof ge[1]=="string")&&(z=!1,de=x),z||(it[et]=de)}var v=ft;if(ft+=et.length,!z)qe.push(st+v,de);else{var y=ge[1],C=et.indexOf(y),_=C+y.length;ge[2]&&(_=et.length-ge[2].length,C=_-y.length);var ne=de.substring(5);Y(nt,st+v,et.substring(0,C),Pe,qe),Y(nt,st+v+C,y,I(ne,y),qe),Y(nt,st+v+_,et.substring(_),Pe,qe)}}ze.decorations=qe};return Pe}function Fe(Te){var Be=[],Ye=[];Te.tripleQuotedStrings?Be.push([ye,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?Be.push([ye,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Be.push([ye,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&Ye.push([ye,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var tt=Te.hashComments;tt&&(Te.cStyleComments?(tt>1?Be.push([oe,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Be.push([oe,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ye.push([ye,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Be.push([oe,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(Ye.push([oe,/^\/\/[^\r\n]*/,null]),Ye.push([oe,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ke=Te.regexLiterals;if(Ke){var Pe=Ke>1?"":`
|
|
\r`,ze=Pe?".":"[\\S\\s]",vt="/(?=[^/*"+Pe+"])(?:[^/\\x5B\\x5C"+Pe+"]|\\x5C"+ze+"|\\x5B(?:[^\\x5C\\x5D"+Pe+"]|\\x5C"+ze+")*(?:\\x5D|$))+/";Ye.push(["lang-regex",RegExp("^"+me+"("+vt+")")])}var st=Te.types;st&&Ye.push([pe,st]);var nt=(""+Te.keywords).replace(/^ | $/g,"");nt.length&&Ye.push([Oe,new RegExp("^(?:"+nt.replace(/[\s,]+/g,"|")+")\\b"),null]),Be.push([T,/^\s+/,null,` \r
|
|
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(qe+="(?!s*/)"),Ye.push([_e,/^@[a-z_$][a-z_$@0-9]*/i,null],[pe,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[T,/^[a-z_$][a-z_$@0-9]*/i,null],[_e,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[T,/^\\[\s\S]?/,null],[ce,new RegExp(qe),null]),Ue(Be,Ye)}var be=Fe({keywords:He,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(Te,Be,Ye){for(var tt=/(?:^|\s)nocode(?:\s|$)/,Ke=/\r\n?|\n/,Pe=Te.ownerDocument,ze=Pe.createElement("li");Te.firstChild;)ze.appendChild(Te.firstChild);var vt=[ze];function st(ve){var mt=ve.nodeType;if(mt==1&&!tt.test(ve.className))if(ve.nodeName==="br")nt(ve),ve.parentNode&&ve.parentNode.removeChild(ve);else for(var et=ve.firstChild;et;et=et.nextSibling)st(et);else if((mt==3||mt==4)&&Ye){var de=ve.nodeValue,ge=de.match(Ke);if(ge){var z=de.substring(0,ge.index);ve.nodeValue=z;var R=de.substring(ge.index+ge[0].length);if(R){var U=ve.parentNode;U.insertBefore(Pe.createTextNode(R),ve.nextSibling)}nt(ve),z||ve.parentNode.removeChild(ve)}}}function nt(ve){for(;!ve.nextSibling;)if(ve=ve.parentNode,!ve)return;function mt(ge,z){var R=z?ge.cloneNode(!1):ge,U=ge.parentNode;if(U){var v=mt(U,1),y=ge.nextSibling;v.appendChild(R);for(var C=y;C;C=y)y=C.nextSibling,v.appendChild(C)}return R}for(var et=mt(ve.nextSibling,0),de;(de=et.parentNode)&&de.nodeType===1;)et=de;vt.push(et)}for(var qe=0;qe<vt.length;++qe)st(vt[qe]);Be===(Be|0)&&vt[0].setAttribute("value",Be);var ft=Pe.createElement("ol");ft.className="linenums";for(var at=Math.max(0,Be-1|0)||0,qe=0,it=vt.length;qe<it;++qe)ze=vt[qe],ze.className="L"+(qe+at)%10,ze.firstChild||ze.appendChild(Pe.createTextNode("\xA0")),ft.appendChild(ze);Te.appendChild(ft)}function xe(Te){var Be=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Be=Be&&+Be[1]<=8;var Ye=/\n/g,tt=Te.sourceCode,Ke=tt.length,Pe=0,ze=Te.spans,vt=ze.length,st=0,nt=Te.decorations,qe=nt.length,ft=0;nt[qe]=Ke;var at,it;for(it=at=0;it<qe;)nt[it]!==nt[it+2]?(nt[at++]=nt[it++],nt[at++]=nt[it++]):it+=2;for(qe=at,it=at=0;it<qe;){for(var ve=nt[it],mt=nt[it+1],et=it+2;et+2<=qe&&nt[et+1]===mt;)et+=2;nt[at++]=ve,nt[at++]=mt,it=et}qe=nt.length=at;var de=Te.sourceNode,ge="";de&&(ge=de.style.display,de.style.display="none");try{for(var z=null;st<vt;){var R=ze[st],U=ze[st+2]||Ke,v=nt[ft+2]||Ke,et=Math.min(U,v),y=ze[st+1],C;if(y.nodeType!==1&&(C=tt.substring(Pe,et))){Be&&(C=C.replace(Ye,"\r")),y.nodeValue=C;var _=y.ownerDocument,ne=_.createElement("span");ne.className=nt[ft+1];var he=y.parentNode;he.replaceChild(ne,y),ne.appendChild(y),Pe<U&&(ze[st+1]=y=_.createTextNode(tt.substring(et,U)),he.insertBefore(y,ne.nextSibling))}Pe=et,Pe>=U&&(st+=2),Pe>=v&&(ft+=2)}}finally{de&&(de.style.display=ge)}}var Ee={};function $(Te,Be){for(var Ye=Be.length;--Ye>=0;){var tt=Be[Ye];Ee.hasOwnProperty(tt)?L.console&&console.warn("cannot override language handler %s",tt):Ee[tt]=Te}}function I(Te,Be){return Te&&Ee.hasOwnProperty(Te)||(Te=/^\s*</.test(Be)?"default-markup":"default-code"),Ee[Te]}$(be,["default-code"]),$(Ue([],[[T,/^[^<?]+/],[q,/^<!\w[^>]*(?:>|$)/],[oe,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[ce,/^(?:<[%?]|[%?]>)/],["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"]),$(Ue([[T,/^[\s]+/,null,` \r
|
|
`],[J,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[se,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[D,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[ce,/^[=<>\/]+/],["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"]),$(Ue([],[[J,/^[\s\S]+/]]),["uq.val"]),$(Fe({keywords:E,hashComments:!0,cStyleComments:!0,types:ue}),["c","cc","cpp","cxx","cyc","m"]),$(Fe({keywords:"null,true,false"}),["json"]),$(Fe({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:ue}),["cs"]),$(Fe({keywords:V,cStyleComments:!0}),["java"]),$(Fe({keywords:Le,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),$(Fe({keywords:ie,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),$(Fe({keywords:N,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),$(Fe({keywords:Q,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),$(Fe({keywords:G,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),$(Fe({keywords:O,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),$(Ue([],[[ye,/^[\s\S]+/]]),["regex"]);function Ie(Te){var Be=Te.langExtension;try{var Ye=m(Te.sourceNode,Te.pre),tt=Ye.sourceCode;Te.sourceCode=tt,Te.spans=Ye.spans,Te.basePos=0,I(Be,tt)(Te),xe(Te)}catch(Ke){L.console&&console.log(Ke&&Ke.stack||Ke)}}function ot(Te,Be,Ye){var tt=Ye||!1,Ke=Be||null,Pe=document.createElement("div");Pe.innerHTML="<pre>"+Te+"</pre>",Pe=Pe.firstChild,tt&&Se(Pe,tt,!0);var ze={langExtension:Ke,numberLines:tt,sourceNode:Pe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ie(ze),Pe.innerHTML}function ct(Te,Be){var Ye=Be||document.body,tt=Ye.ownerDocument||document;function Ke(R){return Ye.getElementsByTagName(R)}for(var Pe=[Ke("pre"),Ke("code"),Ke("xmp")],ze=[],vt=0;vt<Pe.length;++vt)for(var st=0,nt=Pe[vt].length;st<nt;++st)ze.push(Pe[vt][st]);Pe=null;var qe=Date;qe.now||(qe={now:function(){return+new Date}});var ft=0,at=/\blang(?:uage)?-([\w.]+)(?!\S)/,it=/\bprettyprint\b/,ve=/\bprettyprinted\b/,mt=/pre|xmp/i,et=/^code$/i,de=/^(?:pre|code|xmp)$/i,ge={};function z(){for(var R=L.PR_SHOULD_USE_CONTINUATION?qe.now()+250:Infinity;ft<ze.length&&qe.now()<R;ft++){for(var U=ze[ft],v=ge,y=U;y=y.previousSibling;){var C=y.nodeType,_=(C===7||C===8)&&y.nodeValue;if(_?!/^\??prettify\b/.test(_):C!==3||/\S/.test(y.nodeValue))break;if(_){v={},_.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Bt,kt,mn){v[kt]=mn});break}}var ne=U.className;if((v!==ge||it.test(ne))&&!ve.test(ne)){for(var he=!1,Ne=U.parentNode;Ne;Ne=Ne.parentNode){var yt=Ne.tagName;if(de.test(yt)&&Ne.className&&it.test(Ne.className)){he=!0;break}}if(!he){U.className+=" prettyprinted";var _t=v.lang;if(!_t){_t=ne.match(at);var Re;!_t&&(Re=fe(U))&&et.test(Re.tagName)&&(_t=Re.className.match(at)),_t&&(_t=_t[1])}var Et;if(mt.test(U.tagName))Et=1;else{var pt=U.currentStyle,$e=tt.defaultView,Dt=pt?pt.whiteSpace:$e&&$e.getComputedStyle?$e.getComputedStyle(U,null).getPropertyValue("white-space"):0;Et=Dt&&Dt.substring(0,3)==="pre"}var Lt=v.linenums;(Lt=Lt==="true"||+Lt)||(Lt=ne.match(/\blinenums\b(?::(\d+))?/),Lt=Lt?Lt[1]&&Lt[1].length?+Lt[1]:!0:!1),Lt&&Se(U,Lt,Et);var Vt={langExtension:_t,sourceNode:U,numberLines:Lt,pre:Et,sourceCode:null,basePos:null,spans:null,decorations:null};Ie(Vt)}}}ft<ze.length?L.setTimeout(z,250):typeof Te=="function"&&Te()}z()}var Xe=L.PR={createSimpleLexer:Ue,registerLangHandler:$,sourceDecorator:Fe,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:J,PR_COMMENT:oe,PR_DECLARATION:q,PR_KEYWORD:Oe,PR_LITERAL:_e,PR_NOCODE:j,PR_PLAIN:T,PR_PUNCTUATION:ce,PR_SOURCE:x,PR_STRING:ye,PR_TAG:se,PR_TYPE:pe,prettyPrintOne:X?L.prettyPrintOne=ot:K=ot,prettyPrint:S=X?L.prettyPrint=ct:S=ct},Je=L.define;typeof Je=="function"&&Je.amd&&Je("google-code-prettify",[],function(){return Xe})})()},UUDw:function(Qe,We,b){Qe.exports={buttonFixed:"buttonFixed___2zLVJ",button:"button___-JgFH",buttonWrap:"buttonWrap___aZhhk"}},UqFu:function(Qe,We,b){"use strict";b.d(We,"a",function(){return P});var P=function(X){var ae=document.createElement("textarea");return ae.value=X,ae.value}},"VrN/":function(Qe,We,b){(function(P,le){Qe.exports=le()})(this,function(){"use strict";var P=navigator.userAgent,le=navigator.platform,X=/gecko\/\d/i.test(P),ae=/MSIE \d/.test(P),te=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(P),K=/Edge\/(\d+)/.exec(P),S=ae||te||K,L=S&&(ae?document.documentMode||6:+(K||te)[1]),A=!K&&/WebKit\//.test(P),W=A&&/Qt\/\d+\.\d+/.test(P),k=!K&&/Chrome\//.test(P),E=/Opera\//.test(P),V=/Apple Computer/.test(navigator.vendor),H=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(P),O=/PhantomJS/.test(P),G=!K&&/AppleWebKit/.test(P)&&/Mobile\/\w+/.test(P),N=/Android/.test(P),ie=G||N||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(P),Q=G||/Mac/.test(le),Le=/\bCrOS\b/.test(P),He=/win/i.test(le),ue=E&&P.match(/Version\/(\d*\.\d*)/);ue&&(ue=Number(ue[1])),ue&&ue>=15&&(E=!1,A=!0);var ye=Q&&(W||E&&(ue==null||ue<12.11)),Oe=X||S&&L>=9;function oe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var pe=function(e,t){var i=e.className,n=oe(t).exec(i);if(n){var r=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(r?n[1]+r:"")}};function _e(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ce(e,t){return _e(e).appendChild(t)}function T(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)r.appendChild(t[s]);return r}function se(e,t,i,n){var r=T(e,t,i,n);return r.setAttribute("role","presentation"),r}var q;document.createRange?q=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:q=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function x(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 D(){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 J(e,t){var i=e.className;oe(t).test(i)||(e.className+=(i?" ":"")+t)}function j(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!oe(i[n]).test(t)&&(t+=" "+i[n]);return t}var me=function(e){e.select()};G?me=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:S&&(me=function(e){try{e.select()}catch(t){}});function w(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function m(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function Y(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=r||0;;){var d=e.indexOf(" ",s);if(d<0||d>=t)return l+(t-s);l+=d-s,l+=i-l%i,s=d+1}}var we=function(){this.id=null,this.f=null,this.time=0,this.handler=w(this.onTimeout,this)};we.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},we.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function fe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ue=50,Fe={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},Se={origin:"*mouse"},xe={origin:"+move"};function Ee(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||r+l>=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var $=[""];function I(e){for(;$.length<=e;)$.push(Ie($)+" ");return $[e]}function Ie(e){return e[e.length-1]}function ot(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function ct(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function Xe(){}function Je(e,t){var i;return Object.create?i=Object.create(e):(Xe.prototype=e,i=new Xe),t&&m(t,i),i}var Te=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Be(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Te.test(e))}function Ye(e,t){return t?t.source.indexOf("\\w")>-1&&Be(e)?!0:t.test(e):Be(e)}function tt(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ke=/[\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 Pe(e){return e.charCodeAt(0)>=768&&Ke.test(e)}function ze(e,t,i){for(;(i<0?t>0:t<e.length)&&Pe(e.charAt(t));)t+=i;return t}function vt(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var r=(t+i)/2,s=n<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function st(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var nt=null;function qe(e,t,i){var n;nt=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:nt=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:nt=r)}return n!=null?n:nt}var ft=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(g){return g<=247?e.charAt(g):1424<=g&&g<=1524?"R":1536<=g&&g<=1785?t.charAt(g-1536):1774<=g&&g<=2220?"r":8192<=g&&g<=8203?"w":g==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,d=/[1n]/;function f(g,M,B){this.level=g,this.from=M,this.to=B}return function(g,M){var B=M=="ltr"?"L":"R";if(g.length==0||M=="ltr"&&!n.test(g))return!1;for(var ee=g.length,Z=[],Ce=0;Ce<ee;++Ce)Z.push(i(g.charCodeAt(Ce)));for(var Ae=0,je=B;Ae<ee;++Ae){var Ge=Z[Ae];Ge=="m"?Z[Ae]=je:je=Ge}for(var Ze=0,Ve=B;Ze<ee;++Ze){var rt=Z[Ze];rt=="1"&&Ve=="r"?Z[Ze]="n":s.test(rt)&&(Ve=rt,rt=="r"&&(Z[Ze]="R"))}for(var xt=1,gt=Z[0];xt<ee-1;++xt){var Tt=Z[xt];Tt=="+"&>=="1"&&Z[xt+1]=="1"?Z[xt]="1":Tt==","&>==Z[xt+1]&&(gt=="1"||gt=="n")&&(Z[xt]=gt),gt=Tt}for(var Yt=0;Yt<ee;++Yt){var fn=Z[Yt];if(fn==",")Z[Yt]="N";else if(fn=="%"){var Zt=void 0;for(Zt=Yt+1;Zt<ee&&Z[Zt]=="%";++Zt);for(var Un=Yt&&Z[Yt-1]=="!"||Zt<ee&&Z[Zt]=="1"?"1":"N",Rn=Yt;Rn<Zt;++Rn)Z[Rn]=Un;Yt=Zt-1}}for(var tn=0,Dn=B;tn<ee;++tn){var xn=Z[tn];Dn=="L"&&xn=="1"?Z[tn]="L":s.test(xn)&&(Dn=xn)}for(var an=0;an<ee;++an)if(r.test(Z[an])){var nn=void 0;for(nn=an+1;nn<ee&&r.test(Z[nn]);++nn);for(var Qt=(an?Z[an-1]:B)=="L",Pn=(nn<ee?Z[nn]:B)=="L",cr=Qt==Pn?Qt?"L":"R":B,Ai=an;Ai<nn;++Ai)Z[Ai]=cr;an=nn-1}for(var wn=[],si,pn=0;pn<ee;)if(l.test(Z[pn])){var $o=pn;for(++pn;pn<ee&&l.test(Z[pn]);++pn);wn.push(new f(0,$o,pn))}else{var gi=pn,Gi=wn.length,Vi=M=="rtl"?1:0;for(++pn;pn<ee&&Z[pn]!="L";++pn);for(var kn=gi;kn<pn;)if(d.test(Z[kn])){gi<kn&&(wn.splice(Gi,0,new f(1,gi,kn)),Gi+=Vi);var dr=kn;for(++kn;kn<pn&&d.test(Z[kn]);++kn);wn.splice(Gi,0,new f(2,dr,kn)),Gi+=Vi,gi=kn}else++kn;gi<pn&&wn.splice(Gi,0,new f(1,gi,pn))}return M=="ltr"&&(wn[0].level==1&&(si=g.match(/^\s+/))&&(wn[0].from=si[0].length,wn.unshift(new f(0,0,si[0].length))),Ie(wn).level==1&&(si=g.match(/\s+$/))&&(Ie(wn).to-=si[0].length,wn.push(new f(0,ee-si[0].length,ee)))),M=="rtl"?wn.reverse():wn}}();function at(e,t){var i=e.order;return i==null&&(i=e.order=ft(e.text,t)),i}var it=[],ve=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||it).concat(i)}};function mt(e,t){return e._handlers&&e._handlers[t]||it}function et(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=fe(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function de(e,t){var i=mt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)}function ge(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),de(e,i||t.type,e,t),C(t)||t.codemirrorIgnore}function z(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)fe(i,t[n])==-1&&i.push(t[n])}function R(e,t){return mt(e,t).length>0}function U(e){e.prototype.on=function(t,i){ve(this,t,i)},e.prototype.off=function(t,i){et(this,t,i)}}function v(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function y(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function C(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function _(e){v(e),y(e)}function ne(e){return e.target||e.srcElement}function he(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),Q&&e.ctrlKey&&t==1&&(t=3),t}var Ne=function(){if(S&&L<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}(),yt;function _t(e){if(yt==null){var t=T("span","\u200B");ce(e,T("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(S&&L<8))}var i=yt?T("span","\u200B"):T("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Re;function Et(e){if(Re!=null)return Re;var t=ce(e,document.createTextNode("A\u062EA")),i=q(t,0,1).getBoundingClientRect(),n=q(t,1,2).getBoundingClientRect();return _e(e),!i||i.left==i.right?!1:Re=n.right-i.right<3}var pt=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(`
|
|
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},$e=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(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Dt=function(){var e=T("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Lt=null;function Vt(e){if(Lt!=null)return Lt;var t=ce(e,T("span","x")),i=t.getBoundingClientRect(),n=q(t,0,1).getBoundingClientRect();return Lt=Math.abs(i.left-n.left)>1}var Bt={},kt={};function mn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Bt[e]=t}function sn(e,t){kt[e]=t}function dt(e){if(typeof e=="string"&&kt.hasOwnProperty(e))e=kt[e];else if(e&&typeof e.name=="string"&&kt.hasOwnProperty(e.name)){var t=kt[e.name];typeof t=="string"&&(t={name:t}),e=Je(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return dt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return dt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function En(e,t){t=dt(t);var i=Bt[t.name];if(!i)return En(e,"text/plain");var n=i(e,t);if(ln.hasOwnProperty(t.name)){var r=ln[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=r[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var ln={};function gn(e,t){var i=ln.hasOwnProperty(e)?ln[e]:ln[e]={};m(t,i)}function _n(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function li(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Xn(e,t,i){return e.startState?e.startState(t,i):!0}var Nt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Nt.prototype.eol=function(){return this.pos>=this.string.length},Nt.prototype.sol=function(){return this.pos==this.lineStart},Nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Nt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Nt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Nt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Nt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Nt.prototype.skipToEnd=function(){this.pos=this.string.length},Nt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Nt.prototype.backUp=function(e){this.pos-=e},Nt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Y(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Nt.prototype.indentation=function(){return Y(this.string,null,this.tabSize)-(this.lineStart?Y(this.string,this.lineStart,this.tabSize):0)},Nt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(n(r)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Nt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Nt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Nt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ut(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 i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t<s){i=r;break}t-=s}return i.lines[t]}function Fn(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;r==i.line&&(l=l.slice(0,i.ch)),r==t.line&&(l=l.slice(t.ch)),n.push(l),++r}),n}function ui(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function Tn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Ot(e){if(e.parent==null)return null;for(var t=e.parent,i=fe(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;!(n.children[r]==t);++r)i+=n.children[r].chunkSize();return i+t.first}function Kn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var d=e.lines[l],f=d.height;if(t<f)break;t-=f}return i+l}function hi(e,t){return t>=e.first&&t<e.first+e.size}function vi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function De(e,t,i){if(i===void 0&&(i=null),!(this instanceof De))return new De(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function ti(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function ci(e){return De(e.line,e.ch)}function di(e,t){return Ct(e,t)<0?t:e}function Oi(e,t){return Ct(e,t)<0?e:t}function c(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function o(e,t){if(t.line<e.first)return De(e.first,0);var i=e.first+e.size-1;return t.line>i?De(i,ut(e,i).text.length):a(t,ut(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?De(e.line,t):i<0?De(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var p=function(e,t){this.state=e,this.lookAhead=t},h=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};h.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},h.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}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,i){return t instanceof p?new h(e,_n(e.mode,t.state),i,t.lookAhead):new h(e,_n(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?_n(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new p(t,this.maxLookAhead):t};function F(e,t,i,n){var r=[e.state.modeGen],s={};Hn(e,t.text,e.doc.mode,i,function(g,M){return r.push(g,M)},s,n);for(var l=i.state,d=function(g){i.baseTokens=r;var M=e.state.overlays[g],B=1,ee=0;i.state=!0,Hn(e,t.text,M.mode,i,function(Z,Ce){for(var Ae=B;ee<Z;){var je=r[B];je>Z&&r.splice(B,1,Z,r[B+1],je),B+=2,ee=Math.min(Z,je)}if(!Ce)return;if(M.opaque)r.splice(Ae,B-Ae,Z,"overlay "+Ce),B=Ae+2;else for(;Ae<B;Ae+=2){var Ge=r[Ae+1];r[Ae+1]=(Ge?Ge+" ":"")+"overlay "+Ce}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},f=0;f<e.state.overlays.length;++f)d(f);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function ke(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=re(e,Ot(t)),r=t.text.length>e.options.maxHighlightLength&&_n(e.doc.mode,n.state),s=F(e,t,n);r&&(n.state=r),t.stateAfter=n.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function re(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=un(e,t,i),l=s>n.first&&ut(n,s-1).stateAfter,d=l?h.fromSaved(n,l,s):new h(n,Xn(n.mode),s);return n.iter(s,t,function(f){lt(e,f.text,d);var g=d.line;f.stateAfter=g==t-1||g%5==0||g>=r.viewFrom&&g<r.viewTo?d.save():null,d.nextLine()}),i&&(n.modeFrontier=d.line),d}function lt(e,t,i,n){var r=e.doc.mode,s=new Nt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Me(r,i.state);!s.eol();)wt(r,s,i.state),s.start=s.pos}function Me(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=li(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function wt(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=li(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var Pt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Wt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var d=ut(r,t.line),f=re(e,t.line,i),g=new Nt(d.text,e.options.tabSize,f),M;for(n&&(M=[]);(n||g.pos<t.ch)&&!g.eol();)g.start=g.pos,l=wt(s,g,f.state),n&&M.push(new Pt(g,l,_n(r.mode,f.state)));return n?M:new Pt(g,l,f.state)}function Wn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Hn(e,t,i,n,r,s,l){var d=i.flattenSpans;d==null&&(d=e.options.flattenSpans);var f=0,g=null,M=new Nt(t,e.options.tabSize,n),B,ee=e.options.addModeClass&&[null];for(t==""&&Wn(Me(i,n.state),s);!M.eol();){if(M.pos>e.options.maxHighlightLength?(d=!1,l&<(e,t,n,M.pos),M.pos=t.length,B=null):B=Wn(wt(i,M,n.state,ee),s),ee){var Z=ee[0].name;Z&&(B="m-"+(B?Z+" "+B:Z))}if(!d||g!=B){for(;f<M.start;)f=Math.min(M.start,f+5e3),r(f,g);g=B}M.start=M.pos}for(;f<M.pos;){var Ce=Math.min(M.pos,f+5e3);r(Ce,g),f=Ce}}function un(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),d=t;d>l;--d){if(d<=s.first)return s.first;var f=ut(s,d-1),g=f.stateAfter;if(g&&(!i||d+(g instanceof p?g.lookAhead:0)<=s.modeFrontier))return d;var M=Y(f.text,null,e.options.tabSize);(r==null||n>M)&&(r=d-1,n=M)}return r}function Yn(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var r=ut(e,n).stateAfter;if(r&&(!(r instanceof p)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Xi=!1,Ln=!1;function Mn(){Xi=!0}function ni(){Ln=!0}function yi(e,t,i){this.marker=e,this.from=t,this.to=i}function Jn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function ii(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function zn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function fr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,d=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(d||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new yi(l,s.from,f?null:s.to))}}return n}function Ki(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,d=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(d||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new yi(l,f?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Nn(e,t){if(t.full)return null;var i=hi(e,t.from.line)&&ut(e,t.from.line).markedSpans,n=hi(e,t.to.line)&&ut(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=Ct(t.from,t.to)==0,d=fr(i,r,l),f=Ki(n,s,l),g=t.text.length==1,M=Ie(t.text).length+(g?r:0);if(d)for(var B=0;B<d.length;++B){var ee=d[B];if(ee.to==null){var Z=Jn(f,ee.marker);Z?g&&(ee.to=Z.to==null?null:Z.to+M):ee.to=r}}if(f)for(var Ce=0;Ce<f.length;++Ce){var Ae=f[Ce];if(Ae.to!=null&&(Ae.to+=M),Ae.from==null){var je=Jn(d,Ae.marker);je||(Ae.from=M,g&&(d||(d=[])).push(Ae))}else Ae.from+=M,g&&(d||(d=[])).push(Ae)}d&&(d=In(d)),f&&f!=d&&(f=In(f));var Ge=[d];if(!g){var Ze=t.text.length-2,Ve;if(Ze>0&&d)for(var rt=0;rt<d.length;++rt)d[rt].to==null&&(Ve||(Ve=[])).push(new yi(d[rt].marker,null,null));for(var xt=0;xt<Ze;++xt)Ge.push(Ve);Ge.push(f)}return Ge}function In(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ri(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Z){if(Z.markedSpans)for(var Ce=0;Ce<Z.markedSpans.length;++Ce){var Ae=Z.markedSpans[Ce].marker;Ae.readOnly&&(!n||fe(n,Ae)==-1)&&(n||(n=[])).push(Ae)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],d=l.find(0),f=0;f<r.length;++f){var g=r[f];if(Ct(g.to,d.from)<0||Ct(g.from,d.to)>0)continue;var M=[f,1],B=Ct(g.from,d.from),ee=Ct(g.to,d.to);(B<0||!l.inclusiveLeft&&!B)&&M.push({from:g.from,to:d.from}),(ee>0||!l.inclusiveRight&&!ee)&&M.push({from:d.to,to:g.to}),r.splice.apply(r,M),f+=M.length-3}return r}function Di(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Pi(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function qt(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function vn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=Ct(n.from,r.from)||qt(e)-qt(t);if(s)return-s;var l=Ct(n.to,r.to)||jt(e)-jt(t);return l||t.id-e.id}function Ut(e,t){var i=Ln&&e.markedSpans,n;if(i)for(var r=void 0,s=0;s<i.length;++s)r=i[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!n||vn(n,r.marker)<0)&&(n=r.marker);return n}function yn(e){return Ut(e,!0)}function Kt(e){return Ut(e,!1)}function bi(e,t){var i=Ln&&e.markedSpans,n;if(i)for(var r=0;r<i.length;++r){var s=i[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||vn(n,s.marker)<0)&&(n=s.marker)}return n}function rn(e,t,i,n,r){var s=ut(e,t),l=Ln&&s.markedSpans;if(l)for(var d=0;d<l.length;++d){var f=l[d];if(!f.marker.collapsed)continue;var g=f.marker.find(0),M=Ct(g.from,i)||qt(f.marker)-qt(r),B=Ct(g.to,n)||jt(f.marker)-jt(r);if(M>=0&&B<=0||M<=0&&B>=0)continue;if(M<=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?Ct(g.to,i)>=0:Ct(g.to,i)>0)||M>=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?Ct(g.from,n)<=0:Ct(g.from,n)<0))return!0}}function on(e){for(var t;t=yn(e);)e=t.find(-1,!0).line;return e}function ri(e){for(var t;t=Kt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Kt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Ci(e,t){var i=ut(e,t),n=on(i);return i==n?t:Ot(n)}function Ur(e,t){if(t>e.lastLine())return t;var i=ut(e,t),n;if(!Zn(e,i))return t;for(;n=Kt(i);)i=n.find(1,!0).line;return Ot(i)+1}function Zn(e,t){var i=Ln&&t.markedSpans;if(i)for(var n=void 0,r=0;r<i.length;++r){if(n=i[r],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Yi(e,t,n))return!0}}function Yi(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return Yi(e,n.line,Jn(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&Yi(e,t,r))return!0}function Bn(e){e=on(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var d=s.children[l];if(d==i)break;t+=d.height}return t}function $i(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=yn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Kt(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function fi(e){var t=e.display,i=e.doc;t.maxLine=ut(i,i.first),t.maxLineLength=$i(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=$i(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var wi=function(e,t,i){this.text=e,Pi(this,t),this.height=i?i(this):1};wi.prototype.lineNo=function(){return Ot(this)},U(wi);function uo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Di(e),Pi(e,i);var r=n?n(e):1;r!=e.height&&Tn(e,r)}function ho(e){e.parent=null,Di(e)}var Zo={},Qo={};function co(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:Zo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Fr(e,t){var i=se("span",null,null,A?"padding-right: .1px":null),n={pre:se("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;n.pos=0,n.addToken=St,Et(e.display.measure)&&(l=at(s,e.doc.direction))&&(n.addToken=Mt(n.addToken,l)),n.map=[];var d=t!=e.display.externalMeasured&&Ot(s);Ht(s,n,ke(e,s,d)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=j(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=j(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(_t(e.display.measure))),r==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 f=n.content.lastChild;(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return de(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=j(n.pre.className,n.textClass||"")),n}function ht(e){var t=T("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function St(e,t,i,n,r,s,l){if(!t)return;var d=e.splitSpaces?bt(t,e.trailingSpace):t,f=e.cm.state.specialChars,g=!1,M;if(!f.test(t))e.col+=t.length,M=document.createTextNode(d),e.map.push(e.pos,e.pos+t.length,M),S&&L<9&&(g=!0),e.pos+=t.length;else{M=document.createDocumentFragment();for(var B=0;;){f.lastIndex=B;var ee=f.exec(t),Z=ee?ee.index-B:t.length-B;if(Z){var Ce=document.createTextNode(d.slice(B,B+Z));S&&L<9?M.appendChild(T("span",[Ce])):M.appendChild(Ce),e.map.push(e.pos,e.pos+Z,Ce),e.col+=Z,e.pos+=Z}if(!ee)break;B+=Z+1;var Ae=void 0;if(ee[0]==" "){var je=e.cm.options.tabSize,Ge=je-e.col%je;Ae=M.appendChild(T("span",I(Ge),"cm-tab")),Ae.setAttribute("role","presentation"),Ae.setAttribute("cm-text"," "),e.col+=Ge}else ee[0]=="\r"||ee[0]==`
|
|
`?(Ae=M.appendChild(T("span",ee[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ae.setAttribute("cm-text",ee[0]),e.col+=1):(Ae=e.cm.options.specialCharPlaceholder(ee[0]),Ae.setAttribute("cm-text",ee[0]),S&&L<9?M.appendChild(T("span",[Ae])):M.appendChild(Ae),e.col+=1);e.map.push(e.pos,e.pos+1,Ae),e.pos++}}if(e.trailingSpace=d.charCodeAt(t.length-1)==32,i||n||r||g||s||l){var Ze=i||"";n&&(Ze+=n),r&&(Ze+=r);var Ve=T("span",[M],Ze,s);if(l)for(var rt in l)l.hasOwnProperty(rt)&&rt!="style"&&rt!="class"&&Ve.setAttribute(rt,l[rt]);return e.content.appendChild(Ve)}e.content.appendChild(M)}function bt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&i&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function Mt(e,t){return function(i,n,r,s,l,d,f){r=r?r+" cm-force-border":"cm-force-border";for(var g=i.pos,M=g+n.length;;){for(var B=void 0,ee=0;ee<t.length&&!(B=t[ee],B.to>g&&B.from<=g);ee++);if(B.to>=M)return e(i,n,r,s,l,d,f);e(i,n.slice(0,B.to-g),r,s,null,d,f),s=null,n=n.slice(B.to-g),g=B.to}}}function It(e,t,i,n){var r=!n&&i.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!n&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",i.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Ht(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),co(i[l+1],t.cm.options));return}for(var d=r.length,f=0,g=1,M="",B,ee,Z=0,Ce,Ae,je,Ge,Ze;;){if(Z==f){Ce=Ae=je=ee="",Ze=null,Ge=null,Z=Infinity;for(var Ve=[],rt=void 0,xt=0;xt<n.length;++xt){var gt=n[xt],Tt=gt.marker;if(Tt.type=="bookmark"&>.from==f&&Tt.widgetNode)Ve.push(Tt);else if(gt.from<=f&&(gt.to==null||gt.to>f||Tt.collapsed&>.to==f&>.from==f)){if(gt.to!=null&>.to!=f&&Z>gt.to&&(Z=gt.to,Ae=""),Tt.className&&(Ce+=" "+Tt.className),Tt.css&&(ee=(ee?ee+";":"")+Tt.css),Tt.startStyle&>.from==f&&(je+=" "+Tt.startStyle),Tt.endStyle&>.to==Z&&(rt||(rt=[])).push(Tt.endStyle,gt.to),Tt.title&&((Ze||(Ze={})).title=Tt.title),Tt.attributes)for(var Yt in Tt.attributes)(Ze||(Ze={}))[Yt]=Tt.attributes[Yt];Tt.collapsed&&(!Ge||vn(Ge.marker,Tt)<0)&&(Ge=gt)}else gt.from>f&&Z>gt.from&&(Z=gt.from)}if(rt)for(var fn=0;fn<rt.length;fn+=2)rt[fn+1]==Z&&(Ae+=" "+rt[fn]);if(!Ge||Ge.from==f)for(var Zt=0;Zt<Ve.length;++Zt)It(t,0,Ve[Zt]);if(Ge&&(Ge.from||0)==f){if(It(t,(Ge.to==null?d+1:Ge.to)-f,Ge.marker,Ge.from==null),Ge.to==null)return;Ge.to==f&&(Ge=!1)}}if(f>=d)break;for(var Un=Math.min(d,Z);;){if(M){var Rn=f+M.length;if(!Ge){var tn=Rn>Un?M.slice(0,Un-f):M;t.addToken(t,tn,B?B+Ce:Ce,je,f+tn.length==Z?Ae:"",ee,Ze)}if(Rn>=Un){M=M.slice(Un-f),f=Un;break}f=Rn,je=""}M=r.slice(s,s=i[g++]),B=co(i[g++],t.cm.options)}}}function Rt(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Ot(Ie(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Zn(e,t)}function Jt(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Rt(e.doc,ut(e.doc,s),s);r=s+l.size,n.push(l)}return n}var hn=null;function At(e){hn?hn.ops.push(e):e.ownsGroup=hn={ops:[e],delayedCallbacks:[]}}function Ni(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(i<t.length)}function zt(e,t){var i=e.ownsGroup;if(!i)return;try{Ni(i)}finally{hn=null,t(i)}}var bn=null;function Xt(e,t){var i=mt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;hn?r=hn.delayedCallbacks:bn?r=bn:(r=bn=[],setTimeout($n,0));for(var s=function(d){r.push(function(){return i[d].apply(null,n)})},l=0;l<i.length;++l)s(l)}function $n(){var e=bn;bn=null;for(var t=0;t<e.length;++t)e[t]()}function pr(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ps(e,t):s=="gutter"?ea(e,t,i,n):s=="class"?fo(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),S&&L<8&&(e.node.style.zIndex=2)),e.node}function Ds(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=mr(t);t.background=n.insertBefore(T("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function qo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Fr(e,t)}function Ps(e,t){var i=t.text.className,n=qo(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,fo(e,t)):i&&(t.text.className=i)}function fo(e,t){Ds(e,t),t.line.wrapClass?mr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ea(e,t,i,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 r=mr(t);t.gutterBackground=T("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),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=mr(t),d=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(d),l.insertBefore(d,t.text),t.line.gutterClass&&(d.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=d.appendChild(T("div",vi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var f=0;f<e.display.gutterSpecs.length;++f){var g=e.display.gutterSpecs[f].className,M=s.hasOwnProperty(g)&&s[g];M&&d.appendChild(T("div",[M],"CodeMirror-gutter-elt","left: "+n.gutterLeft[g]+"px; width: "+n.gutterWidth[g]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=oe("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ta(e,t,i)}function Is(e,t,i,n){var r=qo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),fo(e,t),ea(e,t,i,n),ta(e,t,n),t.node}function ta(e,t,i){if(na(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)na(e,t.rest[n],t,i,!1)}function na(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),l=0,d=t.widgets;l<d.length;++l){var f=d[l],g=T("div",[f.node],"CodeMirror-linewidget"+(f.className?" "+f.className:""));f.handleMouseEvents||g.setAttribute("cm-ignore-events","true"),Bs(f,g,i,n),e.display.input.setUneditable(g),r&&f.above?s.insertBefore(g,i.gutter||i.text):s.appendChild(g),Xt(f,"redraw")}}function Bs(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),ce(t.display.measure,T("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=ne(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Wr(e){return e.lineSpace.offsetTop}function po(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=ce(e.measure,T("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function oi(e){return Ue-e.display.nativeBarWidth}function Ii(e){return e.display.scroller.clientWidth-oi(e)-e.display.barWidth}function mo(e){return e.display.scroller.clientHeight-oi(e)-e.display.barHeight}function js(e,t,i){var n=e.options.lineWrapping,r=n&&Ii(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),d=0;d<l.length-1;d++){var f=l[d],g=l[d+1];Math.abs(f.bottom-g.bottom)>2&&s.push((f.bottom+g.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ra(e,t,i){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 r=0;r<e.rest.length;r++)if(Ot(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=on(t);var i=Ot(t),n=e.display.externalMeasured=new Rt(e.doc,t,i);n.lineN=i;var r=n.built=Fr(e,n);return n.text=r.pre,ce(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return ai(e,Ji(e,t),i,n)}function go(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ui(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Ji(e,t){var i=Ot(t),n=go(e,i);n&&!n.text?n=null:n&&n.changes&&(pr(e,n,i,wo(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var r=ra(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ai(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(js(e,t.view,t.rect),t.hasHeights=!0),l=Ws(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var aa={left:0,right:0,top:0,bottom:0};function sa(e,t,i){for(var n,r,s,l,d,f,g=0;g<e.length;g+=3)if(d=e[g],f=e[g+1],t<d?(r=0,s=1,l="left"):t<f?(r=t-d,s=r+1):(g==e.length-3||t==f&&e[g+3]>t)&&(s=f-d,r=s-1,t>=f&&(l="right")),r!=null){if(n=e[g+2],d==f&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;g&&e[g-2]==e[g-3]&&e[g-1].insertLeft;)n=e[(g-=3)+2],l="left";if(i=="right"&&r==f-d)for(;g<e.length-3&&e[g+3]==e[g+4]&&!e[g+5].insertLeft;)n=e[(g+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:d,coverEnd:f}}function Fs(e,t){var i=aa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function Ws(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,d=r.end,f=r.collapse,g;if(s.nodeType==3){for(var M=0;M<4;M++){for(;l&&Pe(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+d<r.coverEnd&&Pe(t.line.text.charAt(r.coverStart+d));)++d;if(S&&L<9&&l==0&&d==r.coverEnd-r.coverStart?g=s.parentNode.getBoundingClientRect():g=Fs(q(s,l,d).getClientRects(),n),g.left||g.right||l==0)break;d=l,l=l-1,f="right"}S&&L<11&&(g=Hs(e.display.measure,g))}else{l>0&&(f=n="right");var B;e.options.lineWrapping&&(B=s.getClientRects()).length>1?g=B[n=="right"?B.length-1:0]:g=s.getBoundingClientRect()}if(S&&L<9&&!l&&(!g||!g.left&&!g.right)){var ee=s.parentNode.getClientRects()[0];ee?g={left:ee.left,right:ee.left+Qi(e.display),top:ee.top,bottom:ee.bottom}:g=aa}for(var Z=g.top-t.rect.top,Ce=g.bottom-t.rect.top,Ae=(Z+Ce)/2,je=t.view.measure.heights,Ge=0;Ge<je.length-1&&!(Ae<je[Ge]);Ge++);var Ze=Ge?je[Ge-1]:0,Ve=je[Ge],rt={left:(f=="right"?g.right:g.left)-t.rect.left,right:(f=="left"?g.left:g.right)-t.rect.left,top:Ze,bottom:Ve};return!g.left&&!g.right&&(rt.bogus=!0),e.options.singleCursorHeightPerLine||(rt.rtop=Z,rt.rbottom=Ce),rt}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Vt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function la(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 ua(e){e.display.externalMeasure=null,_e(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)la(e.display.view[t])}function vr(e){ua(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ha(){return k&&N?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ca(){return k&&N?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vo(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=gr(e.widgets[i]));return t}function Hr(e,t,i,n,r){if(!r){var s=vo(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=Bn(t);if(n=="local"?l+=Wr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var d=e.display.lineSpace.getBoundingClientRect();l+=d.top+(n=="window"?0:ca());var f=d.left+(n=="window"?0:ha());i.left+=f,i.right+=f}return i.top+=l,i.bottom+=l,i}function da(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ha(),r-=ca();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function yo(e,t,i,n,r){return n||(n=ut(e.doc,t.line)),Hr(e,n,oa(e,n,t.ch,r),i)}function Qn(e,t,i,n,r,s){n=n||ut(e.doc,t.line),r||(r=Ji(e,n));function l(Ce,Ae){var je=ai(e,r,Ce,Ae?"right":"left",s);return Ae?je.left=je.right:je.right=je.left,Hr(e,n,je,i)}var d=at(n,e.doc.direction),f=t.ch,g=t.sticky;if(f>=n.text.length?(f=n.text.length,g="before"):f<=0&&(f=0,g="after"),!d)return l(g=="before"?f-1:f,g=="before");function M(Ce,Ae,je){var Ge=d[Ae],Ze=Ge.level==1;return l(je?Ce-1:Ce,Ze!=je)}var B=qe(d,f,g),ee=nt,Z=M(f,B,g=="before");return ee!=null&&(Z.other=M(f,ee,g!="before")),Z}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Qi(e.display)*t.ch);var n=ut(e.doc,t.line),r=Bn(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=De(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function xo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return bo(n.first,0,null,-1,-1);var r=Kn(n,i),s=n.first+n.size-1;if(r>s)return bo(n.first+n.size-1,ut(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=ut(n,r);;){var d=zs(e,l,r,t,i),f=bi(l,d.ch+(d.xRel>0||d.outside>0?1:0));if(!f)return d;var g=f.find(1);if(g.line==r)return g;l=ut(n,r=g.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=vt(function(l){return ai(e,i,l-1).bottom<=n},r,0);return r=vt(function(l){return ai(e,i,l).top>n},s,r),{begin:s,end:r}}function ma(e,t,i,n){i||(i=Ji(e,t));var r=Hr(e,t,ai(e,i,n),"line").top;return pa(e,t,i,r)}function Co(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function zs(e,t,i,n,r){r-=Bn(t);var s=Ji(e,t),l=vo(t),d=0,f=t.text.length,g=!0,M=at(t,e.doc.direction);if(M){var B=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,M,n,r);g=B.level!=1,d=g?B.from:B.to-1,f=g?B.to:B.from-1}var ee=null,Z=null,Ce=vt(function(xt){var gt=ai(e,s,xt);return gt.top+=l,gt.bottom+=l,Co(gt,n,r,!1)?(gt.top<=r&>.left<=n&&(ee=xt,Z=gt),!0):!1},d,f),Ae,je,Ge=!1;if(Z){var Ze=n-Z.left<Z.right-n,Ve=Ze==g;Ce=ee+(Ve?0:1),je=Ve?"after":"before",Ae=Ze?Z.left:Z.right}else{!g&&(Ce==f||Ce==d)&&Ce++,je=Ce==0?"after":Ce==t.text.length?"before":ai(e,s,Ce-(g?1:0)).bottom+l<=r==g?"after":"before";var rt=Qn(e,De(i,Ce,je),"line",t,s);Ae=rt.left,Ge=r<rt.top?-1:r>=rt.bottom?1:0}return Ce=ze(t.text,Ce,1),bo(i,Ce,je,Ge,n-Ae)}function Gs(e,t,i,n,r,s,l){var d=vt(function(B){var ee=r[B],Z=ee.level!=1;return Co(Qn(e,De(i,Z?ee.to:ee.from,Z?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),f=r[d];if(d>0){var g=f.level!=1,M=Qn(e,De(i,g?f.from:f.to,g?"after":"before"),"line",t,n);Co(M,s,l,!0)&&M.top>l&&(f=r[d-1])}return f}function Vs(e,t,i,n,r,s,l){var d=pa(e,t,n,l),f=d.begin,g=d.end;/\s/.test(t.text.charAt(g-1))&&g--;for(var M=null,B=null,ee=0;ee<r.length;ee++){var Z=r[ee];if(Z.from>=g||Z.to<=f)continue;var Ce=Z.level!=1,Ae=ai(e,n,Ce?Math.min(g,Z.to)-1:Math.max(f,Z.from)).right,je=Ae<s?s-Ae+1e9:Ae-s;(!M||B>je)&&(M=Z,B=je)}return M||(M=r[r.length-1]),M.from<f&&(M={from:f,to:M.to,level:M.level}),M.to>g&&(M={from:M.from,to:g,level:M.level}),M}var Bi;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Bi==null){Bi=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Bi.appendChild(document.createTextNode("x")),Bi.appendChild(T("br"));Bi.appendChild(document.createTextNode("x"))}ce(e.measure,Bi);var i=Bi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),_e(e.measure),i||1}function Qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),i=T("pre",[t],"CodeMirror-line-like");ce(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function wo(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var d=e.display.gutterSpecs[l].className;i[d]=s.offsetLeft+s.clientLeft+r,n[d]=s.clientWidth}return{fixedPos:Eo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Eo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ga(e){var t=Zi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Qi(e.display)-3);return function(r){if(Zn(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function So(e){var t=e.doc,i=ga(e);t.iter(function(n){var r=i(n);r!=n.height&&Tn(n,r)})}function ji(e,t,i,n){var r=e.display;if(!i&&ne(t).getAttribute("cm-not-content")=="true")return null;var s,l,d=r.lineSpace.getBoundingClientRect();try{s=t.clientX-d.left,l=t.clientY-d.top}catch(B){return null}var f=xo(e,s,l),g;if(n&&f.xRel>0&&(g=ut(e.doc,f.line).text).length==f.ch){var M=Y(g,g.length,e.options.tabSize)-g.length;f=De(f.line,Math.max(0,Math.round((s-ia(e.display).left)/Qi(e.display))-M))}return f}function Ui(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function An(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var r=e.display;if(n&&i<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Ln&&Ci(e.doc,t)<r.viewTo&&Si(e);else if(i<=r.viewFrom)Ln&&Ur(e.doc,i+n)>r.viewFrom?Si(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Si(e);else if(t<=r.viewFrom){var s=zr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Si(e)}else if(i>=r.viewTo){var l=zr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Si(e)}else{var d=zr(e,t,t,-1),f=zr(e,i,i+n,1);d&&f?(r.view=r.view.slice(0,d.index).concat(Jt(e,d.lineN,f.lineN)).concat(r.view.slice(f.index)),r.viewTo+=n):Si(e)}var g=r.externalMeasured;g&&(i<g.lineN?g.lineN+=n:t<g.lineN+g.size&&(r.externalMeasured=null))}function Ei(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[Ui(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);fe(l,i)==-1&&l.push(i)}function Si(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zr(e,t,i,n){var r=Ui(e,t),s,l=e.display.view;if(!Ln||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var d=e.display.viewFrom,f=0;f<r;f++)d+=l[f].size;if(d!=t){if(n>0){if(r==l.length-1)return null;s=d+l[r].size-t,r++}else s=d-t;t+=s,i+=s}for(;Ci(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Xs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Jt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Jt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ui(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Jt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ui(e,i)))),n.viewTo=i}function va(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ya(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var d=i.sel.ranges[l];if(d.from().line>=e.display.viewTo||d.to().line<e.display.viewFrom)continue;var f=d.empty();(f||e.options.showCursorWhenSelecting)&&ba(e,d.head,r),f||Ks(e,d,s)}return n}function ba(e,t,i){var n=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(T("div","\xA0","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(T("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Gr(e,t){return e.top-t.top||e.left-t.left}function Ks(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=ia(e.display),d=l.left,f=Math.max(n.sizerWidth,Ii(e)-n.sizer.offsetLeft)-l.right,g=r.direction=="ltr";function M(Ve,rt,xt,gt){rt<0&&(rt=0),rt=Math.round(rt),gt=Math.round(gt),s.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+Ve+`px;
|
|
top: `+rt+"px; width: "+(xt==null?f-Ve:xt)+`px;
|
|
height: `+(gt-rt)+"px"))}function B(Ve,rt,xt){var gt=ut(r,Ve),Tt=gt.text.length,Yt,fn;function Zt(tn,Dn){return yo(e,De(Ve,tn),"div",gt,Dn)}function Un(tn,Dn,xn){var an=ma(e,gt,null,tn),nn=Dn=="ltr"==(xn=="after")?"left":"right",Qt=xn=="after"?an.begin:an.end-(/\s/.test(gt.text.charAt(an.end-1))?2:1);return Zt(Qt,nn)[nn]}var Rn=at(gt,r.direction);return st(Rn,rt||0,xt==null?Tt:xt,function(tn,Dn,xn,an){var nn=xn=="ltr",Qt=Zt(tn,nn?"left":"right"),Pn=Zt(Dn-1,nn?"right":"left"),cr=rt==null&&tn==0,Ai=xt==null&&Dn==Tt,wn=an==0,si=!Rn||an==Rn.length-1;if(Pn.top-Qt.top<=3){var pn=(g?cr:Ai)&&wn,$o=(g?Ai:cr)&&si,gi=pn?d:(nn?Qt:Pn).left,Gi=$o?f:(nn?Pn:Qt).right;M(gi,Qt.top,Gi-gi,Qt.bottom)}else{var Vi,kn,dr,Jo;nn?(Vi=g&&cr&&wn?d:Qt.left,kn=g?f:Un(tn,xn,"before"),dr=g?d:Un(Dn,xn,"after"),Jo=g&&Ai&&si?f:Pn.right):(Vi=g?Un(tn,xn,"before"):d,kn=!g&&cr&&wn?f:Qt.right,dr=!g&&Ai&&si?d:Pn.left,Jo=g?Un(Dn,xn,"after"):f),M(Vi,Qt.top,kn-Vi,Qt.bottom),Qt.bottom<Pn.top&&M(d,Qt.bottom,null,Pn.top),M(dr,Pn.top,Jo-dr,Pn.bottom)}(!Yt||Gr(Qt,Yt)<0)&&(Yt=Qt),Gr(Pn,Yt)<0&&(Yt=Pn),(!fn||Gr(Qt,fn)<0)&&(fn=Qt),Gr(Pn,fn)<0&&(fn=Pn)}),{start:Yt,end:fn}}var ee=t.from(),Z=t.to();if(ee.line==Z.line)B(ee.line,ee.ch,Z.ch);else{var Ce=ut(r,ee.line),Ae=ut(r,Z.line),je=on(Ce)==on(Ae),Ge=B(ee.line,ee.ch,je?Ce.text.length+1:null).end,Ze=B(Z.line,je?0:null,Z.ch).start;je&&(Ge.top<Ze.top-2?(M(Ge.right,Ge.top,null,Ge.bottom),M(d,Ze.top,Ze.left,Ze.bottom)):M(Ge.right,Ge.top,Ze.left-Ge.right,Ge.bottom)),Ge.bottom<Ze.top&&M(d,Ge.bottom,null,Ze.top)}i.appendChild(s)}function ko(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||qi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function xa(e){e.state.focused||(e.display.input.focus(),_o(e))}function Ca(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qi(e))},100)}function _o(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(de(e,"focus",e,t),e.state.focused=!0,J(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()),ko(e)}function qi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(de(e,"blur",e,t),e.state.focused=!1,pe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r=t.view[n],s=e.options.lineWrapping,l=void 0,d=0;if(r.hidden)continue;if(S&&L<8){var f=r.node.offsetTop+r.node.offsetHeight;l=f-i,i=f}else{var g=r.node.getBoundingClientRect();l=g.bottom-g.top,!s&&r.text.firstChild&&(d=r.text.firstChild.getBoundingClientRect().right-g.left-1)}var M=r.line.height-l;if((M>.005||M<-.005)&&(Tn(r.line,l),wa(r.line),r.rest))for(var B=0;B<r.rest.length;B++)wa(r.rest[B]);if(d>e.display.sizerWidth){var ee=Math.ceil(d/Qi(e.display));ee>e.display.maxLineLength&&(e.display.maxLineLength=ee,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function wa(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Xr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Kn(t,n),l=Kn(t,r);if(i&&i.ensure){var d=i.ensure.from.line,f=i.ensure.to.line;d<s?(s=d,l=Kn(t,Bn(ut(t,d))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(s=Kn(t,Bn(ut(t,f))-e.wrapper.clientHeight),l=f)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(ge(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!O){var s=T("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Wr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+oi(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function $s(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?De(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?De(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,d=Qn(e,t),f=!i||i==t?d:Qn(e,i);r={left:Math.min(d.left,f.left),top:Math.min(d.top,f.top)-n,right:Math.max(d.left,f.left),bottom:Math.max(d.bottom,f.bottom)+n};var g=To(e,r),M=e.doc.scrollTop,B=e.doc.scrollLeft;if(g.scrollTop!=null&&(xr(e,g.scrollTop),Math.abs(e.doc.scrollTop-M)>1&&(l=!0)),g.scrollLeft!=null&&(Fi(e,g.scrollLeft),Math.abs(e.doc.scrollLeft-B)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=To(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&Fi(e,i.scrollLeft)}function To(e,t){var i=e.display,n=Zi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=mo(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var d=e.doc.height+po(i),f=t.top<n,g=t.bottom>d-n;if(t.top<r)l.scrollTop=f?0:t.top;else if(t.bottom>r+s){var M=Math.min(t.top,(g?d:t.bottom)-s);M!=r&&(l.scrollTop=M)}var B=e.options.fixedGutter?0:i.gutters.offsetWidth,ee=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-B,Z=Ii(e)-i.gutters.offsetWidth,Ce=t.right-t.left>Z;return Ce&&(t.right=t.left+Z),t.left<10?l.scrollLeft=0:t.left<ee?l.scrollLeft=Math.max(0,t.left+B-(Ce?0:10)):t.right>Z+ee-3&&(l.scrollLeft=t.right+(Ce?0:10)-Z),l}function Lo(e,t){if(t==null)return;Kr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function er(e){Kr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Kr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Kr(e),e.curOp.scrollToPos=t}function Kr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=fa(e,t.from),n=fa(e,t.to);Ea(e,i,n,t.margin)}}function Ea(e,t,i,n){var r=To(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;X||Ao(e,{top:t}),Sa(e,t,!0),X&&Ao(e),Er(e,100)}function Sa(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Fi(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ma(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+po(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?i:0,docHeight:n,scrollHeight:n+oi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Wi=function(e,t,i){this.cm=i;var n=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),ve(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ve(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,S&&L<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var r=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"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:i?n:0,bottom:t?n:0}},Wi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wi.prototype.zeroWidthHack=function(){var e=Q&&!H?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new we,this.disableVert=new we},Wi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var r=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Wi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wr=function(){};wr.prototype.update=function(){return{bottom:0,right:0}},wr.prototype.setScrollLeft=function(){},wr.prototype.setScrollTop=function(){},wr.prototype.clear=function(){};function tr(e,t){t||(t=Cr(e));var i=e.display.barWidth,n=e.display.barHeight;ka(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Vr(e),ka(e,Cr(e)),i=e.display.barWidth,n=e.display.barHeight}function ka(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var _a={native:Wi,null:wr};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&pe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new _a[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ve(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Fi(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&J(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Hi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},At(e.curOp)}function zi(e){var t=e.curOp;t&&zt(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&fi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Mo(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=Cr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oa(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+oi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ii(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==D();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&tr(t,e.barMeasure),e.updatedDisplay&&Ro(t,e.barMeasure),e.selectionChanged&&ko(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&xa(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&La(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Sa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Fi(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$s(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var d=0;d<s.length;++d)s[d].lines.length||de(s[d],"hide");if(l)for(var f=0;f<l.length;++f)l[f].lines.length&&de(l[f],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&de(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function jn(e,t){if(e.curOp)return t();Hi(e);try{return t()}finally{zi(e)}}function cn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hi(e);try{return t.apply(e,arguments)}finally{zi(e)}}}function Sn(e){return function(){if(this.curOp)return e.apply(this,arguments);Hi(this);try{return e.apply(this,arguments)}finally{zi(this)}}}function dn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hi(t);try{return e.apply(this,arguments)}finally{zi(t)}}}function Er(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,w(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=re(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,d=s.text.length>e.options.maxHighlightLength?_n(t.mode,n.state):null,f=F(e,s,n,!0);d&&(n.state=d),s.styles=f.styles;var g=s.styleClasses,M=f.classes;M?s.styleClasses=M:g&&(s.styleClasses=null);for(var B=!l||l.length!=s.styles.length||g!=M&&(!g||!M||g.bgClass!=M.bgClass||g.textClass!=M.textClass),ee=0;!B&&ee<l.length;++ee)B=l[ee]!=s.styles[ee];B&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&<(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return Er(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&jn(e,function(){for(var s=0;s<r.length;s++)Ei(e,r[s],"text")})}var Yr=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Xr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ii(e),this.force=i,this.dims=wo(e),this.events=[]};Yr.prototype.signal=function(e,t){R(e,t)&&this.events.push(arguments)},Yr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)de.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=oi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=oi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=D();if(!t||!x(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&x(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==D())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Mo(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Si(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&va(e)==0)return!1;Aa(e)&&(Si(e),t.dims=wo(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),Ln&&(s=Ci(e.doc,s),l=Ur(e.doc,l));var d=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=Bn(ut(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var f=va(e);if(!d&&f==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var g=sl(e);return f>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),f>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(g),_e(i.cursorDiv),_e(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,d&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Er(e,400)),i.updateLineNumbers=null,!0}function La(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ii(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-mo(e),i.top)}),t.visible=Xr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Xr(e.display,e.doc,i));if(!Mo(e,t))break;Vr(e);var r=Cr(e);yr(e),tr(e,r),Ro(e,r),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 Ao(e,t){var i=new Yr(e,t);if(Mo(e,i)){Vr(e),La(e,i);var n=Cr(e);yr(e),tr(e,n),Ro(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function d(Ce){var Ae=Ce.nextSibling;return A&&Q&&e.display.currentWheelTarget==Ce?Ce.style.display="none":Ce.parentNode.removeChild(Ce),Ae}for(var f=n.view,g=n.viewFrom,M=0;M<f.length;M++){var B=f[M];if(!B.hidden)if(!B.node||B.node.parentNode!=s){var ee=Is(e,B,g,i);s.insertBefore(ee,l)}else{for(;l!=B.node;)l=d(l);var Z=r&&t!=null&&t<=g&&B.lineNumber;B.changes&&(fe(B.changes,"gutter")>-1&&(Z=!1),pr(e,B,g,i)),Z&&(_e(B.lineNumber),B.lineNumber.appendChild(document.createTextNode(vi(e.options,g)))),l=B.node.nextSibling}g+=B.size}for(;l;)l=d(l)}function Oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ro(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+oi(e)+"px"}function Ma(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Eo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var d=i[l].alignable;if(d)for(var f=0;f<d.length;f++)d[f].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function Aa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=vi(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(T("div",[T("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oo(e.display),!0}return!1}function Do(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Oa(e){var t=e.gutters,i=e.gutterSpecs;_e(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,d=t.appendChild(T("div",null,"CodeMirror-gutter "+s));l&&(d.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=d,d.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oo(e)}function Sr(e){Oa(e.display),An(e),Ma(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=se("div",null,"CodeMirror-code"),r.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=T("div",null,"CodeMirror-cursors"),r.measure=T("div",null,"CodeMirror-measure"),r.lineMeasure=T("div",null,"CodeMirror-measure"),r.lineSpace=se("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=se("div",[r.lineSpace],"CodeMirror-lines");r.mover=T("div",[s],null,"position: relative"),r.sizer=T("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=T("div",null,null,"position: absolute; height: "+Ue+"px; width: 1px;"),r.gutters=T("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=T("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=T("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),S&&L<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!A&&!(X&&ie)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Do(n.gutters,n.lineNumbers),Oa(r),i.init(r)}var $r=0,Gn=null;S?Gn=-.53:X?Gn=15:k?Gn=-.7:V&&(Gn=-1/3);function Ra(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Ra(e);return t.x*=Gn,t.y*=Gn,t}function Da(e,t){var i=Ra(t),n=i.x,r=i.y,s=e.display,l=s.scroller,d=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight;if(!(n&&d||r&&f))return;if(r&&Q&&A){e:for(var g=t.target,M=s.view;g!=l;g=g.parentNode)for(var B=0;B<M.length;B++)if(M[B].node==g){e.display.currentWheelTarget=g;break e}}if(n&&!X&&!E&&Gn!=null){r&&f&&xr(e,Math.max(0,l.scrollTop+r*Gn)),Fi(e,Math.max(0,l.scrollLeft+n*Gn)),(!r||r&&f)&&v(t),s.wheelStartX=null;return}if(r&&Gn!=null){var ee=r*Gn,Z=e.doc.scrollTop,Ce=Z+s.wrapper.clientHeight;ee<0?Z=Math.max(0,Z+ee-50):Ce=Math.min(e.doc.height,Ce+ee+50),Ao(e,{top:Z,bottom:Ce})}$r<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var Ae=l.scrollLeft-s.wheelStartX,je=l.scrollTop-s.wheelStartY,Ge=je&&s.wheelDY&&je/s.wheelDY||Ae&&s.wheelDX&&Ae/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!Ge)return;Gn=(Gn*$r+Ge)/($r+1),++$r},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Vn=function(e,t){this.ranges=e,this.primIndex=t};Vn.prototype.primary=function(){return this.ranges[this.primIndex]},Vn.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 i=this.ranges[t],n=e.ranges[t];if(!ti(i.anchor,n.anchor)||!ti(i.head,n.head))return!1}return!0},Vn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ft(ci(this.ranges[t].anchor),ci(this.ranges[t].head));return new Vn(e,this.primIndex)},Vn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Vn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ct(t,n.from())>=0&&Ct(e,n.to())<=0)return i}return-1};var Ft=function(e,t){this.anchor=e,this.head=t};Ft.prototype.from=function(){return Oi(this.anchor,this.head)},Ft.prototype.to=function(){return di(this.anchor,this.head)},Ft.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qn(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(ee,Z){return Ct(ee.from(),Z.from())}),i=fe(t,r);for(var s=1;s<t.length;s++){var l=t[s],d=t[s-1],f=Ct(d.to(),l.from());if(n&&!l.empty()?f>0:f>=0){var g=Oi(d.from(),l.from()),M=di(d.to(),l.to()),B=d.empty()?l.from()==l.head:d.from()==d.head;s<=i&&--i,t.splice(--s,2,new Ft(B?M:g,B?g:M))}}return new Vn(t,i)}function ki(e,t){return new Vn([new Ft(e,t||e)],0)}function _i(e){return e.text?De(e.from.line+e.text.length-1,Ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Pa(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return _i(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=_i(t).ch-t.to.ch),De(i,n)}function Po(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Ft(Pa(r.anchor,t),Pa(r.head,t)))}return qn(e.cm,i,e.sel.primIndex)}function Na(e,t,i){return e.line==t.line?De(i.line,e.ch-t.ch+i.ch):De(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=De(e.first,0),s=r,l=0;l<t.length;l++){var d=t[l],f=Na(d.from,r,s),g=Na(_i(d),r,s);if(r=d.to,s=g,i=="around"){var M=e.sel.ranges[l],B=Ct(M.head,M.anchor)<0;n[l]=new Ft(B?g:f,B?f:g)}else n[l]=new Ft(f,f)}return new Vn(n,e.sel.primIndex)}function No(e){e.doc.mode=En(e.options,e.doc.modeOption),kr(e)}function kr(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,Er(e,100),e.state.modeGen++,e.curOp&&An(e)}function Ia(e,t){return t.from.ch==0&&t.to.ch==0&&Ie(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Io(e,t,i,n){function r(Ze){return i?i[Ze]:null}function s(Ze,Ve,rt){uo(Ze,Ve,rt,n),Xt(Ze,"change",Ze,t)}function l(Ze,Ve){for(var rt=[],xt=Ze;xt<Ve;++xt)rt.push(new wi(g[xt],r(xt),n));return rt}var d=t.from,f=t.to,g=t.text,M=ut(e,d.line),B=ut(e,f.line),ee=Ie(g),Z=r(g.length-1),Ce=f.line-d.line;if(t.full)e.insert(0,l(0,g.length)),e.remove(g.length,e.size-g.length);else if(Ia(e,t)){var Ae=l(0,g.length-1);s(B,B.text,Z),Ce&&e.remove(d.line,Ce),Ae.length&&e.insert(d.line,Ae)}else if(M==B)if(g.length==1)s(M,M.text.slice(0,d.ch)+ee+M.text.slice(f.ch),Z);else{var je=l(1,g.length-1);je.push(new wi(ee+M.text.slice(f.ch),Z,n)),s(M,M.text.slice(0,d.ch)+g[0],r(0)),e.insert(d.line+1,je)}else if(g.length==1)s(M,M.text.slice(0,d.ch)+g[0]+B.text.slice(f.ch),r(0)),e.remove(d.line+1,Ce);else{s(M,M.text.slice(0,d.ch)+g[0],r(0)),s(B,ee+B.text.slice(f.ch),Z);var Ge=l(1,g.length-1);Ce>1&&e.remove(d.line+1,Ce-1),e.insert(d.line+1,Ge)}Xt(e,"change",e,t)}function Ti(e,t,i){function n(r,s,l){if(r.linked)for(var d=0;d<r.linked.length;++d){var f=r.linked[d];if(f.doc==s)continue;var g=l&&f.sharedHist;if(i&&!g)continue;t(f.doc,g),n(f.doc,r,g)}}n(e,null,!0)}function Ba(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,So(e),No(e),ja(e),e.options.lineWrapping||fi(e),e.options.mode=t.modeOption,An(e)}function ja(e){(e.doc.direction=="rtl"?J:pe)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){jn(e,function(){ja(e),An(e)})}function Jr(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 Bo(e,t){var i={from:ci(t.from),to:_i(t),text:Fn(e,t.from,t.to)};return Wa(e,i,t.from.line,t.to.line+1),Ti(e,function(n){return Wa(n,i,t.from.line,t.to.line+1)},!0),i}function Ua(e){for(;e.length;){var t=Ie(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ua(e.done),Ie(e.done);if(e.done.length&&!Ie(e.done).ranges)return Ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ie(e.done)}function Fa(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,d;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))d=Ie(l.changes),Ct(t.from,t.to)==0&&Ct(t.from,d.to)==0?d.to=_i(t):l.changes.push(Bo(e,t));else{var f=Ie(r.done);for((!f||!f.ranges)&&Zr(e.sel,r.done),l={changes:[Bo(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,d||de(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,Ie(r.done),t))?r.done[r.done.length-1]=t:Zr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ua(r.undone)}function Zr(e,t){var i=Ie(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Wa(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function Ha(e,t){var i=yl(e,t),n=Nn(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var d=0;d<l.length;++d){for(var f=l[d],g=0;g<s.length;++g)if(s[g].marker==f.marker)continue e;s.push(f)}}else l&&(i[r]=l)}return i}function nr(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Vn.prototype.deepCopy.call(s):s);continue}var l=s.changes,d=[];n.push({changes:d});for(var f=0;f<l.length;++f){var g=l[f],M=void 0;if(d.push({from:g.from,to:g.to,text:g.text}),t)for(var B in g)(M=B.match(/^spans_(\d+)$/))&&(fe(t,Number(M[1]))>-1&&(Ie(d)[B]=g[B],delete g[B]))}}return n}function jo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=Ct(t,r)<0;s!=Ct(i,r)<0?(r=t,t=i):s!=Ct(t,i)<0&&(t=i)}return new Ft(r,t)}else return new Ft(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Cn(e,new Vn([jo(e.sel.primary(),t,i,r)],0),n)}function za(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=jo(e.sel.ranges[s],t[s],null,r);var l=qn(e.cm,n,e.sel.primIndex);Cn(e,l,i)}function Uo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Cn(e,qn(e.cm,r,e.sel.primIndex),n)}function Ga(e,t,i,n){Cn(e,ki(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new Ft(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return de(e,"beforeSelectionChange",e,n),e.cm&&de(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?qn(e.cm,n.ranges,n.ranges.length-1):t}function Va(e,t,i){var n=e.history.done,r=Ie(n);r&&r.ranges?(n[n.length-1]=t,qr(e,t,i)):Cn(e,t,i)}function Cn(e,t,i){qr(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qr(e,t,i){(R(e,"beforeSelectionChange")||e.cm&&R(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Xa(e,Ya(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&er(e.cm)}function Xa(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,z(e.cm)),Xt(e,"cursorActivity",e)}function Ka(e){Xa(e,Ya(e,e.sel,null,!1))}function Ya(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],d=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],f=eo(e,l.anchor,d&&d.anchor,i,n),g=eo(e,l.head,d&&d.head,i,n);(r||f!=l.anchor||g!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ft(f,g))}return r?qn(e.cm,r,t.primIndex):t}function ir(e,t,i,n,r){var s=ut(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var d=s.markedSpans[l],f=d.marker,g="selectLeft"in f?!f.selectLeft:f.inclusiveLeft,M="selectRight"in f?!f.selectRight:f.inclusiveRight;if((d.from==null||(g?d.from<=t.ch:d.from<t.ch))&&(d.to==null||(M?d.to>=t.ch:d.to>t.ch))){if(r&&(de(f,"beforeCursorEnter"),f.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!f.atomic)continue;if(i){var B=f.find(n<0?1:-1),ee=void 0;if((n<0?M:g)&&(B=$a(e,B,-n,B&&B.line==t.line?s:null)),B&&B.line==t.line&&(ee=Ct(B,i))&&(n<0?ee<0:ee>0))return ir(e,B,t,n,r)}var Z=f.find(n<0?-1:1);return(n<0?g:M)&&(Z=$a(e,Z,n,Z.line==t.line?s:null)),Z?ir(e,Z,t,n,r):null}}return t}function eo(e,t,i,n,r){var s=n||1,l=ir(e,t,i,s,r)||!r&&ir(e,t,i,s,!0)||ir(e,t,i,-s,r)||!r&&ir(e,t,i,-s,!0);return l||(e.cantEdit=!0,De(e.first,0))}function $a(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,De(t.line-1)):null:i>0&&t.ch==(n||ut(e,t.line)).text.length?t.line<e.first+e.size-1?De(t.line+1,0):null:new De(t.line,t.ch+i)}function Ja(e){e.setSelection(De(e.firstLine(),0),De(e.lastLine()),be)}function Za(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(r,s,l,d){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),d!==void 0&&(n.origin=d)}),de(e,"beforeChange",e,n),e.cm&&de(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 rr(e,t,i){if(e.cm){if(!e.cm.curOp)return cn(e.cm,rr)(e,t,i);if(e.cm.state.suppressEdits)return}if((R(e,"beforeChange")||e.cm&&R(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var n=Xi&&!i&&Ri(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Qa(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Qa(e,t)}function Qa(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Po(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),_r(e,t,i,Nn(e,t));var n=[];Ti(e,function(r,s){!s&&fe(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),_r(r,t,null,Nn(r,t))})}function to(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,d=t=="undo"?r.done:r.undone,f=t=="undo"?r.undone:r.done,g=0;g<d.length&&!(s=d[g],i?s.ranges&&!s.equals(e.sel):!s.ranges);g++);if(g==d.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=d.pop(),s.ranges){if(Zr(s,f),i&&!s.equals(e.sel)){Cn(e,s,{clearRedo:!1});return}l=s}else if(n){d.push(s);return}else break;var M=[];Zr(l,f),f.push({changes:M,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var B=R(e,"beforeChange")||e.cm&&R(e.cm,"beforeChange"),ee=function(Ae){var je=s.changes[Ae];if(je.origin=t,B&&!Za(e,je,!1))return d.length=0,{};M.push(Bo(e,je));var Ge=Ae?Po(e,je):Ie(d);_r(e,je,Ge,Ha(e,je)),!Ae&&e.cm&&e.cm.scrollIntoView({from:je.from,to:_i(je)});var Ze=[];Ti(e,function(Ve,rt){!rt&&fe(Ze,Ve.history)==-1&&(ns(Ve.history,je),Ze.push(Ve.history)),_r(Ve,je,null,Ha(Ve,je))})},Z=s.changes.length-1;Z>=0;--Z){var Ce=ee(Z);if(Ce)return Ce.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Vn(ot(e.sel.ranges,function(r){return new Ft(De(r.anchor.line+t,r.anchor.ch),De(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){An(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Ei(e.cm,n,"gutter")}}function _r(e,t,i,n){if(e.cm&&!e.cm.curOp)return cn(e.cm,_r)(e,t,i,n);if(t.to.line<e.first){qa(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 r=t.text.length-1-(e.first-t.from.line);qa(e,r),t={from:De(e.first,0),to:De(t.to.line+r,t.to.ch),text:[Ie(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:De(s,ut(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Fn(e,t.from,t.to),i||(i=Po(e,t)),e.cm?xl(e.cm,t,n):Io(e,t,n),qr(e,i,be),e.cantEdit&&eo(e,De(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,d=!1,f=s.line;e.options.lineWrapping||(f=Ot(on(ut(n,s.line))),n.iter(f,l.line+1,function(Z){if(Z==r.maxLine)return d=!0,!0})),n.sel.contains(t.from,t.to)>-1&&z(e),Io(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(f,s.line+t.text.length,function(Z){var Ce=$i(Z);Ce>r.maxLineLength&&(r.maxLine=Z,r.maxLineLength=Ce,r.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),Yn(n,s.line),Er(e,400);var g=t.text.length-(l.line-s.line)-1;t.full?An(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?Ei(e,s.line,"text"):An(e,s.line,l.line+1,g);var M=R(e,"changes"),B=R(e,"change");if(B||M){var ee={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};B&&Xt(e,"change",e,ee),M&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ee)}e.display.selForContextMenu=null}function or(e,t,i,n,r){var s;n||(n=i),Ct(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),rr(e,{from:i,to:n,text:t,origin:r})}function es(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ts(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var d=0;d<s.ranges.length;d++)es(s.ranges[d].anchor,t,i,n),es(s.ranges[d].head,t,i,n);continue}for(var f=0;f<s.changes.length;++f){var g=s.changes[f];if(i<g.from.line)g.from=De(g.from.line+n,g.from.ch),g.to=De(g.to.line+n,g.to.ch);else if(t<=g.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ns(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;ts(e.done,i,n,r),ts(e.undone,i,n,r)}function Tr(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=ut(e,c(e,t)):r=Ot(t),r==null?null:(n(s,r)&&e.cm&&Ei(e.cm,r,i),s)}function Lr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Lr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,ho(r),Xt(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,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,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Mr(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var r=e[n];t+=r.chunkSize(),i+=r.height,r.parent=this}this.size=t,this.height=i,this.parent=null}Mr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Lr))){var d=[];this.collapse(d),this.children=[new Lr(d)],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,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,d=l;d<r.lines.length;){var f=new Lr(r.lines.slice(d,d+=25));r.height-=f.height,this.children.splice(++n,0,f),f.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Mr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=fe(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Mr(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Ar=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Ar.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Ot(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=gr(this);Tn(i,Math.max(0,i.height-s)),e&&(jn(e,function(){is(e,i,-s),Ei(e,n,"widget")}),Xt(e,"lineWidgetCleared",e,this,n))},Ar.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=gr(this)-t;if(!r)return;Zn(this.doc,n)||Tn(n,n.height+r),i&&jn(i,function(){i.curOp.forceUpdate=!0,is(i,n,r),Xt(i,"lineWidgetChanged",i,e,Ot(n))})},U(Ar);function is(e,t,i){Bn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Lo(e,i)}function Cl(e,t,i,n){var r=new Ar(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Tr(e,t,"widget",function(l){var d=l.widgets||(l.widgets=[]);if(r.insertAt==null?d.push(r):d.splice(Math.min(d.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Zn(e,l)){var f=Bn(l)<e.scrollTop;Tn(l,l.height+gr(r)),f&&Lo(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Xt(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Ot(t)),r}var rs=0,Li=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};Li.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hi(e),R(this,"clear")){var i=this.find();i&&Xt(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],d=Jn(l.markedSpans,this);e&&!this.collapsed?Ei(e,Ot(l),"text"):e&&(d.to!=null&&(r=Ot(l)),d.from!=null&&(n=Ot(l))),l.markedSpans=ii(l.markedSpans,d),d.from==null&&this.collapsed&&!Zn(this.doc,l)&&e&&Tn(l,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var g=on(this.lines[f]),M=$i(g);M>e.display.maxLineLength&&(e.display.maxLine=g,e.display.maxLineLength=M,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&An(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ka(e.doc)),e&&Xt(e,"markerCleared",e,this,n,r),t&&zi(e),this.parent&&this.parent.clear()},Li.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=Jn(s.markedSpans,this);if(l.from!=null&&(i=De(t?s:Ot(s),l.from),e==-1))return i;if(l.to!=null&&(n=De(t?s:Ot(s),l.to),e==1))return n}return i&&{from:i,to:n}},Li.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;jn(n,function(){var r=t.line,s=Ot(t.line),l=go(n,s);if(l&&(la(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Zn(i.doc,r)&&i.height!=null){var d=i.height;i.height=null;var f=gr(i)-d;f&&Tn(r,r.height+f)}Xt(n,"markerChanged",n,e)})},Li.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||fe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Li.prototype.detachLine=function(e){if(this.lines.splice(fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},U(Li);function ar(e,t,i,n,r){if(n&&n.shared)return wl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return cn(e.cm,ar)(e,t,i,n,r);var s=new Li(e,r),l=Ct(t,i);if(n&&m(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=se("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(rn(e,t.line,t,i,s)||t.line!=i.line&&rn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");ni()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var d=t.line,f=e.cm,g;if(e.iter(d,i.line+1,function(B){f&&s.collapsed&&!f.options.lineWrapping&&on(B)==f.display.maxLine&&(g=!0),s.collapsed&&d!=t.line&&Tn(B,0),zn(B,new yi(s,d==t.line?t.ch:null,d==i.line?i.ch:null)),++d}),s.collapsed&&e.iter(t.line,i.line+1,function(B){Zn(e,B)&&Tn(B,0)}),s.clearOnEnter&&ve(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Mn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),f){if(g&&(f.curOp.updateMaxLine=!0),s.collapsed)An(f,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var M=t.line;M<=i.line;M++)Ei(f,M,"text");s.atomic&&Ka(f.doc),Xt(f,"markerAdded",f,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Or.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Xt(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},U(Or);function wl(e,t,i,n,r){n=m(n),n.shared=!1;var s=[ar(e,t,i,n,r)],l=s[0],d=n.widgetNode;return Ti(e,function(f){d&&(n.widgetNode=d.cloneNode(!0)),s.push(ar(f,o(f,t),o(f,i),n,r));for(var g=0;g<f.linked.length;++g)if(f.linked[g].isParent)return;l=Ie(s)}),new Or(s,l)}function os(e){return e.findMarks(De(e.first,0),e.clipPos(De(e.lastLine())),function(t){return t.parent})}function El(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(Ct(s,l)){var d=ar(e,s,l,n.primary,n.primary.type);n.markers.push(d),d.parent=n}}}function Sl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Ti(r.primary.doc,function(f){return s.push(f)});for(var l=0;l<r.markers.length;l++){var d=r.markers[l];fe(s,d.doc)==-1&&(d.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,On=function(e,t,i,n,r){if(!(this instanceof On))return new On(e,t,i,n,r);i==null&&(i=0),Mr.call(this,[new Lr([new wi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=De(i,0);this.sel=ki(s),this.history=new Jr(null),this.id=++kl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Io(this,{from:s,to:s,text:e}),Cn(this,ki(s),be)};On.prototype=Je(Mr.prototype,{constructor:On,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ui(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:dn(function(e){var t=De(this.first,0),i=this.first+this.size-1;rr(this,{from:t,to:De(i,ut(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),Cn(this,ki(t),be)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,or(this,e,t,i,n)},getRange:function(e,t,i){var n=Fn(this,o(this,e),o(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(hi(this,e))return ut(this,e)},getLineNumber:function(e){return Ot(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ut(this,e)),on(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:dn(function(e,t,i){Ga(this,o(this,typeof e=="number"?De(e,t||0):e),null,i)}),setSelection:dn(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:dn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:dn(function(e,t){za(this,u(this,e),t)}),extendSelectionsBy:dn(function(e,t){var i=ot(this.sel.ranges,e);za(this,u(this,i),t)}),setSelections:dn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Ft(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Cn(this,qn(this.cm,n,t),i)}),addSelection:dn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Ft(o(this,e),o(this,t||e))),Cn(this,qn(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var r=Fn(this,t[n].from(),t[n].to());i=i?i.concat(r):r}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var r=Fn(this,i[n].from(),i[n].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:dn(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var d=t&&t!="end"&&dl(this,n,t),f=n.length-1;f>=0;f--)rr(this,n[f]);d?Va(this,d):this.cm&&er(this.cm)}),undo:dn(function(){to(this,"undo")}),redo:dn(function(){to(this,"redo")}),undoSelection:dn(function(){to(this,"undo",!0)}),redoSelection:dn(function(){to(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Jr(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:nr(this.history.done),undone:nr(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=nr(e.done.slice(0),null,!0),t.undone=nr(e.undone.slice(0),null,!0)},setGutterMarker:dn(function(e,t,i){return Tr(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&tt(r)&&(n.gutterMarkers=null),!0})}),clearGutter:dn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Tr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,tt(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!hi(this,e))return null;if(t=e,e=ut(this,e),!e)return null}else if(t=Ot(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,i){return Tr(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[r])n[r]=i;else{if(oe(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:dn(function(e,t,i){return Tr(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[r];if(s)if(i==null)n[r]=null;else{var l=s.match(oe(i));if(!l)return!1;var d=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||d==s.length?"":" ")+s.slice(d)||null}else return!1;return!0})}),addLineWidget:dn(function(e,t,i){return Cl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ar(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),ar(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=ut(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var d=0;d<l.length;d++){var f=l[d];!(f.to!=null&&r==e.line&&e.ch>=f.to||f.from==null&&r!=e.line||f.from!=null&&r==t.line&&f.from>=t.ch)&&(!i||i(f.marker))&&n.push(f.marker.parent||f.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,De(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new On(ui(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new On(ui(this,t,i),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}],El(n,os(this)),n},unlinkDoc:function(e){if(e instanceof $t&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),Sl(os(this));break}if(e.history==this.history){var n=[e.id];Ti(e,function(r){return n.push(r.id)},!0),e.history=new Jr(null),e.history.done=nr(this.history.done,n),e.history.undone=nr(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):pt(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&&fl(this.cm)})}),On.prototype.eachLine=On.prototype.iter;var as=0;function _l(e){var t=this;if(ss(t),ge(t,e)||pi(t.display,e))return;v(e),S&&(as=+new Date);var i=ji(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,s=Array(r),l=0,d=function(){++l==r&&cn(t,function(){i=o(t.doc,i);var Z={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ce){return Ce!=null}).join(t.doc.lineSeparator())),origin:"paste"};rr(t.doc,Z),Va(t.doc,ki(o(t.doc,i),o(t.doc,_i(Z))))})()},f=function(Z,Ce){if(t.options.allowDropFileTypes&&fe(t.options.allowDropFileTypes,Z.type)==-1){d();return}var Ae=new FileReader;Ae.onerror=function(){return d()},Ae.onload=function(){var je=Ae.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(je)){d();return}s[Ce]=je,d()},Ae.readAsText(Z)},g=0;g<n.length;g++)f(n[g],g);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var M=e.dataTransfer.getData("Text");if(M){var B;if(t.state.draggingText&&!t.state.draggingText.copy&&(B=t.listSelections()),qr(t.doc,ki(i,i)),B)for(var ee=0;ee<B.length;++ee)or(t.doc,"",B[ee].anchor,B[ee].head,"drag");t.replaceSelection(M,"around","paste"),t.display.input.focus()}}catch(Z){}}}function Tl(e,t){if(S&&(!e.state.draggingText||+new Date-as<100)){_(t);return}if(ge(e,t)||pi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!V){var i=T("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",E&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),E&&i.parentNode.removeChild(i)}}function Ll(e,t){var i=ji(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ce(e.display.dragCursor,n)}function ss(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ls(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&i.push(r)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var us=!1;function Ml(){if(us)return;Al(),us=!0}function Al(){var e;ve(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Ol)},100))}),ve(window,"blur",function(){return ls(qi)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Mi={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"},Rr=0;Rr<10;Rr++)Mi[Rr+48]=Mi[Rr+96]=String(Rr);for(var no=65;no<=90;no++)Mi[no]=String.fromCharCode(no);for(var Dr=1;Dr<=12;Dr++)Mi[Dr+111]=Mi[Dr+63235]="F"+Dr;var mi={};mi.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"},mi.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"},mi.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"},mi.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"]},mi.default=Q?mi.macDefault:mi.pcDefault;function Rl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var d=t[l];if(/^(cmd|meta|m)$/i.test(d))s=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))n=!0;else if(/^s(hift)?$/i.test(d))r=!0;else throw new Error("Unrecognized modifier name: "+d)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Dl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var r=ot(i.split(" "),Rl),s=0;s<r.length;s++){var l=void 0,d=void 0;s==r.length-1?(d=r.join(" "),l=n):(d=r.slice(0,s+1).join(" "),l="...");var f=t[d];if(!f)t[d]=l;else if(f!=l)throw new Error("Inconsistent bindings for "+d)}delete e[i]}for(var g in t)e[g]=t[g];return e}function sr(e,t,i,n){t=io(t);var r=t.call?t.call(e,n):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&i(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return sr(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=sr(e,t.fallthrough[s],i,n);if(l)return l}}}function hs(e){var t=typeof e=="string"?e:Mi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function cs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ye?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ye?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ds(e,t){if(E&&e.keyCode==34&&e.char)return!1;var i=Mi[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),cs(i,e,t))}function io(e){return typeof e=="string"?mi[e]:e}function lr(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&Ct(s.from,Ie(n).to)<=0;){var l=n.pop();if(Ct(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}jn(e,function(){for(var d=n.length-1;d>=0;d--)or(e.doc,"",n[d].from,n[d].to,"+delete");er(e)})}function Fo(e,t,i){var n=ze(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Wo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new De(t.line,n,i<0?"after":"before")}function Ho(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=at(i,t.doc.direction);if(s){var l=r<0?Ie(s):s[0],d=r<0==(l.level==1),f=d?"after":"before",g;if(l.level>0||t.doc.direction=="rtl"){var M=Ji(t,i);g=r<0?i.text.length-1:0;var B=ai(t,M,g).top;g=vt(function(ee){return ai(t,M,ee).top==B},r<0==(l.level==1)?l.from:l.to-1,g),f=="before"&&(g=Fo(i,g,1))}else g=r<0?l.to:l.from;return new De(n,g,f)}}return new De(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=at(t,e.doc.direction);if(!r)return Wo(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=qe(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return Wo(t,i,n);var d=function(Ge,Ze){return Fo(t,Ge instanceof De?Ge.ch:Ge,Ze)},f,g=function(Ge){return e.options.lineWrapping?(f=f||Ji(e,t),ma(e,t,f,Ge)):{begin:0,end:t.text.length}},M=g(i.sticky=="before"?d(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var B=l.level==1==n<0,ee=d(i,B?1:-1);if(ee!=null&&(B?ee<=l.to&&ee<=M.end:ee>=l.from&&ee>=M.begin)){var Z=B?"before":"after";return new De(i.line,ee,Z)}}var Ce=function(Ge,Ze,Ve){for(var rt=function(Yt,fn){return fn?new De(i.line,d(Yt,1),"before"):new De(i.line,Yt,"after")};Ge>=0&&Ge<r.length;Ge+=Ze){var xt=r[Ge],gt=Ze>0==(xt.level!=1),Tt=gt?Ve.begin:d(Ve.end,-1);if(xt.from<=Tt&&Tt<xt.to)return rt(Tt,gt);if(Tt=gt?xt.from:d(xt.to,-1),Ve.begin<=Tt&&Tt<Ve.end)return rt(Tt,gt)}},Ae=Ce(s+n,n,M);if(Ae)return Ae;var je=n>0?M.end:d(M.begin,-1);return je!=null&&!(n>0&&je==t.text.length)&&(Ae=Ce(n>0?0:r.length-1,n,g(je)),Ae)?Ae:null}var Pr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),be)},killLine:function(e){return lr(e,function(t){if(t.empty()){var i=ut(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:De(t.head.line+1,0)}:{from:t.head,to:De(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return lr(e,function(t){return{from:De(t.from().line,0),to:o(e.doc,De(t.to().line+1,0))}})},delLineLeft:function(e){return lr(e,function(t){return{from:De(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return lr(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return lr(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"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(De(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(De(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ps(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},xe)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},xe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ps(e,t.head):n},xe)},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=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=Y(e.getLine(s.line),s.ch,n);t.push(I(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return jn(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var r=t[n].head,s=ut(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new De(r.line,r.ch-1)),r.ch>0)r=new De(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),De(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=ut(e.doc,r.line-1).text;l&&(r=new De(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),De(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ft(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return jn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);er(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function fs(e,t){var i=ut(e.doc,t),n=on(i);return n!=i&&(t=Ot(n)),Ho(!0,e,n,t,1)}function Nl(e,t){var i=ut(e.doc,t),n=ri(i);return n!=i&&(t=Ot(n)),Ho(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=ut(e.doc,i.line),r=at(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return De(i.line,l?0:s,i.sticky)}return i}function ro(e,t,i){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=Fe}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function Il(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=sr(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&sr(t,e.options.extraKeys,i,e)||sr(t,e.options.keyMap,i,e)}var Bl=new we;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(hs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Bl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ms(e,r+" "+t,i,n))return!0}return ms(e,t,i,n)}function ms(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&Xt(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(v(i),ko(e)),!!r}function gs(e,t){var i=ds(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return ro(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ro(e,n)}):Nr(e,i,t,function(n){return ro(e,n)}):!1}function jl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var zo=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=D(),ge(t,e))return;S&&L<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);E&&(zo=n?i:null,!n&&i==88&&!Dt&&(Q?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),X&&!Q&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;J(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(pe(t,"CodeMirror-crosshair"),et(document,"keyup",i),et(document,"mouseover",i))}ve(document,"keyup",i),ve(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),ge(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pi(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||Q&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(E&&i==zo){zo=null,v(e);return}if(E&&(!e.which||e.which<10)&&gs(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(jl(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,Go=function(e,t,i){this.time=e,this.pos=t,this.button=i};Go.prototype.compare=function(e,t,i){return this.time+Fl>e&&Ct(t,this.pos)==0&&i==this.button};var Ir,Br;function Wl(e,t){var i=+new Date;return Br&&Br.compare(i,e,t)?(Ir=Br=null,"triple"):Ir&&Ir.compare(i,e,t)?(Br=new Go(i,e,t),Ir=null,"double"):(Ir=new Go(i,e,t),Br=null,"single")}function xs(e){var t=this,i=t.display;if(ge(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){A||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=ji(t,e),r=he(e),s=n?Wl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):ne(e)==i.scroller&&v(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Oe?t.display.input.onContextMenu(e):Ca(t))}function Hl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,cs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d=l(e,i)!=Fe}finally{e.state.suppressEdits=!1}return d})}function zl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Le?i.shiftKey&&i.metaKey:i.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||i.shiftKey),r.addNew==null&&(r.addNew=Q?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(Q?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){S?setTimeout(w(xa,e),0):e.curOp.focus=D();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ne&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(Ct((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(Ct(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Xl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=cn(e,function(g){A&&(r.scroller.draggable=!1),e.state.draggingText=!1,et(r.wrapper.ownerDocument,"mouseup",l),et(r.wrapper.ownerDocument,"mousemove",d),et(r.scroller,"dragstart",f),et(r.scroller,"drop",l),s||(v(g),n.addNew||Qr(e.doc,i,null,null,n.extend),A&&!V||S&&L==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),d=function(g){s=s||Math.abs(t.clientX-g.clientX)+Math.abs(t.clientY-g.clientY)>=10},f=function(){return s=!0};A&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),ve(r.wrapper.ownerDocument,"mouseup",l),ve(r.wrapper.ownerDocument,"mousemove",d),ve(r.scroller,"dragstart",f),ve(r.scroller,"drop",l),Ca(e),setTimeout(function(){return r.input.focus()},20)}function Cs(e,t,i){if(i=="char")return new Ft(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ft(De(t.line,0),o(e.doc,De(t.line+1,0)));var n=i(e,t);return new Ft(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;v(t);var l,d,f=s.sel,g=f.ranges;if(n.addNew&&!n.extend?(d=s.sel.contains(i),d>-1?l=g[d]:l=new Ft(i,i)):(l=s.sel.primary(),d=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ft(i,i)),i=ji(e,t,!0,!0),d=-1;else{var M=Cs(e,i,n.unit);n.extend?l=jo(l,M.anchor,M.head,n.extend):l=M}n.addNew?d==-1?(d=g.length,Cn(s,qn(e,g.concat([l]),d),{scroll:!1,origin:"*mouse"})):g.length>1&&g[d].empty()&&n.unit=="char"&&!n.extend?(Cn(s,qn(e,g.slice(0,d).concat(g.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),f=s.sel):Uo(s,d,l,Se):(d=0,Cn(s,new Vn([l],0),Se),f=s.sel);var B=i;function ee(Ve){if(Ct(B,Ve)==0)return;if(B=Ve,n.unit=="rectangle"){for(var rt=[],xt=e.options.tabSize,gt=Y(ut(s,i.line).text,i.ch,xt),Tt=Y(ut(s,Ve.line).text,Ve.ch,xt),Yt=Math.min(gt,Tt),fn=Math.max(gt,Tt),Zt=Math.min(i.line,Ve.line),Un=Math.min(e.lastLine(),Math.max(i.line,Ve.line));Zt<=Un;Zt++){var Rn=ut(s,Zt).text,tn=Ee(Rn,Yt,xt);Yt==fn?rt.push(new Ft(De(Zt,tn),De(Zt,tn))):Rn.length>tn&&rt.push(new Ft(De(Zt,tn),De(Zt,Ee(Rn,fn,xt))))}rt.length||rt.push(new Ft(i,i)),Cn(s,qn(e,f.ranges.slice(0,d).concat(rt),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ve)}else{var Dn=l,xn=Cs(e,Ve,n.unit),an=Dn.anchor,nn;Ct(xn.anchor,an)>0?(nn=xn.head,an=Oi(Dn.from(),xn.anchor)):(nn=xn.anchor,an=di(Dn.to(),xn.head));var Qt=f.ranges.slice(0);Qt[d]=Kl(e,new Ft(o(s,an),nn)),Cn(s,qn(e,Qt,d),Se)}}var Z=r.wrapper.getBoundingClientRect(),Ce=0;function Ae(Ve){var rt=++Ce,xt=ji(e,Ve,!0,n.unit=="rectangle");if(!xt)return;if(Ct(xt,B)!=0){e.curOp.focus=D(),ee(xt);var gt=Xr(r,s);(xt.line>=gt.to||xt.line<gt.from)&&setTimeout(cn(e,function(){Ce==rt&&Ae(Ve)}),150)}else{var Tt=Ve.clientY<Z.top?-20:Ve.clientY>Z.bottom?20:0;Tt&&setTimeout(cn(e,function(){if(Ce!=rt)return;r.scroller.scrollTop+=Tt,Ae(Ve)}),50)}}function je(Ve){e.state.selectingText=!1,Ce=Infinity,Ve&&(v(Ve),r.input.focus()),et(r.wrapper.ownerDocument,"mousemove",Ge),et(r.wrapper.ownerDocument,"mouseup",Ze),s.history.lastSelOrigin=null}var Ge=cn(e,function(Ve){Ve.buttons===0||!he(Ve)?je(Ve):Ae(Ve)}),Ze=cn(e,je);e.state.selectingText=Ze,ve(r.wrapper.ownerDocument,"mousemove",Ge),ve(r.wrapper.ownerDocument,"mouseup",Ze)}function Kl(e,t){var i=t.anchor,n=t.head,r=ut(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var s=at(r);if(!s)return t;var l=qe(s,i.ch,i.sticky),d=s[l];if(d.from!=i.ch&&d.to!=i.ch)return t;var f=l+(d.from==i.ch==(d.level!=1)?0:1);if(f==0||f==s.length)return t;var g;if(n.line!=i.line)g=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var M=qe(s,n.ch,n.sticky),B=M-l||(n.ch-i.ch)*(d.level==1?-1:1);M==f-1||M==f?g=B<0:g=B>0}var ee=s[f+(g?-1:0)],Z=g==(ee.level==1),Ce=Z?ee.from:ee.to,Ae=Z?"after":"before";return i.ch==Ce&&i.sticky==Ae?t:new Ft(new De(i.line,Ce,Ae),n)}function ws(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(ee){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&v(t);var l=e.display,d=l.lineDiv.getBoundingClientRect();if(s>d.bottom||!R(e,i))return C(t);s-=d.top-l.viewOffset;for(var f=0;f<e.display.gutterSpecs.length;++f){var g=l.gutters.childNodes[f];if(g&&g.getBoundingClientRect().right>=r){var M=Kn(e.doc,s),B=e.display.gutterSpecs[f];return de(e,i,e,M,B.className,t),C(t)}}}function Vo(e,t){return ws(e,t,"gutterClick",!0)}function Es(e,t){if(pi(e.display,t)||Yl(e,t))return;if(ge(e,t,"contextmenu"))return;Oe||e.display.input.onContextMenu(t)}function Yl(e,t){return R(e,"gutterContextMenu")?ws(e,t,"gutterContextMenu",!1):!1}function Ss(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var ur={toString:function(){return"CodeMirror.Init"}},ks={},oo={};function $l(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(d,f,g){g!=ur&&s(d,f,g)}:s)}e.defineOption=i,e.Init=ur,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,No(n)},!0),i("indentUnit",2,No,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){kr(n),vr(n),An(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(f){for(var g=0;;){var M=f.text.indexOf(r,g);if(M==-1)break;g=M+r.length,s.push(De(l,M))}l++});for(var d=s.length-1;d>=0;d--)or(n.doc,r,s[d],De(s[d].line,s[d].ch+r.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,r,s){n.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=ur&&n.refresh()}),i("specialCharPlaceholder",ht,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",ie?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,r){return n.getInputField().spellcheck=r},!0),i("autocorrect",!1,function(n,r){return n.getInputField().autocorrect=r},!0),i("autocapitalize",!1,function(n,r){return n.getInputField().autocapitalize=r},!0),i("rtlMoveVisually",!He),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Ss(n),Sr(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),d=s!=ur&&io(s);d&&d.detach&&d.detach(n,l),l.attach&&l.attach(n,d||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Do(r,n.options.lineNumbers),Sr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?Eo(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return tr(n)},!0),i("scrollbarStyle","native",function(n){Ta(n),tr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=Do(n.options.gutters,r),Sr(n)},!0),i("firstLineNumber",1,Sr,!0),i("lineNumberFormatter",function(n){return n},Sr,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(qi(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,kr,!0),i("addModeClass",!1,kr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,kr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=ur;if(!t!=!n){var r=e.display.dragFunctions,s=t?ve:et;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Zl(e){e.options.lineWrapping?(J(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(pe(e.display.wrapper,"CodeMirror-wrap"),fi(e)),So(e),An(e),vr(e),setTimeout(function(){return tr(e)},100)}function $t(e,t){var i=this;if(!(this instanceof $t))return new $t(e,t);this.options=t=t?m(t):{},m(ks,t,!1);var n=t.value;typeof n=="string"?n=new On(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new $t.inputStyles[t.inputStyle](this),s=this.display=new hl(e,n,r,t);s.wrapper.CodeMirror=this,Ss(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ta(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 we,keySeq:null,specialChars:null},t.autofocus&&!ie&&s.input.focus(),S&&L<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ml(),Hi(this),this.curOp.forceUpdate=!0,Ba(this,n),t.autofocus&&!ie||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&_o(i)},20):qi(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],ur);Aa(this),t.finishInit&&t.finishInit(this);for(var d=0;d<Xo.length;++d)Xo[d](this);zi(this),A&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}$t.defaults=ks,$t.optionHandlers=oo;function Ql(e){var t=e.display;ve(t.scroller,"mousedown",cn(e,xs)),S&&L<11?ve(t.scroller,"dblclick",cn(e,function(f){if(ge(e,f))return;var g=ji(e,f);if(!g||Vo(e,f)||pi(e.display,f))return;v(f);var M=e.findWordAt(g);Qr(e.doc,M.anchor,M.head)})):ve(t.scroller,"dblclick",function(f){return ge(e,f)||v(f)}),ve(t.scroller,"contextmenu",function(f){return Es(e,f)}),ve(t.input.getField(),"contextmenu",function(f){t.scroller.contains(f.target)||Es(e,f)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(f){if(f.touches.length!=1)return!1;var g=f.touches[0];return g.radiusX<=1&&g.radiusY<=1}function l(f,g){if(g.left==null)return!0;var M=g.left-f.left,B=g.top-f.top;return M*M+B*B>20*20}ve(t.scroller,"touchstart",function(f){if(!ge(e,f)&&!s(f)&&!Vo(e,f)){t.input.ensurePolled(),clearTimeout(i);var g=+new Date;t.activeTouch={start:g,moved:!1,prev:g-n.end<=300?n:null},f.touches.length==1&&(t.activeTouch.left=f.touches[0].pageX,t.activeTouch.top=f.touches[0].pageY)}}),ve(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ve(t.scroller,"touchend",function(f){var g=t.activeTouch;if(g&&!pi(t,f)&&g.left!=null&&!g.moved&&new Date-g.start<300){var M=e.coordsChar(t.activeTouch,"page"),B;!g.prev||l(g,g.prev)?B=new Ft(M,M):!g.prev.prev||l(g,g.prev.prev)?B=e.findWordAt(M):B=new Ft(De(M.line,0),o(e.doc,De(M.line+1,0))),e.setSelection(B.anchor,B.head),e.focus(),v(f)}r()}),ve(t.scroller,"touchcancel",r),ve(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Fi(e,t.scroller.scrollLeft,!0),de(e,"scroll",e))}),ve(t.scroller,"mousewheel",function(f){return Da(e,f)}),ve(t.scroller,"DOMMouseScroll",function(f){return Da(e,f)}),ve(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(f){ge(e,f)||_(f)},over:function(f){ge(e,f)||(Ll(e,f),_(f))},start:function(f){return Tl(e,f)},drop:cn(e,_l),leave:function(f){ge(e,f)||ss(e)}};var d=t.input.getField();ve(d,"keyup",function(f){return ys.call(e,f)}),ve(d,"keydown",cn(e,vs)),ve(d,"keypress",cn(e,bs)),ve(d,"focus",function(f){return _o(e,f)}),ve(d,"blur",function(f){return qi(e,f)})}var Xo=[];$t.defineInitHook=function(e){return Xo.push(e)};function jr(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=re(e,t).state:i="prev");var l=e.options.tabSize,d=ut(r,t),f=Y(d.text,null,l);d.stateAfter&&(d.stateAfter=null);var g=d.text.match(/^\s*/)[0],M;if(!n&&!/\S/.test(d.text))M=0,i="not";else if(i=="smart"&&(M=r.mode.indent(s,d.text.slice(g.length),d.text),M==Fe||M>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?M=Y(ut(r,t-1).text,null,l):M=0:i=="add"?M=f+e.options.indentUnit:i=="subtract"?M=f-e.options.indentUnit:typeof i=="number"&&(M=f+i),M=Math.max(0,M);var B="",ee=0;if(e.options.indentWithTabs)for(var Z=Math.floor(M/l);Z;--Z)ee+=l,B+=" ";if(ee<M&&(B+=I(M-ee)),B!=g)return or(r,B,De(t,0),De(t,g.length),"+input"),d.stateAfter=null,!0;for(var Ce=0;Ce<r.sel.ranges.length;Ce++){var Ae=r.sel.ranges[Ce];if(Ae.head.line==t&&Ae.head.ch<g.length){var je=De(t,g.length);Uo(r,Ce,new Ft(je,je));break}}}var ei=null;function ao(e){ei=e}function Ko(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,d=r=="paste"||e.state.pasteIncoming>l,f=pt(t),g=null;if(d&&n.ranges.length>1)if(ei&&ei.text.join(`
|
|
`)==t){if(n.ranges.length%ei.text.length==0){g=[];for(var M=0;M<ei.text.length;M++)g.push(s.splitLines(ei.text[M]))}}else f.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(g=ot(f,function(Ge){return[Ge]}));for(var B=e.curOp.updateInput,ee=n.ranges.length-1;ee>=0;ee--){var Z=n.ranges[ee],Ce=Z.from(),Ae=Z.to();Z.empty()&&(i&&i>0?Ce=De(Ce.line,Ce.ch-i):e.state.overwrite&&!d?Ae=De(Ae.line,Math.min(ut(s,Ae.line).text.length,Ae.ch+Ie(f).length)):d&&ei&&ei.lineWise&&ei.text.join(`
|
|
`)==f.join(`
|
|
`)&&(Ce=Ae=De(Ce.line,0)));var je={from:Ce,to:Ae,text:g?g[ee%g.length]:f,origin:r||(d?"paste":e.state.cutIncoming>l?"cut":"+input")};rr(e.doc,je),Xt(e,"inputRead",e,je)}t&&!d&&Ts(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=B),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function _s(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&jn(t,function(){return Ko(t,i,0,null,"paste")}),!0}function Ts(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var d=0;d<s.electricChars.length;d++)if(t.indexOf(s.electricChars.charAt(d))>-1){l=jr(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(ut(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=jr(e,r.head.line,"smart")));l&&Xt(e,"electricInput",e,r.head.line)}}function Ls(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:De(r,0),head:De(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Ms(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function As(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return A?e.style.width="1000px":e.setAttribute("wrap","off"),G&&(e.style.border="1px solid black"),Ms(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&cn(this,t[n])(this,r,l),de(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](io(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:Sn(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");ct(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,An(this)}),removeOverlay:Sn(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,An(this);return}}}),indentLine:Sn(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),hi(this.doc,n)&&jr(this,n,r,s)}),indentSelection:Sn(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var d=r[l];if(d.empty())d.head.line>s&&(jr(this,d.head.line,n,!0),s=d.head.line,l==this.doc.sel.primIndex&&er(this));else{var f=d.from(),g=d.to(),M=Math.max(s,f.line);s=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var B=M;B<s;++B)jr(this,B,n);var ee=this.doc.sel.ranges;f.ch==0&&r.length==ee.length&&ee[l].from().ch>0&&Uo(this.doc,l,new Ft(f,ee[l].to()),be)}}}),getTokenAt:function(n,r){return Wt(this,n,r)},getLineTokens:function(n,r){return Wt(this,De(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=ke(this,ut(this.doc,n.line)),s=0,l=(r.length-1)/2,d=n.ch,f;if(d==0)f=r[2];else for(;;){var g=s+l>>1;if((g?r[g*2-1]:0)>=d)l=g;else if(r[g*2+1]<d)s=g+1;else{f=r[g*2+2];break}}var M=f?f.indexOf("overlay "):-1;return M<0?f:M==0?null:f.slice(0,M-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],d=this.getModeAt(n);if(typeof d[r]=="string")l[d[r]]&&s.push(l[d[r]]);else if(d[r])for(var f=0;f<d[r].length;f++){var g=l[d[r][f]];g&&s.push(g)}else d.helperType&&l[d.helperType]?s.push(l[d.helperType]):l[d.name]&&s.push(l[d.name]);for(var M=0;M<l._global.length;M++){var B=l._global[M];B.pred(d,this)&&fe(s,B.val)==-1&&s.push(B.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=c(s,n==null?s.first+s.size-1:n),re(this,n+1,r).state},cursorCoords:function(n,r){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=o(this.doc,n):s=n?l.from():l.to(),Qn(this,s,r||"page")},charCoords:function(n,r){return yo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=da(this,n,r||"page"),xo(this,n.left,n.top)},lineAtHeight:function(n,r){return n=da(this,{top:n,left:0},r||"page").top,Kn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,d;if(typeof n=="number"){var f=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>f&&(n=f,l=!0),d=ut(this.doc,n)}else d=n;return Hr(this,d,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Bn(d):0)},defaultTextHeight:function(){return Zi(this.display)},defaultCharWidth:function(){return Qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,d){var f=this.display;n=Qn(this,o(this.doc,n));var g=n.bottom,M=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),f.sizer.appendChild(r),l=="over")g=n.top;else if(l=="above"||l=="near"){var B=Math.max(f.wrapper.clientHeight,this.doc.height),ee=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>B)&&n.top>r.offsetHeight?g=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=B&&(g=n.bottom),M+r.offsetWidth>ee&&(M=ee-r.offsetWidth)}r.style.top=g+"px",r.style.left=r.style.right="",d=="right"?(M=f.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(d=="left"?M=0:d=="middle"&&(M=(f.sizer.clientWidth-r.offsetWidth)/2),r.style.left=M+"px"),s&&Js(this,{left:M,top:g,right:M+r.offsetWidth,bottom:g+r.offsetHeight})},triggerOnKeyDown:Sn(vs),triggerOnKeyPress:Sn(bs),triggerOnKeyUp:ys,triggerOnMouseDown:Sn(xs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:Sn(function(n){Ts(this,n)}),findPosH:function(n,r,s,l){var d=1;r<0&&(d=-1,r=-r);for(var f=o(this.doc,n),g=0;g<r&&!(f=Yo(this.doc,f,d,s,l),f.hitSide);++g);return f},moveH:Sn(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Yo(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},xe)}),deleteH:Sn(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):lr(this,function(d){var f=Yo(l,d.head,n,r,!1);return n<0?{from:f,to:d.head}:{from:d.head,to:f}})}),findPosV:function(n,r,s,l){var d=1,f=l;r<0&&(d=-1,r=-r);for(var g=o(this.doc,n),M=0;M<r;++M){var B=Qn(this,g,"div");if(f==null?f=B.left:B.left=f,g=Os(this,B,d,s),g.hitSide)break}return g},moveV:Sn(function(n,r){var s=this,l=this.doc,d=[],f=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(M){if(f)return n<0?M.from():M.to();var B=Qn(s,M.head,"div");M.goalColumn!=null&&(B.left=M.goalColumn),d.push(B.left);var ee=Os(s,B,n,r);return r=="page"&&M==l.sel.primary()&&Lo(s,yo(s,ee,"div").top-B.top),ee},xe),d.length)for(var g=0;g<l.sel.ranges.length;g++)l.sel.ranges[g].goalColumn=d[g]}),findWordAt:function(n){var r=this.doc,s=ut(r,n.line).text,l=n.ch,d=n.ch;if(s){var f=this.getHelper(n,"wordChars");(n.sticky=="before"||d==s.length)&&l?--l:++d;for(var g=s.charAt(l),M=Ye(g,f)?function(B){return Ye(B,f)}:/\s/.test(g)?function(B){return/\s/.test(B)}:function(B){return!/\s/.test(B)&&!Ye(B)};l>0&&M(s.charAt(l-1));)--l;for(;d<s.length&&M(s.charAt(d));)++d}return new Ft(De(n.line,l),De(n.line,d))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?J(this.display.cursorDiv,"CodeMirror-overwrite"):pe(this.display.cursorDiv,"CodeMirror-overwrite"),de(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==D()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Sn(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-oi(this)-this.display.barHeight,width:n.scrollWidth-oi(this)-this.display.barWidth,clientHeight:mo(this),clientWidth:Ii(this)}},scrollIntoView:Sn(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:De(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?Zs(this,n):Ea(this,n.from,n.to,n.margin)}),setSize:Sn(function(n,r){var s=this,l=function(f){return typeof f=="number"||/^\d+$/.test(String(f))?f+"px":f};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&ua(this);var d=this.display.viewFrom;this.doc.iter(d,this.display.viewTo,function(f){if(f.widgets){for(var g=0;g<f.widgets.length;g++)if(f.widgets[g].noHScroll){Ei(s,d,"widget");break}}++d}),this.curOp.forceUpdate=!0,de(this,"refresh",this)}),operation:function(n){return jn(this,n)},startOperation:function(){return Hi(this)},endOperation:function(){return zi(this)},refresh:Sn(function(){var n=this.display.cachedTextHeight;An(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Oo(this.display),(n==null||Math.abs(n-Zi(this.display))>.5||this.options.lineWrapping)&&So(this),de(this,"refresh",this)}),swapDoc:Sn(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ba(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Xt(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[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}},U(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function Yo(e,t,i,n,r){var s=t,l=i,d=ut(e,t.line),f=r&&e.direction=="rtl"?-i:i;function g(){var Ze=t.line+f;return Ze<e.first||Ze>=e.first+e.size?!1:(t=new De(Ze,t.ch,t.sticky),d=ut(e,Ze))}function M(Ze){var Ve;if(n=="codepoint"){var rt=d.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(rt)?Ve=null:Ve=new De(t.line,Math.max(0,Math.min(d.text.length,t.ch+i*(rt>=55296&&rt<56320?2:1))),-i)}else r?Ve=Pl(e.cm,d,t,i):Ve=Wo(d,t,i);if(Ve==null)if(!Ze&&g())t=Ho(r,e.cm,d,t.line,f);else return!1;else t=Ve;return!0}if(n=="char"||n=="codepoint")M();else if(n=="column")M(!0);else if(n=="word"||n=="group")for(var B=null,ee=n=="group",Z=e.cm&&e.cm.getHelper(t,"wordChars"),Ce=!0;!(i<0&&!M(!Ce));Ce=!1){var Ae=d.text.charAt(t.ch)||`
|
|
`,je=Ye(Ae,Z)?"w":ee&&Ae==`
|
|
`?"n":!ee||/\s/.test(Ae)?null:"p";if(ee&&!Ce&&!je&&(je="s"),B&&B!=je){i<0&&(i=1,M(),t.sticky="after");break}if(je&&(B=je),i>0&&!M(!Ce))break}var Ge=eo(e,t,s,l,!0);return ti(s,Ge)&&(Ge.hitSide=!0),Ge}function Os(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var d=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),f=Math.max(d-.5*Zi(e.display),3);l=(i>0?t.bottom:t.top)+i*f}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var g;!(g=xo(e,s,l),!g.outside);){if(i<0?l<=0:l>=r.height){g.hitSide=!0;break}l+=i*5}return g}var Gt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new we,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Gt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;Ms(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(d){for(var f=d.target;f;f=f.parentNode){if(f==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}ve(r,"paste",function(d){if(!s(d)||ge(n,d)||_s(d,n))return;L<=11&&setTimeout(cn(n,function(){return t.updateFromDOM()}),20)}),ve(r,"compositionstart",function(d){t.composing={data:d.data,done:!1}}),ve(r,"compositionupdate",function(d){t.composing||(t.composing={data:d.data,done:!1})}),ve(r,"compositionend",function(d){t.composing&&(d.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ve(r,"touchstart",function(){return i.forceCompositionEnd()}),ve(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(d){if(!s(d)||ge(n,d))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()}),d.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var f=Ls(n);ao({lineWise:!0,text:f.text}),d.type=="cut"&&n.operation(function(){n.setSelections(f.ranges,0,be),n.replaceSelection("",null,"cut")})}else return;if(d.clipboardData){d.clipboardData.clearData();var g=ei.text.join(`
|
|
`);if(d.clipboardData.setData("Text",g),d.clipboardData.getData("Text")==g){d.preventDefault();return}}var M=As(),B=M.firstChild;n.display.lineSpace.insertBefore(M,n.display.lineSpace.firstChild),B.value=ei.text.join(`
|
|
`);var ee=document.activeElement;me(B),setTimeout(function(){n.display.lineSpace.removeChild(M),ee.focus(),ee==r&&i.showPrimarySelection()},50)}ve(r,"copy",l),ve(r,"cut",l)},Gt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Gt.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},Gt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Gt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Gt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),r=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||r.line<t.display.viewFrom){e.removeAllRanges();return}var s=so(t,e.anchorNode,e.anchorOffset),l=so(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&Ct(Oi(s,l),n)==0&&Ct(di(s,l),r)==0)return;var d=t.display.view,f=n.line>=t.display.viewFrom&&Rs(t,n)||{node:d[0].measure.map[2],offset:0},g=r.line<t.display.viewTo&&Rs(t,r);if(!g){var M=d[d.length-1].measure,B=M.maps?M.maps[M.maps.length-1]:M.map;g={node:B[B.length-1],offset:B[B.length-2]-B[B.length-3]}}if(!f||!g){e.removeAllRanges();return}var ee=e.rangeCount&&e.getRangeAt(0),Z;try{Z=q(f.node,f.offset,g.offset,g.node)}catch(Ce){}Z&&(!X&&t.state.focused?(e.collapse(f.node,f.offset),Z.collapsed||(e.removeAllRanges(),e.addRange(Z))):(e.removeAllRanges(),e.addRange(Z)),ee&&e.anchorNode==null?e.addRange(ee):X&&this.startGracePeriod()),this.rememberSelection()},Gt.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)},Gt.prototype.showMultipleSelections=function(e){ce(this.cm.display.cursorDiv,e.cursors),ce(this.cm.display.selectionDiv,e.selection)},Gt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Gt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},Gt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Gt.prototype.blur=function(){this.div.blur()},Gt.prototype.getField=function(){return this.div},Gt.prototype.supportsTouch=function(){return!0},Gt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():jn(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)},Gt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Gt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(N&&k&&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 i=so(t,e.anchorNode,e.anchorOffset),n=so(t,e.focusNode,e.focusOffset);i&&n&&jn(t,function(){Cn(t.doc,ki(i,n),be),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Gt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=De(n.line-1,ut(e.doc,n.line-1).length)),r.ch==ut(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=De(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,d;n.line==t.viewFrom||(s=Ui(e,n.line))==0?(l=Ot(t.view[0].line),d=t.view[0].node):(l=Ot(t.view[s].line),d=t.view[s-1].node.nextSibling);var f=Ui(e,r.line),g,M;if(f==t.view.length-1?(g=t.viewTo-1,M=t.lineDiv.lastChild):(g=Ot(t.view[f+1].line)-1,M=t.view[f+1].node.previousSibling),!d)return!1;for(var B=e.doc.splitLines(tu(e,d,M,l,g)),ee=Fn(e.doc,De(l,0),De(g,ut(e.doc,g).text.length));B.length>1&&ee.length>1;)if(Ie(B)==Ie(ee))B.pop(),ee.pop(),g--;else if(B[0]==ee[0])B.shift(),ee.shift(),l++;else break;for(var Z=0,Ce=0,Ae=B[0],je=ee[0],Ge=Math.min(Ae.length,je.length);Z<Ge&&Ae.charCodeAt(Z)==je.charCodeAt(Z);)++Z;for(var Ze=Ie(B),Ve=Ie(ee),rt=Math.min(Ze.length-(B.length==1?Z:0),Ve.length-(ee.length==1?Z:0));Ce<rt&&Ze.charCodeAt(Ze.length-Ce-1)==Ve.charCodeAt(Ve.length-Ce-1);)++Ce;if(B.length==1&&ee.length==1&&l==n.line)for(;Z&&Z>n.ch&&Ze.charCodeAt(Ze.length-Ce-1)==Ve.charCodeAt(Ve.length-Ce-1);)Z--,Ce++;B[B.length-1]=Ze.slice(0,Ze.length-Ce).replace(/^\u200b+/,""),B[0]=B[0].slice(Z).replace(/\u200b+$/,"");var xt=De(l,Z),gt=De(g,ee.length?Ie(ee).length-Ce:0);if(B.length>1||B[0]||Ct(xt,gt))return or(e.doc,B,xt,gt,"+input"),!0},Gt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Gt.prototype.reset=function(){this.forceCompositionEnd()},Gt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Gt.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)},Gt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&jn(this.cm,function(){return An(e.cm)})},Gt.prototype.setUneditable=function(e){e.contentEditable="false"},Gt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||cn(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Gt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Gt.prototype.onContextMenu=function(){},Gt.prototype.resetPosition=function(){},Gt.prototype.needsContentAttribute=!0;function Rs(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=ut(e.doc,t.line),r=ra(i,n,t.line),s=at(n,e.doc.direction),l="left";if(s){var d=qe(s,t.ch);l=d%2?"right":"left"}var f=sa(r.map,t.ch,l);return f.offset=f.collapse=="right"?f.end:f.start,f}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function hr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,d=e.doc.lineSeparator(),f=!1;function g(Z){return function(Ce){return Ce.id==Z}}function M(){l&&(s+=d,f&&(s+=d),l=f=!1)}function B(Z){Z&&(M(),s+=Z)}function ee(Z){if(Z.nodeType==1){var Ce=Z.getAttribute("cm-text");if(Ce){B(Ce);return}var Ae=Z.getAttribute("cm-marker"),je;if(Ae){var Ge=e.findMarks(De(n,0),De(r+1,0),g(+Ae));Ge.length&&(je=Ge[0].find(0))&&B(Fn(e.doc,je.from,je.to).join(d));return}if(Z.getAttribute("contenteditable")=="false")return;var Ze=/^(pre|div|p|li|table|br)$/i.test(Z.nodeName);if(!/^br$/i.test(Z.nodeName)&&Z.textContent.length==0)return;Ze&&M();for(var Ve=0;Ve<Z.childNodes.length;Ve++)ee(Z.childNodes[Ve]);/^(pre|p)$/i.test(Z.nodeName)&&(f=!0),Ze&&(l=!0)}else Z.nodeType==3&&B(Z.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ee(t),t==i);)t=t.nextSibling,f=!1;return s}function so(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return hr(e.clipPos(De(e.display.viewTo-1)),!0);t=null,i=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 r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,r=!1;if(!t||!x(n,t))return hr(De(Ot(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?Ie(e.rest):e.line;return hr(De(Ot(s),s.text.length),r)}var l=t.nodeType==3?t:null,d=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));d.parentNode!=n;)d=d.parentNode;var f=e.measure,g=f.maps;function M(je,Ge,Ze){for(var Ve=-1;Ve<(g?g.length:0);Ve++)for(var rt=Ve<0?f.map:g[Ve],xt=0;xt<rt.length;xt+=3){var gt=rt[xt+2];if(gt==je||gt==Ge){var Tt=Ot(Ve<0?e.line:e.rest[Ve]),Yt=rt[xt]+Ze;return(Ze<0||gt!=je)&&(Yt=rt[xt+(Ze?1:0)]),De(Tt,Yt)}}}var B=M(l,d,i);if(B)return hr(B,r);for(var ee=d.nextSibling,Z=l?l.nodeValue.length-i:0;ee;ee=ee.nextSibling){if(B=M(ee,ee.firstChild,0),B)return hr(De(B.line,B.ch-Z),r);Z+=ee.textContent.length}for(var Ce=d.previousSibling,Ae=i;Ce;Ce=Ce.previousSibling){if(B=M(Ce,Ce.firstChild,-1),B)return hr(De(B.line,B.ch+Ae),r);Ae+=Ce.textContent.length}}var en=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new we,this.hasSelection=!1,this.composing=null};en.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),G&&(r.style.width="0px"),ve(r,"input",function(){S&&L>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),ve(r,"paste",function(l){if(ge(n,l)||_s(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(ge(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var d=Ls(n);ao({lineWise:!0,text:d.text}),l.type=="cut"?n.setSelections(d.ranges,null,be):(i.prevInput="",r.value=d.text.join(`
|
|
`),me(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}ve(r,"cut",s),ve(r,"copy",s),ve(e.scroller,"paste",function(l){if(pi(e,l)||ge(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var d=new Event("paste");d.clipboardData=l.clipboardData,r.dispatchEvent(d)}),ve(e.lineSpace,"selectstart",function(l){pi(e,l)||v(l)}),ve(r,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),ve(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},en.prototype.createField=function(e){this.wrapper=As(),this.textarea=this.wrapper.firstChild},en.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},en.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ya(e);if(e.options.moveInputWithCursor){var r=Qn(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},en.prototype.showSelection=function(e){var t=this.cm,i=t.display;ce(i.cursorDiv,e.cursors),ce(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},en.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&me(this.textarea),S&&L>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",S&&L>=9&&(this.hasSelection=null))},en.prototype.getField=function(){return this.textarea},en.prototype.supportsTouch=function(){return!1},en.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ie||D()!=this.textarea))try{this.textarea.focus()}catch(e){}},en.prototype.blur=function(){this.textarea.blur()},en.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},en.prototype.receivedFocus=function(){this.slowPoll()},en.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()})},en.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},en.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||$e(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=i.value;if(r==n&&!t.somethingSelected())return!1;if(S&&L>=9&&this.hasSelection===r||Q&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,d=Math.min(n.length,r.length);l<d&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return jn(t,function(){Ko(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},en.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},en.prototype.onKeyPress=function(){S&&L>=9&&(this.hasSelection=null),this.fastPoll()},en.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=ji(i,e),l=n.scroller.scrollTop;if(!s||E)return;var d=i.options.resetSelectionOnContextMenu;d&&i.doc.sel.contains(s)==-1&&cn(i,Cn)(i.doc,ki(s),be);var f=r.style.cssText,g=t.wrapper.style.cssText,M=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-M.top-5)+"px; left: "+(e.clientX-M.left-5)+`px;
|
|
z-index: 1000; background: `+(S?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var B;A&&(B=window.scrollY),n.input.focus(),A&&window.scrollTo(null,B),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=Z,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ee(){if(r.selectionStart!=null){var Ae=i.somethingSelected(),je="\u200B"+(Ae?r.value:"");r.value="\u21DA",r.value=je,t.prevInput=Ae?"":"\u200B",r.selectionStart=1,r.selectionEnd=je.length,n.selForContextMenu=i.doc.sel}}function Z(){if(t.contextMenuPending!=Z)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=g,r.style.cssText=f,S&&L<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!S||S&&L<9)&&ee();var Ae=0,je=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?cn(i,Ja)(i):Ae++<10?n.detectingSelectAll=setTimeout(je,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(je,200)}}if(S&&L>=9&&ee(),Oe){_(e);var Ce=function(){et(window,"mouseup",Ce),setTimeout(Z,20)};ve(window,"mouseup",Ce)}else setTimeout(Z,50)},en.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},en.prototype.setUneditable=function(){},en.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?m(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 i=D();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=d.getValue()}var r;if(e.form&&(ve(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(f){}}t.finishInit=function(f){f.save=n,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,n(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(et(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var d=$t(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return d}function ru(e){e.off=et,e.on=ve,e.wheelEventPixels=cl,e.Doc=On,e.splitLines=pt,e.countColumn=Y,e.findColumn=Ee,e.isWordChar=Be,e.Pass=Fe,e.signal=de,e.Line=wi,e.changeEnd=_i,e.scrollbarModel=_a,e.Pos=De,e.cmpPos=Ct,e.modes=Bt,e.mimeModes=kt,e.resolveMode=dt,e.getMode=En,e.modeExtensions=ln,e.extendMode=gn,e.copyState=_n,e.startState=Xn,e.innerMode=li,e.commands=Pr,e.keyMap=mi,e.keyName=ds,e.isModifierKey=hs,e.lookupKey=sr,e.normalizeKeyMap=Dl,e.StringStream=Nt,e.SharedTextMarker=Or,e.TextMarker=Li,e.LineWidget=Ar,e.e_preventDefault=v,e.e_stopPropagation=y,e.e_stop=_,e.addClass=J,e.contains=x,e.rmClass=pe,e.keyNames=Mi}$l($t),ql($t);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in On.prototype)On.prototype.hasOwnProperty(lo)&&fe(ou,lo)<0&&($t.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(On.prototype[lo]));return U(On),$t.inputStyles={textarea:en,contenteditable:Gt},$t.defineMode=function(e){!$t.defaults.mode&&e!="null"&&($t.defaults.mode=e),mn.apply(this,arguments)},$t.defineMIME=sn,$t.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),$t.defineMIME("text/plain","null"),$t.defineExtension=function(e,t){$t.prototype[e]=t},$t.defineDocExtension=function(e,t){On.prototype[e]=t},$t.fromTextArea=iu,ru($t),$t.version="5.58.2",$t})},Y1PL:function(Qe,We,b){"use strict";b.r(We),b.d(We,"ResizableTextArea",function(){return fe});var P=b("wx14"),le=b("1OyB"),X=b("vuIU"),ae=b("Ji7U"),te=b("LK+K"),K=b("q1tI"),S=b("VTBJ"),L=b("rePB"),A=b("Zm9Q"),W=b("Kwbf"),k=b("c+Xe"),E=b("m+aA"),V=b("bdgK"),H=new Map;function O(be){be.forEach(function(Se){var xe,Ee=Se.target;(xe=H.get(Ee))===null||xe===void 0||xe.forEach(function($){return $(Ee)})})}var G=new V.default(O),N=null,ie=null;function Q(be,Se){H.has(be)||(H.set(be,new Set),G.observe(be)),H.get(be).add(Se)}function Le(be,Se){H.has(be)&&(H.get(be).delete(Se),H.get(be).size||(G.unobserve(be),H.delete(be)))}var He=function(be){Object(ae.a)(xe,be);var Se=Object(te.a)(xe);function xe(){return Object(le.a)(this,xe),Se.apply(this,arguments)}return Object(X.a)(xe,[{key:"render",value:function(){return this.props.children}}]),xe}(K.Component),ue=K.createContext(null);function ye(be){var Se=be.children,xe=be.onBatchResize,Ee=K.useRef(0),$=K.useRef([]),I=K.useContext(ue),Ie=K.useCallback(function(ot,ct,Xe){Ee.current+=1;var Je=Ee.current;$.current.push({size:ot,element:ct,data:Xe}),Promise.resolve().then(function(){Je===Ee.current&&(xe==null||xe($.current),$.current=[])}),I==null||I(ot,ct,Xe)},[xe,I]);return K.createElement(ue.Provider,{value:Ie},Se)}function Oe(be){var Se=be.children,xe=be.disabled,Ee=K.useRef(null),$=K.useRef(null),I=K.useContext(ue),Ie=K.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),ot=K.isValidElement(Se)&&Object(k.c)(Se),ct=ot?Se.ref:null,Xe=K.useMemo(function(){return Object(k.a)(ct,Ee)},[ct,Ee]),Je=K.useRef(be);Je.current=be;var Te=K.useCallback(function(Be){var Ye=Je.current,tt=Ye.onResize,Ke=Ye.data,Pe=Be.getBoundingClientRect(),ze=Pe.width,vt=Pe.height,st=Be.offsetWidth,nt=Be.offsetHeight,qe=Math.floor(ze),ft=Math.floor(vt);if(Ie.current.width!==qe||Ie.current.height!==ft||Ie.current.offsetWidth!==st||Ie.current.offsetHeight!==nt){var at={width:qe,height:ft,offsetWidth:st,offsetHeight:nt};Ie.current=at;var it=st===Math.round(ze)?ze:st,ve=nt===Math.round(vt)?vt:nt,mt=Object(S.a)(Object(S.a)({},at),{},{offsetWidth:it,offsetHeight:ve});I==null||I(mt,Be,Ke),tt&&Promise.resolve().then(function(){tt(mt,Be)})}},[]);return K.useEffect(function(){var Be=Object(E.a)(Ee.current)||Object(E.a)($.current);return Be&&!xe&&Q(Be,Te),function(){return Le(Be,Te)}},[Ee.current,xe]),K.createElement(He,{ref:$},ot?K.cloneElement(Se,{ref:Xe}):Se)}var oe="rc-observer-key";function pe(be){var Se=be.children,xe=Object(A.a)(Se);return xe.map(function(Ee,$){var I=(Ee==null?void 0:Ee.key)||"".concat(oe,"-").concat($);return K.createElement(Oe,Object(P.a)({},be,{key:I}),Ee)})}pe.Collection=ye;var _e=pe,ce=b("bT9E"),T=b("TSYQ"),se=b.n(T),q=`
|
|
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
|
|
`,x=["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"],D={},J;function j(be){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xe=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(Se&&D[xe])return D[xe];var Ee=window.getComputedStyle(be),$=Ee.getPropertyValue("box-sizing")||Ee.getPropertyValue("-moz-box-sizing")||Ee.getPropertyValue("-webkit-box-sizing"),I=parseFloat(Ee.getPropertyValue("padding-bottom"))+parseFloat(Ee.getPropertyValue("padding-top")),Ie=parseFloat(Ee.getPropertyValue("border-bottom-width"))+parseFloat(Ee.getPropertyValue("border-top-width")),ot=x.map(function(Xe){return"".concat(Xe,":").concat(Ee.getPropertyValue(Xe))}).join(";"),ct={sizingStyle:ot,paddingSize:I,borderSize:Ie,boxSizing:$};return Se&&xe&&(D[xe]=ct),ct}function me(be){var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ee=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;J||(J=document.createElement("textarea"),J.setAttribute("tab-index","-1"),J.setAttribute("aria-hidden","true"),document.body.appendChild(J)),be.getAttribute("wrap")?J.setAttribute("wrap",be.getAttribute("wrap")):J.removeAttribute("wrap");var $=j(be,Se),I=$.paddingSize,Ie=$.borderSize,ot=$.boxSizing,ct=$.sizingStyle;J.setAttribute("style","".concat(ct,";").concat(q)),J.value=be.value||be.placeholder||"";var Xe=Number.MIN_SAFE_INTEGER,Je=Number.MAX_SAFE_INTEGER,Te=J.scrollHeight,Be;if(ot==="border-box"?Te+=Ie:ot==="content-box"&&(Te-=I),xe!==null||Ee!==null){J.value=" ";var Ye=J.scrollHeight-I;xe!==null&&(Xe=Ye*xe,ot==="border-box"&&(Xe=Xe+I+Ie),Te=Math.max(Xe,Te)),Ee!==null&&(Je=Ye*Ee,ot==="border-box"&&(Je=Je+I+Ie),Be=Te>Je?"":"hidden",Te=Math.min(Je,Te))}return{height:Te,minHeight:Xe,maxHeight:Je,overflowY:Be,resize:"none"}}var w=b("Gytx"),m=b.n(w),Y;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(Y||(Y={}));var we=function(be){Object(ae.a)(xe,be);var Se=Object(te.a)(xe);function xe(Ee){var $;return Object(le.a)(this,xe),$=Se.call(this,Ee),$.nextFrameActionId=void 0,$.resizeFrameId=void 0,$.textArea=void 0,$.saveTextArea=function(I){$.textArea=I},$.handleResize=function(I){var Ie=$.state.resizeStatus,ot=$.props,ct=ot.autoSize,Xe=ot.onResize;if(Ie!==Y.NONE)return;typeof Xe=="function"&&Xe(I),ct&&$.resizeOnNextFrame()},$.resizeOnNextFrame=function(){cancelAnimationFrame($.nextFrameActionId),$.nextFrameActionId=requestAnimationFrame($.resizeTextarea)},$.resizeTextarea=function(){var I=$.props.autoSize;if(!I||!$.textArea)return;var Ie=I.minRows,ot=I.maxRows,ct=me($.textArea,!1,Ie,ot);$.setState({textareaStyles:ct,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame($.resizeFrameId),$.resizeFrameId=requestAnimationFrame(function(){$.setState({resizeStatus:Y.RESIZED},function(){$.resizeFrameId=requestAnimationFrame(function(){$.setState({resizeStatus:Y.NONE}),$.fixFirefoxAutoScroll()})})})})},$.renderTextArea=function(){var I=$.props,Ie=I.prefixCls,ot=Ie===void 0?"rc-textarea":Ie,ct=I.autoSize,Xe=I.onResize,Je=I.className,Te=I.disabled,Be=$.state,Ye=Be.textareaStyles,tt=Be.resizeStatus,Ke=Object(ce.a)($.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Pe=se()(ot,Je,Object(L.a)({},"".concat(ot,"-disabled"),Te));"value"in Ke&&(Ke.value=Ke.value||"");var ze=Object(S.a)(Object(S.a)(Object(S.a)({},$.props.style),Ye),tt===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return K.createElement(_e,{onResize:$.handleResize,disabled:!(ct||Xe)},K.createElement("textarea",Object(P.a)({},Ke,{className:Pe,style:ze,ref:$.saveTextArea})))},$.state={textareaStyles:{},resizeStatus:Y.NONE},$}return Object(X.a)(xe,[{key:"componentDidUpdate",value:function($){($.value!==this.props.value||!m()($.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var $=this.textArea.selectionStart,I=this.textArea.selectionEnd;this.textArea.setSelectionRange($,I)}}catch(Ie){}}},{key:"render",value:function(){return this.renderTextArea()}}]),xe}(K.Component),fe=we,Ue=function(be){Object(ae.a)(xe,be);var Se=Object(te.a)(xe);function xe(Ee){var $;Object(le.a)(this,xe),$=Se.call(this,Ee),$.resizableTextArea=void 0,$.focus=function(){$.resizableTextArea.textArea.focus()},$.saveTextArea=function(Ie){$.resizableTextArea=Ie},$.handleChange=function(Ie){var ot=$.props.onChange;$.setValue(Ie.target.value,function(){$.resizableTextArea.resizeTextarea()}),ot&&ot(Ie)},$.handleKeyDown=function(Ie){var ot=$.props,ct=ot.onPressEnter,Xe=ot.onKeyDown;Ie.keyCode===13&&ct&&ct(Ie),Xe&&Xe(Ie)};var I=typeof Ee.value=="undefined"||Ee.value===null?Ee.defaultValue:Ee.value;return $.state={value:I},$}return Object(X.a)(xe,[{key:"setValue",value:function($,I){"value"in this.props||this.setState({value:$},I)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return K.createElement(fe,Object(P.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function($){return"value"in $?{value:$.value}:null}}]),xe}(K.Component),Fe=We.default=Ue},ZW9T:function(Qe,We,b){"use strict";b.d(We,"a",function(){return He});var P=b("k1fw"),le=b("miYZ"),X=b("tsqr"),ae=b("rAM+"),te=b("tJVT"),K=b("PpiC"),S=b("q1tI"),L=b.n(S),A=b("bdgK");function W(ue,ye,Oe,oe,pe){var _e=ye.getWordUntilPosition(Oe),ce={startLineNumber:Oe.lineNumber,endLineNumber:Oe.lineNumber,startColumn:_e.startColumn,endColumn:_e.endColumn},T=oe.map(function(se){return{label:se,kind:ue.languages.CompletionItemKind.Keyword,insertText:se,insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}});return pe.map(function(se){T.push(Object(P.a)(Object(P.a)({},se),{},{range:ce}))}),T}var k=function(ue){var ye={label:"ifelse",kind:ue.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet},Oe=["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"];ue.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ce,T){var se=W(ue,ce,T,Oe,[ye]);return{suggestions:se}}});var oe=["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"];ue.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ce,T){var se=[{label:"print",kind:ue.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet}],q=W(ue,ce,T,oe,se);return{suggestions:q}}});var pe=["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"];ue.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ce,T){var se=[ye,{label:"main",kind:ue.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:ue.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:ue.languages.CompletionItemInsertTextRule.InsertAsSnippet}],q=W(ue,ce,T,pe,se);return{suggestions:q}}})},E="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",V=b("LvDl");function H(ue){return/^\d+$/.test(ue)?"".concat(ue,"px"):ue}function O(){}var G=!1,N={"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 ie(){var ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=ue;if(Array.isArray(ue)){for(var Oe=0;Oe<ue.length;Oe++){var oe=N[ue[Oe]];if(oe)return oe}return ye[0]}return N[ye]||ye}var Q=null,Le=We.b=function(ue){var ye=ue.width,Oe=ye===void 0?"100%":ye,oe=ue.height,pe=oe===void 0?"100%":oe,_e=ue.value,ce=ue.language,T=ce===void 0?"javascript":ce,se=ue.style,q=se===void 0?{}:se,x=ue.options,D=x===void 0?{}:x,J=ue.overrideServices,j=J===void 0?{}:J,me=ue.theme,w=me===void 0?"vs-dark":me,m=ue.onEditBlur,Y=ue.onSave,we=ue.autoHeight,fe=we===void 0?!1:we,Ue=ue.forbidCopy,Fe=Ue===void 0?!1:Ue,be=ue.onChange,Se=be===void 0?O:be,xe=ue.editorDidMount,Ee=xe===void 0?O:xe,$=ue.onFocus,I=$===void 0?O:$,Ie=ue.filename,ot=Ie===void 0?"educoder.txt":Ie,ct=Object(K.a)(ue,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Xe=Object(S.useRef)(),Je=Object(S.useRef)({}),Te=Object(S.useRef)(),Be=Object(S.useRef)(!1),Ye=Object(S.useRef)(),tt=Object(S.useState)(!1),Ke=Object(te.a)(tt,2),Pe=Ke[0],ze=Ke[1];function vt(){var C;return Xe.current&&(C=new A.default(function(_){var ne=Object(ae.a)(_),he;try{for(ne.s();!(he=ne.n()).done;){var Ne=he.value;(Ne.target.offsetHeight>0||Ne.target.offsetWidth>0)&&Je.current.instance.layout()}}catch(yt){ne.e(yt)}finally{ne.f()}}),C.observe(Xe.current)),C}function st(){X.b.warn(decodeURIComponent(E))}var nt=function(){var _=Je.current.instance;if(_e!=null&&_&&Pe){var ne=_.getModel();ne&&_e!==ne.getValue()&&(G=!0,ne.setValue(_e),_.layout(),G=!1)}};Object(S.useEffect)(function(){Te.current&&clearTimeout(Te.current),Te.current=setTimeout(function(){nt()},500)},[_e,Pe,Je.current]);function qe(){var C=Je.current.instance;if(C){var _=C.getSelection(),ne=Je.current.pastePos||{},he=new Q.Range(ne.startLineNumber||_.endLineNumber,ne.startColumn||_.endColumn,ne.endLineNumber||_.endLineNumber,ne.endColumn||_.endColumn);setTimeout(function(){C.executeEdits("",[{range:he,text:""}])},300)}}function ft(C){(window.navigator.platform.match("Mac")?C.metaKey:C.ctrlKey)&&C.keyCode==83&&(C.preventDefault(),Y())}var at=function(){if(fe&&Je.current.instance){var _=Je.current.instance.getContentHeight();v(_<pe?pe:_)}else v(pe)};function it(C){var _=document.createEvent("MouseEvents");_.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),C.dispatchEvent(_)}function ve(C,_){var ne=window.URL||window.webkitURL||window,he=new Blob([_]),Ne=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ne.href=ne.createObjectURL(he),Ne.download=C,it(Ne)}Object(S.useEffect)(function(){at()},[at]),Object(S.useEffect)(function(){Xe.current&&!Pe&&b.e(27).then(b.t.bind(null,"M/lh",7)).then(function(C){try{Q=C,Je.current.instance=Q.editor.create(Xe.current,{value:_e,language:ie(T),theme:w,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},j);var _=Je.current.instance;if(Ee(_,Q),setTimeout(function(){at(),Je.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ve(ot||"educoder.txt",_.getValue())}})},500),Je.current.subscription=_.onDidChangeModelContent(function(he){Be.current?clearTimeout(Ye.current):(at(),Se(_.getValue(),he)),Ye.current=setTimeout(function(){Be.current=!1},500)}),window.Monaco||k(Q),Fe&&(_.addCommand(Q.KeyMod.CtrlCmd|Q.KeyMod.Shift|Q.KeyCode.KEY_V,function(){return st(),null}),_.addCommand(Q.KeyMod.CtrlCmd|Q.KeyCode.KEY_C,function(){return st(),null})),window.Monaco=Q,m&&_.onDidBlurEditorWidget(function(){m(_.getValue())}),I&&_.onDidFocusEditorText(function(){I(_.getValue())}),Fe){_.addCommand(Q.KeyMod.CtrlCmd|Q.KeyCode.KEY_V,function(){return st(),null}),_.onDidPaste(function(he){Je.current.pastePos=he});try{window.addEventListener("paste",qe)}catch(he){}}var ne=vt();return ze(!0),function(){var he=Je.current.instance;he.dispose();var Ne=he.getModel();Ne&&Ne.dispose(),Je.current.subscription&&Je.current.subscription.dispose(),Fe&&window.removeEventListener("paste",qe),ne.unobserve(Xe.current)}}catch(he){}})},[]),Object(S.useEffect)(function(){var C=Je.current.instance;if(C&&Pe)return document.addEventListener("keydown",ft,!1),function(){document.removeEventListener("keydown",ft)}},[Y,Pe]),Object(S.useEffect)(function(){var C=Je.current.instance;if(C&&Pe){var _=ie(T);Q.editor.setModelLanguage(C.getModel(),_),console.log("language:",T,C.getModel(),_)}},[T,Pe]),Object(S.useEffect)(function(){var C=Je.current.instance;C&&Pe&&Q.editor.setTheme(w)},[w,Pe]),Object(S.useEffect)(function(){var C=Je.current.instance;C&&Pe&&(C.updateOptions(Object(P.a)({},D)),setTimeout(function(){C.getModel().updateOptions(Object(P.a)({},D))},200))},[JSON.stringify(D),Pe]),Object(S.useEffect)(function(){var C=Je.current.instance;C&&Pe&&C.layout()},[Oe,pe,Pe]);var mt=Object(S.useState)(H(Oe)),et=Object(te.a)(mt,2),de=et[0],ge=et[1],z=Object(S.useState)(H(pe)),R=Object(te.a)(z,2),U=R[0],v=R[1],y=Object(P.a)(Object(P.a)({},q),{},{width:de,height:U});return L.a.createElement("div",{className:"my-monaco-editor",ref:Xe,style:y})};function He(ue){var ye=ue.width,Oe=ye===void 0?"100%":ye,oe=ue.height,pe=oe===void 0?"100%":oe,_e=ue.original,ce=ue.modified,T=ue.language,se=ue.options,q=se===void 0?{}:se,x=Object(S.useRef)(),D=Object(S.useState)(null),J=Object(te.a)(D,2),j=J[0],me=J[1];function w(fe){var Ue;return x.current&&(Ue=new A.default(function(Fe){var be=Object(ae.a)(Fe),Se;try{for(be.s();!(Se=be.n()).done;){var xe=Se.value;(xe.target.offsetHeight>0||xe.target.offsetWidth>0)&&fe.layout()}}catch(Ee){be.e(Ee)}finally{be.f()}}),Ue.observe(x.current)),Ue}Object(S.useEffect)(function(){x.current&&b.e(27).then(b.t.bind(null,"M/lh",7)).then(function(fe){Q=fe;var Ue=Q.editor.createDiffEditor(x.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},q),{},{wordWrap:!0}));me(Ue);var Fe=w(Ue);return function(){Ue.dispose();var be=Ue.getModel();be&&be.dispose(),Fe.unobserve(x.current)}})},[]),Object(S.useEffect)(function(){j&&j.setModel({original:Q.editor.createModel(_e,T),modified:Q.editor.createModel(ce,T)})},[_e,ce,T,j]);var m=H(Oe),Y=H(pe),we={width:m,height:Y};return L.a.createElement("div",{className:"my-diff-editor",ref:x,style:we})}},ZpRC:function(Qe,We,b){"use strict";function P(k){return typeof k=="object"&&k!=null&&k.nodeType===1}function le(k,E){return(!E||k!=="hidden")&&k!=="visible"&&k!=="clip"}function X(k,E){if(k.clientHeight<k.scrollHeight||k.clientWidth<k.scrollWidth){var V=getComputedStyle(k,null);return le(V.overflowY,E)||le(V.overflowX,E)||function(H){var O=function(G){if(!G.ownerDocument||!G.ownerDocument.defaultView)return null;try{return G.ownerDocument.defaultView.frameElement}catch(N){return null}}(H);return!!O&&(O.clientHeight<H.scrollHeight||O.clientWidth<H.scrollWidth)}(k)}return!1}function ae(k,E,V,H,O,G,N,ie){return G<k&&N>E||G>k&&N<E?0:G<=k&&ie<=V||N>=E&&ie>=V?G-k-H:N>E&&ie<V||G<k&&ie>V?N-E+O:0}var te=function(k,E){var V=window,H=E.scrollMode,O=E.block,G=E.inline,N=E.boundary,ie=E.skipOverflowHiddenElements,Q=typeof N=="function"?N:function(Ye){return Ye!==N};if(!P(k))throw new TypeError("Invalid target");for(var Le=document.scrollingElement||document.documentElement,He=[],ue=k;P(ue)&&Q(ue);){if((ue=ue.parentElement)===Le){He.push(ue);break}ue!=null&&ue===document.body&&X(ue)&&!X(document.documentElement)||ue!=null&&X(ue,ie)&&He.push(ue)}for(var ye=V.visualViewport?V.visualViewport.width:innerWidth,Oe=V.visualViewport?V.visualViewport.height:innerHeight,oe=window.scrollX||pageXOffset,pe=window.scrollY||pageYOffset,_e=k.getBoundingClientRect(),ce=_e.height,T=_e.width,se=_e.top,q=_e.right,x=_e.bottom,D=_e.left,J=O==="start"||O==="nearest"?se:O==="end"?x:se+ce/2,j=G==="center"?D+T/2:G==="end"?q:D,me=[],w=0;w<He.length;w++){var m=He[w],Y=m.getBoundingClientRect(),we=Y.height,fe=Y.width,Ue=Y.top,Fe=Y.right,be=Y.bottom,Se=Y.left;if(H==="if-needed"&&se>=0&&D>=0&&x<=Oe&&q<=ye&&se>=Ue&&x<=be&&D>=Se&&q<=Fe)return me;var xe=getComputedStyle(m),Ee=parseInt(xe.borderLeftWidth,10),$=parseInt(xe.borderTopWidth,10),I=parseInt(xe.borderRightWidth,10),Ie=parseInt(xe.borderBottomWidth,10),ot=0,ct=0,Xe="offsetWidth"in m?m.offsetWidth-m.clientWidth-Ee-I:0,Je="offsetHeight"in m?m.offsetHeight-m.clientHeight-$-Ie:0;if(Le===m)ot=O==="start"?J:O==="end"?J-Oe:O==="nearest"?ae(pe,pe+Oe,Oe,$,Ie,pe+J,pe+J+ce,ce):J-Oe/2,ct=G==="start"?j:G==="center"?j-ye/2:G==="end"?j-ye:ae(oe,oe+ye,ye,Ee,I,oe+j,oe+j+T,T),ot=Math.max(0,ot+pe),ct=Math.max(0,ct+oe);else{ot=O==="start"?J-Ue-$:O==="end"?J-be+Ie+Je:O==="nearest"?ae(Ue,be,we,$,Ie+Je,J,J+ce,ce):J-(Ue+we/2)+Je/2,ct=G==="start"?j-Se-Ee:G==="center"?j-(Se+fe/2)+Xe/2:G==="end"?j-Fe+I+Xe:ae(Se,Fe,fe,Ee,I+Xe,j,j+T,T);var Te=m.scrollLeft,Be=m.scrollTop;J+=Be-(ot=Math.max(0,Math.min(Be+ot,m.scrollHeight-we+Je))),j+=Te-(ct=Math.max(0,Math.min(Te+ct,m.scrollWidth-fe+Xe)))}me.push({el:m,top:ot,left:ct})}return me};function K(k){return k===Object(k)&&Object.keys(k).length!==0}function S(k,E){E===void 0&&(E="auto");var V="scrollBehavior"in document.body.style;k.forEach(function(H){var O=H.el,G=H.top,N=H.left;O.scroll&&V?O.scroll({top:G,left:N,behavior:E}):(O.scrollTop=G,O.scrollLeft=N)})}function L(k){return k===!1?{block:"end",inline:"nearest"}:K(k)?k:{block:"start",inline:"nearest"}}function A(k,E){var V=!k.ownerDocument.documentElement.contains(k);if(K(E)&&typeof E.behavior=="function")return E.behavior(V?[]:te(k,E));if(V)return;var H=L(E);return S(te(k,H),H.behavior)}var W=We.a=A},aRTE:function(Qe,We){Qe.exports={L:1,M:0,Q:3,H:2}},bNIU:function(Qe,We,b){Qe.exports={flex_box_center:"flex_box_center___4ZFPv",flex_space_between:"flex_space_between___1poVp",flex_box_vertical_center:"flex_box_vertical_center___2vHuy",flex_box_center_end:"flex_box_center_end___3AGfr",flex_box_column:"flex_box_column___9QgjS",bg:"bg___2D1BG",flexRow:"flexRow___3qWci",flexJustifyCenter:"flexJustifyCenter___ONt7G",flexAlignEnd:"flexAlignEnd___XXRbD",flexAlingCenter:"flexAlingCenter___3bK98",flexAlignCenter:"flexAlignCenter___2Ct2A",flexColumn:"flexColumn___JTR6P",formWrap:"formWrap___3QUHG",titleWrap:"titleWrap___1MIxp",fieldWrap:"fieldWrap___YXlbk",mdWrap:"mdWrap___ZlPmu",backgroundFa:"backgroundFa___2s4Lu",button:"button___KQ_S9",icons:"icons___zqUcb",navBar:"navBar___3taGH",active:"active____5MwL",tipWrap:"tipWrap___2wfhG",tip:"tip___3fuVl",width300:"width300___1tL-J",popover:"popover___2mWr7",groupWrap:"groupWrap___2zY7s",check:"check___3Eies"}},bT9E:function(Qe,We,b){"use strict";b.d(We,"a",function(){return le});var P=b("VTBJ");function le(X,ae){var te=Object(P.a)({},X);return Array.isArray(ae)&&ae.forEach(function(K){delete te[K]}),te}},c5Ni:function(Qe,We,b){},dQei:function(Qe,We){for(var b={glog:function(le){if(le<1)throw new Error("glog("+le+")");return b.LOG_TABLE[le]},gexp:function(le){for(;le<0;)le+=255;for(;le>=256;)le-=255;return b.EXP_TABLE[le]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},P=0;P<8;P++)b.EXP_TABLE[P]=1<<P;for(var P=8;P<256;P++)b.EXP_TABLE[P]=b.EXP_TABLE[P-4]^b.EXP_TABLE[P-5]^b.EXP_TABLE[P-6]^b.EXP_TABLE[P-8];for(var P=0;P<255;P++)b.LOG_TABLE[b.EXP_TABLE[P]]=P;Qe.exports=b},dWSS:function(Qe,We,b){var P=b("dQei");function le(X,ae){if(X.length==null)throw new Error(X.length+"/"+ae);for(var te=0;te<X.length&&X[te]==0;)te++;this.num=new Array(X.length-te+ae);for(var K=0;K<X.length-te;K++)this.num[K]=X[K+te]}le.prototype={get:function(X){return this.num[X]},getLength:function(){return this.num.length},multiply:function(X){for(var ae=new Array(this.getLength()+X.getLength()-1),te=0;te<this.getLength();te++)for(var K=0;K<X.getLength();K++)ae[te+K]^=P.gexp(P.glog(this.get(te))+P.glog(X.get(K)));return new le(ae,0)},mod:function(X){if(this.getLength()-X.getLength()<0)return this;for(var ae=P.glog(this.get(0))-P.glog(X.get(0)),te=new Array(this.getLength()),K=0;K<this.getLength();K++)te[K]=this.get(K);for(var K=0;K<X.getLength();K++)te[K]^=P.gexp(P.glog(X.get(K))+ae);return new le(te,0).mod(X)}},Qe.exports=le},dejd:function(Qe,We,b){},dmUQ:function(Qe,We,b){"use strict";var P=b("Ff2n"),le=b("rePB"),X=b("1OyB"),ae=b("vuIU"),te=b("Ji7U"),K=b("md7G"),S=b("foSv"),L=b("q1tI"),A=b.n(L),W=b("TSYQ"),k=b.n(W),E=b("4IlW");function V(ce,T){var se=Object.keys(ce);if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(ce);T&&(q=q.filter(function(x){return Object.getOwnPropertyDescriptor(ce,x).enumerable})),se.push.apply(se,q)}return se}function H(ce){for(var T=1;T<arguments.length;T++){var se=arguments[T]!=null?arguments[T]:{};T%2?V(Object(se),!0).forEach(function(q){Object(le.a)(ce,q,se[q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(ce,Object.getOwnPropertyDescriptors(se)):V(Object(se)).forEach(function(q){Object.defineProperty(ce,q,Object.getOwnPropertyDescriptor(se,q))})}return ce}function O(ce){var T=G();return function(){var q=Object(S.a)(ce),x;if(T){var D=Object(S.a)(this).constructor;x=Reflect.construct(q,arguments,D)}else x=q.apply(this,arguments);return Object(K.a)(this,x)}}function G(){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(ce){return!1}}function N(){}function ie(ce){ce.preventDefault()}var Q=function(T){return T.replace(/[^\w.-]+/g,"")},Le=200,He=600,ue=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ye=function(T){return T!=null},Oe=function(T,se){return se===T||typeof se=="number"&&typeof T=="number"&&isNaN(se)&&isNaN(T)},oe=function(ce){Object(te.a)(se,ce);var T=O(se);function se(q){var x;Object(X.a)(this,se),x=T.call(this,q),x.onKeyDown=function(j){var me=x.props,w=me.onKeyDown,m=me.onPressEnter;if(j.keyCode===E.a.UP){var Y=x.getRatio(j);x.up(j,Y,null),x.stop()}else if(j.keyCode===E.a.DOWN){var we=x.getRatio(j);x.down(j,we,null),x.stop()}else j.keyCode===E.a.ENTER&&m&&m(j);if(x.recordCursorPosition(),x.lastKeyCode=j.keyCode,w){for(var fe=arguments.length,Ue=new Array(fe>1?fe-1:0),Fe=1;Fe<fe;Fe++)Ue[Fe-1]=arguments[Fe];w.apply(void 0,[j].concat(Ue))}},x.onKeyUp=function(j){var me=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),me){for(var w=arguments.length,m=new Array(w>1?w-1:0),Y=1;Y<w;Y++)m[Y-1]=arguments[Y];me.apply(void 0,[j].concat(m))}},x.onChange=function(j){var me=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(j)),x.setState({inputValue:x.rawInput}),me(x.toNumber(x.rawInput))},x.onMouseUp=function(){var j=x.props.onMouseUp;x.recordCursorPosition(),j&&j.apply(void 0,arguments)},x.onFocus=function(){var j;x.setState({focused:!0}),(j=x.props).onFocus.apply(j,arguments)},x.onBlur=function(){var j=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var me=x.getCurrentValidValue(x.state.inputValue),w=x.setValue(me,N);if(j){var m=x.input.value,Y=x.getInputDisplayValue({focus:!1,value:w});x.input.value=Y&&Number(Y),j.apply(void 0,arguments),x.input.value=m}},x.getRatio=function(j){var me=1;return j.metaKey||j.ctrlKey?me=.1:j.shiftKey&&(me=10),me},x.getFullNum=function(j){return isNaN(j)?j:/e/i.test(String(j))?Number(j).toFixed(18).replace(/\.?0+$/,""):j},x.getPrecision=function(j){if(ye(x.props.precision))return x.props.precision;var me=String(j);if(me.indexOf("e-")>=0)return parseInt(me.slice(me.indexOf("e-")+2),10);var w=0;return me.indexOf(".")>=0&&(w=me.length-me.indexOf(".")-1),w},x.getInputDisplayValue=function(j){var me=j||x.state,w=me.focused,m=me.inputValue,Y=me.value,we;w?we=m:we=x.toPrecisionAsStep(Y),we==null&&(we="");var fe=x.formatWrapper(we);return ye(x.props.decimalSeparator)&&(fe=fe.toString().replace(".",x.props.decimalSeparator)),fe},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(j){}},x.restoreByAfter=function(j){if(j===void 0)return!1;var me=x.input.value,w=me.lastIndexOf(j);if(w===-1)return!1;var m=x.cursorBefore.length;return x.lastKeyCode===E.a.DELETE&&x.cursorBefore.charAt(m-1)===j[0]?(x.fixCaret(m,m),!0):w+j.length===me.length?(x.fixCaret(w,w),!0):!1},x.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(me,w){var m=j.substring(w);return x.restoreByAfter(m)})},x.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(j,me,w){x.pressingUpOrDown=!0,x.step("down",j,me,w)},x.up=function(j,me,w){x.pressingUpOrDown=!0,x.step("up",j,me,w)},x.saveInput=function(j){x.input=j};var D=q.value;D===void 0&&(D=q.defaultValue),x.state={focused:q.autoFocus};var J=x.getValidValue(x.toNumber(D));return x.state=H(H({},x.state),{},{inputValue:x.toPrecisionAsStep(J),value:J}),x}return Object(ae.a)(se,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var D=this.props,J=D.value,j=D.onChange,me=D.max,w=D.min,m=this.state.focused;if(x){if(!Oe(x.value,J)||!Oe(x.max,me)||!Oe(x.min,w)){var Y=m?J:this.getValidValue(J),we;this.pressingUpOrDown?we=Y:this.inputting?we=this.rawInput:we=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:we})}var fe="value"in this.props?J:this.state.value;"max"in this.props&&x.max!==me&&typeof fe=="number"&&fe>me&&j&&j(me),"min"in this.props&&x.min!==w&&typeof fe=="number"&&fe<w&&j&&j(w)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ue=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===E.a.BACKSPACE?Ue=this.cursorStart-1:this.lastKeyCode===E.a.DELETE&&(Ue=this.cursorStart):Ue=this.input.value.length,this.fixCaret(Ue,Ue)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case E.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case E.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Fe){}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(x){var D=x;return D===""?D="":this.isNotCompleteNumber(parseFloat(D))?D=this.state.value:D=this.getValidValue(D),this.toNumber(D)}},{key:"getValueFromEvent",value:function(x){var D=x.target.value.trim().replace(/。/g,".");return ye(this.props.decimalSeparator)&&(D=D.replace(this.props.decimalSeparator,".")),D}},{key:"getValidValue",value:function(x){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,j=parseFloat(x);return isNaN(j)?x:(j<D&&(j=D),j>J&&(j=J),j)}},{key:"setValue",value:function(x,D){var J=this.props.precision,j=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),me=this.state.value,w=me===void 0?null:me,m=this.state.inputValue,Y=m===void 0?null:m,we=typeof j=="number"?j.toFixed(J):"".concat(j),fe=j!==w||we!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},D)):this.setState({value:j,inputValue:this.toPrecisionAsStep(x)},D),fe&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(x){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,J=this.props,j=J.precision,me=J.step;if(ye(j))return j;var w=this.getPrecision(D),m=this.getPrecision(me),Y=this.getPrecision(x);return x?Math.max(Y,w+m):w+m}},{key:"getPrecisionFactor",value:function(x){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,J=this.getMaxPrecision(x,D);return Math.pow(10,J)}},{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(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var D=Math.abs(this.getMaxPrecision(x));return isNaN(D)?x.toString():Number(x).toFixed(D)}},{key:"toNumber",value:function(x){var D=this.props.precision,J=this.state.focused,j=x&&x.length>16&&J;return this.isNotCompleteNumber(x)||j?x:ye(D)?Math.round(x*Math.pow(10,D))/Math.pow(10,D):Number(x)}},{key:"upStep",value:function(x,D){var J=this.props.step,j=this.getPrecisionFactor(x,D),me=Math.abs(this.getMaxPrecision(x,D)),w=((j*x+j*J*D)/j).toFixed(me);return this.toNumber(w)}},{key:"downStep",value:function(x,D){var J=this.props.step,j=this.getPrecisionFactor(x,D),me=Math.abs(this.getMaxPrecision(x,D)),w=((j*x-j*J*D)/j).toFixed(me);return this.toNumber(w)}},{key:"step",value:function(x,D){var J=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,me=arguments.length>3?arguments[3]:void 0;this.stop(),D&&(D.persist(),D.preventDefault());var w=this.props;if(w.disabled)return;var m=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(m))return;var Y=this["".concat(x,"Step")](m,j),we=Y>w.max||Y<w.min;if(Y>w.max?Y=w.max:Y<w.min&&(Y=w.min),this.setValue(Y,null),this.setState({focused:!0},function(){J.pressingUpOrDown=!1}),we)return;this.autoStepTimer=setTimeout(function(){J[x](D,j,!0)},me?Le:He)}},{key:"fixCaret",value:function(x,D){if(x===void 0||D===void 0||!this.input||!this.input.value)return;try{var J=this.input.selectionStart,j=this.input.selectionEnd;(x!==J||D!==j)&&this.input.setSelectionRange(x,D)}catch(me){}}},{key:"render",value:function(){var x,D=this.props,J=D.prefixCls,j=D.disabled,me=D.readOnly,w=D.useTouch,m=D.autoComplete,Y=D.upHandler,we=D.downHandler,fe=D.className,Ue=D.max,Fe=D.min,be=D.style,Se=D.title,xe=D.onMouseEnter,Ee=D.onMouseLeave,$=D.onMouseOver,I=D.onMouseOut,Ie=D.required,ot=D.onClick,ct=D.tabIndex,Xe=D.type,Je=D.placeholder,Te=D.id,Be=D.inputMode,Ye=D.pattern,tt=D.step,Ke=D.maxLength,Pe=D.autoFocus,ze=D.name,vt=D.onPaste,st=D.onInput,nt=Object(P.a)(D,["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"]),qe=this.state,ft=qe.value,at=qe.focused,it=k()(J,(x={},Object(le.a)(x,fe,!!fe),Object(le.a)(x,"".concat(J,"-disabled"),j),Object(le.a)(x,"".concat(J,"-focused"),at),x)),ve={};Object.keys(nt).forEach(function(_){(_.substr(0,5)==="data-"||_.substr(0,5)==="aria-"||_==="role")&&(ve[_]=nt[_])});var mt=!me&&!j,et=this.getInputDisplayValue(null),de=(ft||ft===0)&&(isNaN(ft)||Number(ft)>=Ue),ge=(ft||ft===0)&&(isNaN(ft)||Number(ft)<=Fe),z=de||j||me,R=ge||j||me,U=k()("".concat(J,"-handler"),"".concat(J,"-handler-up"),Object(le.a)({},"".concat(J,"-handler-up-disabled"),z)),v=k()("".concat(J,"-handler"),"".concat(J,"-handler-down"),Object(le.a)({},"".concat(J,"-handler-down-disabled"),R)),y=w?{onTouchStart:z?N:this.up,onTouchEnd:this.stop}:{onMouseDown:z?N:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},C=w?{onTouchStart:R?N:this.down,onTouchEnd:this.stop}:{onMouseDown:R?N:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return A.a.createElement("div",{className:it,style:be,title:Se,onMouseEnter:xe,onMouseLeave:Ee,onMouseOver:$,onMouseOut:I,onFocus:function(){return null},onBlur:function(){return null}},A.a.createElement("div",{className:"".concat(J,"-handler-wrap")},A.a.createElement("span",Object.assign({unselectable:"on"},y,{role:"button","aria-label":"Increase Value","aria-disabled":z,className:U}),Y||A.a.createElement("span",{unselectable:"on",className:"".concat(J,"-handler-up-inner"),onClick:ie})),A.a.createElement("span",Object.assign({unselectable:"on"},C,{role:"button","aria-label":"Decrease Value","aria-disabled":R,className:v}),we||A.a.createElement("span",{unselectable:"on",className:"".concat(J,"-handler-down-inner"),onClick:ie}))),A.a.createElement("div",{className:"".concat(J,"-input-wrap")},A.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Fe,"aria-valuemax":Ue,"aria-valuenow":ft,required:Ie,type:Xe,placeholder:Je,onPaste:vt,onClick:ot,onMouseUp:this.onMouseUp,className:"".concat(J,"-input"),tabIndex:ct,autoComplete:m,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:mt?this.onKeyDown:N,onKeyUp:mt?this.onKeyUp:N,autoFocus:Pe,maxLength:Ke,readOnly:me,disabled:j,max:Ue,min:Fe,step:tt,name:ze,title:Se,id:Te,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(et),pattern:Ye,inputMode:Be,onInput:st},ve))))}}]),se}(A.a.Component);oe.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ue,min:-ue,step:1,style:{},onChange:N,onKeyDown:N,onPressEnter:N,onFocus:N,onBlur:N,parser:Q,required:!1,autoComplete:"off"};var pe=oe,_e=We.a=pe},f4xo:function(Qe,We,b){var P=b("nVVt");function le(X){this.mode=P.MODE_8BIT_BYTE,this.data=X}le.prototype={getLength:function(X){return this.data.length},write:function(X){for(var ae=0;ae<this.data.length;ae++)X.put(this.data.charCodeAt(ae),8)}},Qe.exports=le},fnXi:function(Qe,We,b){"use strict";var P=b("2qtc"),le=b("kLXV"),X=b("q1tI"),ae=b.n(X),te=b("Ty5D"),K=b("9kvl"),S=b("93VE"),L=b.n(S),A=function(k){var E=k.activeIndex,V=k.isEdit,H=V===void 0?!0:V,O=k.dispatch,G=k.practiceSetting,N=Object(te.i)(),ie=N.id,Q=N.challengesId,Le=Object(X.useMemo)(function(){return[{name:"\u672C\u5173\u4EFB\u52A1",url:"/shixuns/".concat(ie,"/edit/").concat(Q,"/editcheckpoint")},{name:"\u8BC4\u6D4B\u8BBE\u7F6E",url:"/shixuns/".concat(ie,"/edit/").concat(Q,"/tab=2")},{name:"\u6837\u4F8B\u4EE3\u7801",url:"/shixuns/".concat(ie,"/edit/").concat(Q,"/tab=3")},{name:"\u5173\u5361\u6392\u884C\u699C",url:"/shixuns/".concat(ie,"/edit/").concat(Q,"/tab=4")}]},[ie,Q]),He=function(ye){var Oe,oe=function(){K.d.push(ye),O({type:"practiceSetting/setSideBarTabs",payload:{confirmLeave:!1}})};G!=null&&(Oe=G.sideBar)!==null&&Oe!==void 0&&Oe.confirmLeave?le.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(){oe()}}):oe()};return ae.a.createElement("ul",{className:"challenge-nav"},H?Le.map(function(ue,ye){return E===ye?ae.a.createElement("li",{key:ue.url}," ",ae.a.createElement("a",{className:"active"},ue.name)," "):ae.a.createElement("li",{key:ue.url}," ",ae.a.createElement("a",{onClick:function(){return He(ue.url)}},ue.name)," ")}):ae.a.createElement("li",{key:Le[0].url}," ",ae.a.createElement("a",{className:"active"},Le[0].name)," "))};We.a=Object(K.a)(function(W){var k=W.globalSetting,E=W.practiceSetting;return{globalSetting:k,practiceSetting:E}})(A)},kSUc:function(Qe,We,b){},lZu9:function(Qe,We,b){(function(P){P(b("VrN/"),b("1eCo"),b("8EBN"))})(function(P){"use strict";P.defineMode("markdown",function(le,X){var ae=P.getMode(le,"text/html"),te=ae.name=="null";function K(w){if(P.findModeByName){var m=P.findModeByName(w);m&&(w=m.mime||m.mimes[0])}var Y=P.getMode(le,w);return Y.name=="null"?null:Y}X.highlightFormatting===void 0&&(X.highlightFormatting=!1),X.maxBlockquoteDepth===void 0&&(X.maxBlockquoteDepth=0),X.taskLists===void 0&&(X.taskLists=!1),X.strikethrough===void 0&&(X.strikethrough=!1),X.emoji===void 0&&(X.emoji=!1),X.fencedCodeBlockHighlighting===void 0&&(X.fencedCodeBlockHighlighting=!0),X.fencedCodeBlockDefaultMode===void 0&&(X.fencedCodeBlockDefaultMode="text/plain"),X.xml===void 0&&(X.xml=!0),X.tokenTypeOverrides===void 0&&(X.tokenTypeOverrides={});var S={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 L in S)S.hasOwnProperty(L)&&X.tokenTypeOverrides[L]&&(S[L]=X.tokenTypeOverrides[L]);var A=/^([*\-_])(?:\s*\1){2,}\s*$/,W=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,k=/^\[(x| )\](?=\s)/i,E=X.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,V=/^ {0,3}(?:\={1,}|-{2,})\s*$/,H=/^[^#!\[\]*_\\<>` "'(~:]+/,O=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,G=/^\s*\[[^\]]+?\]:.*$/,N=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,ie=" ";function Q(w,m,Y){return m.f=m.inline=Y,Y(w,m)}function Le(w,m,Y){return m.f=m.block=Y,Y(w,m)}function He(w){return!w||!/\S/.test(w.string)}function ue(w){if(w.linkTitle=!1,w.linkHref=!1,w.linkText=!1,w.em=!1,w.strong=!1,w.strikethrough=!1,w.quote=0,w.indentedCode=!1,w.f==Oe){var m=te;if(!m){var Y=P.innerMode(ae,w.htmlState);m=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}m&&(w.f=ce,w.block=ye,w.htmlState=null)}return w.trailingSpace=0,w.trailingSpaceNewLine=!1,w.prevLine=w.thisLine,w.thisLine={stream:null},null}function ye(w,m){var Y=w.column()===m.indentation,we=He(m.prevLine.stream),fe=m.indentedCode,Ue=m.prevLine.hr,Fe=m.list!==!1,be=(m.listStack[m.listStack.length-1]||0)+3;m.indentedCode=!1;var Se=m.indentation;if(m.indentationDiff===null&&(m.indentationDiff=m.indentation,Fe)){for(m.list=null;Se<m.listStack[m.listStack.length-1];)m.listStack.pop(),m.listStack.length?m.indentation=m.listStack[m.listStack.length-1]:m.list=!1;m.list!==!1&&(m.indentationDiff=Se-m.listStack[m.listStack.length-1])}var xe=!we&&!Ue&&!m.prevLine.header&&(!Fe||!fe)&&!m.prevLine.fencedCodeEnd,Ee=(m.list===!1||Ue||we)&&m.indentation<=be&&w.match(A),$=null;if(m.indentationDiff>=4&&(fe||m.prevLine.fencedCodeEnd||m.prevLine.header||we))return w.skipToEnd(),m.indentedCode=!0,S.code;if(w.eatSpace())return null;if(Y&&m.indentation<=be&&($=w.match(E))&&$[1].length<=6)return m.quote=0,m.header=$[1].length,m.thisLine.header=!0,X.highlightFormatting&&(m.formatting="header"),m.f=m.inline,pe(m);if(m.indentation<=be&&w.eat(">"))return m.quote=Y?1:m.quote+1,X.highlightFormatting&&(m.formatting="quote"),w.eatSpace(),pe(m);if(!Ee&&!m.setext&&Y&&m.indentation<=be&&($=w.match(W))){var I=$[1]?"ol":"ul";return m.indentation=Se+w.current().length,m.list=!0,m.quote=0,m.listStack.push(m.indentation),m.em=!1,m.strong=!1,m.code=!1,m.strikethrough=!1,X.taskLists&&w.match(k,!1)&&(m.taskList=!0),m.f=m.inline,X.highlightFormatting&&(m.formatting=["list","list-"+I]),pe(m)}else{if(Y&&m.indentation<=be&&($=w.match(O,!0)))return m.quote=0,m.fencedEndRE=new RegExp($[1]+"+ *$"),m.localMode=X.fencedCodeBlockHighlighting&&K($[2]||X.fencedCodeBlockDefaultMode),m.localMode&&(m.localState=P.startState(m.localMode)),m.f=m.block=oe,X.highlightFormatting&&(m.formatting="code-block"),m.code=-1,pe(m);if(m.setext||(!xe||!Fe)&&!m.quote&&m.list===!1&&!m.code&&!Ee&&!G.test(w.string)&&($=w.lookAhead(1))&&($=$.match(V)))return m.setext?(m.header=m.setext,m.setext=0,w.skipToEnd(),X.highlightFormatting&&(m.formatting="header")):(m.header=$[0].charAt(0)=="="?1:2,m.setext=m.header),m.thisLine.header=!0,m.f=m.inline,pe(m);if(Ee)return w.skipToEnd(),m.hr=!0,m.thisLine.hr=!0,S.hr;if(w.peek()==="[")return Q(w,m,D)}return Q(w,m,m.inline)}function Oe(w,m){var Y=ae.token(w,m.htmlState);if(!te){var we=P.innerMode(ae,m.htmlState);(we.mode.name=="xml"&&we.state.tagStart===null&&!we.state.context&&we.state.tokenize.isInText||m.md_inside&&w.current().indexOf(">")>-1)&&(m.f=ce,m.block=ye,m.htmlState=null)}return Y}function oe(w,m){var Y=m.listStack[m.listStack.length-1]||0,we=m.indentation<Y,fe=Y+3;if(m.fencedEndRE&&m.indentation<=fe&&(we||w.match(m.fencedEndRE))){X.highlightFormatting&&(m.formatting="code-block");var Ue;return we||(Ue=pe(m)),m.localMode=m.localState=null,m.block=ye,m.f=ce,m.fencedEndRE=null,m.code=0,m.thisLine.fencedCodeEnd=!0,we?Le(w,m,m.block):Ue}else return m.localMode?m.localMode.token(w,m.localState):(w.skipToEnd(),S.code)}function pe(w){var m=[];if(w.formatting){m.push(S.formatting),typeof w.formatting=="string"&&(w.formatting=[w.formatting]);for(var Y=0;Y<w.formatting.length;Y++)m.push(S.formatting+"-"+w.formatting[Y]),w.formatting[Y]==="header"&&m.push(S.formatting+"-"+w.formatting[Y]+"-"+w.header),w.formatting[Y]==="quote"&&(!X.maxBlockquoteDepth||X.maxBlockquoteDepth>=w.quote?m.push(S.formatting+"-"+w.formatting[Y]+"-"+w.quote):m.push("error"))}if(w.taskOpen)return m.push("meta"),m.length?m.join(" "):null;if(w.taskClosed)return m.push("property"),m.length?m.join(" "):null;if(w.linkHref?m.push(S.linkHref,"url"):(w.strong&&m.push(S.strong),w.em&&m.push(S.em),w.strikethrough&&m.push(S.strikethrough),w.emoji&&m.push(S.emoji),w.linkText&&m.push(S.linkText),w.code&&m.push(S.code),w.image&&m.push(S.image),w.imageAltText&&m.push(S.imageAltText,"link"),w.imageMarker&&m.push(S.imageMarker)),w.header&&m.push(S.header,S.header+"-"+w.header),w.quote&&(m.push(S.quote),!X.maxBlockquoteDepth||X.maxBlockquoteDepth>=w.quote?m.push(S.quote+"-"+w.quote):m.push(S.quote+"-"+X.maxBlockquoteDepth)),w.list!==!1){var we=(w.listStack.length-1)%3;we?we===1?m.push(S.list2):m.push(S.list3):m.push(S.list1)}return w.trailingSpaceNewLine?m.push("trailing-space-new-line"):w.trailingSpace&&m.push("trailing-space-"+(w.trailingSpace%2?"a":"b")),m.length?m.join(" "):null}function _e(w,m){return w.match(H,!0)?pe(m):void 0}function ce(w,m){var Y=m.text(w,m);if(typeof Y!="undefined")return Y;if(m.list)return m.list=null,pe(m);if(m.taskList){var we=w.match(k,!0)[1]===" ";return we?m.taskOpen=!0:m.taskClosed=!0,X.highlightFormatting&&(m.formatting="task"),m.taskList=!1,pe(m)}if(m.taskOpen=!1,m.taskClosed=!1,m.header&&w.match(/^#+$/,!0))return X.highlightFormatting&&(m.formatting="header"),pe(m);var fe=w.next();if(m.linkTitle){m.linkTitle=!1;var Ue=fe;fe==="("&&(Ue=")"),Ue=(Ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Fe="^\\s*(?:[^"+Ue+"\\\\]+|\\\\\\\\|\\\\.)"+Ue;if(w.match(new RegExp(Fe),!0))return S.linkHref}if(fe==="`"){var be=m.formatting;X.highlightFormatting&&(m.formatting="code"),w.eatWhile("`");var Se=w.current().length;if(m.code==0&&(!m.quote||Se==1))return m.code=Se,pe(m);if(Se==m.code){var xe=pe(m);return m.code=0,xe}else return m.formatting=be,pe(m)}else if(m.code)return pe(m);if(fe==="\\"&&(w.next(),X.highlightFormatting)){var Ee=pe(m),$=S.formatting+"-escape";return Ee?Ee+" "+$:$}if(fe==="!"&&w.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return m.imageMarker=!0,m.image=!0,X.highlightFormatting&&(m.formatting="image"),pe(m);if(fe==="["&&m.imageMarker&&w.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return m.imageMarker=!1,m.imageAltText=!0,X.highlightFormatting&&(m.formatting="image"),pe(m);if(fe==="]"&&m.imageAltText){X.highlightFormatting&&(m.formatting="image");var Ee=pe(m);return m.imageAltText=!1,m.image=!1,m.inline=m.f=se,Ee}if(fe==="["&&!m.image)return m.linkText&&w.match(/^.*?\]/)||(m.linkText=!0,X.highlightFormatting&&(m.formatting="link")),pe(m);if(fe==="]"&&m.linkText){X.highlightFormatting&&(m.formatting="link");var Ee=pe(m);return m.linkText=!1,m.inline=m.f=w.match(/\(.*?\)| ?\[.*?\]/,!1)?se:ce,Ee}if(fe==="<"&&w.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){m.f=m.inline=T,X.highlightFormatting&&(m.formatting="link");var Ee=pe(m);return Ee?Ee+=" ":Ee="",Ee+S.linkInline}if(fe==="<"&&w.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){m.f=m.inline=T,X.highlightFormatting&&(m.formatting="link");var Ee=pe(m);return Ee?Ee+=" ":Ee="",Ee+S.linkEmail}if(X.xml&&fe==="<"&&w.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var I=w.string.indexOf(">",w.pos);if(I!=-1){var Ie=w.string.substring(w.start,I);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ie)&&(m.md_inside=!0)}return w.backUp(1),m.htmlState=P.startState(ae),Le(w,m,Oe)}if(X.xml&&fe==="<"&&w.match(/^\/\w*?>/))return m.md_inside=!1,"tag";if(fe==="*"||fe==="_"){for(var ot=1,ct=w.pos==1?" ":w.string.charAt(w.pos-2);ot<3&&w.eat(fe);)ot++;var Xe=w.peek()||" ",Je=!/\s/.test(Xe)&&(!N.test(Xe)||/\s/.test(ct)||N.test(ct)),Te=!/\s/.test(ct)&&(!N.test(ct)||/\s/.test(Xe)||N.test(Xe)),Be=null,Ye=null;if(ot%2&&(!m.em&&Je&&(fe==="*"||!Te||N.test(ct))?Be=!0:m.em==fe&&Te&&(fe==="*"||!Je||N.test(Xe))&&(Be=!1)),ot>1&&(!m.strong&&Je&&(fe==="*"||!Te||N.test(ct))?Ye=!0:m.strong==fe&&Te&&(fe==="*"||!Je||N.test(Xe))&&(Ye=!1)),Ye!=null||Be!=null){X.highlightFormatting&&(m.formatting=Be==null?"strong":Ye==null?"em":"strong em"),Be===!0&&(m.em=fe),Ye===!0&&(m.strong=fe);var xe=pe(m);return Be===!1&&(m.em=!1),Ye===!1&&(m.strong=!1),xe}}else if(fe===" "&&(w.eat("*")||w.eat("_"))){if(w.peek()===" ")return pe(m);w.backUp(1)}if(X.strikethrough){if(fe==="~"&&w.eatWhile(fe)){if(m.strikethrough){X.highlightFormatting&&(m.formatting="strikethrough");var xe=pe(m);return m.strikethrough=!1,xe}else if(w.match(/^[^\s]/,!1))return m.strikethrough=!0,X.highlightFormatting&&(m.formatting="strikethrough"),pe(m)}else if(fe===" "&&w.match(/^~~/,!0)){if(w.peek()===" ")return pe(m);w.backUp(2)}}if(X.emoji&&fe===":"&&w.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){m.emoji=!0,X.highlightFormatting&&(m.formatting="emoji");var tt=pe(m);return m.emoji=!1,tt}return fe===" "&&(w.match(/^ +$/,!1)?m.trailingSpace++:m.trailingSpace&&(m.trailingSpaceNewLine=!0)),pe(m)}function T(w,m){var Y=w.next();if(Y===">"){m.f=m.inline=ce,X.highlightFormatting&&(m.formatting="link");var we=pe(m);return we?we+=" ":we="",we+S.linkInline}return w.match(/^[^>]+/,!0),S.linkInline}function se(w,m){if(w.eatSpace())return null;var Y=w.next();return Y==="("||Y==="["?(m.f=m.inline=x(Y==="("?")":"]"),X.highlightFormatting&&(m.formatting="link-string"),m.linkHref=!0,pe(m)):"error"}var q={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(w){return function(m,Y){var we=m.next();if(we===w){Y.f=Y.inline=ce,X.highlightFormatting&&(Y.formatting="link-string");var fe=pe(Y);return Y.linkHref=!1,fe}return m.match(q[w]),Y.linkHref=!0,pe(Y)}}function D(w,m){return w.match(/^([^\]\\]|\\.)*\]:/,!1)?(m.f=J,w.next(),X.highlightFormatting&&(m.formatting="link"),m.linkText=!0,pe(m)):Q(w,m,ce)}function J(w,m){if(w.match(/^\]:/,!0)){m.f=m.inline=j,X.highlightFormatting&&(m.formatting="link");var Y=pe(m);return m.linkText=!1,Y}return w.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function j(w,m){return w.eatSpace()?null:(w.match(/^[^\s]+/,!0),w.peek()===void 0?m.linkTitle=!0:w.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),m.f=m.inline=ce,S.linkHref+" url")}var me={startState:function(){return{f:ye,prevLine:{stream:null},thisLine:{stream:null},block:ye,htmlState:null,indentation:0,inline:ce,text:_e,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(w){return{f:w.f,prevLine:w.prevLine,thisLine:w.thisLine,block:w.block,htmlState:w.htmlState&&P.copyState(ae,w.htmlState),indentation:w.indentation,localMode:w.localMode,localState:w.localMode?P.copyState(w.localMode,w.localState):null,inline:w.inline,text:w.text,formatting:!1,linkText:w.linkText,linkTitle:w.linkTitle,linkHref:w.linkHref,code:w.code,em:w.em,strong:w.strong,strikethrough:w.strikethrough,emoji:w.emoji,header:w.header,setext:w.setext,hr:w.hr,taskList:w.taskList,list:w.list,listStack:w.listStack.slice(0),quote:w.quote,indentedCode:w.indentedCode,trailingSpace:w.trailingSpace,trailingSpaceNewLine:w.trailingSpaceNewLine,md_inside:w.md_inside,fencedEndRE:w.fencedEndRE}},token:function(w,m){if(m.formatting=!1,w!=m.thisLine.stream){if(m.header=0,m.hr=!1,w.match(/^\s*$/,!0))return ue(m),null;if(m.prevLine=m.thisLine,m.thisLine={stream:w},m.taskList=!1,m.trailingSpace=0,m.trailingSpaceNewLine=!1,!m.localState&&(m.f=m.block,m.f!=Oe)){var Y=w.match(/^\s*/,!0)[0].replace(/\t/g,ie).length;if(m.indentation=Y,m.indentationDiff=null,Y>0)return null}}return m.f(w,m)},innerMode:function(w){return w.block==Oe?{state:w.htmlState,mode:ae}:w.localState?{state:w.localState,mode:w.localMode}:{state:w,mode:me}},indent:function(w,m,Y){return w.block==Oe&&ae.indent?ae.indent(w.htmlState,m,Y):w.localState&&w.localMode.indent?w.localMode.indent(w.localState,m,Y):P.Pass},blankLine:ue,getType:pe,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return me},"xml"),P.defineMIME("text/markdown","markdown"),P.defineMIME("text/x-markdown","markdown")})},nVVt:function(Qe,We){Qe.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},nuEh:function(Qe,We,b){"use strict";var P=b("T2oS"),le=b("W9HT"),X=b("q1tI"),ae=b.n(X),te=b("F8wB"),K=b.n(te),S=function(A){var W=A.loading;return W?ae.a.createElement("div",{className:K.a.loading},ae.a.createElement(le.a,null)):ae.a.createElement(ae.a.Fragment,null)};We.a=S},osHv:function(Qe,We,b){(function(P){P(b("VrN/"))})(function(P){"use strict";var le=P.Pos;function X(N,ie){return N.line-ie.line||N.ch-ie.ch}var ae="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",te=ae+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",K=new RegExp("<(/?)(["+ae+"]["+te+"]*)","g");function S(N,ie,Q,Le){this.line=ie,this.ch=Q,this.cm=N,this.text=N.getLine(ie),this.min=Le?Math.max(Le.from,N.firstLine()):N.firstLine(),this.max=Le?Math.min(Le.to-1,N.lastLine()):N.lastLine()}function L(N,ie){var Q=N.cm.getTokenTypeAt(le(N.line,ie));return Q&&/\btag\b/.test(Q)}function A(N){return N.line>=N.max?void 0:(N.ch=0,N.text=N.cm.getLine(++N.line),!0)}function W(N){return N.line<=N.min?void 0:(N.text=N.cm.getLine(--N.line),N.ch=N.text.length,!0)}function k(N){for(;;){var ie=N.text.indexOf(">",N.ch);if(ie==-1){if(A(N))continue;return}if(!L(N,ie+1)){N.ch=ie+1;continue}var Q=N.text.lastIndexOf("/",ie),Le=Q>-1&&!/\S/.test(N.text.slice(Q+1,ie));return N.ch=ie+1,Le?"selfClose":"regular"}}function E(N){for(;;){var ie=N.ch?N.text.lastIndexOf("<",N.ch-1):-1;if(ie==-1){if(W(N))continue;return}if(!L(N,ie+1)){N.ch=ie;continue}K.lastIndex=ie,N.ch=ie;var Q=K.exec(N.text);if(Q&&Q.index==ie)return Q}}function V(N){for(;;){K.lastIndex=N.ch;var ie=K.exec(N.text);if(!ie){if(A(N))continue;return}if(!L(N,ie.index+1)){N.ch=ie.index+1;continue}return N.ch=ie.index+ie[0].length,ie}}function H(N){for(;;){var ie=N.ch?N.text.lastIndexOf(">",N.ch-1):-1;if(ie==-1){if(W(N))continue;return}if(!L(N,ie+1)){N.ch=ie;continue}var Q=N.text.lastIndexOf("/",ie),Le=Q>-1&&!/\S/.test(N.text.slice(Q+1,ie));return N.ch=ie+1,Le?"selfClose":"regular"}}function O(N,ie){for(var Q=[];;){var Le=V(N),He,ue=N.line,ye=N.ch-(Le?Le[0].length:0);if(!Le||!(He=k(N)))return;if(He=="selfClose")continue;if(Le[1]){for(var Oe=Q.length-1;Oe>=0;--Oe)if(Q[Oe]==Le[2]){Q.length=Oe;break}if(Oe<0&&(!ie||ie==Le[2]))return{tag:Le[2],from:le(ue,ye),to:le(N.line,N.ch)}}else Q.push(Le[2])}}function G(N,ie){for(var Q=[];;){var Le=H(N);if(!Le)return;if(Le=="selfClose"){E(N);continue}var He=N.line,ue=N.ch,ye=E(N);if(!ye)return;if(ye[1])Q.push(ye[2]);else{for(var Oe=Q.length-1;Oe>=0;--Oe)if(Q[Oe]==ye[2]){Q.length=Oe;break}if(Oe<0&&(!ie||ie==ye[2]))return{tag:ye[2],from:le(N.line,N.ch),to:le(He,ue)}}}}P.registerHelper("fold","xml",function(N,ie){for(var Q=new S(N,ie.line,0);;){var Le=V(Q);if(!Le||Q.line!=ie.line)return;var He=k(Q);if(!He)return;if(!Le[1]&&He!="selfClose"){var ue=le(Q.line,Q.ch),ye=O(Q,Le[2]);return ye&&X(ye.from,ue)>0?{from:ue,to:ye.from}:null}}}),P.findMatchingTag=function(N,ie,Q){var Le=new S(N,ie.line,ie.ch,Q);if(Le.text.indexOf(">")==-1&&Le.text.indexOf("<")==-1)return;var He=k(Le),ue=He&&le(Le.line,Le.ch),ye=He&&E(Le);if(!He||!ye||X(Le,ie)>0)return;var Oe={from:le(Le.line,Le.ch),to:ue,tag:ye[2]};return He=="selfClose"?{open:Oe,close:null,at:"open"}:ye[1]?{open:G(Le,ye[2]),close:Oe,at:"close"}:(Le=new S(N,ue.line,ue.ch,Q),{open:Oe,close:O(Le,ye[2]),at:"open"})},P.findEnclosingTag=function(N,ie,Q,Le){for(var He=new S(N,ie.line,ie.ch,Q);;){var ue=G(He,Le);if(!ue)break;var ye=new S(N,ie.line,ie.ch,Q),Oe=O(ye,ue.tag);if(Oe)return{open:ue,close:Oe}}},P.scanForClosingTag=function(N,ie,Q,Le){var He=new S(N,ie.line,ie.ch,Le?{from:0,to:Le}:null);return O(He,Q)}})},p5ED:function(Qe,We,b){"use strict";var P=b("+L6B"),le=b("2/Rp"),X=b("5Dmo"),ae=b("3S7+"),te=b("k1fw"),K=b("tJVT"),S=b("q1tI"),L=b.n(S),A=b("vHTk"),W=b.n(A),k=b("yEEn"),E=b("ZW9T"),V=b("1vsH"),H=b("m3rI");We.a=function(O){var G=O.name,N=O.data,ie=O.theme,Q=O.type,Le=O.filename,He=O.monacoEditor,ue=O.className,ye=O.style,Oe=O.close,oe=O.onClose,pe=O.hasMask,_e=O.otherData,ce=Object(S.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),T=Object(K.a)(ce,2),se=T[0],q=T[1],x=Object(S.useState)(""),D=Object(K.a)(x,2),J=D[0],j=D[1],me,w=1024*1024,m=10*w,Y=Object(S.useRef)();Q==="office"&&(me=Object(V.R)(N).filesize,me>m&&(Q="other")),Le&&(He.filename=Le),Object(S.useEffect)(function(){var Ue,Fe,be=(Ue=document.cookie)===null||Ue===void 0||((Fe=Ue.replace(/\s/g,""))===null||Fe===void 0)?void 0:Fe.split(";");be==null||be.map(function(Se){var xe=Se.split("=");xe[0]==="_educoder_session"&&j(xe[1])})},[]);var we=function(){if(N.startsWith("http")||N.startsWith("blob:")){fe();return}Object(V.x)(Le||"educoder",N,Le)},fe=function(){Object(V.v)(Le||"educoder",decodeURIComponent(N))};return L.a.createElement("div",{style:Object(te.a)({},ye||{}),className:"".concat(pe&&W.a.bgBlack," ").concat(Q?W.a.wrp:"hide")},Oe&&L.a.createElement("div",{className:W.a.close,ref:Y},L.a.createElement(ae.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Y.current}},L.a.createElement("span",{onClick:fe},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(ae.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Y.current}},L.a.createElement("span",{className:"",onClick:oe},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(W.a[ue]," ").concat(ue," ").concat(W.a.monaco," ").concat(Q==="txt"?"show":"hide")},Q==="txt"&&L.a.createElement(E.b,He)),Q==="audio"&&L.a.createElement("audio",{src:"".concat((N==null?void 0:N.indexOf("http://"))>-1||(N==null?void 0:N.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(N),autoPlay:!0}),Q==="video"&&L.a.createElement(L.a.Fragment,null,(N==null?void 0:N.indexOf("http"))>-1?L.a.createElement("video",{controls:!0,src:"".concat(N),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(N),autoPlay:!0})),Q==="office"&&L.a.createElement("iframe",{src:"https://view.officeapps.live.com/op/embed.aspx?src=".concat(N,"?").concat(encodeURIComponent("disposition=office&token=".concat(J)))}),(Q==="xlsx"||Q==="doc"||Q==="pptx"||Q==="docx")&&L.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(_e.key,"&url=").concat(H.a.API_SERVER+_e.url,"&callbackUrl=").concat(H.a.API_SERVER+_e.callbackUrl,"&fileType=").concat(_e.fileType,"&title=").concat(_e.title,"&model=").concat(_e.model)}),Q==="html"&&L.a.createElement("iframe",{src:N+"&disposition=inline"}),Q==="pdf"&&L.a.createElement("embed",{className:W.a.embed,src:N,type:"application/pdf"}),Q==="image"&&L.a.createElement("img",{src:"".concat((N==null?void 0:N.indexOf("http://"))>-1||(N==null?void 0:N.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(N)}),Q==="other"&&L.a.createElement("div",null,L.a.createElement(le.a,{type:"primary",size:"large",onClick:we},L.a.createElement(k.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),Q==="download"&&L.a.createElement(le.a,{type:"primary",size:"large",onClick:we},L.a.createElement(k.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Qe,We,b){},"rAM+":function(Qe,We,b){"use strict";b.d(We,"a",function(){return le});var P=b("Qw5x");function le(X,ae){var te;if(typeof Symbol=="undefined"||X[Symbol.iterator]==null){if(Array.isArray(X)||(te=Object(P.a)(X))||ae&&X&&typeof X.length=="number"){te&&(X=te);var K=0,S=function(){};return{s:S,n:function(){return K>=X.length?{done:!0}:{done:!1,value:X[K++]}},e:function(E){throw E},f:S}}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 L=!0,A=!1,W;return{s:function(){te=X[Symbol.iterator]()},n:function(){var E=te.next();return L=E.done,E},e:function(E){A=!0,W=E},f:function(){try{!L&&te.return!=null&&te.return()}finally{if(A)throw W}}}}},rUJ1:function(Qe,We){const b=/[&<>"']/,P=/[&<>"']/g,le=/[<>"']|&(?!#?\w+;)/,X=/[<>"']|&(?!#?\w+;)/g,ae={"&":"&","<":"<",">":">",'"':""","'":"'"},te=oe=>ae[oe];function K(oe,pe){if(pe){if(b.test(oe))return oe.replace(P,te)}else if(le.test(oe))return oe.replace(X,te);return oe}const S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function L(oe){return oe.replace(S,(pe,_e)=>(_e=_e.toLowerCase(),_e==="colon"?":":_e.charAt(0)==="#"?_e.charAt(1)==="x"?String.fromCharCode(parseInt(_e.substring(2),16)):String.fromCharCode(+_e.substring(1)):""))}const A=/(^|[^\[])\^/g;function W(oe,pe){oe=oe.source||oe,pe=pe||"";const _e={replace:(ce,T)=>(T=T.source||T,T=T.replace(A,"$1"),oe=oe.replace(ce,T),_e),getRegex:()=>new RegExp(oe,pe)};return _e}const k=/[^\w:]/g,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function V(oe,pe,_e){if(oe){let ce;try{ce=decodeURIComponent(L(_e)).replace(k,"").toLowerCase()}catch(T){return null}if(ce.indexOf("javascript:")===0||ce.indexOf("vbscript:")===0||ce.indexOf("data:")===0)return null}pe&&!E.test(_e)&&(_e=ie(pe,_e));try{_e=encodeURI(_e).replace(/%25/g,"%")}catch(ce){return null}return _e}const H={},O=/^[^:]+:\/*[^/]*$/,G=/^([^:]+:)[\s\S]*$/,N=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ie(oe,pe){H[" "+oe]||(O.test(oe)?H[" "+oe]=oe+"/":H[" "+oe]=ue(oe,"/",!0)),oe=H[" "+oe];const _e=oe.indexOf(":")===-1;return pe.substring(0,2)==="//"?_e?pe:oe.replace(G,"$1")+pe:pe.charAt(0)==="/"?_e?pe:oe.replace(N,"$1")+pe:oe+pe}const Q={exec:function(){}};function Le(oe){let pe=1,_e,ce;for(;pe<arguments.length;pe++){_e=arguments[pe];for(ce in _e)Object.prototype.hasOwnProperty.call(_e,ce)&&(oe[ce]=_e[ce])}return oe}function He(oe,pe){const _e=oe.replace(/\|/g,(se,q,x)=>{let D=!1,J=q;for(;--J>=0&&x[J]==="\\";)D=!D;return D?"|":" |"}),ce=_e.split(/ \|/);let T=0;if(ce.length>pe)ce.splice(pe);else for(;ce.length<pe;)ce.push("");for(;T<ce.length;T++)ce[T]=ce[T].trim().replace(/\\\|/g,"|");return ce}function ue(oe,pe,_e){const ce=oe.length;if(ce===0)return"";let T=0;for(;T<ce;){const se=oe.charAt(ce-T-1);if(se===pe&&!_e)T++;else if(se!==pe&&_e)T++;else break}return oe.substr(0,ce-T)}function ye(oe,pe){if(oe.indexOf(pe[1])===-1)return-1;const _e=oe.length;let ce=0,T=0;for(;T<_e;T++)if(oe[T]==="\\")T++;else if(oe[T]===pe[0])ce++;else if(oe[T]===pe[1]&&(ce--,ce<0))return T;return-1}function Oe(oe){oe&&oe.sanitize&&!oe.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")}Qe.exports={escape:K,unescape:L,edit:W,cleanUrl:V,resolveUrl:ie,noopTest:Q,merge:Le,splitCells:He,rtrim:ue,findClosingBracket:ye,checkSanitizeDeprecation:Oe}},rcnY:function(Qe,We,b){var P=b("aRTE");function le(X,ae){this.totalCount=X,this.dataCount=ae}le.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],le.getRSBlocks=function(X,ae){var te=le.getRsBlockTable(X,ae);if(te==null)throw new Error("bad rs block @ typeNumber:"+X+"/errorCorrectLevel:"+ae);for(var K=te.length/3,S=new Array,L=0;L<K;L++)for(var A=te[L*3+0],W=te[L*3+1],k=te[L*3+2],E=0;E<A;E++)S.push(new le(W,k));return S},le.getRsBlockTable=function(X,ae){switch(ae){case P.L:return le.RS_BLOCK_TABLE[(X-1)*4+0];case P.M:return le.RS_BLOCK_TABLE[(X-1)*4+1];case P.Q:return le.RS_BLOCK_TABLE[(X-1)*4+2];case P.H:return le.RS_BLOCK_TABLE[(X-1)*4+3];default:return}},Qe.exports=le},vHTk:function(Qe,We,b){Qe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(Qe,We){function b(){this.buffer=new Array,this.length=0}b.prototype={get:function(P){var le=Math.floor(P/8);return(this.buffer[le]>>>7-P%8&1)==1},put:function(P,le){for(var X=0;X<le;X++)this.putBit((P>>>le-X-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(P){var le=Math.floor(this.length/8);this.buffer.length<=le&&this.buffer.push(0),P&&(this.buffer[le]|=128>>>this.length%8),this.length++}},Qe.exports=b}}]);
|