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.
350 lines
617 KiB
350 lines
617 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[171,6,7,17],{"+NIl":function(ot,$e,x){(function(F){F(x("VrN/"))})(function(F){"use strict";F.defineMode("stex",function(ue,ne){"use strict";function ge(Z,U){Z.cmdState.push(U)}function se(Z){return Z.cmdState.length>0?Z.cmdState[Z.cmdState.length-1]:null}function G(Z){var U=Z.cmdState.pop();U&&U.closeBracket()}function T(Z){for(var U=Z.cmdState,X=U.length-1;X>=0;X--){var J=U[X];if(J.name=="DEFAULT")continue;return J}return{styleIdentifier:function(){return null}}}function M(Z,U,X){return function(){this.name=Z,this.bracketNo=0,this.style=U,this.styles=X,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=M("importmodule","tag",["string","builtin"]),k.documentclass=M("documentclass","tag",["","atom"]),k.usepackage=M("usepackage","tag",["atom"]),k.begin=M("begin","tag",["atom"]),k.end=M("end","tag",["atom"]),k.label=M("label","tag",["atom"]),k.ref=M("ref","tag",["atom"]),k.eqref=M("eqref","tag",["atom"]),k.cite=M("cite","tag",["atom"]),k.bibitem=M("bibitem","tag",["atom"]),k.Bibitem=M("Bibitem","tag",["atom"]),k.RBibitem=M("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(Z,U){Z.f=U}function P(Z,U){var X;if(Z.match(/^\\[a-zA-Z@]+/)){var J=Z.current().slice(1);return X=k.hasOwnProperty(J)?k[J]:k.DEFAULT,X=new X,ge(U,X),D(U,ee),X.style}if(Z.match(/^\\[$&%#{}_]/))return"tag";if(Z.match(/^\\[,;!\/\\]/))return"tag";if(Z.match("\\["))return D(U,function(ce,Ue){return _(ce,Ue,"\\]")}),"keyword";if(Z.match("\\("))return D(U,function(ce,Ue){return _(ce,Ue,"\\)")}),"keyword";if(Z.match("$$"))return D(U,function(ce,Ue){return _(ce,Ue,"$$")}),"keyword";if(Z.match("$"))return D(U,function(ce,Ue){return _(ce,Ue,"$")}),"keyword";var le=Z.next();if(le=="%")return Z.skipToEnd(),"comment";if(le=="}"||le=="]"){if(X=se(U),X)X.closeBracket(le),D(U,ee);else return"error";return"bracket"}else return le=="{"||le=="["?(X=k.DEFAULT,X=new X,ge(U,X),"bracket"):/\d/.test(le)?(Z.eatWhile(/[\w.%]/),"atom"):(Z.eatWhile(/[\w\-_]/),X=T(U),X.name=="begin"&&(X.argument=Z.current()),X.styleIdentifier())}function _(Z,U,X){if(Z.eatSpace())return null;if(X&&Z.match(X))return D(U,P),"keyword";if(Z.match(/^\\[a-zA-Z@]+/))return"tag";if(Z.match(/^[a-zA-Z]+/))return"variable-2";if(Z.match(/^\\[$&%#{}_]/))return"tag";if(Z.match(/^\\[,;!\/]/))return"tag";if(Z.match(/^[\^_&]/))return"tag";if(Z.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Z.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var J=Z.next();return J=="{"||J=="}"||J=="["||J=="]"||J=="("||J==")"?"bracket":J=="%"?(Z.skipToEnd(),"comment"):"error"}function ee(Z,U){var X=Z.peek(),J;return X=="{"||X=="["?(J=se(U),J.openBracket(X),Z.eat(X),D(U,P),"bracket"):/[ \t\r]/.test(X)?(Z.eat(X),null):(D(U,P),G(U),P(Z,U))}return{startState:function(){var Z=ne.inMathMode?function(U,X){return _(U,X)}:P;return{cmdState:[],f:Z}},copyState:function(Z){return{cmdState:Z.cmdState.slice(),f:Z.f}},token:function(Z,U){return U.f(Z,U)},blankLine:function(Z){Z.f=P,Z.cmdState.length=0},lineComment:"%"}}),F.defineMIME("text/x-stex","stex"),F.defineMIME("text/x-latex","stex")})},"19Vz":function(ot,$e,x){(function(F){F(x("VrN/"))})(function(F){F.defineOption("placeholder","",function(M,k,D){var P=D&&D!=F.Init;if(k&&!P)M.on("blur",se),M.on("change",G),M.on("swapDoc",G),F.on(M.getInputField(),"compositionupdate",M.state.placeholderCompose=function(){ge(M)}),G(M);else if(!k&&P){M.off("blur",se),M.off("change",G),M.off("swapDoc",G),F.off(M.getInputField(),"compositionupdate",M.state.placeholderCompose),ue(M);var _=M.getWrapperElement();_.className=_.className.replace(" CodeMirror-empty","")}k&&!M.hasFocus()&&se(M)});function ue(M){M.state.placeholder&&(M.state.placeholder.parentNode.removeChild(M.state.placeholder),M.state.placeholder=null)}function ne(M){ue(M);var k=M.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=M.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var D=M.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),k.appendChild(D),M.display.lineSpace.insertBefore(k,M.display.lineSpace.firstChild)}function ge(M){setTimeout(function(){var k=!1,D=M.getInputField();D.nodeName=="TEXTAREA"?k=!D.value:M.lineCount()==1&&(k=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),k?ne(M):ue(M)},20)}function se(M){T(M)&&ne(M)}function G(M){var k=M.getWrapperElement(),D=T(M);k.className=k.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?ne(M):ue(M)}function T(M){return M.lineCount()===1&&M.getLine(0)===""}})},"1eCo":function(ot,$e,x){(function(F){F(x("VrN/"))})(function(F){"use strict";var ue={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},ne={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};F.defineMode("xml",function(ge,se){var G=ge.indentUnit,T={},M=se.htmlMode?ue:ne;for(var k in M)T[k]=M[k];for(var k in se)T[k]=se[k];var D,P;function _(R,oe){function ie(N){return oe.tokenize=N,N(R,oe)}var C=R.next();if(C=="<")return R.eat("!")?R.eat("[")?R.match("CDATA[")?ie(U("atom","]]>")):null:R.match("--")?ie(U("comment","-->")):R.match("DOCTYPE",!0,!0)?(R.eatWhile(/[\w\._\-]/),ie(X(1))):null:R.eat("?")?(R.eatWhile(/[\w\._\-]/),oe.tokenize=U("meta","?>"),"meta"):(D=R.eat("/")?"closeTag":"openTag",oe.tokenize=ee,"tag bracket");if(C=="&"){var I;return R.eat("#")?R.eat("x")?I=R.eatWhile(/[a-fA-F\d]/)&&R.eat(";"):I=R.eatWhile(/[\d]/)&&R.eat(";"):I=R.eatWhile(/[\w\.\-:]/)&&R.eat(";"),I?"atom":"error"}else return R.eatWhile(/[^&<]/),null}_.isInText=!0;function ee(R,oe){var ie=R.next();if(ie==">"||ie=="/"&&R.eat(">"))return oe.tokenize=_,D=ie==">"?"endTag":"selfcloseTag","tag bracket";if(ie=="=")return D="equals",null;if(ie=="<"){oe.tokenize=_,oe.state=Ue,oe.tagName=oe.tagStart=null;var C=oe.tokenize(R,oe);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(ie)?(oe.tokenize=Z(ie),oe.stringStartCol=R.column(),oe.tokenize(R,oe)):(R.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Z(R){var oe=function(ie,C){for(;!ie.eol();)if(ie.next()==R){C.tokenize=ee;break}return"string"};return oe.isInAttribute=!0,oe}function U(R,oe){return function(ie,C){for(;!ie.eol();){if(ie.match(oe)){C.tokenize=_;break}ie.next()}return R}}function X(R){return function(oe,ie){for(var C;(C=oe.next())!=null;){if(C=="<")return ie.tokenize=X(R+1),ie.tokenize(oe,ie);if(C==">")if(R==1){ie.tokenize=_;break}else return ie.tokenize=X(R-1),ie.tokenize(oe,ie)}return"meta"}}function J(R,oe,ie){this.prev=R.context,this.tagName=oe,this.indent=R.indented,this.startOfLine=ie,(T.doNotIndent.hasOwnProperty(oe)||R.context&&R.context.noIndent)&&(this.noIndent=!0)}function le(R){R.context&&(R.context=R.context.prev)}function ce(R,oe){for(var ie;;){if(!R.context)return;if(ie=R.context.tagName,!T.contextGrabbers.hasOwnProperty(ie)||!T.contextGrabbers[ie].hasOwnProperty(oe))return;le(R)}}function Ue(R,oe,ie){return R=="openTag"?(ie.tagStart=oe.column(),Je):R=="closeTag"?Se:Ue}function Je(R,oe,ie){return R=="word"?(ie.tagName=oe.current(),P="tag",_e):T.allowMissingTagName&&R=="endTag"?(P="tag bracket",_e(R,oe,ie)):(P="error",Je)}function Se(R,oe,ie){if(R=="word"){var C=oe.current();return ie.context&&ie.context.tagName!=C&&T.implicitlyClosed.hasOwnProperty(ie.context.tagName)&&le(ie),ie.context&&ie.context.tagName==C||T.matchClosing===!1?(P="tag",De):(P="tag error",He)}else return T.allowMissingTagName&&R=="endTag"?(P="tag bracket",De(R,oe,ie)):(P="error",He)}function De(R,oe,ie){return R!="endTag"?(P="error",De):(le(ie),Ue)}function He(R,oe,ie){return P="error",De(R,oe,ie)}function _e(R,oe,ie){if(R=="word")return P="attribute",Ae;if(R=="endTag"||R=="selfcloseTag"){var C=ie.tagName,I=ie.tagStart;return ie.tagName=ie.tagStart=null,R=="selfcloseTag"||T.autoSelfClosers.hasOwnProperty(C)?ce(ie,C):(ce(ie,C),ie.context=new J(ie,C,I==ie.indented)),Ue}return P="error",_e}function Ae(R,oe,ie){return R=="equals"?we:(T.allowMissing||(P="error"),_e(R,oe,ie))}function we(R,oe,ie){return R=="string"?de:R=="word"&&T.allowUnquoted?(P="string",_e):(P="error",_e(R,oe,ie))}function de(R,oe,ie){return R=="string"?de:_e(R,oe,ie)}return{startState:function(R){var oe={tokenize:_,state:Ue,indented:R||0,tagName:null,tagStart:null,context:null};return R!=null&&(oe.baseIndent=R),oe},token:function(R,oe){if(!oe.tagName&&R.sol()&&(oe.indented=R.indentation()),R.eatSpace())return null;D=null;var ie=oe.tokenize(R,oe);return(ie||D)&&ie!="comment"&&(P=null,oe.state=oe.state(D||ie,R,oe),P&&(ie=P=="error"?ie+" error":P)),ie},indent:function(R,oe,ie){var C=R.context;if(R.tokenize.isInAttribute)return R.tagStart==R.indented?R.stringStartCol+1:R.indented+G;if(C&&C.noIndent)return F.Pass;if(R.tokenize!=ee&&R.tokenize!=_)return ie?ie.match(/^(\s*)/)[0].length:0;if(R.tagName)return T.multilineTagIndentPastTag!==!1?R.tagStart+R.tagName.length+2:R.tagStart+G*(T.multilineTagIndentFactor||1);if(T.alignCDATA&&/<!\[CDATA\[/.test(oe))return 0;var I=oe&&/^<(\/)?([\w_:\.-]*)/.exec(oe);if(I&&I[1])for(;C;)if(C.tagName==I[2]){C=C.prev;break}else if(T.implicitlyClosed.hasOwnProperty(C.tagName))C=C.prev;else break;else if(I)for(;C;){var N=T.contextGrabbers[C.tagName];if(N&&N.hasOwnProperty(I[2]))C=C.prev;else break}for(;C&&C.prev&&!C.startOfLine;)C=C.prev;return C?C.indent+G:R.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:T.htmlMode?"html":"xml",helperType:T.htmlMode?"html":"xml",skipAttribute:function(R){R.state==we&&(R.state=_e)},xmlCurrentTag:function(R){return R.tagName?{name:R.tagName,close:R.type=="closeTag"}:null},xmlCurrentContext:function(R){for(var oe=[],ie=R.context;ie;ie=ie.prev)ie.tagName&&oe.push(ie.tagName);return oe.reverse()}}}),F.defineMIME("text/xml","xml"),F.defineMIME("application/xml","xml"),F.mimeModes.hasOwnProperty("text/html")||F.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"55Ip":function(ot,$e,x){"use strict";x.d($e,"a",function(){return ce}),x.d($e,"b",function(){return _e});var F=x("Ty5D"),ue=x("dI71"),ne=x("q1tI"),ge=x.n(ne),se=x("YS25"),G=x("17x9"),T=x.n(G),M=x("wx14"),k=x("zLVn"),D=x("9R94"),P=function(we){Object(ue.a)(de,we);function de(){for(var oe,ie=arguments.length,C=new Array(ie),I=0;I<ie;I++)C[I]=arguments[I];return oe=we.call.apply(we,[this].concat(C))||this,oe.history=Object(se.a)(oe.props),oe}var R=de.prototype;return R.render=function(){return ge.a.createElement(F.c,{history:this.history,children:this.props.children})},de}(ge.a.Component),_=function(we){Object(ue.a)(de,we);function de(){for(var oe,ie=arguments.length,C=new Array(ie),I=0;I<ie;I++)C[I]=arguments[I];return oe=we.call.apply(we,[this].concat(C))||this,oe.history=Object(se.b)(oe.props),oe}var R=de.prototype;return R.render=function(){return ge.a.createElement(F.c,{history:this.history,children:this.props.children})},de}(ge.a.Component),ee=function(de,R){return typeof de=="function"?de(R):de},Z=function(de,R){return typeof de=="string"?Object(se.c)(de,null,null,R):de},U=function(de){return de},X=ge.a.forwardRef;typeof X=="undefined"&&(X=U);function J(we){return!!(we.metaKey||we.altKey||we.ctrlKey||we.shiftKey)}var le=X(function(we,de){var R=we.innerRef,oe=we.navigate,ie=we.onClick,C=Object(k.a)(we,["innerRef","navigate","onClick"]),I=C.target,N=Object(M.a)({},C,{onClick:function(A){try{ie&&ie(A)}catch(p){throw A.preventDefault(),p}!A.defaultPrevented&&A.button===0&&(!I||I==="_self")&&!J(A)&&(A.preventDefault(),oe())}});return U!==X?N.ref=de||R:N.ref=R,ge.a.createElement("a",N)}),ce=X(function(we,de){var R=we.component,oe=R===void 0?le:R,ie=we.replace,C=we.to,I=we.innerRef,N=Object(k.a)(we,["component","replace","to","innerRef"]);return ge.a.createElement(F.e.Consumer,null,function(w){w||Object(D.a)(!1);var A=w.history,p=Z(ee(C,w.location),w.location),d=p?A.createHref(p):"",E=Object(M.a)({},N,{href:d,navigate:function(){var $=ee(C,w.location),xe=ie?A.replace:A.push;xe($)}});return U!==X?E.ref=de||I:E.innerRef=I,ge.a.createElement(oe,E)})});if(!1)var Ue,Je;var Se=function(de){return de},De=ge.a.forwardRef;typeof De=="undefined"&&(De=Se);function He(){for(var we=arguments.length,de=new Array(we),R=0;R<we;R++)de[R]=arguments[R];return de.filter(function(oe){return oe}).join(" ")}var _e=De(function(we,de){var R=we["aria-current"],oe=R===void 0?"page":R,ie=we.activeClassName,C=ie===void 0?"active":ie,I=we.activeStyle,N=we.className,w=we.exact,A=we.isActive,p=we.location,d=we.sensitive,E=we.strict,H=we.style,$=we.to,xe=we.innerRef,Me=Object(k.a)(we,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return ge.a.createElement(F.e.Consumer,null,function(be){be||Object(D.a)(!1);var Ce=p||be.location,he=Z(ee($,Ce),Ce),ve=he.pathname,Q=ve&&ve.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),z=Q?Object(F.f)(Ce.pathname,{path:Q,exact:w,sensitive:d,strict:E}):null,b=!!(A?A(z,Ce):z),W=b?He(N,C):N,L=b?Object(M.a)({},H,{},I):H,ye=Object(M.a)({"aria-current":b&&oe||null,className:W,style:L,to:he},Me);return Se!==De?ye.ref=de||xe:ye.innerRef=xe,ge.a.createElement(ce,ye)})});if(!1)var Ae},"7Cbv":function(ot,$e,x){"use strict";var F=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ue=new Uint8Array(16);function ne(){if(!F)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return F(ue)}var ge=/^(?:[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 se(ee){return typeof ee=="string"&&ge.test(ee)}for(var G=se,T=[],M=0;M<256;++M)T.push((M+256).toString(16).substr(1));function k(ee){var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,U=(T[ee[Z+0]]+T[ee[Z+1]]+T[ee[Z+2]]+T[ee[Z+3]]+"-"+T[ee[Z+4]]+T[ee[Z+5]]+"-"+T[ee[Z+6]]+T[ee[Z+7]]+"-"+T[ee[Z+8]]+T[ee[Z+9]]+"-"+T[ee[Z+10]]+T[ee[Z+11]]+T[ee[Z+12]]+T[ee[Z+13]]+T[ee[Z+14]]+T[ee[Z+15]]).toLowerCase();if(!G(U))throw TypeError("Stringified UUID is invalid");return U}var D=k;function P(ee,Z,U){ee=ee||{};var X=ee.random||(ee.rng||ne)();if(X[6]=X[6]&15|64,X[8]=X[8]&63|128,Z){U=U||0;for(var J=0;J<16;++J)Z[U+J]=X[J];return Z}return D(X)}var _=$e.a=P},"7ahc":function(ot,$e,x){"use strict";x.d($e,"a",function(){return Je});var F=x("k1fw"),ue=x("0Owb"),ne=x("+L6B"),ge=x("2/Rp"),se=x("y8nQ"),G=x("Vl3Y"),T=x("tJVT"),M=x("OaEy"),k=x("2fM7"),D=x("q1tI"),P=x.n(D),_=x("VrN/"),ee=x.n(_),Z=x("p77/"),U=x.n(Z),X=x("c5Ni"),J=x.n(X),le=k.a.Option,ce={labelCol:{span:4},wrapperCol:{span:20}},Ue={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"]};$e.b=function(Se){var De=Se.callback,He=Se.onCancel,_e=Object(D.useState)("python"),Ae=Object(T.a)(_e,2),we=Ae[0],de=Ae[1];function R(ie){de(Ue[ie][1])}function oe(ie){De(ie)}return P.a.createElement(G.a,Object(ue.a)({},ce,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:oe}),P.a.createElement(G.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},P.a.createElement(k.a,{onChange:R},Object.keys(Ue).map(function(ie){return P.a.createElement(le,{key:ie,value:ie},Ue[ie][0])}))),P.a.createElement(G.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},P.a.createElement(Je,{mode:we})),P.a.createElement("div",{className:"flex-container flex-end"},P.a.createElement(ge.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),P.a.createElement(ge.a,{type:"ghost",onClick:He},"\u53D6\u6D88")))};function Je(Se){var De=Se.value,He=Se.onChange,_e=Se.mode,Ae=Se.options,we=Ae===void 0?{}:Ae,de=Object(D.useRef)(),R=Object(D.useState)(),oe=Object(T.a)(R,2),ie=oe[0],C=oe[1];return Object(D.useEffect)(function(){if(ie){function I(N){var w=N.getValue();He&&He(w)}return ie.on("change",I),function(){ie.off("change",I)}}},[ie,He]),Object(D.useEffect)(function(){ie&&ie.setOption("mode",_e)},[ie,_e]),Object(D.useEffect)(function(){ie&&((De!==ie.getValue()||De==="")&&setTimeout(function(){ie.setValue(De||" ")},300))},[ie,De]),Object(D.useEffect)(function(){if(de.current&&!ie){var I=ee.a.fromTextArea(de.current,Object(F.a)({mode:_e,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},we));C(I)}},[de.current,ie]),P.a.createElement("div",{className:"my-codemirror-container"},P.a.createElement("textarea",{ref:de}))}},"7ixt":function(ot,$e,x){"use strict";x.d($e,"a",function(){return ne});var F={adjustX:1,adjustY:1},ue=[0,0],ne={left:{points:["cr","cl"],overflow:F,offset:[-4,0],targetOffset:ue},right:{points:["cl","cr"],overflow:F,offset:[4,0],targetOffset:ue},top:{points:["bc","tc"],overflow:F,offset:[0,-4],targetOffset:ue},bottom:{points:["tc","bc"],overflow:F,offset:[0,4],targetOffset:ue},topLeft:{points:["bl","tl"],overflow:F,offset:[0,-4],targetOffset:ue},leftTop:{points:["tr","tl"],overflow:F,offset:[-4,0],targetOffset:ue},topRight:{points:["br","tr"],overflow:F,offset:[0,-4],targetOffset:ue},rightTop:{points:["tl","tr"],overflow:F,offset:[4,0],targetOffset:ue},bottomRight:{points:["tr","br"],overflow:F,offset:[0,4],targetOffset:ue},rightBottom:{points:["bl","br"],overflow:F,offset:[4,0],targetOffset:ue},bottomLeft:{points:["tl","bl"],overflow:F,offset:[0,4],targetOffset:ue},leftBottom:{points:["br","bl"],overflow:F,offset:[-4,0],targetOffset:ue}},ge=ne},"8EBN":function(ot,$e,x){(function(F){F(x("VrN/"))})(function(F){"use strict";F.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 ue=0;ue<F.modeInfo.length;ue++){var ne=F.modeInfo[ue];ne.mimes&&(ne.mime=ne.mimes[0])}F.findModeByMIME=function(ge){ge=ge.toLowerCase();for(var se=0;se<F.modeInfo.length;se++){var G=F.modeInfo[se];if(G.mime==ge)return G;if(G.mimes){for(var T=0;T<G.mimes.length;T++)if(G.mimes[T]==ge)return G}}if(/\+xml$/.test(ge))return F.findModeByMIME("application/xml");if(/\+json$/.test(ge))return F.findModeByMIME("application/json")},F.findModeByExtension=function(ge){ge=ge.toLowerCase();for(var se=0;se<F.modeInfo.length;se++){var G=F.modeInfo[se];if(G.ext){for(var T=0;T<G.ext.length;T++)if(G.ext[T]==ge)return G}}},F.findModeByFileName=function(ge){for(var se=0;se<F.modeInfo.length;se++){var G=F.modeInfo[se];if(G.file&&G.file.test(ge))return G}var T=ge.lastIndexOf("."),M=T>-1&&ge.substring(T+1,ge.length);if(M)return F.findModeByExtension(M)},F.findModeByName=function(ge){ge=ge.toLowerCase();for(var se=0;se<F.modeInfo.length;se++){var G=F.modeInfo[se];if(G.name.toLowerCase()==ge)return G;if(G.alias){for(var T=0;T<G.alias.length;T++)if(G.alias[T].toLowerCase()==ge)return G}}}})},"8hTe":function(ot,$e,x){ot.exports={button:"button___1wy9m"}},"9Bee":function(ot,$e,x){"use strict";var F=x("DYRE"),ue=x("zeV3"),ne=x("+L6B"),ge=x("2/Rp"),se=x("k1fw"),G=x("9og8"),T=x("tJVT"),M=x("WmNS"),k=x.n(M),D=x("q1tI"),P=x.n(D),_=x("vg9a"),ee=x("DlQD"),Z=x.n(ee),U=x("rUJ1");function X(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(g){var h=g.match(/^\s+/);if(h===null)return g;var K=Object(T.a)(h,1),je=K[0];return je.length>=u.length?g.slice(u.length):g}).join(`
|
|
`)}var J=[],le=["<ul>"],ce=new Z.a.Renderer,Ue=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Je(){J.length=0,le=["<ul>"]}var Se={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function De(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var g=c[o];u.push("<li><a href='#"+g.anchor+"'>"+g.text+"</a>"),o++;var h=[];return o=De(c,o,g.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(K){u.push(K)}),u.push("</ul>")),u.push("</li>"),o=De(c,o,a,u),o}function He(){return De(J,0,0,le),le.push("</ul>"),le.join("")}var _e={heading:function(o){var a=Ue.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],g=X(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var K=de(),je=g;g=K,R[K]={type:"block",expression:je}}return{type:"code",raw:u,lang:h,text:g}}}},Ae=/(?:\${2})([^\n`]+?)(?:\${2})/gi,we=0,de=function(){return"__special_katext_id_".concat(we++,"__")},R={};function oe(){return R}function ie(){we=0,R={}}function C(c){return c=c.replace(Ae,function(o,a){var u=de();return R[u]={type:"inline",expression:a},u}),c}var I=ce.listitem;ce.listitem=function(c){return I(C(c))};var N=ce.paragraph;ce.paragraph=function(c){return N(C(c))};var w=ce.tablecell;ce.tablecell=function(c,o){return w(C(c),o)},ce.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(U.escape)(c,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(U.escape)(c,!0))+"</code></pre>"},ce.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return J.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},Z.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),Z.a.use({tokenizer:_e,renderer:ce});var A=Z.a,p=x("SJMd"),d=x("ulZh"),E=x.n(d),H=x("m3rI"),$=x("Oy/b"),xe=x("p5ED"),Me=x("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 g in u)Object.prototype.hasOwnProperty.call(u,g)&&(a[g]=u[g])})(c,o)};function Ce(c,o){function a(){this.constructor=c}be(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function he(c,o,a,u){return new(a||(a=Promise))(function(g,h){function K(ht){try{me(u.next(ht))}catch(Fe){h(Fe)}}function je(ht){try{me(u.throw(ht))}catch(Fe){h(Fe)}}function me(ht){var Fe;ht.done?g(ht.value):(Fe=ht.value,Fe instanceof a?Fe:new a(function(wt){wt(Fe)})).then(K,je)}me((u=u.apply(c,o||[])).next())})}function ve(c,o){var a,u,g,h,K={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return h={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function je(me){return function(ht){return function(Fe){if(a)throw new TypeError("Generator is already executing.");for(;K;)try{if(a=1,u&&(g=2&Fe[0]?u.return:Fe[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,Fe[1])).done)return g;switch(u=0,g&&(Fe=[2&Fe[0],g.value]),Fe[0]){case 0:case 1:g=Fe;break;case 4:return K.label++,{value:Fe[1],done:!1};case 5:K.label++,u=Fe[1],Fe=[0];continue;case 7:Fe=K.ops.pop(),K.trys.pop();continue;default:if(!(g=K.trys,(g=g.length>0&&g[g.length-1])||Fe[0]!==6&&Fe[0]!==2)){K=0;continue}if(Fe[0]===3&&(!g||Fe[1]>g[0]&&Fe[1]<g[3])){K.label=Fe[1];break}if(Fe[0]===6&&K.label<g[1]){K.label=g[1],g=Fe;break}if(g&&K.label<g[2]){K.label=g[2],K.ops.push(Fe);break}g[2]&&K.ops.pop(),K.trys.pop();continue}Fe=o.call(c,K)}catch(wt){Fe=[6,wt],u=0}finally{a=g=0}if(5&Fe[0])throw Fe[1];return{value:Fe[0]?Fe[1]:void 0,done:!0}}([me,ht])}}}function Q(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),g=0;for(o=0;o<a;o++)for(var h=arguments[o],K=0,je=h.length;K<je;K++,g++)u[g]=h[K];return u}var z=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,g=a;u<g.length;u++){var h=g[u],K=h[0],je=h[1];o.setAttribute(K,je)}},c.createRect=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","rect");return g.setAttribute("width",o.toString()),g.setAttribute("height",a.toString()),u&&c.setAttributes(g,u),g},c.createLine=function(o,a,u,g,h){var K=document.createElementNS("http://www.w3.org/2000/svg","line");return K.setAttribute("x1",o.toString()),K.setAttribute("y1",a.toString()),K.setAttribute("x2",u.toString()),K.setAttribute("y2",g.toString()),h&&c.setAttributes(K,h),K},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 g=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return g.setAttribute("cx",(o/2).toString()),g.setAttribute("cy",(a/2).toString()),g.setAttribute("rx",(o/2).toString()),g.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(g,u),g},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,g,h,K,je){var me=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(me,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",g.toString()],["refX",h.toString()],["refY",K.toString()]]),me.appendChild(je),me},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}(),b=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}(),W=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var g=this;return new Promise(function(h){var K=u!==void 0?u:document.createElement("canvas");o===null&&(g.markersOnly=!0,g.naturalSize=!1);var je=document.createElementNS("http://www.w3.org/2000/svg","svg");je.setAttribute("xmlns","http://www.w3.org/2000/svg"),je.setAttribute("width",a.width.baseVal.valueAsString),je.setAttribute("height",a.height.baseVal.valueAsString),je.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),je.innerHTML=a.innerHTML,g.naturalSize===!0?(je.width.baseVal.value=o.naturalWidth,je.height.baseVal.value=o.naturalHeight):g.width!==void 0&&g.height!==void 0&&(je.width.baseVal.value=g.width,je.height.baseVal.value=g.height),K.width=je.width.baseVal.value,K.height=je.height.baseVal.value;var me=je.outerHTML,ht=K.getContext("2d");g.markersOnly!==!0&&ht.drawImage(o,0,0,K.width,K.height);var Fe=window.URL,wt=new Image(K.width,K.height);wt.setAttribute("crossOrigin","anonymous");var Pt=new Blob([me],{type:"image/svg+xml"}),Ht=Fe.createObjectURL(Pt);wt.onload=function(){ht.drawImage(wt,0,0),Fe.revokeObjectURL(Ht);var Un=K.toDataURL(g.imageType,g.imageQuality);h(Un)},wt.src=Ht})},c}(),L=function(){},ye=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 Ee("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ee("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ee("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new re("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new re("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}(),Ee=function(c,o){this.selector=c,this.style=o},re=function(c,o){this.localName=c,this.style=o},Te=function(){function c(o,a,u,g,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=g,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 K=document.createElement("div");K.className=""+a.toolbarButtonStyleClass.name,K.setAttribute("data-type-name",h.typeName),K.innerHTML=h.icon,K.addEventListener("click",function(){a.markerToolbarButtonClicked(K,h)}),a.buttons.push(K),a.markerButtons.push(K)}),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 g=document.createElement("div");g.className=this.toolbarBlockStyleClass.name,g.style.whiteSpace="nowrap",g.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(g),this.addActionButton(g,'<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(g,'<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 g=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){g.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 re("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 re("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new re("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new re("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 re("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new re("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 re("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new re("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ee("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ee("."+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}(),Ne=function(){function c(o,a,u,g){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=g,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new re("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 re("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new re("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new re("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new re("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 re("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new re("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 re("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new re("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ee("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ee("."+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,g=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 K;h.uiStyleSettings=g.uiStyleSettings;var je=document.createElement("div");je.className=g.toolboxButtonStyleClass.name+" "+((K=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&K!==void 0?K:g.toolboxButtonStyleColorsClass.name),je.innerHTML=h.icon,je.title=h.title,je.addEventListener("click",function(){g.panelButtonClick(h)}),g.panelButtons.push(je),g.buttonRow.appendChild(je)}),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 g=o.getUi();g.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(g),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,K){var je,me;h.className=a.toolboxButtonStyleClass.name+" "+(K===u?""+((je=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&je!==void 0?je:a.toolboxActiveButtonStyleColorsClass.name):""+((me=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&me!==void 0?me:a.toolboxButtonStyleColorsClass.name))})},c}(),Ge=function(c,o){this.title=c,this.icon=o},Ie=function(c){function o(a,u,g,h){var K=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 K.colors=[],K.addTransparent=!1,K.colorBoxes=[],K.colors=u,K.currentColor=g,K.setCurrentColor=K.setCurrentColor.bind(K),K.getColorBox=K.getColorBox.bind(K),K}return Ce(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(g){var h=a.getColorBox(g);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,g=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-g,K=document.createElement("div");K.style.display="inline-block",K.style.boxSizing="content-box",K.style.width=h-2+"px",K.style.height=h-2+"px",K.style.padding="1px",K.style.marginRight="2px",K.style.marginBottom="2px",K.style.borderWidth="2px",K.style.borderStyle="solid",K.style.borderRadius=(h+2)/2+"px",K.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",K.addEventListener("click",function(){u.setCurrentColor(a,K)});var je=document.createElement("div");return je.style.display="inline-block",je.style.width=h-2+"px",je.style.height=h-2+"px",je.style.backgroundColor=a,je.style.borderRadius=h/2+"px",a==="transparent"&&(je.style.fill=this.uiStyleSettings.toolboxAccentColor,je.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>`),K.appendChild(je),K},o.prototype.setCurrentColor=function(a,u){var g=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Ge),Re=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}(),Be=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}(),Ze=function(){function c(){this.GRIP_SIZE=10,this.visual=z.createGroup(),this.visual.appendChild(z.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(z.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}(),at=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}(),et=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||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(z.createTransform()),h.setupControlBox(),h}return Ce(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=z.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 g=this.unrotatePoint(a);if(this.manipulationStartX=g.x,this.manipulationStartY=g.y,this.offsetX=g.x-this.left,this.offsetY=g.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 K=this.container.transform.baseVal.getItem(0);K.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(K,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,g=this.manipulationStartWidth,h=this.manipulationStartTop,K=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,g=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:g=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,K=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:K=this.manipulationStartHeight+a.y-this.manipulationStartY}g>=0?(this.left=u,this.width=g):(this.left=u+g,this.width=-g),K>=0?(this.top=h,this.height=K):(this.top=h+K,this.height=-K),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(),g=z.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var g=z.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.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=z.createGroup();var a=z.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=z.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=z.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 Be,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 Ze;return a.visual.transform.baseVal.appendItem(z.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,g=u,h=(this.width+this.CB_DISTANCE)/2-a/2,K=(this.height+this.CB_DISTANCE)/2-a/2,je=this.height+this.CB_DISTANCE-a/2,me=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,g),this.positionGrip(this.controlGrips.topCenter.visual,h,g),this.positionGrip(this.controlGrips.topRight.visual,me,g),this.positionGrip(this.controlGrips.centerLeft.visual,u,K),this.positionGrip(this.controlGrips.centerRight.visual,me,K),this.positionGrip(this.controlGrips.bottomLeft.visual,u,je),this.positionGrip(this.controlGrips.bottomCenter.visual,h,je),this.positionGrip(this.controlGrips.bottomRight.visual,me,je),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,g-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,g){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,g),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:at.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:at.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(at.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(at.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var g=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:g.x*a,y:g.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Re),nt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||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 Ce(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=z.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),z.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&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&z.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}(et),pt=function(c){function o(a,u,g,h){var K=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return K.widths=[],K.widthBoxes=[],K.widths=u,K.currentWidth=g,K.setCurrentWidth=K.setCurrentWidth.bind(K),K}return Ce(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(g){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=g===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(g,h)}),u.appendChild(h);var K=document.createElement("div");K.innerText=g.toString(),K.style.marginRight="5px",h.appendChild(K);var je=document.createElement("div");je.style.minHeight="20px",je.style.flexGrow="2",je.style.display="flex",je.style.alignItems="center";var me=document.createElement("hr");me.style.minWidth="20px",me.style.border="0px",me.style.borderTop=g+"px solid "+a.uiStyleSettings.toolboxColor,me.style.flexGrow="2",je.appendChild(me),h.appendChild(je),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var g=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Ge),ut=function(c){function o(a,u,g,h){var K=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 K.styles=[],K.styleBoxes=[],K.styles=u,K.currentStyle=g,K.setCurrentStyle=K.setCurrentStyle.bind(K),K}return Ce(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(g){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=g===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(g,h)}),u.appendChild(h);var K=document.createElement("div");K.style.minHeight="20px",K.style.flexGrow="2",K.style.overflow="hidden";var je=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(g!==""?'stroke-dasharray="'+g+'"':"")+` />
|
|
</svg>`;K.innerHTML=je,h.appendChild(K),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var g=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Ge),it=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Ce(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}(nt),Le=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},vt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||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 Ce(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=z.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 Ze;return a.visual.transform.baseVal.appendItem(z.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,g){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,g),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}(Re),st=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||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=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Ce(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=z.createGroup(),this.selectorLine=z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=z.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()),z.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),z.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}(vt),Pe=function(c){function o(a,u,g,h){var K=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 K.fonts=[],K.fontBoxes=[],K.fonts=u,K.currentFont=g,K.setCurrentFont=K.setCurrentFont.bind(K),K}return Ce(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(g){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=g===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(g,h)}),u.appendChild(h);var K=document.createElement("div");K.style.display="flex",K.style.minHeight="20px",K.style.flexGrow="2",K.style.fontFamily=g,K.style.overflow="hidden";var je=document.createElement("div");je.style.whiteSpace="nowrap",je.style.overflow="hidden",je.style.textOverflow="ellipsis",je.innerHTML="The quick brown fox jumps over the lazy dog",K.appendChild(je),h.appendChild(K),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var g=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Ge),Xe=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=g.defaultColor,h.fontFamily=g.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 Ie("Color",g.defaultColorSet,g.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Pe("Font",g.defaultFontFamilies,g.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return Ce(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(g){g===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=z.createGroup(),this.bgRectangle=z.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=z.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(z.createTransform()),this.textElement.transform.baseVal.appendItem(z.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(z.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 g=(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(g,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),g=0,h=0;return u.width>0&&u.height>0&&(g=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:g,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),g=this.getTextPosition(u);g.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+g.x+"px, "+g.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(g.x,g.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&&(z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.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 g=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(g)),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}),g=this.textElement.getBBox(),h={x:g.width*a,y:g.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&&z.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&&z.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}(et),te=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=g.defaultColor,h.lineWidth=g.defaultStrokeWidth,h.pixelRatio=g.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 Ie("Color",g.defaultColorSet,g.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return Ce(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=z.createGroup(),this.drawingImage=z.createImage(),this.visual.appendChild(this.drawingImage);var a=z.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),z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),z.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],g=u[0],h=u[1],K=u[2],je=u[3],me=!1,ht=0;ht<this.canvasElement.height;ht++)for(var Fe=0;Fe<this.canvasElement.width;Fe++)a.data[ht*this.canvasElement.width*4+4*Fe+3]>0&&(me=!0,ht<h&&(h=ht),Fe<g&&(g=Fe),ht>je&&(je=ht),Fe>K&&(K=Fe));if(me){this.left=g/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(K-g)/this.pixelRatio,this.height=(je-h)/this.pixelRatio;var wt=document.createElement("canvas");wt.width=K-g,wt.height=je-h,wt.getContext("2d").putImageData(this.canvasContext.getImageData(g,h,K-g,je-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(){z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),z.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}(et),Y=function(c){function o(a,u,g){var h=c.call(this,a,g||'<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 Ce(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 g=function(je){var me="both";switch(je){case 0:me="both";break;case 1:me="start";break;case 2:me="end";break;case 3:me="none"}var ht=document.createElement("div");if(ht.style.display="flex",ht.style.flexGrow="2",ht.style.alignItems="center",ht.style.justifyContent="space-between",ht.style.padding="5px",ht.style.borderWidth="2px",ht.style.borderStyle="solid",ht.style.borderColor=me===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ht.addEventListener("click",function(){a.setCurrentType(me,ht)}),u.appendChild(ht),me==="both"||me==="start"){var Fe=document.createElement("div");Fe.style.display="flex",Fe.style.alignItems="center",Fe.style.minHeight="20px",Fe.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>`,Fe.style.marginLeft="5px",ht.appendChild(Fe)}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),ht.appendChild(wt),me==="both"||me==="end"){var Ht=document.createElement("div");Ht.style.display="flex",Ht.style.alignItems="center",Ht.style.minHeight="20px",Ht.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>`,Ht.style.marginRight="5px",ht.appendChild(Ht)}h.typeBoxes.push(ht)},h=this,K=0;K<4;K++)g(K);return u},o.prototype.setCurrentType=function(a,u){var g=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings!==void 0?g.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Ge),q=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||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 Y("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return Ce(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 g=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-g/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+g/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=z.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(z.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=z.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(z.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",z.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),z.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 g=this.arrow2.transform.baseVal.getItem(0);g.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(g,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}(st),y=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor=g.defaultFillColor,h.strokeWidth=0,h.fillPanel=new Ie("Color",g.defaultColorSet,g.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return Ce(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}(nt),S=function(c){function o(a,u,g,h){var K=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 K.opacities=[],K.opacityBoxes=[],K.opacities=u,K.currentOpacity=g,K.setCurrentOpacity=K.setCurrentOpacity.bind(K),K}return Ce(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(g){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=g===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(g,h)}),u.appendChild(h);var K=document.createElement("div");K.innerText=100*g+"%",h.appendChild(K),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var g=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Ge),O=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=g.defaultHighlightColor,h.strokeWidth=0,h.opacity=g.defaultHighlightOpacity,h.fillPanel=new Ie("Color",g.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new S("Opacity",g.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return Ce(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&z.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}(y),j='<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>',pe=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||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=g.defaultStrokeColor,h.bgColor=g.defaultFillColor,h.fontFamily=g.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 Ie("Text color",g.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 Ie("Fill color",g.defaultColorSet,h.bgColor,j),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Pe("Font",g.defaultFontFamilies,g.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new Ze,h.tipGrip.visual.transform.baseVal.appendItem(z.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return Ce(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(){z.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=z.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&&(z.setAttributes(this.bgRectangle,[["fill",a]]),z.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),g=this.height/5;a&&(this.tipPosition={x:u+g/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))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+g,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+g}):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))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-g,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+g}):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))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-g,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-g},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+g,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-g})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){z.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}(Xe),ke=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.fillColor=g.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 Ie("Line color",Q(g.defaultColorSet,["transparent"]),g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new Ie("Fill color",Q(g.defaultColorSet,["transparent"]),h.fillColor,j),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new S("Opacity",g.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return Ce(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=z.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),z.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&&z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&z.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&z.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}(et),Ke=function(c){function o(a,u,g){return c.call(this,a,u,g)||this}return Ce(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=z.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(z.createTransform()),this.visual.appendChild(this.tip1),this.tip2=z.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(z.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&&(z.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()]]),z.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 g=this.tip2.transform.baseVal.getItem(0);g.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(g,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}(st),yt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokePanel.colors=g.defaultColorSet,h.fillColor="transparent",h}return Ce(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}(ke),Tt=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}(),We=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||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=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ie("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new pt("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new ut("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return Ce(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=z.createGroup(),this.selectorCurve=z.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=z.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()),z.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),z.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),z.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=z.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=z.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}(vt),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}(),mt=function(c){function o(a,u,g){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=g,h}return Ce(o,c),o}(Et),tt=function(c){function o(a,u,g){g===void 0&&(g=!1);var h=c.call(this,a,g)||this;return h.marker=u,h}return Ce(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}(),At=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 Le,this._isOpen=!1,this.undoRedoManager=new Tt,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 ye(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,te,q,Xe,yt,ke,O,pe,Ke,y,st,We]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[it,te,q,Xe,ke,O,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[it,te,q,Xe,O]},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 g=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});g!==void 0&&a._availableMarkerTypes.push(g)}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(),b.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&L.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=L.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Et(o))})},c.prototype.render=function(){return he(this,void 0,void 0,function(){var o;return ve(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new W).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(g){var h=new Et(a,!0);g(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(g){return g(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,g=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,g),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,g=this;this._currentMarker&&this._currentMarker instanceof Xe?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==g._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=z.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 Te(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 Ne(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(g){var h=new tt(o,o._currentMarker,!0);g(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(g){return g(new tt(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(K){var je=new tt(o,void 0,!0);K(je),je.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(K){var je=g.markers[K];g.setCurrentMarker(g.markers[K]),g._currentMarker.dispose(),g.markerImage.removeChild(g._currentMarker.container),g.markers.splice(g.markers.indexOf(g._currentMarker),1),g.eventListeners.markerdelete.forEach(function(me){return me(new tt(o,je))})},g=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 g=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),g<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 he(this,void 0,void 0,function(){var o,a,u=this;return ve(this,function(g){switch(g.label){case 0:return[4,this.render()];case 1:return o=g.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new mt(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 g=a._availableMarkerTypes.find(function(K){return K.typeName===u.typeName});if(g!==void 0){var h=a.addNewMarker(g);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=z.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(g){return g.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(g){return g(new tt(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 te&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(te):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new tt(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 tt(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 tt(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 tt(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){b.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 g in u)Object.prototype.hasOwnProperty.call(u,g)&&(a[g]=u[g])})(c,o)};function jt(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(g,h){function K(ht){try{me(u.next(ht))}catch(Fe){h(Fe)}}function je(ht){try{me(u.throw(ht))}catch(Fe){h(Fe)}}function me(ht){var Fe;ht.done?g(ht.value):(Fe=ht.value,Fe instanceof a?Fe:new a(function(wt){wt(Fe)})).then(K,je)}me((u=u.apply(c,o||[])).next())})}function bn(c,o){var a,u,g,h,K={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return h={next:je(0),throw:je(1),return:je(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function je(me){return function(ht){return function(Fe){if(a)throw new TypeError("Generator is already executing.");for(;K;)try{if(a=1,u&&(g=2&Fe[0]?u.return:Fe[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,Fe[1])).done)return g;switch(u=0,g&&(Fe=[2&Fe[0],g.value]),Fe[0]){case 0:case 1:g=Fe;break;case 4:return K.label++,{value:Fe[1],done:!1};case 5:K.label++,u=Fe[1],Fe=[0];continue;case 7:Fe=K.ops.pop(),K.trys.pop();continue;default:if(!(g=K.trys,(g=g.length>0&&g[g.length-1])||Fe[0]!==6&&Fe[0]!==2)){K=0;continue}if(Fe[0]===3&&(!g||Fe[1]>g[0]&&Fe[1]<g[3])){K.label=Fe[1];break}if(Fe[0]===6&&K.label<g[1]){K.label=g[1],g=Fe;break}if(g&&K.label<g[2]){K.label=g[2],K.ops.push(Fe);break}g[2]&&K.ops.pop(),K.trys.pop();continue}Fe=o.call(c,K)}catch(wt){Fe=[6,wt],u=0}finally{a=g=0}if(5&Fe[0])throw Fe[1];return{value:Fe[0]?Fe[1]:void 0,done:!0}}([me,ht])}}}var rn=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}(),ft=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,g=a;u<g.length;u++){var h=g[u],K=h[0],je=h[1];o.setAttribute(K,je)}},c.createRect=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","rect");return g.setAttribute("width",o.toString()),g.setAttribute("height",a.toString()),u&&c.setAttributes(g,u),g},c.createLine=function(o,a,u,g,h){var K=document.createElementNS("http://www.w3.org/2000/svg","line");return K.setAttribute("x1",o.toString()),K.setAttribute("y1",a.toString()),K.setAttribute("x2",u.toString()),K.setAttribute("y2",g.toString()),h&&c.setAttributes(K,h),K},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 g=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return g.setAttribute("cx",(o/2).toString()),g.setAttribute("cy",(a/2).toString()),g.setAttribute("rx",(o/2).toString()),g.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(g,u),g},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,g,h,K,je){var me=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(me,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",g.toString()],["refX",h.toString()],["refY",K.toString()]]),me.appendChild(je),me},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,g,h,K,je,me){return"M"+o+","+a+"V"+(a+g)+"H"+(o+u)+"V"+a+"H"+h+"V"+K+"H"+(h+je)+"V"+(K+me)+"H"+h+"V"+a+"Z"},c}(),Vn=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 xn("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xn("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new xn("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new pn("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new pn("_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}(),xn=function(c,o){this.selector=c,this.style=o},pn=function(c,o){this.localName=c,this.style=o},kn=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 jt(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}(),ct=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.elements=[],a}return jt(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),g=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("xmlns","http://www.w3.org/2000/svg"),K.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(K);var je=ft.createDefs();K.appendChild(je);var me=ft.createElement("clipPath",[["id","text-bg-clip"]]);je.appendChild(me);var ht=ft.createPath(ft.getHollowRectanglePath((24-g)/2,(24-h)/2,g,h,(24-g)/2+2,(24-h)/2+2,g-4,h-4));K.appendChild(ht);var Fe=ft.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Fe.appendChild(ft.createTSpan(o+":"+a)),K.appendChild(Fe);var wt=Fe.getBBox();ft.setAttributes(Fe,[["x",((24-wt.width)/2).toString()],["y",((24-wt.height)/2-wt.y).toString()]]);var Pt=ft.createPath(ft.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 me.appendChild(Pt),ft.setAttributes(ht,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(K),K.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,g){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=g,h}return jt(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),Rt=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=ft.createGroup(),this.visual.appendChild(ft.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ft.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 ft.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Kn=function(){function c(o,a,u,g){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=g,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&&ft.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=ft.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ft.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(ft.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(ft.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=ft.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Rt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Rt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Rt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Rt(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),ft.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,K){var je=a.y+u*(K+1);ft.setAttributes(h,[["x1",""+a.x],["y1",""+je],["x2",""+(a.x+a.width)],["y2",""+je]])});var g=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,K){var je=a.x+g*(K+1);ft.setAttributes(h,[["x1",""+je],["y1",""+a.y],["x2",""+je],["y2",""+(a.y+a.height)]])}),ft.setAttributes(this.cropShadeElement,[["d",ft.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,g=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+=g,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+=g}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),g=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<g/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=g,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,g,h,K){var je=u/o,me=g/a;return{x:(h.x-K)*je+K,y:(h.y-K)*me+K,width:h.width*je,height:h.height*me}},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();ft.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 g=u%5==0?this.height/3:this.height/6;a+="h4v"+-g+"h1v"+g}a+="v1H0Z",this.scaleShape=ft.createPath(a);var h=ft.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=ft.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ft.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var K=ft.createTSpan("");return K.innerHTML="°",this.angleLabelElement.appendChild(K),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,g,h,K,je){var me=this;return new Promise(function(ht){var Fe=document.createElement("canvas");Fe.width=o.width.baseVal.value-2*g,Fe.height=o.height.baseVal.value-2*g;var wt=1,Pt=1;me.naturalSize===!0?(wt=a.naturalWidth/(o.width.baseVal.value-2*g)/K,Pt=a.naturalHeight/(o.height.baseVal.value-2*g)/je,Fe.width=a.naturalWidth/K,Fe.height=a.naturalHeight/je):me.width!==void 0&&me.height!==void 0&&(wt=me.width/u.width,Pt=me.height/u.height,Fe.width*=wt,Fe.height*=Pt);var Ht=Fe.getContext("2d");Ht.translate(Fe.width/2,Fe.height/2),Ht.rotate(h*Math.PI/180),Ht.scale(K,je),Ht.translate(-Fe.width/2,-Fe.height/2),Ht.drawImage(a,0,0,Fe.width,Fe.height);var Un=document.createElement("canvas");Un.width=u.width*wt,Un.height=u.height*Pt,Un.getContext("2d").putImageData(Ht.getImageData((u.x-g)*wt,(u.y-g)*Pt,u.width*wt,u.height*Pt),0,0),ht(Un.toDataURL(me.imageType,me.imageQuality))})},c}(),Ve=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 Vn(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",ft.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();ft.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=ft.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=ft.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=ft.createGroup(),this.editingTargetRotationScaleContainer=ft.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=ft.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=ft.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=ft.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=ft.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 kn,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 Ht=new Nt(ui.getIcon(Pt.horizontal,Pt.vertical),Pt.horizontal===0&&Pt.vertical===0?"FREE":Pt.horizontal+":"+Pt.vertical);Ht.onClick=function(){return o.ratioButtonClicked(Pt)},u.push(Ht)}),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 g=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");g.isActive=this.isGridVisible,g.onClick=function(){o.isGridVisible=!o.isGridVisible,g.isActive=o.isGridVisible},a.addButton(g);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),!rn.isLicensed){var K=new ct;this.topToolbar.addElementBlock(K);var je=document.createElement("div");je.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var me=document.createElement("a");me.style.color="currentColor",me.href="https://markerjs.com/products/cropro",me.target="_blank",me.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>',je.appendChild(me),K.addElement(je)}var ht=new Xn;ht.minWidth=3*this.toolbarHeight+"px",ht.contentAlign="end",this.topToolbar.addButtonBlock(ht);var Fe=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");Fe.onClick=this.startRenderAndClose,ht.addButton(Fe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Fe.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,ht.addButton(wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new kn,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 g=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");g.onClick=this.rotateRightButtonClicked,a.addButton(g);var h=new ct;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(ht){o.rotateBy(ht),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var K=new Xn;K.minWidth=2*this.toolbarHeight+"px",K.contentAlign="end",this.bottomToolbar.addButtonBlock(K);var je=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");je.onClick=this.flipHorizontallyButtonClicked,K.addButton(je);var me=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");me.onClick=this.flipVerticallyButtonClicked,K.addButton(me)},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 bn(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(g){return g(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return kt(this,void 0,void 0,function(){var o;return bn(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(),ft.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 pn("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 pn("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new pn("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new pn("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 pn("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new pn("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new xn("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new xn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new pn("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 pn("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new pn("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 pn("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 pn("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},c.instanceCounter=0,c}(),Ct=x("8hTe"),ti=x.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 Ri=$e.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,g=u===void 0?!1:u,h=c.className,K=c.showTextOnly,je=c.showLines,me=c.replaces,ht=c.zoomImg,Fe=c.hasMask,wt=c.style,Pt=wt===void 0?{}:wt,Ht=c.stylesPrev,Un=Ht===void 0?{}:Ht,Hn=String(a),ln=Object(D.useRef)(),Yn=Object(D.useRef)(),Xi=Object(D.useState)(""),_n=Object(T.a)(Xi,2),An=_n[0],ni=_n[1],yi=Object(D.useState)("office"),Jn=Object(T.a)(yi,2),ii=Jn[0],zn=Jn[1],fr=function(){var Bt=new Ve(Yn.current);Bt.displayMode="popup",Bt.addRenderEventListener(function(){var mn=Object(G.a)(k.a.mark(function Ft(gn){var Kt;return k.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return ln.current.style.display="none",on.next=3,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:gn}});case 3:Kt=on.sent,Kt!=null&&Kt.id&&me(Yn.current.getAttribute("src").replace(H.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return on.stop()}},Ft)}));return function(Ft){return mn.apply(this,arguments)}}()),Bt.show()},Ki=function(){var Bt=new At(Yn.current);Bt.settings.displayMode="popup",Bt.addEventListener("render",function(){var mn=Object(G.a)(k.a.mark(function Ft(gn){var Kt;return k.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(ln.current.style.display="none",!Yn.current){on.next=6;break}return on.next=4,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:gn.dataUrl}});case 4:Kt=on.sent,Kt!=null&&Kt.id&&me(Yn.current.getAttribute("src").replace(H.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return on.stop()}},Ft)}));return function(Ft){return mn.apply(this,arguments)}}()),Bt.show(),window.markerArea=Bt},Pn=Object(D.useMemo)(function(){try{var qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,mn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hn=Hn.replace(qt,"("+H.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+H.a.API_SERVER+"/api/attachments/").replace(mn,'"'+H.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 Ft=A(Hn),gn=oe();if(Hn.match(/\[TOC\]/)&&(Ft=Ft.replace("<p>[TOC]</p>",He()),Je()),Ft=Ft.replace(/(__special_katext_id_\d+__)/g,function(bi,on){var an=gn[on],ri=an.type,xi=an.expression;return Object($.renderToString)(di(xi)||"",{displayMode:ri==="block",throwOnError:!1,output:"html"})}),Ft=Ft.replace(/▁/g,"\u2581\u2581\u2581"),ie(),K){var Kt=document.createElement("div");return Kt.innerHTML=Ft,Kt.innerText}return setTimeout(function(){return Di()},500),Ft},[Hn]),Nn=Object(D.useRef)();Se.WebkitLineClamp=je,je&&(Pt=Object(se.a)(Object(se.a)({},Pt),Se));function Oi(qt){var Bt=qt.target;if(Bt.tagName.toUpperCase()==="IMG"){if(ht){var mn=Bt.getAttribute("src");ni(mn),zn("image")}}else if(Bt.tagName.toUpperCase()==="A"){var Ft=Bt.getAttribute("href");if(Ft.indexOf("office")>-1)qt.preventDefault(),ni(Ft),zn("office");else if(Ft.indexOf("application/pdf")>-1)qt.preventDefault(),ni(Ft),zn("pdf");else if(Ft.indexOf("type=text")>-1)qt.preventDefault(),ni(Ft),zn("html");else if(Ft.startsWith("#")){qt.preventDefault();var gn=document.getElementById(Ft.replace("#",""));gn&&gn.scrollIntoView(!0)}}}var Di=function(){var Bt,mn=(Bt=Nn.current)===null||Bt===void 0?void 0:Bt.querySelectorAll("video");mn==null||mn.forEach(function(Ft){if(Ft.oncontextmenu=function(){return!1},Ft.src.indexOf(".m3u8")>-1&&!Ft.canPlayType("application/vnd.apple.mpegurl")){if(E.a.isSupported()){var gn=new E.a;gn.loadSource(Ft.src),gn.attachMedia(Ft)}}})};Object(D.useEffect)(function(){if(Nn.current&&Pn&&(Pn.match(ci)&&window.PR.prettyPrint()),Nn.current)return Nn.current.addEventListener("click",Oi),function(){Nn.current.removeEventListener("click",Oi),ie(),Je()}},[Pn,Nn.current,Oi]);var Pi=function(Bt){if(!g)return;Bt.target.nodeName==="IMG"?(ln.current.style.display="flex",ln.current.style.width=Bt.target.clientWidth+"px",ln.current.style.height=Bt.target.clientHeight+"px",ln.current.style.top=Bt.target.offsetTop+"px",ln.current.style.left=Bt.target.offsetLeft+"px",Yn.current.src=Bt.target.getAttribute("src")):ln.current.style.display="none"};return P.a.createElement("div",{style:{position:"relative"}},P.a.createElement("div",{ref:Nn,style:Object(se.a)({},Pt),className:"".concat(h||""," markdown-body ").concat(ti.a.mdBody),onMouseOver:Pi,dangerouslySetInnerHTML:{__html:Pn}}),P.a.createElement("div",{ref:ln,className:ti.a.button},P.a.createElement(ue.a,null,P.a.createElement(ge.a,{onClick:function(){return fr()}},"\u88C1\u526A"),P.a.createElement(ge.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),P.a.createElement("img",{ref:Yn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),P.a.createElement(xe.a,{close:!0,data:An,hasMask:Fe,type:An!=null&&An.length?ii:"",style:Object(se.a)({},Un),onClose:function(){return ni("")}}))}},"9VGf":function(ot,$e,x){"use strict";x.d($e,"a",function(){return ne});var F=x("q1tI"),ue=x.n(F);function ne(ge,se){var G=Object(F.useRef)();Object(F.useEffect)(function(){G.current=ge}),Object(F.useEffect)(function(){function T(){G.current()}if(se!==null){var M=setInterval(T,se);return function(){return clearInterval(M)}}},[se])}},Bd2K:function(ot,$e,x){(function(F){F(x("VrN/"),x("osHv"))})(function(F){F.defineOption("autoCloseTags",!1,function(k,D,P){if(P!=F.Init&&P&&k.removeKeyMap("autoCloseTags"),!D)return;var _={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(_["'/'"]=function(ee){return G(ee)}),(typeof D!="object"||D.whenOpening!==!1)&&(_["'>'"]=function(ee){return ge(ee)}),k.addKeyMap(_)});var ue=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ne=["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 ge(k){if(k.getOption("disableInput"))return F.Pass;for(var D=k.listSelections(),P=[],_=k.getOption("autoCloseTags"),ee=0;ee<D.length;ee++){if(!D[ee].empty())return F.Pass;var Z=D[ee].head,U=k.getTokenAt(Z),X=F.innerMode(k.getMode(),U.state),J=X.state,le=X.mode.xmlCurrentTag&&X.mode.xmlCurrentTag(J),ce=le&&le.name;if(!ce)return F.Pass;var Ue=X.mode.configuration=="html",Je=typeof _=="object"&&_.dontCloseTags||Ue&&ue,Se=typeof _=="object"&&_.indentTags||Ue&≠U.end>Z.ch&&(ce=ce.slice(0,ce.length-U.end+Z.ch));var De=ce.toLowerCase();if(!ce||U.type=="string"&&(U.end!=Z.ch||!/[\"\']/.test(U.string.charAt(U.string.length-1))||U.string.length==1)||U.type=="tag"&&le.close||U.string.indexOf("/")==Z.ch-U.start-1||Je&&T(Je,De)>-1||M(k,X.mode.xmlCurrentContext&&X.mode.xmlCurrentContext(J)||[],ce,Z,!0))return F.Pass;var He=typeof _=="object"&&_.emptyTags;if(He&&T(He,ce)>-1){P[ee]={text:"/>",newPos:F.Pos(Z.line,Z.ch+2)};continue}var _e=Se&&T(Se,De)>-1;P[ee]={indent:_e,text:">"+(_e?`
|
|
|
|
`:"")+"</"+ce+">",newPos:_e?F.Pos(Z.line+1,0):F.Pos(Z.line,Z.ch+1)}}for(var Ae=typeof _=="object"&&_.dontIndentOnAutoClose,ee=D.length-1;ee>=0;ee--){var we=P[ee];k.replaceRange(we.text,D[ee].head,D[ee].anchor,"+insert");var de=k.listSelections().slice(0);de[ee]={head:we.newPos,anchor:we.newPos},k.setSelections(de),!Ae&&we.indent&&(k.indentLine(we.newPos.line,null,!0),k.indentLine(we.newPos.line+1,null,!0))}}function se(k,D){for(var P=k.listSelections(),_=[],ee=D?"/":"</",Z=k.getOption("autoCloseTags"),U=typeof Z=="object"&&Z.dontIndentOnSlash,X=0;X<P.length;X++){if(!P[X].empty())return F.Pass;var J=P[X].head,le=k.getTokenAt(J),ce=F.innerMode(k.getMode(),le.state),Ue=ce.state;if(D&&(le.type=="string"||le.string.charAt(0)!="<"||le.start!=J.ch-1))return F.Pass;var Je,Se=ce.mode.name!="xml"&&k.getMode().name=="htmlmixed";if(Se&&ce.mode.name=="javascript")Je=ee+"script";else if(Se&&ce.mode.name=="css")Je=ee+"style";else{var De=ce.mode.xmlCurrentContext&&ce.mode.xmlCurrentContext(Ue);if(!De||De.length&&M(k,De,De[De.length-1],J))return F.Pass;Je=ee+De[De.length-1]}k.getLine(J.line).charAt(le.end)!=">"&&(Je+=">"),_[X]=Je}if(k.replaceSelections(_),P=k.listSelections(),!U)for(var X=0;X<P.length;X++)(X==P.length-1||P[X].head.line<P[X+1].head.line)&&k.indentLine(P[X].head.line)}function G(k){return k.getOption("disableInput")?F.Pass:se(k,!0)}F.commands.closeTag=function(k){return se(k)};function T(k,D){if(k.indexOf)return k.indexOf(D);for(var P=0,_=k.length;P<_;++P)if(k[P]==D)return P;return-1}function M(k,D,P,_,ee){if(!F.scanForClosingTag)return!1;var Z=Math.min(k.lastLine()+1,_.line+500),U=F.scanForClosingTag(k,_,null,Z);if(!U||U.tag!=P)return!1;for(var X=ee?1:0,J=D.length-1;J>=0&&D[J]==P;J--)++X;_=U.to;for(var J=1;J<X;J++){var le=F.scanForClosingTag(k,_,null,Z);if(!le||le.tag!=P)return!1;_=le.to}return!0}})},BjJ7:function(ot,$e,x){"use strict";x.d($e,"d",function(){return ue}),x.d($e,"c",function(){return ne}),x.d($e,"e",function(){return ge}),x.d($e,"b",function(){return se}),x.d($e,"a",function(){return T});var F=x("m3rI");function ue(M){var k=!0;if(M.length>0){for(var D=0;D<M.length;D++)if(M[D].compile_success==0||!M[D].compile_success){k=!1;break}}else k=!1;return k}function ne(M){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],P=0;P<M.length;P++){var _=M[P],ee=k?"".concat(k,"/").concat(_.name):"".concat(_.name);D.push({title:_.name,isLeaf:!(_.type==="tree"),key:ee})}return D}function ge(M,k,D){for(var P=0;P<M.length;P++){var _=M[P];if(_.key===k){_.children=D;break}_.children&&ge(_.children,k,D)}return M}function se(M,k,D){var P;return function(){var _=this,ee=arguments,Z=function(){P=null,D||M.apply(_,ee)},U=D&&!P;clearTimeout(P),P=setTimeout(Z,k),U&&M.apply(_,ee)}}var G=!0,T=F.a.API_SERVER},"C+DQ":function(ot,$e,x){},D1Df:function(ot,$e,x){"use strict";function F(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?F=function(N){return typeof N}:F=function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},F(C)}function ue(){return ue=Object.assign||function(C){for(var I=1;I<arguments.length;I++){var N=arguments[I];for(var w in N)Object.prototype.hasOwnProperty.call(N,w)&&(C[w]=N[w])}return C},ue.apply(this,arguments)}function ne(C,I){var N=Object.keys(C);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(C);I&&(w=w.filter(function(A){return Object.getOwnPropertyDescriptor(C,A).enumerable})),N.push.apply(N,w)}return N}function ge(C){for(var I=1;I<arguments.length;I++){var N=arguments[I]!=null?arguments[I]:{};I%2?ne(N,!0).forEach(function(w){U(C,w,N[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(N)):ne(N).forEach(function(w){Object.defineProperty(C,w,Object.getOwnPropertyDescriptor(N,w))})}return C}function se(C,I){if(C==null)return{};var N=G(C,I),w,A;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(C);for(A=0;A<p.length;A++){if(w=p[A],I.indexOf(w)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(C,w))continue;N[w]=C[w]}}return N}function G(C,I){if(C==null)return{};var N={},w=Object.keys(C),A,p;for(p=0;p<w.length;p++){if(A=w[p],I.indexOf(A)>=0)continue;N[A]=C[A]}return N}function T(C,I){if(!(C instanceof I))throw new TypeError("Cannot call a class as a function")}function M(C,I){for(var N=0;N<I.length;N++){var w=I[N];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(C,w.key,w)}}function k(C,I,N){return I&&M(C.prototype,I),N&&M(C,N),C}function D(C,I){return I&&(F(I)==="object"||typeof I=="function")?I:_(C)}function P(C){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},P(C)}function _(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function ee(C,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(I&&I.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),I&&Z(C,I)}function Z(C,I){return Z=Object.setPrototypeOf||function(w,A){return w.__proto__=A,w},Z(C,I)}function U(C,I,N){return I in C?Object.defineProperty(C,I,{value:N,enumerable:!0,configurable:!0,writable:!0}):C[I]=N,C}var X=x("q1tI"),J=x("17x9"),le=x("H38U"),ce=x("aRTE");function Ue(C){for(var I="",N=0;N<C.length;N++){var w=C.charCodeAt(N);w<128?I+=String.fromCharCode(w):w<2048?(I+=String.fromCharCode(192|w>>6),I+=String.fromCharCode(128|w&63)):w<55296||w>=57344?(I+=String.fromCharCode(224|w>>12),I+=String.fromCharCode(128|w>>6&63),I+=String.fromCharCode(128|w&63)):(N++,w=65536+((w&1023)<<10|C.charCodeAt(N)&1023),I+=String.fromCharCode(240|w>>18),I+=String.fromCharCode(128|w>>12&63),I+=String.fromCharCode(128|w>>6&63),I+=String.fromCharCode(128|w&63))}return I}var Je={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},Se={},De=4,He=.1;function _e(C){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=[];return C.forEach(function(w,A){var p=null;w.forEach(function(d,E){if(!d&&p!==null){N.push("M".concat(p+I," ").concat(A+I,"h").concat(E-p,"v1H").concat(p+I,"z")),p=null;return}if(E===w.length-1){if(!d)return;p===null?N.push("M".concat(E+I,",").concat(A+I," h1v1H").concat(E+I,"z")):N.push("M".concat(p+I,",").concat(A+I," h").concat(E+1-p,"v1H").concat(p+I,"z"));return}d&&p===null&&(p=E)})}),N.join("")}function Ae(C,I){return C.slice().map(function(N,w){return w<I.y||w>=I.y+I.h?N:N.map(function(A,p){return p<I.x||p>=I.x+I.w?A:!1})})}function we(C,I){var N=C.imageSettings,w=C.size,A=C.includeMargin;if(N==null)return null;var p=A?De:0,d=I.length+p*2,E=Math.floor(w*He),H=d/w,$=(N.width||E)*H,xe=(N.height||E)*H,Me=N.x==null?I.length/2-$/2:N.x*H,be=N.y==null?I.length/2-xe/2:N.y*H,Ce=null;if(N.excavate){var he=Math.floor(Me),ve=Math.floor(be),Q=Math.ceil($+Me-he),z=Math.ceil(xe+be-ve);Ce={x:he,y:ve,w:Q,h:z}}return{x:Me,y:be,h:xe,w:$,excavation:Ce}}var de=function(){try{new Path2D().addPath(new Path2D)}catch(C){return!1}return!0}(),R=function(C){ee(I,C);function I(){var N,w;T(this,I);for(var A=arguments.length,p=new Array(A),d=0;d<A;d++)p[d]=arguments[d];return w=D(this,(N=P(I)).call.apply(N,[this].concat(p))),U(_(w),"_canvas",void 0),U(_(w),"_image",void 0),U(_(w),"state",{imgLoaded:!1}),U(_(w),"handleImageLoad",function(){w.setState({imgLoaded:!0})}),w}return k(I,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var w=this.props,A=w.value,p=w.size,d=w.level,E=w.bgColor,H=w.fgColor,$=w.includeMargin,xe=w.imageSettings,Me=new le(-1,ce[d]);if(Me.addData(Ue(A)),Me.make(),this._canvas!=null){var be=this._canvas,Ce=be.getContext("2d");if(!Ce)return;var he=Me.modules;if(he===null)return;var ve=$?De:0,Q=he.length+ve*2,z=we(this.props,he);xe!=null&&z!=null&&(z.excavation!=null&&(he=Ae(he,z.excavation)));var b=window.devicePixelRatio||1;be.height=be.width=p*b;var W=p/Q*b;Ce.scale(W,W),Ce.fillStyle=E,Ce.fillRect(0,0,Q,Q),Ce.fillStyle=H,de?Ce.fill(new Path2D(_e(he,ve))):he.forEach(function(L,ye){L.forEach(function(Ee,re){Ee&&Ce.fillRect(re+ve,ye+ve,1,1)})}),this.state.imgLoaded&&this._image&&z!=null&&Ce.drawImage(this._image,z.x+ve,z.y+ve,z.w,z.h)}}},{key:"render",value:function(){var w=this,A=this.props,p=A.value,d=A.size,E=A.level,H=A.bgColor,$=A.fgColor,xe=A.style,Me=A.includeMargin,be=A.imageSettings,Ce=se(A,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),he=ge({height:d,width:d},xe),ve=null,Q=be&&be.src;return be!=null&&Q!=null&&(ve=X.createElement("img",{src:Q,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(b){return w._image=b}})),X.createElement(X.Fragment,null,X.createElement("canvas",ue({style:he,height:d,width:d,ref:function(b){return w._canvas=b}},Ce)),ve)}}]),I}(X.PureComponent);U(R,"defaultProps",Je);var oe=function(C){ee(I,C);function I(){return T(this,I),D(this,P(I).apply(this,arguments))}return k(I,[{key:"render",value:function(){var w=this.props,A=w.value,p=w.size,d=w.level,E=w.bgColor,H=w.fgColor,$=w.includeMargin,xe=w.imageSettings,Me=se(w,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),be=new le(-1,ce[d]);be.addData(Ue(A)),be.make();var Ce=be.modules;if(Ce===null)return null;var he=$?De:0,ve=Ce.length+he*2,Q=we(this.props,Ce),z=null;xe!=null&&Q!=null&&(Q.excavation!=null&&(Ce=Ae(Ce,Q.excavation)),z=X.createElement("image",{xlinkHref:xe.src,height:Q.h,width:Q.w,x:Q.x+he,y:Q.y+he,preserveAspectRatio:"none"}));var b=_e(Ce,he);return X.createElement("svg",ue({shapeRendering:"crispEdges",height:p,width:p,viewBox:"0 0 ".concat(ve," ").concat(ve)},Me),X.createElement("path",{fill:E,d:"M0,0 h".concat(ve,"v").concat(ve,"H0z")}),X.createElement("path",{fill:H,d:b}),z)}}]),I}(X.PureComponent);U(oe,"defaultProps",Je);var ie=function(I){var N=I.renderAs,w=se(I,["renderAs"]),A=N==="svg"?oe:R;return X.createElement(A,w)};ie.defaultProps=ge({renderAs:"canvas"},Je),ot.exports=ie},DlQD:function(ot,$e,x){(function(F,ue){ot.exports=ue()})(this,function(){"use strict";function F(te,Y){for(var q=0;q<Y.length;q++){var y=Y[q];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(te,y.key,y)}}function ue(te,Y,q){return Y&&F(te.prototype,Y),q&&F(te,q),te}function ne(te,Y){if(!te)return;if(typeof te=="string")return ge(te,Y);var q=Object.prototype.toString.call(te).slice(8,-1);if(q==="Object"&&te.constructor&&(q=te.constructor.name),q==="Map"||q==="Set")return Array.from(te);if(q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(q))return ge(te,Y)}function ge(te,Y){(Y==null||Y>te.length)&&(Y=te.length);for(var q=0,y=new Array(Y);q<Y;q++)y[q]=te[q];return y}function se(te,Y){var q;if(typeof Symbol=="undefined"||te[Symbol.iterator]==null){if(Array.isArray(te)||(q=ne(te))||Y&&te&&typeof te.length=="number"){q&&(te=q);var y=0;return function(){return y>=te.length?{done:!0}:{done:!1,value:te[y++]}}}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 q=te[Symbol.iterator](),q.next.bind(q)}function G(te,Y){return Y={exports:{}},te(Y,Y.exports),Y.exports}var T=G(function(te){function Y(){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 q(y){te.exports.defaults=y}te.exports={defaults:Y(),getDefaults:Y,changeDefaults:q}}),M=T.defaults,k=T.getDefaults,D=T.changeDefaults,P=/[&<>"']/,_=/[&<>"']/g,ee=/[<>"']|&(?!#?\w+;)/,Z=/[<>"']|&(?!#?\w+;)/g,U={"&":"&","<":"<",">":">",'"':""","'":"'"},X=function(Y){return U[Y]};function J(te,Y){if(Y){if(P.test(te))return te.replace(_,X)}else if(ee.test(te))return te.replace(Z,X);return te}var le=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ce(te){return te.replace(le,function(Y,q){return q=q.toLowerCase(),q==="colon"?":":q.charAt(0)==="#"?q.charAt(1)==="x"?String.fromCharCode(parseInt(q.substring(2),16)):String.fromCharCode(+q.substring(1)):""})}var Ue=/(^|[^\[])\^/g;function Je(te,Y){te=te.source||te,Y=Y||"";var q={replace:function(S,O){return O=O.source||O,O=O.replace(Ue,"$1"),te=te.replace(S,O),q},getRegex:function(){return new RegExp(te,Y)}};return q}var Se=/[^\w:]/g,De=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function He(te,Y,q){if(te){var y;try{y=decodeURIComponent(ce(q)).replace(Se,"").toLowerCase()}catch(S){return null}if(y.indexOf("javascript:")===0||y.indexOf("vbscript:")===0||y.indexOf("data:")===0)return null}Y&&!De.test(q)&&(q=R(Y,q));try{q=encodeURI(q).replace(/%25/g,"%")}catch(S){return null}return q}var _e={},Ae=/^[^:]+:\/*[^/]*$/,we=/^([^:]+:)[\s\S]*$/,de=/^([^:]+:\/*[^/]*)[\s\S]*$/;function R(te,Y){_e[" "+te]||(Ae.test(te)?_e[" "+te]=te+"/":_e[" "+te]=I(te,"/",!0)),te=_e[" "+te];var q=te.indexOf(":")===-1;return Y.substring(0,2)==="//"?q?Y:te.replace(we,"$1")+Y:Y.charAt(0)==="/"?q?Y:te.replace(de,"$1")+Y:te+Y}var oe={exec:function(){}};function ie(te){for(var Y=1,q,y;Y<arguments.length;Y++){q=arguments[Y];for(y in q)Object.prototype.hasOwnProperty.call(q,y)&&(te[y]=q[y])}return te}function C(te,Y){var q=te.replace(/\|/g,function(O,j,pe){for(var ke=!1,Ke=j;--Ke>=0&&pe[Ke]==="\\";)ke=!ke;return ke?"|":" |"}),y=q.split(/ \|/),S=0;if(y.length>Y)y.splice(Y);else for(;y.length<Y;)y.push("");for(;S<y.length;S++)y[S]=y[S].trim().replace(/\\\|/g,"|");return y}function I(te,Y,q){var y=te.length;if(y===0)return"";for(var S=0;S<y;){var O=te.charAt(y-S-1);if(O===Y&&!q)S++;else if(O!==Y&&q)S++;else break}return te.substr(0,y-S)}function N(te,Y){if(te.indexOf(Y[1])===-1)return-1;for(var q=te.length,y=0,S=0;S<q;S++)if(te[S]==="\\")S++;else if(te[S]===Y[0])y++;else if(te[S]===Y[1]&&(y--,y<0))return S;return-1}function w(te){te&&te.sanitize&&!te.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 A={escape:J,unescape:ce,edit:Je,cleanUrl:He,resolveUrl:R,noopTest:oe,merge:ie,splitCells:C,rtrim:I,findClosingBracket:N,checkSanitizeDeprecation:w},p=T.defaults,d=A.rtrim,E=A.splitCells,H=A.escape,$=A.findClosingBracket;function xe(te,Y,q){var y=Y.href,S=Y.title?H(Y.title):null,O=te[1].replace(/\\([\[\]])/g,"$1");return te[0].charAt(0)!=="!"?{type:"link",raw:q,href:y,title:S,text:O}:{type:"image",raw:q,href:y,title:S,text:H(O)}}function Me(te,Y){var q=te.match(/^(\s+)(?:```)/);if(q===null)return Y;var y=q[1];return Y.split(`
|
|
`).map(function(S){var O=S.match(/^\s+/);if(O===null)return S;var j=O[0];return j.length>=y.length?S.slice(y.length):S}).join(`
|
|
`)}var be=function(){function te(q){this.options=q||p}var Y=te.prototype;return Y.space=function(y){var S=this.rules.block.newline.exec(y);if(S)return S[0].length>1?{type:"space",raw:S[0]}:{raw:`
|
|
`}},Y.code=function(y,S){var O=this.rules.block.code.exec(y);if(O){var j=S[S.length-1];if(j&&j.type==="paragraph")return{raw:O[0],text:O[0].trimRight()};var pe=O[0].replace(/^ {4}/gm,"");return{type:"code",raw:O[0],codeBlockStyle:"indented",text:this.options.pedantic?pe:d(pe,`
|
|
`)}}},Y.fences=function(y){var S=this.rules.block.fences.exec(y);if(S){var O=S[0],j=Me(O,S[3]||"");return{type:"code",raw:O,lang:S[2]?S[2].trim():S[2],text:j}}},Y.heading=function(y){var S=this.rules.block.heading.exec(y);if(S)return{type:"heading",raw:S[0],depth:S[1].length,text:S[2]}},Y.nptable=function(y){var S=this.rules.block.nptable.exec(y);if(S){var O={type:"table",header:E(S[1].replace(/^ *| *\| *$/g,"")),align:S[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:S[3]?S[3].replace(/\n$/,"").split(`
|
|
`):[],raw:S[0]};if(O.header.length===O.align.length){var j=O.align.length,pe;for(pe=0;pe<j;pe++)/^ *-+: *$/.test(O.align[pe])?O.align[pe]="right":/^ *:-+: *$/.test(O.align[pe])?O.align[pe]="center":/^ *:-+ *$/.test(O.align[pe])?O.align[pe]="left":O.align[pe]=null;for(j=O.cells.length,pe=0;pe<j;pe++)O.cells[pe]=E(O.cells[pe],O.header.length);return O}}},Y.hr=function(y){var S=this.rules.block.hr.exec(y);if(S)return{type:"hr",raw:S[0]}},Y.blockquote=function(y){var S=this.rules.block.blockquote.exec(y);if(S){var O=S[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:S[0],text:O}}},Y.list=function(y){var S=this.rules.block.list.exec(y);if(S){for(var O=S[0],j=S[2],pe=j.length>1,ke=j[j.length-1]===")",Ke={type:"list",raw:O,ordered:pe,start:pe?+j.slice(0,-1):"",loose:!1,items:[]},yt=S[0].match(this.rules.block.item),Tt=!1,We,Et,mt,tt,Dt,At,Vt,jt=yt.length,kt=0;kt<jt;kt++)We=yt[kt],O=We,Et=We.length,We=We.replace(/^ *([*+-]|\d+[.)]) */,""),~We.indexOf(`
|
|
`)&&(Et-=We.length,We=this.options.pedantic?We.replace(/^ {1,4}/gm,""):We.replace(new RegExp("^ {1,"+Et+"}","gm"),"")),kt!==jt-1&&(mt=this.rules.block.bullet.exec(yt[kt+1])[0],(pe?mt.length===1||!ke&&mt[mt.length-1]===")":mt.length>1||this.options.smartLists&&mt!==j)&&(tt=yt.slice(kt+1).join(`
|
|
`),Ke.raw=Ke.raw.substring(0,Ke.raw.length-tt.length),kt=jt-1)),Dt=Tt||/\n\n(?!\s*$)/.test(We),kt!==jt-1&&(Tt=We.charAt(We.length-1)===`
|
|
`,Dt||(Dt=Tt)),Dt&&(Ke.loose=!0),At=/^\[[ xX]\] /.test(We),Vt=void 0,At&&(Vt=We[1]!==" ",We=We.replace(/^\[[ xX]\] +/,"")),Ke.items.push({type:"list_item",raw:O,task:At,checked:Vt,loose:Dt,text:We});return Ke}},Y.html=function(y){var S=this.rules.block.html.exec(y);if(S)return{type:this.options.sanitize?"paragraph":"html",raw:S[0],pre:!this.options.sanitizer&&(S[1]==="pre"||S[1]==="script"||S[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(S[0]):H(S[0]):S[0]}},Y.def=function(y){var S=this.rules.block.def.exec(y);if(S){S[3]&&(S[3]=S[3].substring(1,S[3].length-1));var O=S[1].toLowerCase().replace(/\s+/g," ");return{tag:O,raw:S[0],href:S[2],title:S[3]}}},Y.table=function(y){var S=this.rules.block.table.exec(y);if(S){var O={type:"table",header:E(S[1].replace(/^ *| *\| *$/g,"")),align:S[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:S[3]?S[3].replace(/\n$/,"").split(`
|
|
`):[]};if(O.header.length===O.align.length){O.raw=S[0];var j=O.align.length,pe;for(pe=0;pe<j;pe++)/^ *-+: *$/.test(O.align[pe])?O.align[pe]="right":/^ *:-+: *$/.test(O.align[pe])?O.align[pe]="center":/^ *:-+ *$/.test(O.align[pe])?O.align[pe]="left":O.align[pe]=null;for(j=O.cells.length,pe=0;pe<j;pe++)O.cells[pe]=E(O.cells[pe].replace(/^ *\| *| *\| *$/g,""),O.header.length);return O}}},Y.lheading=function(y){var S=this.rules.block.lheading.exec(y);if(S)return{type:"heading",raw:S[0],depth:S[2].charAt(0)==="="?1:2,text:S[1]}},Y.paragraph=function(y){var S=this.rules.block.paragraph.exec(y);if(S)return{type:"paragraph",raw:S[0],text:S[1].charAt(S[1].length-1)===`
|
|
`?S[1].slice(0,-1):S[1]}},Y.text=function(y,S){var O=this.rules.block.text.exec(y);if(O){var j=S[S.length-1];return j&&j.type==="text"?{raw:O[0],text:O[0]}:{type:"text",raw:O[0],text:O[0]}}},Y.escape=function(y){var S=this.rules.inline.escape.exec(y);if(S)return{type:"escape",raw:S[0],text:H(S[1])}},Y.tag=function(y,S,O){var j=this.rules.inline.tag.exec(y);if(j)return!S&&/^<a /i.test(j[0])?S=!0:S&&/^<\/a>/i.test(j[0])&&(S=!1),!O&&/^<(pre|code|kbd|script)(\s|>)/i.test(j[0])?O=!0:O&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(j[0])&&(O=!1),{type:this.options.sanitize?"text":"html",raw:j[0],inLink:S,inRawBlock:O,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(j[0]):H(j[0]):j[0]}},Y.link=function(y){var S=this.rules.inline.link.exec(y);if(S){var O=$(S[2],"()");if(O>-1){var j=S[0].indexOf("!")===0?5:4,pe=j+S[1].length+O;S[2]=S[2].substring(0,O),S[0]=S[0].substring(0,pe).trim(),S[3]=""}var ke=S[2],Ke="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ke);yt?(ke=yt[1],Ke=yt[3]):Ke=""}else Ke=S[3]?S[3].slice(1,-1):"";ke=ke.trim().replace(/^<([\s\S]*)>$/,"$1");var Tt=xe(S,{href:ke&&ke.replace(this.rules.inline._escapes,"$1"),title:Ke&&Ke.replace(this.rules.inline._escapes,"$1")},S[0]);return Tt}},Y.reflink=function(y,S){var O;if((O=this.rules.inline.reflink.exec(y))||(O=this.rules.inline.nolink.exec(y))){var j=(O[2]||O[1]).replace(/\s+/g," ");if(j=S[j.toLowerCase()],!j||!j.href){var pe=O[0].charAt(0);return{type:"text",raw:pe,text:pe}}var ke=xe(O,j,O[0]);return ke}},Y.strong=function(y,S,O){O===void 0&&(O="");var j=this.rules.inline.strong.start.exec(y);if(j&&(!j[1]||j[1]&&(O===""||this.rules.inline.punctuation.exec(O)))){S=S.slice(-1*y.length);var pe=j[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;pe.lastIndex=0;for(var ke;(j=pe.exec(S))!=null;)if(ke=this.rules.inline.strong.middle.exec(S.slice(0,j.index+3)),ke)return{type:"strong",raw:y.slice(0,ke[0].length),text:y.slice(2,ke[0].length-2)}}},Y.em=function(y,S,O){O===void 0&&(O="");var j=this.rules.inline.em.start.exec(y);if(j&&(!j[1]||j[1]&&(O===""||this.rules.inline.punctuation.exec(O)))){S=S.slice(-1*y.length);var pe=j[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;pe.lastIndex=0;for(var ke;(j=pe.exec(S))!=null;)if(ke=this.rules.inline.em.middle.exec(S.slice(0,j.index+2)),ke)return{type:"em",raw:y.slice(0,ke[0].length),text:y.slice(1,ke[0].length-1)}}},Y.codespan=function(y){var S=this.rules.inline.code.exec(y);if(S){var O=S[2].replace(/\n/g," "),j=/[^ ]/.test(O),pe=O.startsWith(" ")&&O.endsWith(" ");return j&&pe&&(O=O.substring(1,O.length-1)),O=H(O,!0),{type:"codespan",raw:S[0],text:O}}},Y.br=function(y){var S=this.rules.inline.br.exec(y);if(S)return{type:"br",raw:S[0]}},Y.del=function(y){var S=this.rules.inline.del.exec(y);if(S)return{type:"del",raw:S[0],text:S[1]}},Y.autolink=function(y,S){var O=this.rules.inline.autolink.exec(y);if(O){var j,pe;return O[2]==="@"?(j=H(this.options.mangle?S(O[1]):O[1]),pe="mailto:"+j):(j=H(O[1]),pe=j),{type:"link",raw:O[0],text:j,href:pe,tokens:[{type:"text",raw:j,text:j}]}}},Y.url=function(y,S){var O;if(O=this.rules.inline.url.exec(y)){var j,pe;if(O[2]==="@")j=H(this.options.mangle?S(O[0]):O[0]),pe="mailto:"+j;else{var ke;do ke=O[0],O[0]=this.rules.inline._backpedal.exec(O[0])[0];while(ke!==O[0]);j=H(O[0]),O[1]==="www."?pe="http://"+j:pe=j}return{type:"link",raw:O[0],text:j,href:pe,tokens:[{type:"text",raw:j,text:j}]}}},Y.inlineText=function(y,S,O){var j=this.rules.inline.text.exec(y);if(j){var pe;return S?pe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(j[0]):H(j[0]):j[0]:pe=H(this.options.smartypants?O(j[0]):j[0]),{type:"text",raw:j[0],text:pe}}},te}(),Ce=A.noopTest,he=A.edit,ve=A.merge,Q={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ce,table:Ce,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};Q._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Q._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Q.def=he(Q.def).replace("label",Q._label).replace("title",Q._title).getRegex(),Q.bullet=/(?:[*+-]|\d{1,9}[.)])/,Q.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,Q.item=he(Q.item,"gm").replace(/bull/g,Q.bullet).getRegex(),Q.list=he(Q.list).replace(/bull/g,Q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Q.def.source+")").getRegex(),Q._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Q._comment=/<!--(?!-?>)[\s\S]*?-->/,Q.html=he(Q.html,"i").replace("comment",Q._comment).replace("tag",Q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Q.paragraph=he(Q._paragraph).replace("hr",Q.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Q._tag).getRegex(),Q.blockquote=he(Q.blockquote).replace("paragraph",Q.paragraph).getRegex(),Q.normal=ve({},Q),Q.gfm=ve({},Q.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Q.gfm.nptable=he(Q.gfm.nptable).replace("hr",Q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Q._tag).getRegex(),Q.gfm.table=he(Q.gfm.table).replace("hr",Q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Q._tag).getRegex(),Q.pedantic=ve({},Q.normal,{html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Q._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Ce,paragraph:he(Q.normal._paragraph).replace("hr",Q.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",Q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ce,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:Ce,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",z.punctuation=he(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=he(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=he(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=he(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=he(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=he(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=he(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=he(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=he(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=he(z._blockSkip,"g").getRegex(),z.overlapSkip=he(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._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])?)+(?![-_])/,z.autolink=he(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=he(z.tag).replace("comment",Q._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=he(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=he(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=he(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=ve({},z),z.pedantic=ve({},z.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:he(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=ve({},z.normal,{escape:he(z.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),z.gfm.url=he(z.gfm.url,"i").replace("email",z.gfm._extended_email).getRegex(),z.breaks=ve({},z.gfm,{br:he(z.br).replace("{2,}","*").getRegex(),text:he(z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:Q,inline:z},W=T.defaults,L=b.block,ye=b.inline;function Ee(te){return te.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 re(te){var Y="",q,y,S=te.length;for(q=0;q<S;q++)y=te.charCodeAt(q),Math.random()>.5&&(y="x"+y.toString(16)),Y+="&#"+y+";";return Y}var Te=function(){function te(q){this.tokens=[],this.tokens.links=Object.create(null),this.options=q||W,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var y={block:L.normal,inline:ye.normal};this.options.pedantic?(y.block=L.pedantic,y.inline=ye.pedantic):this.options.gfm&&(y.block=L.gfm,this.options.breaks?y.inline=ye.breaks:y.inline=ye.gfm),this.tokenizer.rules=y}te.lex=function(y,S){var O=new te(S);return O.lex(y)};var Y=te.prototype;return Y.lex=function(y){return y=y.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(y,this.tokens,!0),this.inline(this.tokens),this.tokens},Y.blockTokens=function(y,S,O){S===void 0&&(S=[]),O===void 0&&(O=!0),y=y.replace(/^ +$/gm,"");for(var j,pe,ke,Ke;y;){if(j=this.tokenizer.space(y)){y=y.substring(j.raw.length),j.type&&S.push(j);continue}if(j=this.tokenizer.code(y,S)){y=y.substring(j.raw.length),j.type?S.push(j):(Ke=S[S.length-1],Ke.raw+=`
|
|
`+j.raw,Ke.text+=`
|
|
`+j.text);continue}if(j=this.tokenizer.fences(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.heading(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.nptable(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.hr(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.blockquote(y)){y=y.substring(j.raw.length),j.tokens=this.blockTokens(j.text,[],O),S.push(j);continue}if(j=this.tokenizer.list(y)){for(y=y.substring(j.raw.length),ke=j.items.length,pe=0;pe<ke;pe++)j.items[pe].tokens=this.blockTokens(j.items[pe].text,[],!1);S.push(j);continue}if(j=this.tokenizer.html(y)){y=y.substring(j.raw.length),S.push(j);continue}if(O&&(j=this.tokenizer.def(y))){y=y.substring(j.raw.length),this.tokens.links[j.tag]||(this.tokens.links[j.tag]={href:j.href,title:j.title});continue}if(j=this.tokenizer.table(y)){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.lheading(y)){y=y.substring(j.raw.length),S.push(j);continue}if(O&&(j=this.tokenizer.paragraph(y))){y=y.substring(j.raw.length),S.push(j);continue}if(j=this.tokenizer.text(y,S)){y=y.substring(j.raw.length),j.type?S.push(j):(Ke=S[S.length-1],Ke.raw+=`
|
|
`+j.raw,Ke.text+=`
|
|
`+j.text);continue}if(y){var yt="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return S},Y.inline=function(y){var S,O,j,pe,ke,Ke,yt=y.length;for(S=0;S<yt;S++){Ke=y[S];switch(Ke.type){case"paragraph":case"text":case"heading":{Ke.tokens=[],this.inlineTokens(Ke.text,Ke.tokens);break}case"table":{for(Ke.tokens={header:[],cells:[]},pe=Ke.header.length,O=0;O<pe;O++)Ke.tokens.header[O]=[],this.inlineTokens(Ke.header[O],Ke.tokens.header[O]);for(pe=Ke.cells.length,O=0;O<pe;O++)for(ke=Ke.cells[O],Ke.tokens.cells[O]=[],j=0;j<ke.length;j++)Ke.tokens.cells[O][j]=[],this.inlineTokens(ke[j],Ke.tokens.cells[O][j]);break}case"blockquote":{this.inline(Ke.tokens);break}case"list":{for(pe=Ke.items.length,O=0;O<pe;O++)this.inline(Ke.items[O].tokens);break}}}return y},Y.inlineTokens=function(y,S,O,j,pe){S===void 0&&(S=[]),O===void 0&&(O=!1),j===void 0&&(j=!1),pe===void 0&&(pe="");var ke,Ke=y,yt;if(this.tokens.links){var Tt=Object.keys(this.tokens.links);if(Tt.length>0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(Ke))!=null;)Tt.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(Ke=Ke.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(Ke))!=null;)Ke=Ke.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Ke.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;y;){if(ke=this.tokenizer.escape(y)){y=y.substring(ke.raw.length),S.push(ke);continue}if(ke=this.tokenizer.tag(y,O,j)){y=y.substring(ke.raw.length),O=ke.inLink,j=ke.inRawBlock,S.push(ke);continue}if(ke=this.tokenizer.link(y)){y=y.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,j)),S.push(ke);continue}if(ke=this.tokenizer.reflink(y,this.tokens.links)){y=y.substring(ke.raw.length),ke.type==="link"&&(ke.tokens=this.inlineTokens(ke.text,[],!0,j)),S.push(ke);continue}if(ke=this.tokenizer.strong(y,Ke,pe)){y=y.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],O,j),S.push(ke);continue}if(ke=this.tokenizer.em(y,Ke,pe)){y=y.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],O,j),S.push(ke);continue}if(ke=this.tokenizer.codespan(y)){y=y.substring(ke.raw.length),S.push(ke);continue}if(ke=this.tokenizer.br(y)){y=y.substring(ke.raw.length),S.push(ke);continue}if(ke=this.tokenizer.del(y)){y=y.substring(ke.raw.length),ke.tokens=this.inlineTokens(ke.text,[],O,j),S.push(ke);continue}if(ke=this.tokenizer.autolink(y,re)){y=y.substring(ke.raw.length),S.push(ke);continue}if(!O&&(ke=this.tokenizer.url(y,re))){y=y.substring(ke.raw.length),S.push(ke);continue}if(ke=this.tokenizer.inlineText(y,j,Ee)){y=y.substring(ke.raw.length),pe=ke.raw.slice(-1),S.push(ke);continue}if(y){var We="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(We);break}else throw new Error(We)}}return S},ue(te,null,[{key:"rules",get:function(){return{block:L,inline:ye}}}]),te}(),Ne=T.defaults,Ge=A.cleanUrl,Ie=A.escape,Re=function(){function te(q){this.options=q||Ne}var Y=te.prototype;return Y.code=function(y,S,O){var j=(S||"").match(/\S*/)[0];if(this.options.highlight){var pe=this.options.highlight(y,j);pe!=null&&pe!==y&&(O=!0,y=pe)}return j?'<pre><code class="'+this.options.langPrefix+Ie(j,!0)+'">'+(O?y:Ie(y,!0))+`</code></pre>
|
|
`:"<pre><code>"+(O?y:Ie(y,!0))+`</code></pre>
|
|
`},Y.blockquote=function(y){return`<blockquote>
|
|
`+y+`</blockquote>
|
|
`},Y.html=function(y){return y},Y.heading=function(y,S,O,j){return this.options.headerIds?"<h"+S+' id="'+this.options.headerPrefix+j.slug(O)+'">'+y+"</h"+S+`>
|
|
`:"<h"+S+">"+y+"</h"+S+`>
|
|
`},Y.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Y.list=function(y,S,O){var j=S?"ol":"ul",pe=S&&O!==1?' start="'+O+'"':"";return"<"+j+pe+`>
|
|
`+y+"</"+j+`>
|
|
`},Y.listitem=function(y){return"<li>"+y+`</li>
|
|
`},Y.checkbox=function(y){return"<input "+(y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Y.paragraph=function(y){return"<p>"+y+`</p>
|
|
`},Y.table=function(y,S){return S&&(S="<tbody>"+S+"</tbody>"),`<table>
|
|
<thead>
|
|
`+y+`</thead>
|
|
`+S+`</table>
|
|
`},Y.tablerow=function(y){return`<tr>
|
|
`+y+`</tr>
|
|
`},Y.tablecell=function(y,S){var O=S.header?"th":"td",j=S.align?"<"+O+' align="'+S.align+'">':"<"+O+">";return j+y+"</"+O+`>
|
|
`},Y.strong=function(y){return"<strong>"+y+"</strong>"},Y.em=function(y){return"<em>"+y+"</em>"},Y.codespan=function(y){return"<code>"+y+"</code>"},Y.br=function(){return this.options.xhtml?"<br/>":"<br>"},Y.del=function(y){return"<del>"+y+"</del>"},Y.link=function(y,S,O){if(y=Ge(this.options.sanitize,this.options.baseUrl,y),y===null)return O;var j='<a href="'+Ie(y)+'"';return S&&(j+=' title="'+S+'"'),j+=">"+O+"</a>",j},Y.image=function(y,S,O){if(y=Ge(this.options.sanitize,this.options.baseUrl,y),y===null)return O;var j='<img src="'+y+'" alt="'+O+'"';return S&&(j+=' title="'+S+'"'),j+=this.options.xhtml?"/>":">",j},Y.text=function(y){return y},te}(),Be=function(){function te(){}var Y=te.prototype;return Y.strong=function(y){return y},Y.em=function(y){return y},Y.codespan=function(y){return y},Y.del=function(y){return y},Y.html=function(y){return y},Y.text=function(y){return y},Y.link=function(y,S,O){return""+O},Y.image=function(y,S,O){return""+O},Y.br=function(){return""},te}(),Ze=function(){function te(){this.seen={}}var Y=te.prototype;return Y.slug=function(y){var S=y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(S)){var O=S;do this.seen[O]++,S=O+"-"+this.seen[O];while(this.seen.hasOwnProperty(S))}return this.seen[S]=0,S},te}(),at=T.defaults,et=A.unescape,nt=function(){function te(q){this.options=q||at,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new Ze}te.parse=function(y,S){var O=new te(S);return O.parse(y)};var Y=te.prototype;return Y.parse=function(y,S){S===void 0&&(S=!0);var O="",j,pe,ke,Ke,yt,Tt,We,Et,mt,tt,Dt,At,Vt,jt,kt,bn,rn,ft,Vn=y.length;for(j=0;j<Vn;j++){tt=y[j];switch(tt.type){case"space":continue;case"hr":{O+=this.renderer.hr();continue}case"heading":{O+=this.renderer.heading(this.parseInline(tt.tokens),tt.depth,et(this.parseInline(tt.tokens,this.textRenderer)),this.slugger);continue}case"code":{O+=this.renderer.code(tt.text,tt.lang,tt.escaped);continue}case"table":{for(Et="",We="",Ke=tt.header.length,pe=0;pe<Ke;pe++)We+=this.renderer.tablecell(this.parseInline(tt.tokens.header[pe]),{header:!0,align:tt.align[pe]});for(Et+=this.renderer.tablerow(We),mt="",Ke=tt.cells.length,pe=0;pe<Ke;pe++){for(Tt=tt.tokens.cells[pe],We="",yt=Tt.length,ke=0;ke<yt;ke++)We+=this.renderer.tablecell(this.parseInline(Tt[ke]),{header:!1,align:tt.align[ke]});mt+=this.renderer.tablerow(We)}O+=this.renderer.table(Et,mt);continue}case"blockquote":{mt=this.parse(tt.tokens),O+=this.renderer.blockquote(mt);continue}case"list":{for(Dt=tt.ordered,At=tt.start,Vt=tt.loose,Ke=tt.items.length,mt="",pe=0;pe<Ke;pe++)kt=tt.items[pe],bn=kt.checked,rn=kt.task,jt="",kt.task&&(ft=this.renderer.checkbox(bn),Vt?kt.tokens.length>0&&kt.tokens[0].type==="text"?(kt.tokens[0].text=ft+" "+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=ft+" "+kt.tokens[0].tokens[0].text)):kt.tokens.unshift({type:"text",text:ft}):jt+=ft),jt+=this.parse(kt.tokens,Vt),mt+=this.renderer.listitem(jt,rn,bn);O+=this.renderer.list(mt,Dt,At);continue}case"html":{O+=this.renderer.html(tt.text);continue}case"paragraph":{O+=this.renderer.paragraph(this.parseInline(tt.tokens));continue}case"text":{for(mt=tt.tokens?this.parseInline(tt.tokens):tt.text;j+1<Vn&&y[j+1].type==="text";)tt=y[++j],mt+=`
|
|
`+(tt.tokens?this.parseInline(tt.tokens):tt.text);O+=S?this.renderer.paragraph(mt):mt;continue}default:{var xn='Token with "'+tt.type+'" type was not found.';if(this.options.silent){console.error(xn);return}else throw new Error(xn)}}}return O},Y.parseInline=function(y,S){S=S||this.renderer;var O="",j,pe,ke=y.length;for(j=0;j<ke;j++){pe=y[j];switch(pe.type){case"escape":{O+=S.text(pe.text);break}case"html":{O+=S.html(pe.text);break}case"link":{O+=S.link(pe.href,pe.title,this.parseInline(pe.tokens,S));break}case"image":{O+=S.image(pe.href,pe.title,pe.text);break}case"strong":{O+=S.strong(this.parseInline(pe.tokens,S));break}case"em":{O+=S.em(this.parseInline(pe.tokens,S));break}case"codespan":{O+=S.codespan(pe.text);break}case"br":{O+=S.br();break}case"del":{O+=S.del(this.parseInline(pe.tokens,S));break}case"text":{O+=S.text(pe.text);break}default:{var Ke='Token with "'+pe.type+'" type was not found.';if(this.options.silent){console.error(Ke);return}else throw new Error(Ke)}}}return O},te}(),pt=A.merge,ut=A.checkSanitizeDeprecation,it=A.escape,Le=T.getDefaults,vt=T.changeDefaults,st=T.defaults;function Pe(te,Y,q){if(typeof te=="undefined"||te===null)throw new Error("marked(): input parameter is undefined or null");if(typeof te!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(te)+", string expected");if(typeof Y=="function"&&(q=Y,Y=null),Y=pt({},Pe.defaults,Y||{}),ut(Y),q){var y=Y.highlight,S;try{S=Te.lex(te,Y)}catch(ke){return q(ke)}var O=function(Ke){var yt;if(!Ke)try{yt=nt.parse(S,Y)}catch(Tt){Ke=Tt}return Y.highlight=y,Ke?q(Ke):q(null,yt)};if(!y||y.length<3)return O();if(delete Y.highlight,!S.length)return O();var j=0;Pe.walkTokens(S,function(ke){ke.type==="code"&&(j++,setTimeout(function(){y(ke.text,ke.lang,function(Ke,yt){if(Ke)return O(Ke);yt!=null&&yt!==ke.text&&(ke.text=yt,ke.escaped=!0),j--,j===0&&O()})},0))}),j===0&&O();return}try{var pe=Te.lex(te,Y);return Y.walkTokens&&Pe.walkTokens(pe,Y.walkTokens),nt.parse(pe,Y)}catch(ke){if(ke.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Y.silent)return"<p>An error occurred:</p><pre>"+it(ke.message+"",!0)+"</pre>";throw ke}}Pe.options=Pe.setOptions=function(te){return pt(Pe.defaults,te),vt(Pe.defaults),Pe},Pe.getDefaults=Le,Pe.defaults=st,Pe.use=function(te){var Y=pt({},te);if(te.renderer&&function(){var y=Pe.defaults.renderer||new Re,S=function(pe){var ke=y[pe];y[pe]=function(){for(var Ke=arguments.length,yt=new Array(Ke),Tt=0;Tt<Ke;Tt++)yt[Tt]=arguments[Tt];var We=te.renderer[pe].apply(y,yt);return We===!1&&(We=ke.apply(y,yt)),We}};for(var O in te.renderer)S(O);Y.renderer=y}(),te.tokenizer&&function(){var y=Pe.defaults.tokenizer||new be,S=function(pe){var ke=y[pe];y[pe]=function(){for(var Ke=arguments.length,yt=new Array(Ke),Tt=0;Tt<Ke;Tt++)yt[Tt]=arguments[Tt];var We=te.tokenizer[pe].apply(y,yt);return We===!1&&(We=ke.apply(y,yt)),We}};for(var O in te.tokenizer)S(O);Y.tokenizer=y}(),te.walkTokens){var q=Pe.defaults.walkTokens;Y.walkTokens=function(y){te.walkTokens(y),q&&q(y)}}Pe.setOptions(Y)},Pe.walkTokens=function(te,Y){for(var q=se(te),y;!(y=q()).done;){var S=y.value;Y(S);switch(S.type){case"table":{for(var O=se(S.tokens.header),j;!(j=O()).done;){var pe=j.value;Pe.walkTokens(pe,Y)}for(var ke=se(S.tokens.cells),Ke;!(Ke=ke()).done;)for(var yt=Ke.value,Tt=se(yt),We;!(We=Tt()).done;){var Et=We.value;Pe.walkTokens(Et,Y)}break}case"list":{Pe.walkTokens(S.items,Y);break}default:S.tokens&&Pe.walkTokens(S.tokens,Y)}}},Pe.Parser=nt,Pe.parser=nt.parse,Pe.Renderer=Re,Pe.TextRenderer=Be,Pe.Lexer=Te,Pe.lexer=Te.lex,Pe.Tokenizer=be,Pe.Slugger=Ze,Pe.parse=Pe;var Xe=Pe;return Xe})},ELLl:function(ot,$e,x){(function(F){F(x("VrN/"))})(function(F){var ue={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ne=F.Pos;F.defineOption("autoCloseBrackets",!1,function(U,X,J){J&&J!=F.Init&&(U.removeKeyMap(se),U.state.closeBrackets=null),X&&(G(ge(X,"pairs")),U.state.closeBrackets=X,U.addKeyMap(se))});function ge(U,X){return X=="pairs"&&typeof U=="string"?U:typeof U=="object"&&U[X]!=null?U[X]:ue[X]}var se={Backspace:k,Enter:D};function G(U){for(var X=0;X<U.length;X++){var J=U.charAt(X),le="'"+J+"'";se[le]||(se[le]=T(J))}}G(ue.pairs+"`");function T(U){return function(X){return _(X,U)}}function M(U){var X=U.state.closeBrackets;if(!X||X.override)return X;var J=U.getModeAt(U.getCursor());return J.closeBrackets||X}function k(U){var X=M(U);if(!X||U.getOption("disableInput"))return F.Pass;for(var J=ge(X,"pairs"),le=U.listSelections(),ce=0;ce<le.length;ce++){if(!le[ce].empty())return F.Pass;var Ue=ee(U,le[ce].head);if(!Ue||J.indexOf(Ue)%2!=0)return F.Pass}for(var ce=le.length-1;ce>=0;ce--){var Je=le[ce].head;U.replaceRange("",ne(Je.line,Je.ch-1),ne(Je.line,Je.ch+1),"+delete")}}function D(U){var X=M(U),J=X&&ge(X,"explode");if(!J||U.getOption("disableInput"))return F.Pass;for(var le=U.listSelections(),ce=0;ce<le.length;ce++){if(!le[ce].empty())return F.Pass;var Ue=ee(U,le[ce].head);if(!Ue||J.indexOf(Ue)%2!=0)return F.Pass}U.operation(function(){var Je=U.lineSeparator()||`
|
|
`;U.replaceSelection(Je+Je,null),U.execCommand("goCharLeft"),le=U.listSelections();for(var Se=0;Se<le.length;Se++){var De=le[Se].head.line;U.indentLine(De,null,!0),U.indentLine(De+1,null,!0)}})}function P(U){var X=F.cmpPos(U.anchor,U.head)>0;return{anchor:new ne(U.anchor.line,U.anchor.ch+(X?-1:1)),head:new ne(U.head.line,U.head.ch+(X?1:-1))}}function _(U,X){var J=M(U);if(!J||U.getOption("disableInput"))return F.Pass;var le=ge(J,"pairs"),ce=le.indexOf(X);if(ce==-1)return F.Pass;for(var Ue=ge(J,"closeBefore"),Je=ge(J,"triples"),Se=le.charAt(ce+1)==X,De=U.listSelections(),He=ce%2==0,_e,Ae=0;Ae<De.length;Ae++){var we=De[Ae],de=we.head,R,oe=U.getRange(de,ne(de.line,de.ch+1));if(He&&!we.empty())R="surround";else if((Se||!He)&&oe==X)Se&&Z(U,de)?R="both":Je.indexOf(X)>=0&&U.getRange(de,ne(de.line,de.ch+3))==X+X+X?R="skipThree":R="skip";else if(Se&&de.ch>1&&Je.indexOf(X)>=0&&U.getRange(ne(de.line,de.ch-2),de)==X+X){if(de.ch>2&&/\bstring/.test(U.getTokenTypeAt(ne(de.line,de.ch-2))))return F.Pass;R="addFour"}else if(Se){var ie=de.ch==0?" ":U.getRange(ne(de.line,de.ch-1),de);if(!F.isWordChar(oe)&&ie!=X&&!F.isWordChar(ie))R="both";else return F.Pass}else if(He&&(oe.length===0||/\s/.test(oe)||Ue.indexOf(oe)>-1))R="both";else return F.Pass;if(!_e)_e=R;else if(_e!=R)return F.Pass}var C=ce%2?le.charAt(ce-1):X,I=ce%2?X:le.charAt(ce+1);U.operation(function(){if(_e=="skip")U.execCommand("goCharRight");else if(_e=="skipThree")for(var N=0;N<3;N++)U.execCommand("goCharRight");else if(_e=="surround"){for(var w=U.getSelections(),N=0;N<w.length;N++)w[N]=C+w[N]+I;U.replaceSelections(w,"around"),w=U.listSelections().slice();for(var N=0;N<w.length;N++)w[N]=P(w[N]);U.setSelections(w)}else _e=="both"?(U.replaceSelection(C+I,null),U.triggerElectric(C+I),U.execCommand("goCharLeft")):_e=="addFour"&&(U.replaceSelection(C+C+C+C,"before"),U.execCommand("goCharRight"))})}function ee(U,X){var J=U.getRange(ne(X.line,X.ch-1),ne(X.line,X.ch+1));return J.length==2?J:null}function Z(U,X){var J=U.getTokenAt(ne(X.line,X.ch+1));return/\bstring/.test(J.type)&&J.start==X.ch&&(X.ch==0||!/\bstring/.test(U.getTokenTypeAt(X)))}})},GfqC:function(ot,$e,x){"use strict";var F=x("q1tI"),ue=x.n(F),ne=x("TSYQ"),ge=x.n(ne);function se(A,p){var d="cannot "+A.method+" "+A.action+" "+p.status+"'",E=new Error(d);return E.status=p.status,E.method=A.method,E.url=A.action,E}function G(A){var p=A.responseText||A.response;if(!p)return p;try{return JSON.parse(p)}catch(d){return p}}function T(A){var p=new XMLHttpRequest;A.onProgress&&p.upload&&(p.upload.onprogress=function($){$.total>0&&($.percent=$.loaded/$.total*100),A.onProgress($)});var d=new FormData;A.data&&Object.keys(A.data).forEach(function(H){var $=A.data[H];if(Array.isArray($)){$.forEach(function(xe){d.append(H+"[]",xe)});return}d.append(H,A.data[H])}),A.file instanceof Blob?d.append(A.filename,A.file,A.file.name):d.append(A.filename,A.file),p.onerror=function($){A.onError($)},p.onload=function(){return p.status<200||p.status>=300?A.onError(se(A,p),G(p)):A.onSuccess(G(p),p)},p.open(A.method,A.action,!0),A.withCredentials&&"withCredentials"in p&&(p.withCredentials=!0);var E=A.headers||{};return E["X-Requested-With"]!==null&&p.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(E).forEach(function(H){E[H]!==null&&p.setRequestHeader(H,E[H])}),p.send(d),{abort:function(){p.abort()}}}var M=+new Date,k=0;function D(){return"rc-upload-"+M+"-"+ ++k}function P(A,p){return A.indexOf(p,A.length-p.length)!==-1}var _=function(A,p){if(A&&p){var d=Array.isArray(p)?p:p.split(","),E=A.name||"",H=A.type||"",$=H.replace(/\/.*$/,"");return d.some(function(xe){var Me=xe.trim();return Me.charAt(0)==="."?P(E.toLowerCase(),Me.toLowerCase()):/\/\*$/.test(Me)?$===Me.replace(/\/.*$/,""):H===Me})}return!0};function ee(A,p){var d=A.createReader(),E=[];function H(){d.readEntries(function($){var xe=Array.prototype.slice.apply($);E=E.concat(xe);var Me=!xe.length;Me?p(E):H()})}H()}var Z=function(p,d,E){var H=function $(xe,Me){Me=Me||"",xe.isFile?xe.file(function(be){E(be)&&(xe.fullPath&&!be.webkitRelativePath&&(Object.defineProperties(be,{webkitRelativePath:{writable:!0}}),be.webkitRelativePath=xe.fullPath.replace(/^\//,""),Object.defineProperties(be,{webkitRelativePath:{writable:!1}})),d([be]))}):xe.isDirectory&&ee(xe,function(be){be.forEach(function(Ce){$(Ce,""+Me+xe.name+"/")})})};p.forEach(function($){H($.webkitGetAsEntry())})},U=Z,X=Object.assign||function(A){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var E in d)Object.prototype.hasOwnProperty.call(d,E)&&(A[E]=d[E])}return A},J=function(){function A(p,d){var E=[],H=!0,$=!1,xe=void 0;try{for(var Me=p[Symbol.iterator](),be;!(H=(be=Me.next()).done)&&!(E.push(be.value),d&&E.length===d);H=!0);}catch(Ce){$=!0,xe=Ce}finally{try{!H&&Me.return&&Me.return()}finally{if($)throw xe}}return E}return function(p,d){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return A(p,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),le=function(){function A(p,d){for(var E=0;E<d.length;E++){var H=d[E];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(p,H.key,H)}}return function(p,d,E){return d&&A(p.prototype,d),E&&A(p,E),p}}();function ce(A,p,d){return p in A?Object.defineProperty(A,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):A[p]=d,A}function Ue(A,p){var d={};for(var E in A){if(p.indexOf(E)>=0)continue;if(!Object.prototype.hasOwnProperty.call(A,E))continue;d[E]=A[E]}return d}function Je(A,p){if(!(A instanceof p))throw new TypeError("Cannot call a class as a function")}function Se(A,p){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:A}function De(A,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);A.prototype=Object.create(p&&p.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(A,p):A.__proto__=p)}var He=function(p){return Object.keys(p).reduce(function(d,E){return(E.substr(0,5)==="data-"||E.substr(0,5)==="aria-"||E==="role")&&(d[E]=p[E]),d},{})},_e=function(A){De(p,A);function p(){var d,E,H,$;Je(this,p);for(var xe=arguments.length,Me=Array(xe),be=0;be<xe;be++)Me[be]=arguments[be];return $=(E=(H=Se(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Me))),H),H.state={uid:D()},H.reqs={},H.onChange=function(Ce){var he=Ce.target.files;H.uploadFiles(he),H.reset()},H.onClick=function(Ce){var he=H.fileInput;if(!he)return;var ve=H.props,Q=ve.children,z=ve.onClick;Q&&Q.type==="button"&&(he.parentNode.focus(),he.parentNode.querySelector("button").blur()),he.click(),z&&z(Ce)},H.onKeyDown=function(Ce){Ce.key==="Enter"&&H.onClick()},H.onFileDrop=function(Ce){var he=H.props.multiple;if(Ce.preventDefault(),Ce.type==="dragover")return;if(H.props.directory)U(Array.prototype.slice.call(Ce.dataTransfer.items),H.uploadFiles,function(Q){return _(Q,H.props.accept)});else{var ve=Array.prototype.slice.call(Ce.dataTransfer.files).filter(function(Q){return _(Q,H.props.accept)});he===!1&&(ve=ve.slice(0,1)),H.uploadFiles(ve)}},H.uploadFiles=function(Ce){var he=Array.prototype.slice.call(Ce);he.map(function(ve){return ve.uid=D(),ve}).forEach(function(ve){H.upload(ve,he)})},H.saveFileInput=function(Ce){H.fileInput=Ce},E),Se(H,$)}return le(p,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(E,H){var $=this,xe=this.props;if(!xe.beforeUpload)return setTimeout(function(){return $.post(E)},0);var Me=xe.beforeUpload(E,H);Me&&Me.then?Me.then(function(be){var Ce=Object.prototype.toString.call(be);return Ce==="[object File]"||Ce==="[object Blob]"?$.post(be):$.post(E)}).catch(function(be){console.log(be)}):Me!==!1&&setTimeout(function(){return $.post(E)},0);return}},{key:"post",value:function(E){var H=this;if(!this._isMounted)return;var $=this.props,xe=$.onStart,Me=$.onProgress,be=$.transformFile,Ce=be===void 0?function(he){return he}:be;new Promise(function(he){var ve=$.action;return typeof ve=="function"&&(ve=ve(E)),he(ve)}).then(function(he){var ve=E.uid,Q=$.customRequest||T,z=Promise.resolve(Ce(E)).then(function(b){var W=$.data;return typeof W=="function"&&(W=W(b)),Promise.all([b,W])}).catch(function(b){console.error(b)});z.then(function(b){var W=J(b,2),L=W[0],ye=W[1],Ee={action:he,filename:$.name,data:ye,file:L,headers:$.headers,withCredentials:$.withCredentials,method:$.method||"post",onProgress:Me?function(re){Me(re,E)}:null,onSuccess:function(Te,Ne){delete H.reqs[ve],$.onSuccess(Te,E,Ne)},onError:function(Te,Ne){delete H.reqs[ve],$.onError(Te,Ne,E)}};xe(E),H.reqs[ve]=Q(Ee)})})}},{key:"reset",value:function(){this.setState({uid:D()})}},{key:"abort",value:function(E){var H=this.reqs;if(E){var $=E;E&&E.uid&&($=E.uid),H[$]&&H[$].abort&&H[$].abort(),delete H[$]}else Object.keys(H).forEach(function(xe){H[xe]&&H[xe].abort&&H[xe].abort(),delete H[xe]})}},{key:"render",value:function(){var E,H=this.props,$=H.component,xe=H.prefixCls,Me=H.className,be=H.disabled,Ce=H.id,he=H.style,ve=H.multiple,Q=H.accept,z=H.children,b=H.directory,W=H.openFileDialogOnClick,L=H.onMouseEnter,ye=H.onMouseLeave,Ee=Ue(H,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),re=ge()((E={},ce(E,xe,!0),ce(E,xe+"-disabled",be),ce(E,Me,Me),E)),Te=be?{}:{onClick:W?this.onClick:function(){},onKeyDown:W?this.onKeyDown:function(){},onMouseEnter:L,onMouseLeave:ye,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return ue.a.createElement($,X({},Te,{className:re,role:"button",style:he}),ue.a.createElement("input",X({},He(Ee),{id:Ce,type:"file",ref:this.saveFileInput,onClick:function(Ge){return Ge.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:Q,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:ve,onChange:this.onChange})),z)}}]),p}(F.Component),Ae=_e,we=Object.assign||function(A){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var E in d)Object.prototype.hasOwnProperty.call(d,E)&&(A[E]=d[E])}return A},de=function(){function A(p,d){for(var E=0;E<d.length;E++){var H=d[E];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),Object.defineProperty(p,H.key,H)}}return function(p,d,E){return d&&A(p.prototype,d),E&&A(p,E),p}}();function R(A,p){if(!(A instanceof p))throw new TypeError("Cannot call a class as a function")}function oe(A,p){if(!A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:A}function ie(A,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);A.prototype=Object.create(p&&p.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(A,p):A.__proto__=p)}function C(){}var I=function(A){ie(p,A);function p(){var d,E,H,$;R(this,p);for(var xe=arguments.length,Me=Array(xe),be=0;be<xe;be++)Me[be]=arguments[be];return $=(E=(H=oe(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Me))),H),H.saveUploader=function(Ce){H.uploader=Ce},E),oe(H,$)}return de(p,[{key:"abort",value:function(E){this.uploader.abort(E)}},{key:"render",value:function(){return ue.a.createElement(Ae,we({},this.props,{ref:this.saveUploader}))}}]),p}(F.Component);I.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:C,onError:C,onSuccess:C,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var N=I,w=$e.a=N},Gytx:function(ot,$e){ot.exports=function(F,ue,ne,ge){var se=ne?ne.call(ge,F,ue):void 0;if(se!==void 0)return!!se;if(F===ue)return!0;if(typeof F!="object"||!F||typeof ue!="object"||!ue)return!1;var G=Object.keys(F),T=Object.keys(ue);if(G.length!==T.length)return!1;for(var M=Object.prototype.hasOwnProperty.bind(ue),k=0;k<G.length;k++){var D=G[k];if(!M(D))return!1;var P=F[D],_=ue[D];if(se=ne?ne.call(ge,P,_,D):void 0,se===!1||se===void 0&&P!==_)return!1}return!0}},H38U:function(ot,$e,x){var F=x("f4xo"),ue=x("rcnY"),ne=x("wU8J"),ge=x("Iq15"),se=x("dWSS");function G(M,k){this.typeNumber=M,this.errorCorrectLevel=k,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var T=G.prototype;T.addData=function(M){var k=new F(M);this.dataList.push(k),this.dataCache=null},T.isDark=function(M,k){if(M<0||this.moduleCount<=M||k<0||this.moduleCount<=k)throw new Error(M+","+k);return this.modules[M][k]},T.getModuleCount=function(){return this.moduleCount},T.make=function(){if(this.typeNumber<1){var M=1;for(M=1;M<40;M++){for(var k=ue.getRSBlocks(M,this.errorCorrectLevel),D=new ne,P=0,_=0;_<k.length;_++)P+=k[_].dataCount;for(var _=0;_<this.dataList.length;_++){var ee=this.dataList[_];D.put(ee.mode,4),D.put(ee.getLength(),ge.getLengthInBits(ee.mode,M)),ee.write(D)}if(D.getLengthInBits()<=P*8)break}this.typeNumber=M}this.makeImpl(!1,this.getBestMaskPattern())},T.makeImpl=function(M,k){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var D=0;D<this.moduleCount;D++){this.modules[D]=new Array(this.moduleCount);for(var P=0;P<this.moduleCount;P++)this.modules[D][P]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(M,k),this.typeNumber>=7&&this.setupTypeNumber(M),this.dataCache==null&&(this.dataCache=G.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,k)},T.setupPositionProbePattern=function(M,k){for(var D=-1;D<=7;D++){if(M+D<=-1||this.moduleCount<=M+D)continue;for(var P=-1;P<=7;P++){if(k+P<=-1||this.moduleCount<=k+P)continue;0<=D&&D<=6&&(P==0||P==6)||0<=P&&P<=6&&(D==0||D==6)||2<=D&&D<=4&&2<=P&&P<=4?this.modules[M+D][k+P]=!0:this.modules[M+D][k+P]=!1}}},T.getBestMaskPattern=function(){for(var M=0,k=0,D=0;D<8;D++){this.makeImpl(!0,D);var P=ge.getLostPoint(this);(D==0||M>P)&&(M=P,k=D)}return k},T.createMovieClip=function(M,k,D){var P=M.createEmptyMovieClip(k,D),_=1;this.make();for(var ee=0;ee<this.modules.length;ee++)for(var Z=ee*_,U=0;U<this.modules[ee].length;U++){var X=U*_,J=this.modules[ee][U];J&&(P.beginFill(0,100),P.moveTo(X,Z),P.lineTo(X+_,Z),P.lineTo(X+_,Z+_),P.lineTo(X,Z+_),P.endFill())}return P},T.setupTimingPattern=function(){for(var M=8;M<this.moduleCount-8;M++){if(this.modules[M][6]!=null)continue;this.modules[M][6]=M%2==0}for(var k=8;k<this.moduleCount-8;k++){if(this.modules[6][k]!=null)continue;this.modules[6][k]=k%2==0}},T.setupPositionAdjustPattern=function(){for(var M=ge.getPatternPosition(this.typeNumber),k=0;k<M.length;k++)for(var D=0;D<M.length;D++){var P=M[k],_=M[D];if(this.modules[P][_]!=null)continue;for(var ee=-2;ee<=2;ee++)for(var Z=-2;Z<=2;Z++)ee==-2||ee==2||Z==-2||Z==2||ee==0&&Z==0?this.modules[P+ee][_+Z]=!0:this.modules[P+ee][_+Z]=!1}},T.setupTypeNumber=function(M){for(var k=ge.getBCHTypeNumber(this.typeNumber),D=0;D<18;D++){var P=!M&&(k>>D&1)==1;this.modules[Math.floor(D/3)][D%3+this.moduleCount-8-3]=P}for(var D=0;D<18;D++){var P=!M&&(k>>D&1)==1;this.modules[D%3+this.moduleCount-8-3][Math.floor(D/3)]=P}},T.setupTypeInfo=function(M,k){for(var D=this.errorCorrectLevel<<3|k,P=ge.getBCHTypeInfo(D),_=0;_<15;_++){var ee=!M&&(P>>_&1)==1;_<6?this.modules[_][8]=ee:_<8?this.modules[_+1][8]=ee:this.modules[this.moduleCount-15+_][8]=ee}for(var _=0;_<15;_++){var ee=!M&&(P>>_&1)==1;_<8?this.modules[8][this.moduleCount-_-1]=ee:_<9?this.modules[8][15-_-1+1]=ee:this.modules[8][15-_-1]=ee}this.modules[this.moduleCount-8][8]=!M},T.mapData=function(M,k){for(var D=-1,P=this.moduleCount-1,_=7,ee=0,Z=this.moduleCount-1;Z>0;Z-=2)for(Z==6&&Z--;;){for(var U=0;U<2;U++)if(this.modules[P][Z-U]==null){var X=!1;ee<M.length&&(X=(M[ee]>>>_&1)==1);var J=ge.getMask(k,P,Z-U);J&&(X=!X),this.modules[P][Z-U]=X,_--,_==-1&&(ee++,_=7)}if(P+=D,P<0||this.moduleCount<=P){P-=D,D=-D;break}}},G.PAD0=236,G.PAD1=17,G.createData=function(M,k,D){for(var P=ue.getRSBlocks(M,k),_=new ne,ee=0;ee<D.length;ee++){var Z=D[ee];_.put(Z.mode,4),_.put(Z.getLength(),ge.getLengthInBits(Z.mode,M)),Z.write(_)}for(var U=0,ee=0;ee<P.length;ee++)U+=P[ee].dataCount;if(_.getLengthInBits()>U*8)throw new Error("code length overflow. ("+_.getLengthInBits()+">"+U*8+")");for(_.getLengthInBits()+4<=U*8&&_.put(0,4);_.getLengthInBits()%8!=0;)_.putBit(!1);for(;!(_.getLengthInBits()>=U*8);){if(_.put(G.PAD0,8),_.getLengthInBits()>=U*8)break;_.put(G.PAD1,8)}return G.createBytes(_,P)},G.createBytes=function(M,k){for(var D=0,P=0,_=0,ee=new Array(k.length),Z=new Array(k.length),U=0;U<k.length;U++){var X=k[U].dataCount,J=k[U].totalCount-X;P=Math.max(P,X),_=Math.max(_,J),ee[U]=new Array(X);for(var le=0;le<ee[U].length;le++)ee[U][le]=255&M.buffer[le+D];D+=X;var ce=ge.getErrorCorrectPolynomial(J),Ue=new se(ee[U],ce.getLength()-1),Je=Ue.mod(ce);Z[U]=new Array(ce.getLength()-1);for(var le=0;le<Z[U].length;le++){var Se=le+Je.getLength()-Z[U].length;Z[U][le]=Se>=0?Je.get(Se):0}}for(var De=0,le=0;le<k.length;le++)De+=k[le].totalCount;for(var He=new Array(De),_e=0,le=0;le<P;le++)for(var U=0;U<k.length;U++)le<ee[U].length&&(He[_e++]=ee[U][le]);for(var le=0;le<_;le++)for(var U=0;U<k.length;U++)le<Z[U].length&&(He[_e++]=Z[U][le]);return He},ot.exports=G},HmJG:function(ot,$e,x){},Iq15:function(ot,$e,x){var F=x("nVVt"),ue=x("dWSS"),ne=x("dQei"),ge={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},se={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(G){for(var T=G<<10;se.getBCHDigit(T)-se.getBCHDigit(se.G15)>=0;)T^=se.G15<<se.getBCHDigit(T)-se.getBCHDigit(se.G15);return(G<<10|T)^se.G15_MASK},getBCHTypeNumber:function(G){for(var T=G<<12;se.getBCHDigit(T)-se.getBCHDigit(se.G18)>=0;)T^=se.G18<<se.getBCHDigit(T)-se.getBCHDigit(se.G18);return G<<12|T},getBCHDigit:function(G){for(var T=0;G!=0;)T++,G>>>=1;return T},getPatternPosition:function(G){return se.PATTERN_POSITION_TABLE[G-1]},getMask:function(G,T,M){switch(G){case ge.PATTERN000:return(T+M)%2==0;case ge.PATTERN001:return T%2==0;case ge.PATTERN010:return M%3==0;case ge.PATTERN011:return(T+M)%3==0;case ge.PATTERN100:return(Math.floor(T/2)+Math.floor(M/3))%2==0;case ge.PATTERN101:return T*M%2+T*M%3==0;case ge.PATTERN110:return(T*M%2+T*M%3)%2==0;case ge.PATTERN111:return(T*M%3+(T+M)%2)%2==0;default:throw new Error("bad maskPattern:"+G)}},getErrorCorrectPolynomial:function(G){for(var T=new ue([1],0),M=0;M<G;M++)T=T.multiply(new ue([1,ne.gexp(M)],0));return T},getLengthInBits:function(G,T){if(1<=T&&T<10)switch(G){case F.MODE_NUMBER:return 10;case F.MODE_ALPHA_NUM:return 9;case F.MODE_8BIT_BYTE:return 8;case F.MODE_KANJI:return 8;default:throw new Error("mode:"+G)}else if(T<27)switch(G){case F.MODE_NUMBER:return 12;case F.MODE_ALPHA_NUM:return 11;case F.MODE_8BIT_BYTE:return 16;case F.MODE_KANJI:return 10;default:throw new Error("mode:"+G)}else if(T<41)switch(G){case F.MODE_NUMBER:return 14;case F.MODE_ALPHA_NUM:return 13;case F.MODE_8BIT_BYTE:return 16;case F.MODE_KANJI:return 12;default:throw new Error("mode:"+G)}else throw new Error("type:"+T)},getLostPoint:function(G){for(var T=G.getModuleCount(),M=0,k=0;k<T;k++)for(var D=0;D<T;D++){for(var P=0,_=G.isDark(k,D),ee=-1;ee<=1;ee++){if(k+ee<0||T<=k+ee)continue;for(var Z=-1;Z<=1;Z++){if(D+Z<0||T<=D+Z)continue;if(ee==0&&Z==0)continue;_==G.isDark(k+ee,D+Z)&&P++}}P>5&&(M+=3+P-5)}for(var k=0;k<T-1;k++)for(var D=0;D<T-1;D++){var U=0;G.isDark(k,D)&&U++,G.isDark(k+1,D)&&U++,G.isDark(k,D+1)&&U++,G.isDark(k+1,D+1)&&U++,(U==0||U==4)&&(M+=3)}for(var k=0;k<T;k++)for(var D=0;D<T-6;D++)G.isDark(k,D)&&!G.isDark(k,D+1)&&G.isDark(k,D+2)&&G.isDark(k,D+3)&&G.isDark(k,D+4)&&!G.isDark(k,D+5)&&G.isDark(k,D+6)&&(M+=40);for(var D=0;D<T;D++)for(var k=0;k<T-6;k++)G.isDark(k,D)&&!G.isDark(k+1,D)&&G.isDark(k+2,D)&&G.isDark(k+3,D)&&G.isDark(k+4,D)&&!G.isDark(k+5,D)&&G.isDark(k+6,D)&&(M+=40);for(var X=0,D=0;D<T;D++)for(var k=0;k<T;k++)G.isDark(k,D)&&X++;var J=Math.abs(100*X/T/T-50)/5;return M+=J*10,M}};ot.exports=se},LdHM:function(ot,$e,x){"use strict";x.d($e,"b",function(){return Ue}),x.d($e,"a",function(){return Se});var F=x("1OyB"),ue=x("vuIU"),ne=x("Ji7U"),ge=x("LK+K"),se=x("q1tI"),G=x("rePB"),T=x("Ff2n"),M=x("ODXe"),k=x("4IlW"),D=x("bX4T"),P=x("YrtM"),_=x("TSYQ"),ee=x.n(_),Z=x("+nKL"),U=x("8OUc"),X=function(E,H){var $=E.prefixCls,xe=E.id,Me=E.flattenOptions,be=E.childrenAsData,Ce=E.values,he=E.searchValue,ve=E.multiple,Q=E.defaultActiveFirstOption,z=E.height,b=E.itemHeight,W=E.notFoundContent,L=E.open,ye=E.menuItemSelectedIcon,Ee=E.virtual,re=E.onSelect,Te=E.onToggleOpen,Ne=E.onActiveValue,Ge=E.onScroll,Ie=E.onMouseEnter,Re="".concat($,"-item"),Be=Object(P.a)(function(){return Me},[L,Me],function(Xe,te){return te[0]&&Xe[1]!==te[1]}),Ze=se.useRef(null),at=function(te){te.preventDefault()},et=function(te){Ze.current&&Ze.current.scrollTo({index:te})},nt=function(te){for(var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,q=Be.length,y=0;y<q;y+=1){var S=(te+y*Y+q)%q,O=Be[S],j=O.group,pe=O.data;if(!j&&!pe.disabled)return S}return-1},pt=se.useState(function(){return nt(0)}),ut=Object(M.a)(pt,2),it=ut[0],Le=ut[1],vt=function(te){Le(te);var Y=Be[te];if(!Y){Ne(null,-1);return}Ne(Y.data.value,te)};se.useEffect(function(){vt(Q!==!1?nt(0):-1)},[Be.length,he]),se.useEffect(function(){var Xe=setTimeout(function(){if(!ve&&L&&Ce.size===1){var te=Array.from(Ce)[0],Y=Be.findIndex(function(q){var y=q.data;return y.value===te});vt(Y),et(Y)}});return function(){return clearTimeout(Xe)}},[L]);var st=function(te){te!==void 0&&re(te,{selected:!Ce.has(te)}),ve||Te(!1)};if(se.useImperativeHandle(H,function(){return{onKeyDown:function(te){var Y=te.which;switch(Y){case k.a.UP:case k.a.DOWN:{var q=0;if(Y===k.a.UP?q=-1:Y===k.a.DOWN&&(q=1),q!==0){var y=nt(it+q,q);et(y),vt(y)}break}case k.a.ENTER:{var S=Be[it];S&&!S.data.disabled?st(S.data.value):st(void 0),L&&te.preventDefault();break}case k.a.ESC:Te(!1)}},onKeyUp:function(){},scrollTo:function(te){et(te)}}}),Be.length===0)return se.createElement("div",{role:"listbox",id:"".concat(xe,"_list"),className:"".concat(Re,"-empty"),onMouseDown:at},W);function Pe(Xe){var te=Be[Xe];if(!te)return null;var Y=te.data||{},q=Y.value,y=Y.label,S=Y.children,O=Object(D.a)(Y,!0),j=be?S:y;return te?se.createElement("div",Object.assign({"aria-label":typeof j=="string"?j:null},O,{key:Xe,role:"option",id:"".concat(xe,"_list_").concat(Xe),"aria-selected":Ce.has(q)}),q):null}return se.createElement(se.Fragment,null,se.createElement("div",{role:"listbox",id:"".concat(xe,"_list"),style:{height:0,width:0,overflow:"hidden"}},Pe(it-1),Pe(it),Pe(it+1)),se.createElement(Z.a,{itemKey:"key",ref:Ze,data:Be,height:z,itemHeight:b,fullHeight:!1,onMouseDown:at,onScroll:Ge,virtual:Ee,onMouseEnter:Ie},function(Xe,te){var Y,q=Xe.group,y=Xe.groupOption,S=Xe.data,O=S.label,j=S.key;if(q)return se.createElement("div",{className:ee()(Re,"".concat(Re,"-group"))},O!==void 0?O:j);var pe=S.disabled,ke=S.value,Ke=S.title,yt=S.children,Tt=S.style,We=S.className,Et=Object(T.a)(S,["disabled","value","title","children","style","className"]),mt=Ce.has(ke),tt="".concat(Re,"-option"),Dt=ee()(Re,tt,We,(Y={},Object(G.a)(Y,"".concat(tt,"-grouped"),y),Object(G.a)(Y,"".concat(tt,"-active"),it===te&&!pe),Object(G.a)(Y,"".concat(tt,"-disabled"),pe),Object(G.a)(Y,"".concat(tt,"-selected"),mt),Y)),At=be?yt:O,Vt=!ye||typeof ye=="function"||mt;return se.createElement("div",Object.assign({},Et,{"aria-selected":mt,className:Dt,title:Ke,onMouseMove:function(){if(it===te||pe)return;vt(te)},onClick:function(){pe||st(ke)},style:Tt}),se.createElement("div",{className:"".concat(tt,"-content")},At||ke),se.isValidElement(ye)||mt,Vt&&se.createElement(U.a,{className:"".concat(Re,"-option-state"),customizeIcon:ye,customizeIconProps:{isSelected:mt}},mt?"\u2713":null))}))},J=se.forwardRef(X);J.displayName="OptionList";var le=J,ce=function(){return null};ce.isSelectOption=!0;var Ue=ce,Je=function(){return null};Je.isSelectOptGroup=!0;var Se=Je,De=x("VTBJ"),He=x("Zm9Q");function _e(d){var E=d.key,H=d.props,$=H.children,xe=H.value,Me=Object(T.a)(H,["children","value"]);return Object(De.a)({key:E,value:xe!==void 0?xe:E,children:$},Me)}function Ae(d){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(He.a)(d).map(function(H,$){if(!se.isValidElement(H)||!H.type)return null;var xe=H.type.isSelectOptGroup,Me=H.key,be=H.props,Ce=be.children,he=Object(T.a)(be,["children"]);return E||!xe?_e(H):Object(De.a)(Object(De.a)({key:"__RC_SELECT_GRP__".concat(Me===null?$:Me,"__"),label:Me},he),{},{options:Ae(Ce)})}).filter(function(H){return H})}var we=x("2Qr1"),de=x("qNPg"),R=x("U8pU"),oe=x("Kwbf"),ie=x("WKfj");function C(d){var E=d.mode,H=d.options,$=d.children,xe=d.backfill,Me=d.allowClear,be=d.placeholder,Ce=d.getInputElement,he=d.showSearch,ve=d.onSearch,Q=d.defaultOpen,z=d.autoFocus,b=d.labelInValue,W=d.value,L=d.inputValue,ye=d.optionLabelProp,Ee=E==="multiple"||E==="tags",re=he!==void 0?he:Ee||E==="combobox",Te=H||Ae($);if(Object(oe.a)(E!=="tags"||Te.every(function(Re){return!Re.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),E==="tags"||E==="combobox"){var Ne=Te.some(function(Re){return Re.options?Re.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in Re?Re.value:Re.key)=="number"});Object(oe.a)(!Ne,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(oe.a)(E!=="combobox"||!ye,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(oe.a)(E==="combobox"||!xe,"`backfill` only works with `combobox` mode."),Object(oe.a)(E==="combobox"||!Ce,"`getInputElement` only work with `combobox` mode."),Object(oe.b)(E!=="combobox"||!Ce||!Me||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ve&&!re&&E!=="combobox"&&E!=="tags"&&Object(oe.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(oe.b)(!Q||z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),W!=null){var Ge=Object(ie.d)(W);Object(oe.a)(!b||Ge.every(function(Re){return Object(R.a)(Re)==="object"&&("key"in Re||"value"in Re)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(oe.a)(!Ee||Array.isArray(W),"`value` should be array when `mode` is `multiple` or `tags`")}if($){var Ie=null;Object(He.a)($).some(function(Re){if(!se.isValidElement(Re)||!Re.type)return!1;var Be=Re.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var Ze=Object(He.a)(Re.props.children).every(function(at){return!se.isValidElement(at)||!Re.type||at.type.isSelectOption?!0:(Ie=at.type,!1)});return!Ze}return Ie=Be,!0}),Ie&&Object(oe.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ie.displayName||Ie.name||Ie,"`.")),Object(oe.a)(L===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var I=C,N=Object(de.a)({prefixCls:"rc-select",components:{optionList:le},convertChildrenToData:Ae,flattenOptions:we.d,getLabeledValue:we.e,filterOptions:we.b,isValueDisabled:we.g,findValueOption:we.c,warningProps:I,fillOptionsWithMissingValue:we.a}),w=function(d){Object(ne.a)(H,d);var E=Object(ge.a)(H);function H(){var $;return Object(F.a)(this,H),$=E.apply(this,arguments),$.selectRef=se.createRef(),$.focus=function(){$.selectRef.current.focus()},$.blur=function(){$.selectRef.current.blur()},$}return Object(ue.a)(H,[{key:"render",value:function(){return se.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),H}(se.Component);w.Option=Ue,w.OptGroup=Se;var A=w,p=$e.c=A},M8RZ:function(ot,$e,x){"use strict";x.d($e,"a",function(){return k});var F=x("fWQN"),ue=x("mtLc"),ne=x("yKVA"),ge=x("879j"),se=x("q1tI"),G=x.n(se),T=x("i8i4"),M=x.n(T),k=function(D){Object(ne.a)(_,D);var P=Object(ge.a)(_);function _(ee){var Z;Object(F.a)(this,_),Z=P.call(this,ee);var U=window.document;return Z.node=U.createElement("div"),U.body.appendChild(Z.node),Z}return Object(ue.a)(_,[{key:"render",value:function(){var Z=this.props.children;return Object(T.createPortal)(Z,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),_}(G.a.Component)},OLES:function(ot,$e,x){"use strict";var F=x("U8pU"),ue=x("VTBJ"),ne=x("Ff2n"),ge=x("q1tI"),se=x("uciX"),G=x("7ixt"),T=function(ee){var Z=ee.overlay,U=ee.prefixCls,X=ee.id,J=ee.overlayInnerStyle;return ge.createElement("div",{className:"".concat(U,"-inner"),id:X,role:"tooltip",style:J},typeof Z=="function"?Z():Z)},M=T,k=function(ee,Z){var U=ee.overlayClassName,X=ee.trigger,J=X===void 0?["hover"]:X,le=ee.mouseEnterDelay,ce=le===void 0?0:le,Ue=ee.mouseLeaveDelay,Je=Ue===void 0?.1:Ue,Se=ee.overlayStyle,De=ee.prefixCls,He=De===void 0?"rc-tooltip":De,_e=ee.children,Ae=ee.onVisibleChange,we=ee.afterVisibleChange,de=ee.transitionName,R=ee.animation,oe=ee.placement,ie=oe===void 0?"right":oe,C=ee.align,I=C===void 0?{}:C,N=ee.destroyTooltipOnHide,w=N===void 0?!1:N,A=ee.defaultVisible,p=ee.getTooltipContainer,d=ee.overlayInnerStyle,E=Object(ne.a)(ee,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),H=Object(ge.useRef)(null);Object(ge.useImperativeHandle)(Z,function(){return H.current});var $=Object(ue.a)({},E);"visible"in ee&&($.popupVisible=ee.visible);var xe=function(){var ve=ee.arrowContent,Q=ve===void 0?null:ve,z=ee.overlay,b=ee.id;return[ge.createElement("div",{className:"".concat(He,"-arrow"),key:"arrow"},Q),ge.createElement(M,{key:"content",prefixCls:He,id:b,overlay:z,overlayInnerStyle:d})]},Me=!1,be=!1;if(typeof w=="boolean")Me=w;else if(w&&Object(F.a)(w)==="object"){var Ce=w.keepParent;Me=Ce===!0,be=Ce===!1}return ge.createElement(se.a,Object.assign({popupClassName:U,prefixCls:He,popup:xe,action:J,builtinPlacements:G.a,popupPlacement:ie,ref:H,popupAlign:I,getPopupContainer:p,onPopupVisibleChange:Ae,afterPopupVisibleChange:we,popupTransitionName:de,popupAnimation:R,defaultPopupVisible:A,destroyPopupOnHide:Me,autoDestroy:be,mouseLeaveDelay:Je,popupStyle:Se,mouseEnterDelay:ce},$),_e)},D=Object(ge.forwardRef)(k),P=$e.a=D},Ot1p:function(ot,$e,x){"use strict";var F=x("2qtc"),ue=x("kLXV"),ne=x("rAM+"),ge=x("miYZ"),se=x("tsqr"),G=x("9og8"),T=x("tJVT"),M=x("jrin"),k=x("WmNS"),D=x.n(k),P=x("q1tI"),_=x.n(P),ee=x("VrN/"),Z=x.n(ee),U=x("bdgK"),X=x("p77/"),J=x("Bd2K"),le=x("ELLl"),ce=x("19Vz"),Ue=x("lZu9"),Je=x("+NIl"),Se=x("kSUc"),De=x("9Bee"),He=function(We){var Et=We.value,mt=Et===void 0?"":Et,tt=We.className,Dt=We.showTextOnly,At=We.showLines,Vt=We.style,jt=Vt===void 0?{}:Vt,kt=Object(P.useMemo)(function(){return""},[mt]);return _.a.createElement(_.a.Fragment,null,_.a.createElement("div",{dangerouslySetInnerHTML:{__html:kt}}))},_e=x("Q9mQ"),Ae=x("diRs"),we=x("0Owb"),de=x("dejd"),R=x("C+DQ"),oe=x("D1Df"),ie=x.n(oe),C=x("1vsH"),I=x("m3rI"),N=[{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 w(We){var Et=We.onActionCallback,mt=We.title,tt=We.icon,Dt=We.actionName,At=We.className,Vt=At===void 0?"":At,jt=We.children;function kt(){Et(Dt)}return _.a.createElement("a",{title:mt,className:Vt,onClick:kt},_.a.createElement("i",{className:"md-iconfont ".concat(tt)}),jt)}var A=function(We){var Et=We.watch,mt=We.showNullButton,tt=We.onActionCallback,Dt=We.fullScreen,At=We.insertTemp,Vt=We.hidetoolBar,jt=We.uuid,kt=We.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(C.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(C.E)("_educoder_session"),"&key=").concat(jt,"&api=").concat(encodeURIComponent(I.a.PROXY_SERVER)));var bn=[].concat(N,[{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 _.a.createElement("ul",{className:"markdown-toolbar-container"},!Vt&&bn.map(function(rn,ft){return _.a.createElement("li",{key:ft},rn.actionName?_.a.createElement(w,Object(we.a)({},rn,{onActionCallback:tt})):_.a.createElement("span",{className:"v-line"}))}),mt?_.a.createElement("li",null,_.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:tt},_.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,At&&_.a.createElement("li",null,_.a.createElement(w,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(At),onActionCallback:tt},_.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),_.a.createElement("li",null,_.a.createElement(Ae.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:_.a.createElement("div",null,_.a.createElement(ie.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(C.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(C.E)("_educoder_session"),"&key=").concat(jt,"&api=").concat(encodeURIComponent(I.a.PROXY_SERVER))}))},_.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return kt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),_.a.createElement("li",{className:"btn-full-screen"},_.a.createElement(w,{icon:"".concat(Dt?"icon-shrink":"icon-enlarge"),title:Dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:tt})))},p=x("M8RZ"),d=x("+L6B"),E=x("2/Rp"),H=x("y8nQ"),$=x("Vl3Y"),xe=x("5NDa"),Me=x("5rEg"),be={labelCol:{span:4},wrapperCol:{span:20}},Ce=function(We){var Et=We.callback,mt=We.onCancel;function tt(Dt){Et(Dt)}return _.a.createElement($.a,Object(we.a)({},be,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:tt}),_.a.createElement($.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},_.a.createElement(Me.a,null)),_.a.createElement($.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},_.a.createElement(Me.a,null)),_.a.createElement("div",{className:"flex-container flex-end"},_.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),_.a.createElement(E.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},he=x("7ahc"),ve=x("k1fw"),Q=x("HmJG"),z=x("BjJ7"),b=$.a.useForm,W={width:280,marginRight:10},L={labelCol:{span:5},wrapperCol:{span:19}},ye=function(We){var Et=We.callback,mt=We.onCancel,tt=b(),Dt=Object(T.a)(tt,1),At=Dt[0],Vt=Object(P.useRef)();function jt(rn){Et(Object(ve.a)(Object(ve.a)({},rn),{},{name:Vt.current}))}function kt(rn,ft){At.setFieldsValue({src:"/api/attachments/".concat(rn.id,"?type=").concat(rn.content_type),type:ft.type})}function bn(rn){var ft=rn.target.files[0];Vt.current=ft.name,re(ft,kt)}return _.a.createElement($.a,Object(we.a)({form:At},L,{className:"upload-image-panel",onFinish:jt}),_.a.createElement($.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},_.a.createElement("div",{className:"flex-container"},_.a.createElement($.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},_.a.createElement(Me.a,{style:W})),_.a.createElement(Ee,{onFileChange:bn}))),_.a.createElement($.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},_.a.createElement(Me.a,{style:{width:264}})),_.a.createElement($.a.Item,{style:{textAlign:"right"}},_.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),_.a.createElement(E.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))};function Ee(We){var Et=We.onFileChange;return _.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",_.a.createElement("input",{type:"file",onChange:Et}))}function re(We,Et){if(!We)throw new String("\u6CA1\u6709\u6587\u4EF6");var mt=new FormData;mt.append("editormd-image-file",We),mt.append("file_param_name","editormd-image-file"),mt.append("byxhr","true");var tt=new window.XMLHttpRequest;tt.withCredentials=!0,tt.addEventListener("load",function(Dt){Et(JSON.parse(Dt.target.responseText),We)},!1),tt.addEventListener("error",function(Dt){console.error(Dt)},!1),tt.open("POST","".concat(z.a,"/api/attachments.json")),tt.send(mt)}var Te=x("giR+"),Ne=x("fyUT"),Ge=x("7Kak"),Ie=x("9yH6"),Re=Ie.a.Group,Be={margin:"0 8px"},Ze=function(We){var Et=We.callback,mt=We.onCancel;function tt(Dt){Et(Dt)}return _.a.createElement($.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:tt},_.a.createElement("div",{className:"flex-container"},_.a.createElement("span",{style:Be},"\u5355\u5143\u683C\u6570\uFF1A"),_.a.createElement("span",{style:Be},"\u884C\u6570"),_.a.createElement($.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},_.a.createElement(Ne.a,null)),_.a.createElement("span",{style:Be},"\u5217\u6570"),_.a.createElement($.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},_.a.createElement(Ne.a,null))),_.a.createElement("div",{className:"flex-container",style:{marginTop:12}},_.a.createElement("span",{style:Be},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),_.a.createElement($.a.Item,{name:"align"},_.a.createElement(Re,null,_.a.createElement(Ie.a,{value:"default"},_.a.createElement("i",{className:"fa fa-align-justify"})),_.a.createElement(Ie.a,{value:"left"},_.a.createElement("i",{className:"fa fa-align-left"})),_.a.createElement(Ie.a,{value:"center"},_.a.createElement("i",{className:"fa fa-align-center"})),_.a.createElement(Ie.a,{value:"right"},_.a.createElement("i",{className:"fa fa-align-right"}))))),_.a.createElement("div",{className:"flex-container flex-end"},_.a.createElement(E.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),_.a.createElement(E.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},at=x("ErOA"),et=x("7Cbv"),nt="link",pt="upload-image",ut="code-block",it="add-table",Le="------------",vt={default:Le,left:":".concat(Le),center:":".concat(Le,":"),right:"".concat(Le,":")},st=x("9VGf"),Pe,Xe;function te(){}var Y=0,q=1e4,y="\u2581",S=`
|
|
**\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 O(We){return/^\d+$/.test(We)?"".concat(We,"px"):We}var j=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=j?"Cmd":"Ctrl",ke=["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"],Ke=(Pe={},Object(M.a)(Pe,pe+"-B","bold"),Object(M.a)(Pe,pe+"-I","italic"),Pe),yt=(Xe={},Object(M.a)(Xe,nt,"\u6DFB\u52A0\u94FE\u63A5"),Object(M.a)(Xe,ut,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(M.a)(Xe,pt,"\u6DFB\u52A0\u6587\u4EF6"),Object(M.a)(Xe,it,"\u6DFB\u52A0\u8868\u683C"),Xe),Tt=$e.a=function(We){var Et=We.defaultValue,mt=Et===void 0?"":Et,tt=We.onChange,Dt=We.width,At=Dt===void 0?"100%":Dt,Vt=We.height,jt=Vt===void 0?400:Vt,kt=We.miniToolbar,bn=kt===void 0?!1:kt,rn=We.isFocus,ft=rn===void 0?!1:rn,Vn=We.watch,xn=We.insertTemp,pn=We.mode,kn=pn===void 0?"markdown":pn,li=We.id,Xn=li===void 0?"markdown-editor-id":li,Nt=We.showResizeBar,ct=Nt===void 0?!1:Nt,Fn=We.noStorage,ui=Fn===void 0?!1:Fn,Tn=We.showNullButton,Rt=Tn===void 0?!1:Tn,Kn=We.hidetoolBar,hi=Kn===void 0?!1:Kn,vi=We.fullScreen,Ve=vi===void 0?!1:vi,Ct=We.onBlur,ti=We.onCMBeforeChange,ci=We.onFullScreen,di=We.className,Ri=di===void 0?"":di,c=We.disablePaste,o=c===void 0?!1:c,a=We.placeholder,u=a===void 0?"":a,g=We.values,h=g===void 0?"":g,K=Object(P.useState)(null),je=Object(T.a)(K,2),me=je[0],ht=je[1],Fe=Object(P.useState)(mt),wt=Object(T.a)(Fe,2),Pt=wt[0],Ht=wt[1],Un=Object(P.useState)(Vn),Hn=Object(T.a)(Un,2),ln=Hn[0],Yn=Hn[1],Xi=Object(P.useState)(Ve),_n=Object(T.a)(Xi,2),An=_n[0],ni=_n[1],yi=Object(P.useState)(""),Jn=Object(T.a)(yi,2),ii=Jn[0],zn=Jn[1],fr=Object(P.useState)(0),Ki=Object(T.a)(fr,2),Pn=Ki[0],Nn=Ki[1],Oi=Object(P.useState)(jt),Di=Object(T.a)(Oi,2),Pi=Di[0],qt=Di[1],Bt=Object(P.useState)(!1),mn=Object(T.a)(Bt,2),Ft=mn[0],gn=mn[1],Kt=Object(P.useRef)(Object(et.a)()),bi=Object(P.useRef)(!1),on=Object(P.useRef)(),an=Object(P.useRef)(),ri=Object(P.useRef)(),xi=Object(P.useRef)(),Ci=Object(P.useRef)(),Fr=function(){var dt=Object(G.a)(D.a.mark(function St(){var bt,Lt;return D.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return zt.next=2,Object(at.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Kt.current}});case 2:Lt=zt.sent,Lt!=null&&(bt=Lt.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",me,an),Lt.attachments.map(function(Ot){Ot.content_type.indexOf("image")>-1?me.replaceSelection(".concat(Ot.content_type,")")):Ot.content_type.indexOf("video")>-1?me.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ot.content_type.indexOf("pdf")>-1?me.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,'&disposition=inline" target="_blank">').concat(Ot.name,"</a>")):me.replaceSelection("[".concat(Ot.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(Ot.id,"?type=").concat(Ot.content_type,")"))}));case 4:case"end":return zt.stop()}},St)}));return function(){return dt.apply(this,arguments)}}();Object(P.useEffect)(function(){Ht(h),me==null||me.setValue(h)},[h]),Object(P.useEffect)(function(){ci==null||ci(An)},[An]),Object(P.useEffect)(function(){if(an.current){var dt=Z.a.fromTextArea(an.current,{mode:kn,lineNumbers:!bn,lineWrapping:!0,value:mt,autoCloseTags:!0,autoCloseBrackets:!0});ft&&dt.focus();function St(bt,Lt){if(o){Lt.preventDefault();return}var It=Lt.clipboardData;if(It){var zt=It.types.toString(),Ot=It.items;if(zt==="Files"||It.types.indexOf("Files")>-1){if(Lt.preventDefault(),kn=="stex")return;try{var Jt,un=Ot[1];((Jt=Ot[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(un=Ot[0]);var Mt=un.getAsFile(),Ni=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var vn,Xt,$n;(Mt==null||((vn=Mt.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?dt.replaceSelection(".concat(Wt.content_type,")")):(Mt==null||((Xt=Mt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?dt.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||(($n=Mt.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?dt.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):ke.includes(Ni)?dt.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):dt.replaceSelection("[".concat(Mt.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){se.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return dt.on("paste",St),dt.on("dragleave",function(bt,Lt){ri.current.classList.remove("mouse-hover-md")}),dt.on("dragover",function(bt,Lt){ri.current.classList.add("mouse-hover-md")}),dt.on("drop",function(bt,Lt){ri.current.classList.add("mouse-hover-md");var It;if(It=Lt.dataTransfer.files,It.length>0){Lt.preventDefault(),Lt.stopPropagation();for(var zt=function(un){var Mt=It[un],Ni=Mt.name.split(".").pop();re(Mt,function(Wt){if(Wt.id){var vn,Xt,$n;(Mt==null||((vn=Mt.type)===null||vn===void 0)?void 0:vn.indexOf("image"))>-1?dt.replaceSelection(".concat(Wt.content_type,")")):(Mt==null||((Xt=Mt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?dt.replaceSelection('<video width="100%" controls src="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Wt.id,'"></video>')):(Mt==null||(($n=Mt.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?dt.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):ke.includes(Ni)?dt.replaceSelection('<a href="'.concat(I.a.API_SERVER,"/api/attachments/").concat(Wt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):dt.replaceSelection("[".concat(Mt.name,"](").concat(I.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Ot=0;Ot<It.length;Ot++)zt(Ot)}}),ht(dt),function(){dt.off("paste",St)}}},[]);var Zn=Object(P.useCallback)(function(){if(ri.current)try{}catch(dt){console.log(dt,"---- to set md editor body height")}},[Pi,ri,An]);Object(P.useEffect)(function(){function dt(){var bt=new U.default(function(Lt){var It=Object(ne.a)(Lt),zt;try{for(It.s();!(zt=It.n()).done;){var Ot=zt.value;(Ot.target.offsetHeight>0||Ot.target.offsetWidth>0)&&(Zn(),me.setSize("100%","100%"),me.refresh())}}catch(Jt){It.e(Jt)}finally{It.f()}});return bt.observe(an.current.parentElement),bt}if(me){var St=dt();return function(){St.unobserve(an.current.parentElement)}}},[me,Zn]),Object(P.useEffect)(function(){if(me){for(var dt=[],St=function(){var Ot=Lt[bt];It=Object(T.a)(Ot,2);var Jt=It[0],un=It[1],Mt=Object(M.a)({},Jt,function(){Yi(un)});dt.push(Mt),me.addKeyMap(Mt)},bt=0,Lt=Object.entries(Ke);bt<Lt.length;bt++){var It;St()}return on.current=setInterval(function(){bi.current&&Fr()},4e3),function(){clearInterval(on.current);var zt=Object(ne.a)(dt),Ot;try{for(zt.s();!(Ot=zt.n()).done;){var Jt=Ot.value;me.removeKeyMap(Jt)}}catch(un){zt.e(un)}finally{zt.f()}}}},[me]),Object(P.useEffect)(function(){Ve!==An&&ni(Ve)},[Ve]),Object(st.a)(function(){if(!ui&&Pn>0){var dt=new Date().getTime(),St=window.sessionStorage.getItem(Xn);dt>=Pn+q&&(!St||St!==Pt)&&(window.sessionStorage.setItem(Xn,Pt),gn(!0))}},q),Object(P.useEffect)(function(){Yn(Vn)},[me,Vn]),Object(P.useEffect)(function(){me&&(ft&&me.focus())},[me,ft]),Object(P.useEffect)(function(){if(ln&&me){var dt=me.getScrollerElement();function St(bt){var Lt=bt.target;if(Ci.current){var It=Lt.scrollTop/Lt.scrollHeight;Ci.current.scrollTop=Ci.current.scrollHeight*It}}return dt.addEventListener("scroll",St),function(){dt.removeEventListener("scroll",St)}}},[me,ln]),Object(P.useEffect)(function(){if(me&&ti){function dt(St,bt){ti(St,bt)}return me.on("beforeChange",dt),function(){me.off("beforeChange",dt)}}},[me,ti]),Object(P.useEffect)(function(){if(me&&Ct){function dt(){Ct(me.getValue())}return me.on("blur",dt),function(){me.off("blur",dt)}}},[me,Ct]),Object(P.useEffect)(function(){if(me){function dt(St){var bt=St.getValue();Ht(bt),Nn(new Date().getTime()),St.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),tt&&tt(bt)}return me.on("change",dt),function(){me.off("change",dt)}}},[me,tt]),Object(P.useEffect)(function(){me&&(mt==null?(me.setValue(""),Ht("")):mt!==me.getValue()&&(me.setValue(mt),Ht(mt),me.setCursor(me.lineCount(),0)))},[me,mt]);var Yi=Object(P.useCallback)(function(dt){var St=me.getCursor(),bt=me.getSelection(),Lt=bt.split(`
|
|
`);switch(dt){case"bold":return me.replaceSelection("**"+bt+"**"),bt===""&&me.setCursor(St.line,St.ch+2),me.focus();case"italic":return me.replaceSelection("*"+bt+"*"),bt===""&&me.setCursor(St.line,St.ch+1),me.focus();case"code":return me.replaceSelection("`"+bt+"`"),bt===""&&me.setCursor(St.line,St.ch+1),me.focus();case"inline-latex":return me.replaceSelection("`$$"+bt+"$$`"),bt===""&&me.setCursor(St.line,St.ch+3),me.focus();case"latex":return me.replaceSelection("```latex\n"+bt+"\n```"),me.setCursor(St.line+1,bt.length+1),me.focus();case"line-break":return me.replaceSelection(`<br/>
|
|
`),me.focus();case"list-ul":return bt===""?me.replaceSelection("- "+bt):me.replaceSelection(Lt.map(function(It){return It===""?"":"- ".concat(It)}).join(`
|
|
`)),me.focus();case"list-ol":return bt===""?me.replaceSelection("1. "+bt):me.replaceSelection(Lt.map(function(It,zt){return It===""?"":"".concat(zt+1,". ").concat(It)}).join(`
|
|
`)),me.focus();case"add-null-ch":return bt===""&&me.setCursor(St.line,St.ch+1),me.replaceSelection(y),me.focus();case"inster-template-1":return bt===""&&me.setCursor(St.line,St.ch),me.replaceSelection(S),me.focus();case"eraser":return me.setValue(""),me.focus();case"trigger-watch":return Yn(!ln),me.focus();case"trigger-full-screen":return ni(!An),me.focus();case nt:zn(nt);return;case ut:zn(ut);return;case pt:zn(pt);return;case it:zn(it);return;default:throw new Error}},[me,ln,An]),In=Object(P.useCallback)(function(dt){zn("");switch(ii){case nt:var St=dt.title,bt=dt.link;return me.replaceSelection("[".concat(St,"](").concat(bt,")")),me.focus();case ut:var Lt=dt.language,It=dt.content;return me.replaceSelection(["```"+Lt,It,"```"].join(`
|
|
`)),me.focus();case pt:var zt=dt.src,Ot=dt.alt,Jt=dt.name;return zt.indexOf("type=image")>-1?me.replaceSelection(".concat(zt,' "').concat(Ot||"",'" )')):zt.indexOf("type=application/pdf")>-1?me.replaceSelection('<a href="'.concat(zt,'&disposition=inline" target="_blank">').concat(Jt,"</a>")):me.replaceSelection('<a href="'.concat(zt,'" target="_blank">').concat(Jt,"</a>")),me.focus();case it:for(var un=dt.row,Mt=dt.col,Ni=dt.align,Wt=`
|
|
`,vn=0;vn<un;vn++){for(var Xt=[],$n=[],pr=0;pr<Mt;pr++)vn===1&&$n.push(vt[Ni]),Xt.push(" ");vn===1&&(Wt+="| ".concat($n.join(" | "),` |
|
|
`)),Wt+="| ".concat(Xt.join(Mt===1?"":" | "),` |
|
|
`)}return me.replaceSelection(Wt+`
|
|
`),me.focus();default:throw new Error}},[me,ii]),$i=Object(P.useMemo)(function(){switch(ii){case nt:return _.a.createElement(Ce,{callback:In,onCancel:fi});case ut:return _.a.createElement(he.b,{callback:In,onCancel:fi});case pt:return _.a.createElement(ye,{callback:In,onCancel:fi});case it:return _.a.createElement(Ze,{callback:In,onCancel:fi});default:return null}},[ii]);function fi(){zn("")}Object(P.useEffect)(function(){if(xi.current){var dt=xi.current,St=!1,bt=0;function Lt(Ot){St=!0,bt=Ot.pageY}function It(){St=!1}function zt(Ot){if(St){var Jt=Ot.pageY-bt;Jt<0&&(Jt=0),Jt>300&&(Jt=300);var un=jt+Jt+"px";qt(un)}}return dt.addEventListener("mousedown",Lt),document.addEventListener("mousemove",zt),document.addEventListener("mouseup",It),function(){dt.removeEventListener("mousedown",Lt),document.removeEventListener("mousemove",zt),document.removeEventListener("mouseup",It)}}},[me,xi]),Object(P.useEffect)(function(){qt(jt)},[jt]);var wi=O(At),uo=O(Pi),ho={width:wi,height:uo},Zo=Object(P.useMemo)(function(){if(Pn){var dt=new Date(Pn),St=dt.getHours(),bt=dt.getMinutes(),Lt=dt.getSeconds();return St=St<10?"0"+St:St,bt=bt<10?"0"+bt:bt,Lt=Lt<10?"0"+Lt:Lt,"".concat(St,":").concat(bt,":").concat(Lt)}return 0},[Pn]);function Qo(){window.sessionStorage.removeItem(Xn),gn(!1),Nn(0)}function co(){gn(!1),Nn(0),me.setValue(window.sessionStorage.getItem(Xn))}function Ur(dt,St){var bt=me.getValue();bt=bt.replace(dt,St),Ht(bt),me==null||me.setValue(bt)}return _.a.createElement(P.Fragment,null,_.a.createElement("div",{className:"markdown-editor-wrapper",ref:ri},_.a.createElement("div",{className:"markdown-editor-container ".concat(Ri," ").concat(ln?"on-preview":""," ").concat(bn?"mini":""," ").concat(An?"full-screen":""),style:ho},_.a.createElement(A,{insertTemp:xn,watch:ln,fullScreen:An,showNullButton:Rt,onActionCallback:Yi,hidetoolBar:hi,uuid:Kt.current,setOpenPhones:function(){bi.current=!0}}),_.a.createElement("div",{className:"markdown-editor-body"},_.a.createElement("div",{className:"codemirror-container"},_.a.createElement("textarea",{ref:an,placeholder:u})),ln?_.a.createElement("div",{ref:Ci,className:"preview-container"},kn==="stex"&&_.a.createElement(He,{value:Pt}),kn!=="stex"&&_.a.createElement(De.a,{edit:!0,value:Pt,replaces:Ur})):null))),ct?_.a.createElement("a",{ref:xi,className:"editor-resize"}):null,_.a.createElement(p.a,null,yt[ii]?_.a.createElement(ue.a,{centered:!0,title:yt[ii],visible:!0,onCancel:fi,footer:null},$i):null))}},SJMd:function(ot,$e){/**
|
|
* @license
|
|
* Copyright (C) 2006 Google Inc.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/var x,F,ue,ne=!1,ge,se;window.PR_SHOULD_USE_CONTINUATION=!0;var G,T;(function(){var M=window,k=["break,continue,do,else,for,if,return,while"],D=[k,"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"],P=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],_=[P,"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"],ee=[P,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],Z=[P,"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"],U="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",X=[P,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],J="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",le=[k,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],ce=[k,"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"],Ue=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Je=[_,Z,ee,X,J,le,ce,Ue],Se=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,De="str",He="kwd",_e="com",Ae="typ",we="lit",de="pun",R="pln",oe="tag",ie="dec",C="src",I="atn",N="atv",w="nocode",A="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function p(re){for(var Te=0,Ne=!1,Ge=!1,Ie=0,Re=re.length;Ie<Re;++Ie){var Be=re[Ie];if(Be.ignoreCase)Ge=!0;else if(/[a-z]/i.test(Be.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ne=!0,Ge=!1;break}}var Ze={b:8,t:9,n:10,v:11,f:12,r:13};function at(it){var Le=it.charCodeAt(0);if(Le!==92)return Le;var vt=it.charAt(1);return Le=Ze[vt],Le||("0"<=vt&&vt<="7"?parseInt(it.substring(1),8):vt==="u"||vt==="x"?parseInt(it.substring(2),16):it.charCodeAt(1))}function et(it){if(it<32)return(it<16?"\\x0":"\\x")+it.toString(16);var Le=String.fromCharCode(it);return Le==="\\"||Le==="-"||Le==="]"||Le==="^"?"\\"+Le:Le}function nt(it){var Le=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")),vt=[],st=Le[0]==="^",Pe=["["];st&&Pe.push("^");for(var Xe=st?1:0,te=Le.length;Xe<te;++Xe){var Y=Le[Xe];if(/\\[bdsw]/i.test(Y))Pe.push(Y);else{var q=at(Y),y;Xe+2<te&&Le[Xe+1]==="-"?(y=at(Le[Xe+2]),Xe+=2):y=q,vt.push([q,y]),y<65||q>122||(y<65||q>90||vt.push([Math.max(65,q)|32,Math.min(y,90)|32]),y<97||q>122||vt.push([Math.max(97,q)&~32,Math.min(y,122)&~32]))}}vt.sort(function(pe,ke){return pe[0]-ke[0]||ke[1]-pe[1]});for(var S=[],O=[],Xe=0;Xe<vt.length;++Xe){var j=vt[Xe];j[0]<=O[1]+1?O[1]=Math.max(O[1],j[1]):S.push(O=j)}for(var Xe=0;Xe<S.length;++Xe){var j=S[Xe];Pe.push(et(j[0])),j[1]>j[0]&&(j[1]+1>j[0]&&Pe.push("-"),Pe.push(et(j[1])))}return Pe.push("]"),Pe.join("")}function pt(it){for(var Le=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")),vt=Le.length,st=[],Pe=0,Xe=0;Pe<vt;++Pe){var te=Le[Pe];if(te==="(")++Xe;else if(te.charAt(0)==="\\"){var Y=+te.substring(1);Y&&(Y<=Xe?st[Y]=-1:Le[Pe]=et(Y))}}for(var Pe=1;Pe<st.length;++Pe)st[Pe]===-1&&(st[Pe]=++Te);for(var Pe=0,Xe=0;Pe<vt;++Pe){var te=Le[Pe];if(te==="(")++Xe,st[Xe]||(Le[Pe]="(?:");else if(te.charAt(0)==="\\"){var Y=+te.substring(1);Y&&Y<=Xe&&(Le[Pe]="\\"+st[Y])}}for(var Pe=0;Pe<vt;++Pe)Le[Pe]==="^"&&Le[Pe+1]!=="^"&&(Le[Pe]="");if(it.ignoreCase&&Ne)for(var Pe=0;Pe<vt;++Pe){var te=Le[Pe],q=te.charAt(0);te.length>=2&&q==="["?Le[Pe]=nt(te):q!=="\\"&&(Le[Pe]=te.replace(/[a-zA-Z]/g,function(O){var j=O.charCodeAt(0);return"["+String.fromCharCode(j&~32,j|32)+"]"}))}return Le.join("")}for(var ut=[],Ie=0,Re=re.length;Ie<Re;++Ie){var Be=re[Ie];if(Be.global||Be.multiline)throw new Error(""+Be);ut.push("(?:"+pt(Be)+")")}return new RegExp(ut.join("|"),Ge?"gi":"g")}function d(re,Te){var Ne=/(?:^|\s)nocode(?:\s|$)/,Ge=[],Ie=0,Re=[],Be=0;function Ze(at){var et=at.nodeType;if(et==1){if(Ne.test(at.className))return;for(var nt=at.firstChild;nt;nt=nt.nextSibling)Ze(nt);var pt=at.nodeName.toLowerCase();(pt==="br"||pt==="li")&&(Ge[Be]=`
|
|
`,Re[Be<<1]=Ie++,Re[Be++<<1|1]=at)}else if(et==3||et==4){var ut=at.nodeValue;ut.length&&(Te?ut=ut.replace(/\r\n?/g,`
|
|
`):ut=ut.replace(/[ \t\r\n]+/g," "),Ge[Be]=ut,Re[Be<<1]=Ie,Ie+=ut.length,Re[Be++<<1|1]=at)}}return Ze(re),{sourceCode:Ge.join("").replace(/\n$/,""),spans:Re}}function E(re,Te,Ne,Ge,Ie){if(!Ne)return;var Re={sourceNode:re,pre:1,langExtension:null,numberLines:null,sourceCode:Ne,spans:null,basePos:Te,decorations:null};Ge(Re),Ie.push.apply(Ie,Re.decorations)}var H=/\S/;function $(re){for(var Te=void 0,Ne=re.firstChild;Ne;Ne=Ne.nextSibling){var Ge=Ne.nodeType;Te=Ge===1?Te?re:Ne:Ge===3&&H.test(Ne.nodeValue)?re:Te}return Te===re?void 0:Te}function xe(re,Te){var Ne={},Ge;(function(){for(var Be=re.concat(Te),Ze=[],at={},et=0,nt=Be.length;et<nt;++et){var pt=Be[et],ut=pt[3];if(ut)for(var it=ut.length;--it>=0;)Ne[ut.charAt(it)]=pt;var Le=pt[1],vt=""+Le;at.hasOwnProperty(vt)||(Ze.push(Le),at[vt]=null)}Ze.push(/[\0-\uffff]/),Ge=p(Ze)})();var Ie=Te.length,Re=function(Be){for(var Ze=Be.sourceCode,at=Be.basePos,et=Be.sourceNode,nt=[at,R],pt=0,ut=Ze.match(Ge)||[],it={},Le=0,vt=ut.length;Le<vt;++Le){var st=ut[Le],Pe=it[st],Xe=void 0,te;if(typeof Pe=="string")te=!1;else{var Y=Ne[st.charAt(0)];if(Y)Xe=st.match(Y[1]),Pe=Y[0];else{for(var q=0;q<Ie;++q)if(Y=Te[q],Xe=st.match(Y[1]),Xe){Pe=Y[0];break}Xe||(Pe=R)}te=Pe.length>=5&&Pe.substring(0,5)==="lang-",te&&!(Xe&&typeof Xe[1]=="string")&&(te=!1,Pe=C),te||(it[st]=Pe)}var y=pt;if(pt+=st.length,!te)nt.push(at+y,Pe);else{var S=Xe[1],O=st.indexOf(S),j=O+S.length;Xe[2]&&(j=st.length-Xe[2].length,O=j-S.length);var pe=Pe.substring(5);E(et,at+y,st.substring(0,O),Re,nt),E(et,at+y+O,S,z(pe,S),nt),E(et,at+y+j,st.substring(j),Re,nt)}}Be.decorations=nt};return Re}function Me(re){var Te=[],Ne=[];re.tripleQuotedStrings?Te.push([De,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):re.multiLineStrings?Te.push([De,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Te.push([De,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),re.verbatimStrings&&Ne.push([De,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ge=re.hashComments;Ge&&(re.cStyleComments?(Ge>1?Te.push([_e,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Te.push([_e,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ne.push([De,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Te.push([_e,/^#[^\r\n]*/,null,"#"])),re.cStyleComments&&(Ne.push([_e,/^\/\/[^\r\n]*/,null]),Ne.push([_e,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ie=re.regexLiterals;if(Ie){var Re=Ie>1?"":`
|
|
\r`,Be=Re?".":"[\\S\\s]",Ze="/(?=[^/*"+Re+"])(?:[^/\\x5B\\x5C"+Re+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+Re+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";Ne.push(["lang-regex",RegExp("^"+A+"("+Ze+")")])}var at=re.types;at&&Ne.push([Ae,at]);var et=(""+re.keywords).replace(/^ | $/g,"");et.length&&Ne.push([He,new RegExp("^(?:"+et.replace(/[\s,]+/g,"|")+")\\b"),null]),Te.push([R,/^\s+/,null,` \r
|
|
\xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return re.regexLiterals&&(nt+="(?!s*/)"),Ne.push([we,/^@[a-z_$][a-z_$@0-9]*/i,null],[Ae,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[R,/^[a-z_$][a-z_$@0-9]*/i,null],[we,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[R,/^\\[\s\S]?/,null],[de,new RegExp(nt),null]),xe(Te,Ne)}var be=Me({keywords:Je,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ce(re,Te,Ne){for(var Ge=/(?:^|\s)nocode(?:\s|$)/,Ie=/\r\n?|\n/,Re=re.ownerDocument,Be=Re.createElement("li");re.firstChild;)Be.appendChild(re.firstChild);var Ze=[Be];function at(Le){var vt=Le.nodeType;if(vt==1&&!Ge.test(Le.className))if(Le.nodeName==="br")et(Le),Le.parentNode&&Le.parentNode.removeChild(Le);else for(var st=Le.firstChild;st;st=st.nextSibling)at(st);else if((vt==3||vt==4)&&Ne){var Pe=Le.nodeValue,Xe=Pe.match(Ie);if(Xe){var te=Pe.substring(0,Xe.index);Le.nodeValue=te;var Y=Pe.substring(Xe.index+Xe[0].length);if(Y){var q=Le.parentNode;q.insertBefore(Re.createTextNode(Y),Le.nextSibling)}et(Le),te||Le.parentNode.removeChild(Le)}}}function et(Le){for(;!Le.nextSibling;)if(Le=Le.parentNode,!Le)return;function vt(Xe,te){var Y=te?Xe.cloneNode(!1):Xe,q=Xe.parentNode;if(q){var y=vt(q,1),S=Xe.nextSibling;y.appendChild(Y);for(var O=S;O;O=S)S=O.nextSibling,y.appendChild(O)}return Y}for(var st=vt(Le.nextSibling,0),Pe;(Pe=st.parentNode)&&Pe.nodeType===1;)st=Pe;Ze.push(st)}for(var nt=0;nt<Ze.length;++nt)at(Ze[nt]);Te===(Te|0)&&Ze[0].setAttribute("value",Te);var pt=Re.createElement("ol");pt.className="linenums";for(var ut=Math.max(0,Te-1|0)||0,nt=0,it=Ze.length;nt<it;++nt)Be=Ze[nt],Be.className="L"+(nt+ut)%10,Be.firstChild||Be.appendChild(Re.createTextNode("\xA0")),pt.appendChild(Be);re.appendChild(pt)}function he(re){var Te=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Te=Te&&+Te[1]<=8;var Ne=/\n/g,Ge=re.sourceCode,Ie=Ge.length,Re=0,Be=re.spans,Ze=Be.length,at=0,et=re.decorations,nt=et.length,pt=0;et[nt]=Ie;var ut,it;for(it=ut=0;it<nt;)et[it]!==et[it+2]?(et[ut++]=et[it++],et[ut++]=et[it++]):it+=2;for(nt=ut,it=ut=0;it<nt;){for(var Le=et[it],vt=et[it+1],st=it+2;st+2<=nt&&et[st+1]===vt;)st+=2;et[ut++]=Le,et[ut++]=vt,it=st}nt=et.length=ut;var Pe=re.sourceNode,Xe="";Pe&&(Xe=Pe.style.display,Pe.style.display="none");try{for(var te=null;at<Ze;){var Y=Be[at],q=Be[at+2]||Ie,y=et[pt+2]||Ie,st=Math.min(q,y),S=Be[at+1],O;if(S.nodeType!==1&&(O=Ge.substring(Re,st))){Te&&(O=O.replace(Ne,"\r")),S.nodeValue=O;var j=S.ownerDocument,pe=j.createElement("span");pe.className=et[pt+1];var ke=S.parentNode;ke.replaceChild(pe,S),pe.appendChild(S),Re<q&&(Be[at+1]=S=j.createTextNode(Ge.substring(st,q)),ke.insertBefore(S,pe.nextSibling))}Re=st,Re>=q&&(at+=2),Re>=y&&(pt+=2)}}finally{Pe&&(Pe.style.display=Xe)}}var ve={};function Q(re,Te){for(var Ne=Te.length;--Ne>=0;){var Ge=Te[Ne];ve.hasOwnProperty(Ge)?M.console&&console.warn("cannot override language handler %s",Ge):ve[Ge]=re}}function z(re,Te){return re&&ve.hasOwnProperty(re)||(re=/^\s*</.test(Te)?"default-markup":"default-code"),ve[re]}Q(be,["default-code"]),Q(xe([],[[R,/^[^<?]+/],[ie,/^<!\w[^>]*(?:>|$)/],[_e,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[de,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),Q(xe([[R,/^[\s]+/,null,` \r
|
|
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[oe,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[I,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[de,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Q(xe([],[[N,/^[\s\S]+/]]),["uq.val"]),Q(Me({keywords:_,hashComments:!0,cStyleComments:!0,types:Se}),["c","cc","cpp","cxx","cyc","m"]),Q(Me({keywords:"null,true,false"}),["json"]),Q(Me({keywords:Z,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Se}),["cs"]),Q(Me({keywords:ee,cStyleComments:!0}),["java"]),Q(Me({keywords:Ue,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Q(Me({keywords:le,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Q(Me({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Q(Me({keywords:ce,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Q(Me({keywords:X,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Q(Me({keywords:U,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Q(xe([],[[De,/^[\s\S]+/]]),["regex"]);function b(re){var Te=re.langExtension;try{var Ne=d(re.sourceNode,re.pre),Ge=Ne.sourceCode;re.sourceCode=Ge,re.spans=Ne.spans,re.basePos=0,z(Te,Ge)(re),he(re)}catch(Ie){M.console&&console.log(Ie&&Ie.stack||Ie)}}function W(re,Te,Ne){var Ge=Ne||!1,Ie=Te||null,Re=document.createElement("div");Re.innerHTML="<pre>"+re+"</pre>",Re=Re.firstChild,Ge&&Ce(Re,Ge,!0);var Be={langExtension:Ie,numberLines:Ge,sourceNode:Re,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Be),Re.innerHTML}function L(re,Te){var Ne=Te||document.body,Ge=Ne.ownerDocument||document;function Ie(Y){return Ne.getElementsByTagName(Y)}for(var Re=[Ie("pre"),Ie("code"),Ie("xmp")],Be=[],Ze=0;Ze<Re.length;++Ze)for(var at=0,et=Re[Ze].length;at<et;++at)Be.push(Re[Ze][at]);Re=null;var nt=Date;nt.now||(nt={now:function(){return+new Date}});var pt=0,ut=/\blang(?:uage)?-([\w.]+)(?!\S)/,it=/\bprettyprint\b/,Le=/\bprettyprinted\b/,vt=/pre|xmp/i,st=/^code$/i,Pe=/^(?:pre|code|xmp)$/i,Xe={};function te(){for(var Y=M.PR_SHOULD_USE_CONTINUATION?nt.now()+250:Infinity;pt<Be.length&&nt.now()<Y;pt++){for(var q=Be[pt],y=Xe,S=q;S=S.previousSibling;){var O=S.nodeType,j=(O===7||O===8)&&S.nodeValue;if(j?!/^\??prettify\b/.test(j):O!==3||/\S/.test(S.nodeValue))break;if(j){y={},j.replace(/\b(\w+)=([\w:.%+-]+)/g,function(jt,kt,bn){y[kt]=bn});break}}var pe=q.className;if((y!==Xe||it.test(pe))&&!Le.test(pe)){for(var ke=!1,Ke=q.parentNode;Ke;Ke=Ke.parentNode){var yt=Ke.tagName;if(Pe.test(yt)&&Ke.className&&it.test(Ke.className)){ke=!0;break}}if(!ke){q.className+=" prettyprinted";var Tt=y.lang;if(!Tt){Tt=pe.match(ut);var We;!Tt&&(We=$(q))&&st.test(We.tagName)&&(Tt=We.className.match(ut)),Tt&&(Tt=Tt[1])}var Et;if(vt.test(q.tagName))Et=1;else{var mt=q.currentStyle,tt=Ge.defaultView,Dt=mt?mt.whiteSpace:tt&&tt.getComputedStyle?tt.getComputedStyle(q,null).getPropertyValue("white-space"):0;Et=Dt&&Dt.substring(0,3)==="pre"}var At=y.linenums;(At=At==="true"||+At)||(At=pe.match(/\blinenums\b(?::(\d+))?/),At=At?At[1]&&At[1].length?+At[1]:!0:!1),At&&Ce(q,At,Et);var Vt={langExtension:Tt,sourceNode:q,numberLines:At,pre:Et,sourceCode:null,basePos:null,spans:null,decorations:null};b(Vt)}}}pt<Be.length?M.setTimeout(te,250):typeof re=="function"&&re()}te()}var ye=M.PR={createSimpleLexer:xe,registerLangHandler:Q,sourceDecorator:Me,PR_ATTRIB_NAME:I,PR_ATTRIB_VALUE:N,PR_COMMENT:_e,PR_DECLARATION:ie,PR_KEYWORD:He,PR_LITERAL:we,PR_NOCODE:w,PR_PLAIN:R,PR_PUNCTUATION:de,PR_SOURCE:C,PR_STRING:De,PR_TAG:oe,PR_TYPE:Ae,prettyPrintOne:ne?M.prettyPrintOne=W:G=W,prettyPrint:T=ne?M.prettyPrint=L:T=L},Ee=M.define;typeof Ee=="function"&&Ee.amd&&Ee("google-code-prettify",[],function(){return ye})})()},"VrN/":function(ot,$e,x){(function(F,ue){ot.exports=ue()})(this,function(){"use strict";var F=navigator.userAgent,ue=navigator.platform,ne=/gecko\/\d/i.test(F),ge=/MSIE \d/.test(F),se=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(F),G=/Edge\/(\d+)/.exec(F),T=ge||se||G,M=T&&(ge?document.documentMode||6:+(G||se)[1]),k=!G&&/WebKit\//.test(F),D=k&&/Qt\/\d+\.\d+/.test(F),P=!G&&/Chrome\//.test(F),_=/Opera\//.test(F),ee=/Apple Computer/.test(navigator.vendor),Z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(F),U=/PhantomJS/.test(F),X=!G&&/AppleWebKit/.test(F)&&/Mobile\/\w+/.test(F),J=/Android/.test(F),le=X||J||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(F),ce=X||/Mac/.test(ue),Ue=/\bCrOS\b/.test(F),Je=/win/i.test(ue),Se=_&&F.match(/Version\/(\d*\.\d*)/);Se&&(Se=Number(Se[1])),Se&&Se>=15&&(_=!1,k=!0);var De=ce&&(D||_&&(Se==null||Se<12.11)),He=ne||T&&M>=9;function _e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ae=function(e,t){var i=e.className,n=_e(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 we(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function de(e,t){return we(e).appendChild(t)}function R(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 oe(e,t,i,n){var r=R(e,t,i,n);return r.setAttribute("role","presentation"),r}var ie;document.createRange?ie=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:ie=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 C(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 I(){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 N(e,t){var i=e.className;_e(t).test(i)||(e.className+=(i?" ":"")+t)}function w(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!_e(i[n]).test(t)&&(t+=" "+i[n]);return t}var A=function(e){e.select()};X?A=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:T&&(A=function(e){try{e.select()}catch(t){}});function p(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function d(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 E(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 f=e.indexOf(" ",s);if(f<0||f>=t)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var H=function(){this.id=null,this.f=null,this.time=0,this.handler=p(this.onTimeout,this)};H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},H.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 $(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var xe=50,Me={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},Ce={origin:"*mouse"},he={origin:"+move"};function ve(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 Q=[""];function z(e){for(;Q.length<=e;)Q.push(b(Q)+" ");return Q[e]}function b(e){return e[e.length-1]}function W(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function L(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function ye(){}function Ee(e,t){var i;return Object.create?i=Object.create(e):(ye.prototype=e,i=new ye),t&&d(t,i),i}var re=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Te(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||re.test(e))}function Ne(e,t){return t?t.source.indexOf("\\w")>-1&&Te(e)?!0:t.test(e):Te(e)}function Ge(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ie=/[\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 Re(e){return e.charCodeAt(0)>=768&&Ie.test(e)}function Be(e,t,i){for(;(i<0?t>0:t<e.length)&&Re(e.charAt(t));)t+=i;return t}function Ze(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 at(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 et=null;function nt(e,t,i){var n;et=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:et=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:et=r)}return n!=null?n:et}var pt=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(v,B,V){this.level=v,this.from=B,this.to=V}return function(v,B){var V=B=="ltr"?"L":"R";if(v.length==0||B=="ltr"&&!n.test(v))return!1;for(var fe=v.length,ae=[],Oe=0;Oe<fe;++Oe)ae.push(i(v.charCodeAt(Oe)));for(var ze=0,Ye=V;ze<fe;++ze){var Qe=ae[ze];Qe=="m"?ae[ze]=Ye:Ye=Qe}for(var rt=0,qe=V;rt<fe;++rt){var lt=ae[rt];lt=="1"&&qe=="r"?ae[rt]="n":s.test(lt)&&(qe=lt,lt=="r"&&(ae[rt]="R"))}for(var xt=1,gt=ae[0];xt<fe-1;++xt){var _t=ae[xt];_t=="+"&>=="1"&&ae[xt+1]=="1"?ae[xt]="1":_t==","&>==ae[xt+1]&&(gt=="1"||gt=="n")&&(ae[xt]=gt),gt=_t}for(var Yt=0;Yt<fe;++Yt){var dn=ae[Yt];if(dn==",")ae[Yt]="N";else if(dn=="%"){var Zt=void 0;for(Zt=Yt+1;Zt<fe&&ae[Zt]=="%";++Zt);for(var Bn=Yt&&ae[Yt-1]=="!"||Zt<fe&&ae[Zt]=="1"?"1":"N",Rn=Yt;Rn<Zt;++Rn)ae[Rn]=Bn;Yt=Zt-1}}for(var tn=0,On=V;tn<fe;++tn){var yn=ae[tn];On=="L"&&yn=="1"?ae[tn]="L":s.test(yn)&&(On=yn)}for(var sn=0;sn<fe;++sn)if(r.test(ae[sn])){var nn=void 0;for(nn=sn+1;nn<fe&&r.test(ae[nn]);++nn);for(var Qt=(sn?ae[sn-1]:V)=="L",Dn=(nn<fe?ae[nn]:V)=="L",cr=Qt==Dn?Qt?"L":"R":V,Mi=sn;Mi<nn;++Mi)ae[Mi]=cr;sn=nn-1}for(var wn=[],si,fn=0;fn<fe;)if(l.test(ae[fn])){var $o=fn;for(++fn;fn<fe&&l.test(ae[fn]);++fn);wn.push(new m(0,$o,fn))}else{var gi=fn,Gi=wn.length,Vi=B=="rtl"?1:0;for(++fn;fn<fe&&ae[fn]!="L";++fn);for(var Sn=gi;Sn<fn;)if(f.test(ae[Sn])){gi<Sn&&(wn.splice(Gi,0,new m(1,gi,Sn)),Gi+=Vi);var dr=Sn;for(++Sn;Sn<fn&&f.test(ae[Sn]);++Sn);wn.splice(Gi,0,new m(2,dr,Sn)),Gi+=Vi,gi=Sn}else++Sn;gi<fn&&wn.splice(Gi,0,new m(1,gi,fn))}return B=="ltr"&&(wn[0].level==1&&(si=v.match(/^\s+/))&&(wn[0].from=si[0].length,wn.unshift(new m(0,0,si[0].length))),b(wn).level==1&&(si=v.match(/\s+$/))&&(b(wn).to-=si[0].length,wn.push(new m(0,fe-si[0].length,fe)))),B=="rtl"?wn.reverse():wn}}();function ut(e,t){var i=e.order;return i==null&&(i=e.order=pt(e.text,t)),i}var it=[],Le=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 vt(e,t){return e._handlers&&e._handlers[t]||it}function st(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=$(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Pe(e,t){var i=vt(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 Xe(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Pe(e,i||t.type,e,t),O(t)||t.codemirrorIgnore}function te(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)$(i,t[n])==-1&&i.push(t[n])}function Y(e,t){return vt(e,t).length>0}function q(e){e.prototype.on=function(t,i){Le(this,t,i)},e.prototype.off=function(t,i){st(this,t,i)}}function y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function S(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function O(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function j(e){y(e),S(e)}function pe(e){return e.target||e.srcElement}function ke(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ce&&e.ctrlKey&&t==1&&(t=3),t}var Ke=function(){if(T&&M<9)return!1;var e=R("div");return"draggable"in e||"dragDrop"in e}(),yt;function Tt(e){if(yt==null){var t=R("span","\u200B");de(e,R("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(T&&M<8))}var i=yt?R("span","\u200B"):R("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var We;function Et(e){if(We!=null)return We;var t=de(e,document.createTextNode("A\u062EA")),i=ie(t,0,1).getBoundingClientRect(),n=ie(t,1,2).getBoundingClientRect();return we(e),!i||i.left==i.right?!1:We=n.right-i.right<3}var mt=`
|
|
|
|
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/)},tt=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=R("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),At=null;function Vt(e){if(At!=null)return At;var t=de(e,R("span","x")),i=t.getBoundingClientRect(),n=ie(t,0,1).getBoundingClientRect();return At=Math.abs(i.left-n.left)>1}var jt={},kt={};function bn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),jt[e]=t}function rn(e,t){kt[e]=t}function ft(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=Ee(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return ft("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return ft("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Vn(e,t){t=ft(t);var i=jt[t.name];if(!i)return Vn(e,"text/plain");var n=i(e,t);if(xn.hasOwnProperty(t.name)){var r=xn[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 xn={};function pn(e,t){var i=xn.hasOwnProperty(e)?xn[e]:xn[e]={};d(t,i)}function kn(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=E(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?E(this.string,this.lineStart,this.tabSize):0)},Nt.prototype.indentation=function(){return E(this.string,null,this.tabSize)-(this.lineStart?E(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 ct(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 Rt(e){if(e.parent==null)return null;for(var t=e.parent,i=$(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 f=e.lines[l],m=f.height;if(t<m)break;t-=m}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 Ve(e,t,i){if(i===void 0&&(i=null),!(this instanceof Ve))return new Ve(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 Ve(e.line,e.ch)}function di(e,t){return Ct(e,t)<0?t:e}function Ri(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 Ve(e.first,0);var i=e.first+e.size-1;return t.line>i?Ve(i,ct(e,i).text.length):a(t,ct(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Ve(e.line,t):i<0?Ve(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 g=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 g?new h(e,kn(e.mode,t.state),i,t.lookAhead):new h(e,kn(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?kn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new g(t,this.maxLookAhead):t};function K(e,t,i,n){var r=[e.state.modeGen],s={};Hn(e,t.text,e.doc.mode,i,function(v,B){return r.push(v,B)},s,n);for(var l=i.state,f=function(v){i.baseTokens=r;var B=e.state.overlays[v],V=1,fe=0;i.state=!0,Hn(e,t.text,B.mode,i,function(ae,Oe){for(var ze=V;fe<ae;){var Ye=r[V];Ye>ae&&r.splice(V,1,ae,r[V+1],Ye),V+=2,fe=Math.min(ae,Ye)}if(!Oe)return;if(B.opaque)r.splice(ze,V-ze,ae,"overlay "+Oe),V=ze+2;else for(;ze<V;ze+=2){var Qe=r[ze+1];r[ze+1]=(Qe?Qe+" ":"")+"overlay "+Oe}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},m=0;m<e.state.overlays.length;++m)f(m);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function je(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=me(e,Rt(t)),r=t.text.length>e.options.maxHighlightLength&&kn(e.doc.mode,n.state),s=K(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 me(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=ln(e,t,i),l=s>n.first&&ct(n,s-1).stateAfter,f=l?h.fromSaved(n,l,s):new h(n,Xn(n.mode),s);return n.iter(s,t,function(m){ht(e,m.text,f);var v=f.line;m.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&v<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function ht(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==""&&Fe(r,i.state);!s.eol();)wt(r,s,i.state),s.start=s.pos}function Fe(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 Ht(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=ct(r,t.line),m=me(e,t.line,i),v=new Nt(f.text,e.options.tabSize,m),B;for(n&&(B=[]);(n||v.pos<t.ch)&&!v.eol();)v.start=v.pos,l=wt(s,v,m.state),n&&B.push(new Pt(v,l,kn(r.mode,m.state)));return n?B:new Pt(v,l,m.state)}function Un(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 f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var m=0,v=null,B=new Nt(t,e.options.tabSize,n),V,fe=e.options.addModeClass&&[null];for(t==""&&Un(Fe(i,n.state),s);!B.eol();){if(B.pos>e.options.maxHighlightLength?(f=!1,l&&ht(e,t,n,B.pos),B.pos=t.length,V=null):V=Un(wt(i,B,n.state,fe),s),fe){var ae=fe[0].name;ae&&(V="m-"+(V?ae+" "+V:ae))}if(!f||v!=V){for(;m<B.start;)m=Math.min(B.start,m+5e3),r(m,v);v=V}B.start=B.pos}for(;m<B.pos;){var Oe=Math.min(B.pos,m+5e3);r(Oe,v),m=Oe}}function ln(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var m=ct(s,f-1),v=m.stateAfter;if(v&&(!i||f+(v instanceof g?v.lookAhead:0)<=s.modeFrontier))return f;var B=E(m.text,null,e.options.tabSize);(r==null||n>B)&&(r=f-1,n=B)}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=ct(e,n).stateAfter;if(r&&(!(r instanceof g)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Xi=!1,_n=!1;function An(){Xi=!0}function ni(){_n=!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,f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(f||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var m=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new yi(l,s.from,m?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,f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var m=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new yi(l,m?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Pn(e,t){if(t.full)return null;var i=hi(e,t.from.line)&&ct(e,t.from.line).markedSpans,n=hi(e,t.to.line)&&ct(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,f=fr(i,r,l),m=Ki(n,s,l),v=t.text.length==1,B=b(t.text).length+(v?r:0);if(f)for(var V=0;V<f.length;++V){var fe=f[V];if(fe.to==null){var ae=Jn(m,fe.marker);ae?v&&(fe.to=ae.to==null?null:ae.to+B):fe.to=r}}if(m)for(var Oe=0;Oe<m.length;++Oe){var ze=m[Oe];if(ze.to!=null&&(ze.to+=B),ze.from==null){var Ye=Jn(f,ze.marker);Ye||(ze.from=B,v&&(f||(f=[])).push(ze))}else ze.from+=B,v&&(f||(f=[])).push(ze)}f&&(f=Nn(f)),m&&m!=f&&(m=Nn(m));var Qe=[f];if(!v){var rt=t.text.length-2,qe;if(rt>0&&f)for(var lt=0;lt<f.length;++lt)f[lt].to==null&&(qe||(qe=[])).push(new yi(f[lt].marker,null,null));for(var xt=0;xt<rt;++xt)Qe.push(qe);Qe.push(m)}return Qe}function Nn(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 Oi(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ae){if(ae.markedSpans)for(var Oe=0;Oe<ae.markedSpans.length;++Oe){var ze=ae.markedSpans[Oe].marker;ze.readOnly&&(!n||$(n,ze)==-1)&&(n||(n=[])).push(ze)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],f=l.find(0),m=0;m<r.length;++m){var v=r[m];if(Ct(v.to,f.from)<0||Ct(v.from,f.to)>0)continue;var B=[m,1],V=Ct(v.from,f.from),fe=Ct(v.to,f.to);(V<0||!l.inclusiveLeft&&!V)&&B.push({from:v.from,to:f.from}),(fe>0||!l.inclusiveRight&&!fe)&&B.push({from:f.to,to:v.to}),r.splice.apply(r,B),m+=B.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 Bt(e){return e.inclusiveRight?1:0}function mn(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)||Bt(e)-Bt(t);return l||t.id-e.id}function Ft(e,t){var i=_n&&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||mn(n,r.marker)<0)&&(n=r.marker);return n}function gn(e){return Ft(e,!0)}function Kt(e){return Ft(e,!1)}function bi(e,t){var i=_n&&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||mn(n,s.marker)<0)&&(n=s.marker)}return n}function on(e,t,i,n,r){var s=ct(e,t),l=_n&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var m=l[f];if(!m.marker.collapsed)continue;var v=m.marker.find(0),B=Ct(v.from,i)||qt(m.marker)-qt(r),V=Ct(v.to,n)||Bt(m.marker)-Bt(r);if(B>=0&&V<=0||B<=0&&V>=0)continue;if(B<=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(v.to,i)>=0:Ct(v.to,i)>0)||B>=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(v.from,n)<=0:Ct(v.from,n)<0))return!0}}function an(e){for(var t;t=gn(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=ct(e,t),n=an(i);return i==n?t:Rt(n)}function Fr(e,t){if(t>e.lastLine())return t;var i=ct(e,t),n;if(!Zn(e,i))return t;for(;n=Kt(i);)i=n.find(1,!0).line;return Rt(i)+1}function Zn(e,t){var i=_n&&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 In(e){e=an(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 f=s.children[l];if(f==i)break;t+=f.height}return t}function $i(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=gn(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=ct(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 Rt(this)},q(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 Ur(e,t){var i=oe("span",null,null,k?"padding-right: .1px":null),n={pre:oe("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=ut(s,e.doc.direction))&&(n.addToken=Lt(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Rt(s);zt(s,n,je(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=w(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=w(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Tt(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(k){var m=n.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Pe(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=w(n.pre.className,n.textClass||"")),n}function dt(e){var t=R("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 f=e.splitSpaces?bt(t,e.trailingSpace):t,m=e.cm.state.specialChars,v=!1,B;if(!m.test(t))e.col+=t.length,B=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,B),T&&M<9&&(v=!0),e.pos+=t.length;else{B=document.createDocumentFragment();for(var V=0;;){m.lastIndex=V;var fe=m.exec(t),ae=fe?fe.index-V:t.length-V;if(ae){var Oe=document.createTextNode(f.slice(V,V+ae));T&&M<9?B.appendChild(R("span",[Oe])):B.appendChild(Oe),e.map.push(e.pos,e.pos+ae,Oe),e.col+=ae,e.pos+=ae}if(!fe)break;V+=ae+1;var ze=void 0;if(fe[0]==" "){var Ye=e.cm.options.tabSize,Qe=Ye-e.col%Ye;ze=B.appendChild(R("span",z(Qe),"cm-tab")),ze.setAttribute("role","presentation"),ze.setAttribute("cm-text"," "),e.col+=Qe}else fe[0]=="\r"||fe[0]==`
|
|
`?(ze=B.appendChild(R("span",fe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ze.setAttribute("cm-text",fe[0]),e.col+=1):(ze=e.cm.options.specialCharPlaceholder(fe[0]),ze.setAttribute("cm-text",fe[0]),T&&M<9?B.appendChild(R("span",[ze])):B.appendChild(ze),e.col+=1);e.map.push(e.pos,e.pos+1,ze),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var rt=i||"";n&&(rt+=n),r&&(rt+=r);var qe=R("span",[B],rt,s);if(l)for(var lt in l)l.hasOwnProperty(lt)&<!="style"&<!="class"&&qe.setAttribute(lt,l[lt]);return e.content.appendChild(qe)}e.content.appendChild(B)}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 Lt(e,t){return function(i,n,r,s,l,f,m){r=r?r+" cm-force-border":"cm-force-border";for(var v=i.pos,B=v+n.length;;){for(var V=void 0,fe=0;fe<t.length&&!(V=t[fe],V.to>v&&V.from<=v);fe++);if(V.to>=B)return e(i,n,r,s,l,f,m);e(i,n.slice(0,V.to-v),r,s,null,f,m),s=null,n=n.slice(V.to-v),v=V.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 zt(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 f=r.length,m=0,v=1,B="",V,fe,ae=0,Oe,ze,Ye,Qe,rt;;){if(ae==m){Oe=ze=Ye=fe="",rt=null,Qe=null,ae=Infinity;for(var qe=[],lt=void 0,xt=0;xt<n.length;++xt){var gt=n[xt],_t=gt.marker;if(_t.type=="bookmark"&>.from==m&&_t.widgetNode)qe.push(_t);else if(gt.from<=m&&(gt.to==null||gt.to>m||_t.collapsed&>.to==m&>.from==m)){if(gt.to!=null&>.to!=m&&ae>gt.to&&(ae=gt.to,ze=""),_t.className&&(Oe+=" "+_t.className),_t.css&&(fe=(fe?fe+";":"")+_t.css),_t.startStyle&>.from==m&&(Ye+=" "+_t.startStyle),_t.endStyle&>.to==ae&&(lt||(lt=[])).push(_t.endStyle,gt.to),_t.title&&((rt||(rt={})).title=_t.title),_t.attributes)for(var Yt in _t.attributes)(rt||(rt={}))[Yt]=_t.attributes[Yt];_t.collapsed&&(!Qe||mn(Qe.marker,_t)<0)&&(Qe=gt)}else gt.from>m&&ae>gt.from&&(ae=gt.from)}if(lt)for(var dn=0;dn<lt.length;dn+=2)lt[dn+1]==ae&&(ze+=" "+lt[dn]);if(!Qe||Qe.from==m)for(var Zt=0;Zt<qe.length;++Zt)It(t,0,qe[Zt]);if(Qe&&(Qe.from||0)==m){if(It(t,(Qe.to==null?f+1:Qe.to)-m,Qe.marker,Qe.from==null),Qe.to==null)return;Qe.to==m&&(Qe=!1)}}if(m>=f)break;for(var Bn=Math.min(f,ae);;){if(B){var Rn=m+B.length;if(!Qe){var tn=Rn>Bn?B.slice(0,Bn-m):B;t.addToken(t,tn,V?V+Oe:Oe,Ye,m+tn.length==ae?ze:"",fe,rt)}if(Rn>=Bn){B=B.slice(Bn-m),m=Bn;break}m=Rn,Ye=""}B=r.slice(s,s=i[v++]),V=co(i[v++],t.cm.options)}}}function Ot(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Rt(b(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 Ot(e.doc,ct(e.doc,s),s);r=s+l.size,n.push(l)}return n}var un=null;function Mt(e){un?un.ops.push(e):e.ownsGroup=un={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 Wt(e,t){var i=e.ownsGroup;if(!i)return;try{Ni(i)}finally{un=null,t(i)}}var vn=null;function Xt(e,t){var i=vt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;un?r=un.delayedCallbacks:vn?r=vn:(r=vn=[],setTimeout($n,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function $n(){var e=vn;vn=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=R("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),T&&M<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(R("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):Ur(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=R("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),f=t.gutter=R("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(f),l.insertBefore(f,t.text),t.line.gutterClass&&(f.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=f.appendChild(R("div",vi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var m=0;m<e.display.gutterSpecs.length;++m){var v=e.display.gutterSpecs[m].className,B=s.hasOwnProperty(v)&&s[v];B&&f.appendChild(R("div",[B],"CodeMirror-gutter-elt","left: "+n.gutterLeft[v]+"px; width: "+n.gutterWidth[v]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=_e("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,f=t.widgets;l<f.length;++l){var m=f[l],v=R("div",[m.node],"CodeMirror-linewidget"+(m.className?" "+m.className:""));m.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),js(m,v,i,n),e.display.input.setUneditable(v),r&&m.above?s.insertBefore(v,i.gutter||i.text):s.appendChild(v),Xt(m,"redraw")}}function js(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(!C(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;"),de(t.display.measure,R("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=pe(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 Hr(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=de(e.measure,R("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 xe-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 Bs(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(),f=0;f<l.length-1;f++){var m=l[f],v=l[f+1];Math.abs(m.bottom-v.bottom)>2&&s.push((m.bottom+v.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(Rt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Fs(e,t){t=an(t);var i=Rt(t),n=e.display.externalMeasured=new Ot(e.doc,t,i);n.lineN=i;var r=n.built=Ur(e,n);return n.text=r.pre,de(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[Fi(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=Rt(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=Fs(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||(Bs(e,t.view,t.rect),t.hasHeights=!0),l=Hs(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,f,m,v=0;v<e.length;v+=3)if(f=e[v],m=e[v+1],t<f?(r=0,s=1,l="left"):t<m?(r=t-f,s=r+1):(v==e.length-3||t==m&&e[v+3]>t)&&(s=m-f,r=s-1,t>=m&&(l="right")),r!=null){if(n=e[v+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)n=e[(v-=3)+2],l="left";if(i=="right"&&r==m-f)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)n=e[(v+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:f,coverEnd:m}}function Us(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 Hs(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,f=r.end,m=r.collapse,v;if(s.nodeType==3){for(var B=0;B<4;B++){for(;l&&Re(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Re(t.line.text.charAt(r.coverStart+f));)++f;if(T&&M<9&&l==0&&f==r.coverEnd-r.coverStart?v=s.parentNode.getBoundingClientRect():v=Us(ie(s,l,f).getClientRects(),n),v.left||v.right||l==0)break;f=l,l=l-1,m="right"}T&&M<11&&(v=zs(e.display.measure,v))}else{l>0&&(m=n="right");var V;e.options.lineWrapping&&(V=s.getClientRects()).length>1?v=V[n=="right"?V.length-1:0]:v=s.getBoundingClientRect()}if(T&&M<9&&!l&&(!v||!v.left&&!v.right)){var fe=s.parentNode.getClientRects()[0];fe?v={left:fe.left,right:fe.left+Qi(e.display),top:fe.top,bottom:fe.bottom}:v=aa}for(var ae=v.top-t.rect.top,Oe=v.bottom-t.rect.top,ze=(ae+Oe)/2,Ye=t.view.measure.heights,Qe=0;Qe<Ye.length-1&&!(ze<Ye[Qe]);Qe++);var rt=Qe?Ye[Qe-1]:0,qe=Ye[Qe],lt={left:(m=="right"?v.right:v.left)-t.rect.left,right:(m=="left"?v.left:v.right)-t.rect.left,top:rt,bottom:qe};return!v.left&&!v.right&&(lt.bogus=!0),e.options.singleCursorHeightPerLine||(lt.rtop=ae,lt.rbottom=Oe),lt}function zs(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,we(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 P&&J?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ca(){return P&&J?-(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 zr(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=In(t);if(n=="local"?l+=Hr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:ca());var m=f.left+(n=="window"?0:ha());i.left+=m,i.right+=m}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=ct(e.doc,t.line)),zr(e,n,oa(e,n,t.ch,r),i)}function Qn(e,t,i,n,r,s){n=n||ct(e.doc,t.line),r||(r=Ji(e,n));function l(Oe,ze){var Ye=ai(e,r,Oe,ze?"right":"left",s);return ze?Ye.left=Ye.right:Ye.right=Ye.left,zr(e,n,Ye,i)}var f=ut(n,e.doc.direction),m=t.ch,v=t.sticky;if(m>=n.text.length?(m=n.text.length,v="before"):m<=0&&(m=0,v="after"),!f)return l(v=="before"?m-1:m,v=="before");function B(Oe,ze,Ye){var Qe=f[ze],rt=Qe.level==1;return l(Ye?Oe-1:Oe,rt!=Ye)}var V=nt(f,m,v),fe=et,ae=B(m,V,v=="before");return fe!=null&&(ae.other=B(m,fe,v!="before")),ae}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Qi(e.display)*t.ch);var n=ct(e.doc,t.line),r=In(n)+Hr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=Ve(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,ct(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=ct(n,r);;){var f=Ws(e,l,r,t,i),m=bi(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var v=m.find(1);if(v.line==r)return v;l=ct(n,r=v.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=Ze(function(l){return ai(e,i,l-1).bottom<=n},r,0);return r=Ze(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=zr(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 Ws(e,t,i,n,r){r-=In(t);var s=Ji(e,t),l=vo(t),f=0,m=t.text.length,v=!0,B=ut(t,e.doc.direction);if(B){var V=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,B,n,r);v=V.level!=1,f=v?V.from:V.to-1,m=v?V.to:V.from-1}var fe=null,ae=null,Oe=Ze(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&&(fe=xt,ae=gt),!0):!1},f,m),ze,Ye,Qe=!1;if(ae){var rt=n-ae.left<ae.right-n,qe=rt==v;Oe=fe+(qe?0:1),Ye=qe?"after":"before",ze=rt?ae.left:ae.right}else{!v&&(Oe==m||Oe==f)&&Oe++,Ye=Oe==0?"after":Oe==t.text.length?"before":ai(e,s,Oe-(v?1:0)).bottom+l<=r==v?"after":"before";var lt=Qn(e,Ve(i,Oe,Ye),"line",t,s);ze=lt.left,Qe=r<lt.top?-1:r>=lt.bottom?1:0}return Oe=Be(t.text,Oe,1),bo(i,Oe,Ye,Qe,n-ze)}function Gs(e,t,i,n,r,s,l){var f=Ze(function(V){var fe=r[V],ae=fe.level!=1;return Co(Qn(e,Ve(i,ae?fe.to:fe.from,ae?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),m=r[f];if(f>0){var v=m.level!=1,B=Qn(e,Ve(i,v?m.from:m.to,v?"after":"before"),"line",t,n);Co(B,s,l,!0)&&B.top>l&&(m=r[f-1])}return m}function Vs(e,t,i,n,r,s,l){var f=pa(e,t,n,l),m=f.begin,v=f.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var B=null,V=null,fe=0;fe<r.length;fe++){var ae=r[fe];if(ae.from>=v||ae.to<=m)continue;var Oe=ae.level!=1,ze=ai(e,n,Oe?Math.min(v,ae.to)-1:Math.max(m,ae.from)).right,Ye=ze<s?s-ze+1e9:ze-s;(!B||V>Ye)&&(B=ae,V=Ye)}return B||(B=r[r.length-1]),B.from<m&&(B={from:m,to:B.to,level:B.level}),B.to>v&&(B={from:B.from,to:v,level:B.level}),B}var ji;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ji==null){ji=R("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ji.appendChild(document.createTextNode("x")),ji.appendChild(R("br"));ji.appendChild(document.createTextNode("x"))}de(e.measure,ji);var i=ji.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),we(e.measure),i||1}function Qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=R("span","xxxxxxxxxx"),i=R("pre",[t],"CodeMirror-line-like");de(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 f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+r,n[f]=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 Bi(e,t,i,n){var r=e.display;if(!i&&pe(t).getAttribute("cm-not-content")=="true")return null;var s,l,f=r.lineSpace.getBoundingClientRect();try{s=t.clientX-f.left,l=t.clientY-f.top}catch(V){return null}var m=xo(e,s,l),v;if(n&&m.xRel>0&&(v=ct(e.doc,m.line).text).length==m.ch){var B=E(v,v.length,e.options.tabSize)-v.length;m=Ve(m.line,Math.max(0,Math.round((s-ia(e.display).left)/Qi(e.display))-B))}return m}function Fi(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 Ln(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)_n&&Ci(e.doc,t)<r.viewTo&&Si(e);else if(i<=r.viewFrom)_n&&Fr(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=Wr(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=Wr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Si(e)}else{var f=Wr(e,t,t,-1),m=Wr(e,i,i+n,1);f&&m?(r.view=r.view.slice(0,f.index).concat(Jt(e,f.lineN,m.lineN)).concat(r.view.slice(m.index)),r.viewTo+=n):Si(e)}var v=r.externalMeasured;v&&(i<v.lineN?v.lineN+=n:t<v.lineN+v.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[Fi(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);$(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 Wr(e,t,i,n){var r=Fi(e,t),s,l=e.display.view;if(!_n||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,m=0;m<r;m++)f+=l[m].size;if(f!=t){if(n>0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-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(Fi(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,Fi(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 f=i.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var m=f.empty();(m||e.options.showCursorWhenSelecting)&&ba(e,f.head,r),m||Ks(e,f,s)}return n}function ba(e,t,i){var n=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(R("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(R("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),f=l.left,m=Math.max(n.sizerWidth,Ii(e)-n.sizer.offsetLeft)-l.right,v=r.direction=="ltr";function B(qe,lt,xt,gt){lt<0&&(lt=0),lt=Math.round(lt),gt=Math.round(gt),s.appendChild(R("div",null,"CodeMirror-selected","position: absolute; left: "+qe+`px;
|
|
top: `+lt+"px; width: "+(xt==null?m-qe:xt)+`px;
|
|
height: `+(gt-lt)+"px"))}function V(qe,lt,xt){var gt=ct(r,qe),_t=gt.text.length,Yt,dn;function Zt(tn,On){return yo(e,Ve(qe,tn),"div",gt,On)}function Bn(tn,On,yn){var sn=ma(e,gt,null,tn),nn=On=="ltr"==(yn=="after")?"left":"right",Qt=yn=="after"?sn.begin:sn.end-(/\s/.test(gt.text.charAt(sn.end-1))?2:1);return Zt(Qt,nn)[nn]}var Rn=ut(gt,r.direction);return at(Rn,lt||0,xt==null?_t:xt,function(tn,On,yn,sn){var nn=yn=="ltr",Qt=Zt(tn,nn?"left":"right"),Dn=Zt(On-1,nn?"right":"left"),cr=lt==null&&tn==0,Mi=xt==null&&On==_t,wn=sn==0,si=!Rn||sn==Rn.length-1;if(Dn.top-Qt.top<=3){var fn=(v?cr:Mi)&&wn,$o=(v?Mi:cr)&&si,gi=fn?f:(nn?Qt:Dn).left,Gi=$o?m:(nn?Dn:Qt).right;B(gi,Qt.top,Gi-gi,Qt.bottom)}else{var Vi,Sn,dr,Jo;nn?(Vi=v&&cr&&wn?f:Qt.left,Sn=v?m:Bn(tn,yn,"before"),dr=v?f:Bn(On,yn,"after"),Jo=v&&Mi&&si?m:Dn.right):(Vi=v?Bn(tn,yn,"before"):f,Sn=!v&&cr&&wn?m:Qt.right,dr=!v&&Mi&&si?f:Dn.left,Jo=v?Bn(On,yn,"after"):m),B(Vi,Qt.top,Sn-Vi,Qt.bottom),Qt.bottom<Dn.top&&B(f,Qt.bottom,null,Dn.top),B(dr,Dn.top,Jo-dr,Dn.bottom)}(!Yt||Gr(Qt,Yt)<0)&&(Yt=Qt),Gr(Dn,Yt)<0&&(Yt=Dn),(!dn||Gr(Qt,dn)<0)&&(dn=Qt),Gr(Dn,dn)<0&&(dn=Dn)}),{start:Yt,end:dn}}var fe=t.from(),ae=t.to();if(fe.line==ae.line)V(fe.line,fe.ch,ae.ch);else{var Oe=ct(r,fe.line),ze=ct(r,ae.line),Ye=an(Oe)==an(ze),Qe=V(fe.line,fe.ch,Ye?Oe.text.length+1:null).end,rt=V(ae.line,Ye?0:null,ae.ch).start;Ye&&(Qe.top<rt.top-2?(B(Qe.right,Qe.top,null,Qe.bottom),B(f,rt.top,rt.left,rt.bottom)):B(Qe.right,Qe.top,rt.left-Qe.right,Qe.bottom)),Qe.bottom<rt.top&&B(f,Qe.bottom,null,rt.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(),To(e))}function Ca(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qi(e))},100)}function To(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Pe(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&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&&(Pe(e,"blur",e,t),e.state.focused=!1,Ae(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,f=0;if(r.hidden)continue;if(T&&M<8){var m=r.node.offsetTop+r.node.offsetHeight;l=m-i,i=m}else{var v=r.node.getBoundingClientRect();l=v.bottom-v.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-v.left-1)}var B=r.line.height-l;if((B>.005||B<-.005)&&(Tn(r.line,l),wa(r.line),r.rest))for(var V=0;V<r.rest.length;V++)wa(r.rest[V]);if(f>e.display.sizerWidth){var fe=Math.ceil(f/Qi(e.display));fe>e.display.maxLineLength&&(e.display.maxLineLength=fe,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-Hr(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 f=i.ensure.from.line,m=i.ensure.to.line;f<s?(s=f,l=Kn(t,In(ct(t,f))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=l&&(s=Kn(t,In(ct(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(Xe(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&&!U){var s=R("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Hr(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?Ve(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ve(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Qn(e,t),m=!i||i==t?f:Qn(e,i);r={left:Math.min(f.left,m.left),top:Math.min(f.top,m.top)-n,right:Math.max(f.left,m.left),bottom:Math.max(f.bottom,m.bottom)+n};var v=_o(e,r),B=e.doc.scrollTop,V=e.doc.scrollLeft;if(v.scrollTop!=null&&(xr(e,v.scrollTop),Math.abs(e.doc.scrollTop-B)>1&&(l=!0)),v.scrollLeft!=null&&(Ui(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-V)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=_o(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&Ui(e,i.scrollLeft)}function _o(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 f=e.doc.height+po(i),m=t.top<n,v=t.bottom>f-n;if(t.top<r)l.scrollTop=m?0:t.top;else if(t.bottom>r+s){var B=Math.min(t.top,(v?f:t.bottom)-s);B!=r&&(l.scrollTop=B)}var V=e.options.fixedGutter?0:i.gutters.offsetWidth,fe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-V,ae=Ii(e)-i.gutters.offsetWidth,Oe=t.right-t.left>ae;return Oe&&(t.right=t.left+ae),t.left<10?l.scrollLeft=0:t.left<fe?l.scrollLeft=Math.max(0,t.left+V-(Oe?0:10)):t.right>ae+fe-3&&(l.scrollLeft=t.right+(Oe?0:10)-ae),l}function Ao(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=_o(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;ne||Mo(e,{top:t}),Sa(e,t,!0),ne&&Mo(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 Ui(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,La(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 Hi=function(e,t,i){this.cm=i;var n=this.vert=R("div",[R("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=R("div",[R("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Le(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Le(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,T&&M<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Hi.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}},Hi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Hi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Hi.prototype.zeroWidthHack=function(){var e=ce&&!Z?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Hi.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)},Hi.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 Ta={native:Hi,null:wr};function _a(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ae(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ta[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Le(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Ui(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function zi(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},Mt(e.curOp)}function Wi(e){var t=e.curOp;t&&Wt(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&&Lo(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&&Ui(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==I();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&tr(t,e.barMeasure),e.updatedDisplay&&Oo(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&&Aa(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&&Ui(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 f=0;f<s.length;++f)s[f].lines.length||Pe(s[f],"hide");if(l)for(var m=0;m<l.length;++m)l[m].lines.length&&Pe(l[m],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function jn(e,t){if(e.curOp)return t();zi(e);try{return t()}finally{Wi(e)}}function hn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);zi(e);try{return t.apply(e,arguments)}finally{Wi(e)}}}function En(e){return function(){if(this.curOp)return e.apply(this,arguments);zi(this);try{return e.apply(this,arguments)}finally{Wi(this)}}}function cn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);zi(t);try{return e.apply(this,arguments)}finally{Wi(t)}}}function Er(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,p(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=me(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,f=s.text.length>e.options.maxHighlightLength?kn(t.mode,n.state):null,m=K(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var v=s.styleClasses,B=m.classes;B?s.styleClasses=B:v&&(s.styleClasses=null);for(var V=!l||l.length!=s.styles.length||v!=B&&(!v||!B||v.bgClass!=B.bgClass||v.textClass!=B.textClass),fe=0;!V&&fe<l.length;++fe)V=l[fe]!=s.styles[fe];V&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&ht(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){Y(e,t)&&this.events.push(arguments)},Yr.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Pe.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=I();if(!t||!C(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&C(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==I())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&C(document.body,e.anchorNode)&&C(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 Lo(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;Ma(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)),_n&&(s=Ci(e.doc,s),l=Fr(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=In(ct(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=va(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=sl(e);return m>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(v),we(i.cursorDiv),we(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Er(e,400)),i.updateLineNumbers=null,!0}function Aa(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(!Lo(e,t))break;Vr(e);var r=Cr(e);yr(e),tr(e,r),Oo(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 Mo(e,t){var i=new Yr(e,t);if(Lo(e,i)){Vr(e),Aa(e,i);var n=Cr(e);yr(e),tr(e,n),Oo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(Oe){var ze=Oe.nextSibling;return k&&ce&&e.display.currentWheelTarget==Oe?Oe.style.display="none":Oe.parentNode.removeChild(Oe),ze}for(var m=n.view,v=n.viewFrom,B=0;B<m.length;B++){var V=m[B];if(!V.hidden)if(!V.node||V.node.parentNode!=s){var fe=Is(e,V,v,i);s.insertBefore(fe,l)}else{for(;l!=V.node;)l=f(l);var ae=r&&t!=null&&t<=v&&V.lineNumber;V.changes&&($(V.changes,"gutter")>-1&&(ae=!1),pr(e,V,v,i)),ae&&(we(V.lineNumber),V.lineNumber.appendChild(document.createTextNode(vi(e.options,v)))),l=V.node.nextSibling}v+=V.size}for(;l;)l=f(l)}function Ro(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Oo(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 La(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 f=i[l].alignable;if(f)for(var m=0;m<f.length;m++)f[m].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function Ma(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(R("div",[R("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",Ro(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 Ra(e){var t=e.gutters,i=e.gutterSpecs;we(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,f=t.appendChild(R("div",null,"CodeMirror-gutter "+s));l&&(f.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=f,f.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Ro(e)}function Sr(e){Ra(e.display),Ln(e),La(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=R("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=R("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=oe("div",null,"CodeMirror-code"),r.selectionDiv=R("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=R("div",null,"CodeMirror-cursors"),r.measure=R("div",null,"CodeMirror-measure"),r.lineMeasure=R("div",null,"CodeMirror-measure"),r.lineSpace=oe("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=oe("div",[r.lineSpace],"CodeMirror-lines");r.mover=R("div",[s],null,"position: relative"),r.sizer=R("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=R("div",null,null,"position: absolute; height: "+xe+"px; width: 1px;"),r.gutters=R("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=R("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=R("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),T&&M<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!k&&!(ne&&le)&&(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),Ra(r),i.init(r)}var $r=0,Wn=null;T?Wn=-.53:ne?Wn=15:P?Wn=-.7:ee&&(Wn=-1/3);function Oa(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=Oa(e);return t.x*=Wn,t.y*=Wn,t}function Da(e,t){var i=Oa(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&m))return;if(r&&ce&&k){e:for(var v=t.target,B=s.view;v!=l;v=v.parentNode)for(var V=0;V<B.length;V++)if(B[V].node==v){e.display.currentWheelTarget=v;break e}}if(n&&!ne&&!_&&Wn!=null){r&&m&&xr(e,Math.max(0,l.scrollTop+r*Wn)),Ui(e,Math.max(0,l.scrollLeft+n*Wn)),(!r||r&&m)&&y(t),s.wheelStartX=null;return}if(r&&Wn!=null){var fe=r*Wn,ae=e.doc.scrollTop,Oe=ae+s.wrapper.clientHeight;fe<0?ae=Math.max(0,ae+fe-50):Oe=Math.min(e.doc.height,Oe+fe+50),Mo(e,{top:ae,bottom:Oe})}$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 ze=l.scrollLeft-s.wheelStartX,Ye=l.scrollTop-s.wheelStartY,Qe=Ye&&s.wheelDY&&Ye/s.wheelDY||ze&&s.wheelDX&&ze/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!Qe)return;Wn=(Wn*$r+Qe)/($r+1),++$r},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Gn=function(e,t){this.ranges=e,this.primIndex=t};Gn.prototype.primary=function(){return this.ranges[this.primIndex]},Gn.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},Gn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ut(ci(this.ranges[t].anchor),ci(this.ranges[t].head));return new Gn(e,this.primIndex)},Gn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Gn.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 Ut=function(e,t){this.anchor=e,this.head=t};Ut.prototype.from=function(){return Ri(this.anchor,this.head)},Ut.prototype.to=function(){return di(this.anchor,this.head)},Ut.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(fe,ae){return Ct(fe.from(),ae.from())}),i=$(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],m=Ct(f.to(),l.from());if(n&&!l.empty()?m>0:m>=0){var v=Ri(f.from(),l.from()),B=di(f.to(),l.to()),V=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ut(V?B:v,V?v:B))}}return new Gn(t,i)}function ki(e,t){return new Gn([new Ut(e,t||e)],0)}function Ti(e){return e.text?Ve(e.from.line+e.text.length-1,b(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 Ti(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+=Ti(t).ch-t.to.ch),Ve(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 Ut(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?Ve(i.line,e.ch-t.ch+i.ch):Ve(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=Ve(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],m=Na(f.from,r,s),v=Na(Ti(f),r,s);if(r=f.to,s=v,i=="around"){var B=e.sel.ranges[l],V=Ct(B.head,B.anchor)<0;n[l]=new Ut(V?v:m,V?m:v)}else n[l]=new Ut(m,m)}return new Gn(n,e.sel.primIndex)}function No(e){e.doc.mode=Vn(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&&Ln(e)}function Ia(e,t){return t.from.ch==0&&t.to.ch==0&&b(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Io(e,t,i,n){function r(rt){return i?i[rt]:null}function s(rt,qe,lt){uo(rt,qe,lt,n),Xt(rt,"change",rt,t)}function l(rt,qe){for(var lt=[],xt=rt;xt<qe;++xt)lt.push(new wi(v[xt],r(xt),n));return lt}var f=t.from,m=t.to,v=t.text,B=ct(e,f.line),V=ct(e,m.line),fe=b(v),ae=r(v.length-1),Oe=m.line-f.line;if(t.full)e.insert(0,l(0,v.length)),e.remove(v.length,e.size-v.length);else if(Ia(e,t)){var ze=l(0,v.length-1);s(V,V.text,ae),Oe&&e.remove(f.line,Oe),ze.length&&e.insert(f.line,ze)}else if(B==V)if(v.length==1)s(B,B.text.slice(0,f.ch)+fe+B.text.slice(m.ch),ae);else{var Ye=l(1,v.length-1);Ye.push(new wi(fe+B.text.slice(m.ch),ae,n)),s(B,B.text.slice(0,f.ch)+v[0],r(0)),e.insert(f.line+1,Ye)}else if(v.length==1)s(B,B.text.slice(0,f.ch)+v[0]+V.text.slice(m.ch),r(0)),e.remove(f.line+1,Oe);else{s(B,B.text.slice(0,f.ch)+v[0],r(0)),s(V,fe+V.text.slice(m.ch),ae);var Qe=l(1,v.length-1);Oe>1&&e.remove(f.line+1,Oe-1),e.insert(f.line+1,Qe)}Xt(e,"change",e,t)}function _i(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var m=r.linked[f];if(m.doc==s)continue;var v=l&&m.sharedHist;if(i&&!v)continue;t(m.doc,v),n(m.doc,r,v)}}n(e,null,!0)}function ja(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,So(e),No(e),Ba(e),e.options.lineWrapping||fi(e),e.options.mode=t.modeOption,Ln(e)}function Ba(e){(e.doc.direction=="rtl"?N:Ae)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){jn(e,function(){Ba(e),Ln(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 jo(e,t){var i={from:ci(t.from),to:Ti(t),text:Fn(e,t.from,t.to)};return Ha(e,i,t.from.line,t.to.line+1),_i(e,function(n){return Ha(n,i,t.from.line,t.to.line+1)},!0),i}function Fa(e){for(;e.length;){var t=b(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Fa(e.done),b(e.done);if(e.done.length&&!b(e.done).ranges)return b(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),b(e.done)}function Ua(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,f;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)))f=b(l.changes),Ct(t.from,t.to)==0&&Ct(t.from,f.to)==0?f.to=Ti(t):l.changes.push(jo(e,t));else{var m=b(r.done);for((!m||!m.ranges)&&Zr(e.sel,r.done),l={changes:[jo(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,f||Pe(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,b(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&&Fa(r.undone)}function Zr(e,t){var i=b(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Ha(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 za(e,t){var i=yl(e,t),n=Pn(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 f=0;f<l.length;++f){for(var m=l[f],v=0;v<s.length;++v)if(s[v].marker==m.marker)continue e;s.push(m)}}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?Gn.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var m=0;m<l.length;++m){var v=l[m],B=void 0;if(f.push({from:v.from,to:v.to,text:v.text}),t)for(var V in v)(B=V.match(/^spans_(\d+)$/))&&($(t,Number(B[1]))>-1&&(b(f)[V]=v[V],delete v[V]))}}return n}function Bo(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 Ut(r,t)}else return new Ut(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Cn(e,new Gn([Bo(e.sel.primary(),t,i,r)],0),n)}function Wa(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]=Bo(e.sel.ranges[s],t[s],null,r);var l=qn(e.cm,n,e.sel.primIndex);Cn(e,l,i)}function Fo(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 Ut(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Pe(e,"beforeSelectionChange",e,n),e.cm&&Pe(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=b(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){(Y(e,"beforeSelectionChange")||e.cm&&Y(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,te(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],f=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],m=eo(e,l.anchor,f&&f.anchor,i,n),v=eo(e,l.head,f&&f.head,i,n);(r||m!=l.anchor||v!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ut(m,v))}return r?qn(e.cm,r,t.primIndex):t}function ir(e,t,i,n,r){var s=ct(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],m=f.marker,v="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,B="selectRight"in m?!m.selectRight:m.inclusiveRight;if((f.from==null||(v?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(B?f.to>=t.ch:f.to>t.ch))){if(r&&(Pe(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var V=m.find(n<0?1:-1),fe=void 0;if((n<0?B:v)&&(V=$a(e,V,-n,V&&V.line==t.line?s:null)),V&&V.line==t.line&&(fe=Ct(V,i))&&(n<0?fe<0:fe>0))return ir(e,V,t,n,r)}var ae=m.find(n<0?-1:1);return(n<0?v:B)&&(ae=$a(e,ae,n,ae.line==t.line?s:null)),ae?ir(e,ae,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,Ve(e.first,0))}function $a(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Ve(t.line-1)):null:i>0&&t.ch==(n||ct(e,t.line)).text.length?t.line<e.first+e.size-1?Ve(t.line+1,0):null:new Ve(t.line,t.ch+i)}function Ja(e){e.setSelection(Ve(e.firstLine(),0),Ve(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,f){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),f!==void 0&&(n.origin=f)}),Pe(e,"beforeChange",e,n),e.cm&&Pe(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 hn(e.cm,rr)(e,t,i);if(e.cm.state.suppressEdits)return}if((Y(e,"beforeChange")||e.cm&&Y(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var n=Xi&&!i&&Oi(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);Ua(e,t,i,e.cm?e.cm.curOp.id:NaN),Tr(e,t,i,Pn(e,t));var n=[];_i(e,function(r,s){!s&&$(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),Tr(r,t,null,Pn(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,f=t=="undo"?r.done:r.undone,m=t=="undo"?r.undone:r.done,v=0;v<f.length&&!(s=f[v],i?s.ranges&&!s.equals(e.sel):!s.ranges);v++);if(v==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Zr(s,m),i&&!s.equals(e.sel)){Cn(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var B=[];Zr(l,m),m.push({changes:B,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var V=Y(e,"beforeChange")||e.cm&&Y(e.cm,"beforeChange"),fe=function(ze){var Ye=s.changes[ze];if(Ye.origin=t,V&&!Za(e,Ye,!1))return f.length=0,{};B.push(jo(e,Ye));var Qe=ze?Po(e,Ye):b(f);Tr(e,Ye,Qe,za(e,Ye)),!ze&&e.cm&&e.cm.scrollIntoView({from:Ye.from,to:Ti(Ye)});var rt=[];_i(e,function(qe,lt){!lt&&$(rt,qe.history)==-1&&(ns(qe.history,Ye),rt.push(qe.history)),Tr(qe,Ye,null,za(qe,Ye))})},ae=s.changes.length-1;ae>=0;--ae){var Oe=fe(ae);if(Oe)return Oe.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Gn(W(e.sel.ranges,function(r){return new Ut(Ve(r.anchor.line+t,r.anchor.ch),Ve(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Ln(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 Tr(e,t,i,n){if(e.cm&&!e.cm.curOp)return hn(e.cm,Tr)(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:Ve(e.first,0),to:Ve(t.to.line+r,t.to.ch),text:[b(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Ve(s,ct(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,Ve(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,f=!1,m=s.line;e.options.lineWrapping||(m=Rt(an(ct(n,s.line))),n.iter(m,l.line+1,function(ae){if(ae==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&te(e),Io(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(ae){var Oe=$i(ae);Oe>r.maxLineLength&&(r.maxLine=ae,r.maxLineLength=Oe,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Yn(n,s.line),Er(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?Ln(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?Ei(e,s.line,"text"):Ln(e,s.line,l.line+1,v);var B=Y(e,"changes"),V=Y(e,"change");if(V||B){var fe={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};V&&Xt(e,"change",e,fe),B&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(fe)}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 f=0;f<s.ranges.length;f++)es(s.ranges[f].anchor,t,i,n),es(s.ranges[f].head,t,i,n);continue}for(var m=0;m<s.changes.length;++m){var v=s.changes[m];if(i<v.from.line)v.from=Ve(v.from.line+n,v.from.ch),v.to=Ve(v.to.line+n,v.to.ch);else if(t<=v.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 _r(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=ct(e,c(e,t)):r=Rt(t),r==null?null:(n(s,r)&&e.cm&&Ei(e.cm,r,i),s)}function Ar(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}Ar.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 Lr(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}Lr.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 Ar))){var f=[];this.collapse(f),this.children=[new Ar(f)],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,f=l;f<r.lines.length;){var m=new Ar(r.lines.slice(f,f+=25));r.height-=m.height,this.children.splice(++n,0,m),m.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 Lr(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=$(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Lr(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 Mr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Mr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Rt(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))},Mr.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,Rt(n))})},q(Mr);function is(e,t,i){In(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ao(e,i)}function Cl(e,t,i,n){var r=new Mr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),_r(e,t,"widget",function(l){var f=l.widgets||(l.widgets=[]);if(r.insertAt==null?f.push(r):f.splice(Math.min(f.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Zn(e,l)){var m=In(l)<e.scrollTop;Tn(l,l.height+gr(r)),m&&Ao(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Xt(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Rt(t)),r}var rs=0,Ai=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};Ai.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&zi(e),Y(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],f=Jn(l.markedSpans,this);e&&!this.collapsed?Ei(e,Rt(l),"text"):e&&(f.to!=null&&(r=Rt(l)),f.from!=null&&(n=Rt(l))),l.markedSpans=ii(l.markedSpans,f),f.from==null&&this.collapsed&&!Zn(this.doc,l)&&e&&Tn(l,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var m=0;m<this.lines.length;++m){var v=an(this.lines[m]),B=$i(v);B>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=B,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ln(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&&Wi(e),this.parent&&this.parent.clear()},Ai.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=Ve(t?s:Rt(s),l.from),e==-1))return i;if(l.to!=null&&(n=Ve(t?s:Rt(s),l.to),e==1))return n}return i&&{from:i,to:n}},Ai.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=Rt(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 f=i.height;i.height=null;var m=gr(i)-f;m&&Tn(r,r.height+m)}Xt(n,"markerChanged",n,e)})},Ai.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||$(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ai.prototype.detachLine=function(e){if(this.lines.splice($(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},q(Ai);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 hn(e.cm,ar)(e,t,i,n,r);var s=new Ai(e,r),l=Ct(t,i);if(n&&d(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=oe("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(on(e,t.line,t,i,s)||t.line!=i.line&&on(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");ni()}s.addToHistory&&Ua(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,v;if(e.iter(f,i.line+1,function(V){m&&s.collapsed&&!m.options.lineWrapping&&an(V)==m.display.maxLine&&(v=!0),s.collapsed&&f!=t.line&&Tn(V,0),zn(V,new yi(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(V){Zn(e,V)&&Tn(V,0)}),s.clearOnEnter&&Le(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(An(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),m){if(v&&(m.curOp.updateMaxLine=!0),s.collapsed)Ln(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var B=t.line;B<=i.line;B++)Ei(m,B,"text");s.atomic&&Ka(m.doc),Xt(m,"markerAdded",m,s)}return s}var Rr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Rr.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")},Rr.prototype.find=function(e,t){return this.primary.find(e,t)},q(Rr);function wl(e,t,i,n,r){n=d(n),n.shared=!1;var s=[ar(e,t,i,n,r)],l=s[0],f=n.widgetNode;return _i(e,function(m){f&&(n.widgetNode=f.cloneNode(!0)),s.push(ar(m,o(m,t),o(m,i),n,r));for(var v=0;v<m.linked.length;++v)if(m.linked[v].isParent)return;l=b(s)}),new Rr(s,l)}function os(e){return e.findMarks(Ve(e.first,0),e.clipPos(Ve(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 f=ar(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function Sl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];_i(r.primary.doc,function(m){return s.push(m)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];$(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,Mn=function(e,t,i,n,r){if(!(this instanceof Mn))return new Mn(e,t,i,n,r);i==null&&(i=0),Lr.call(this,[new Ar([new wi("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Ve(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)};Mn.prototype=Ee(Lr.prototype,{constructor:Mn,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:cn(function(e){var t=Ve(this.first,0),i=this.first+this.size-1;rr(this,{from:t,to:Ve(i,ct(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 ct(this,e)},getLineNumber:function(e){return Rt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),an(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:cn(function(e,t,i){Ga(this,o(this,typeof e=="number"?Ve(e,t||0):e),null,i)}),setSelection:cn(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:cn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:cn(function(e,t){Wa(this,u(this,e),t)}),extendSelectionsBy:cn(function(e,t){var i=W(this.sel.ranges,e);Wa(this,u(this,i),t)}),setSelections:cn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Ut(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:cn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Ut(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:cn(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 f=t&&t!="end"&&dl(this,n,t),m=n.length-1;m>=0;m--)rr(this,n[m]);f?Va(this,f):this.cm&&er(this.cm)}),undo:cn(function(){to(this,"undo")}),redo:cn(function(){to(this,"redo")}),undoSelection:cn(function(){to(this,"undo",!0)}),redoSelection:cn(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),_i(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:cn(function(e,t,i){return _r(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Ge(r)&&(n.gutterMarkers=null),!0})}),clearGutter:cn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&_r(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Ge(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=ct(this,e),!e)return null}else if(t=Rt(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:cn(function(e,t,i){return _r(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(_e(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:cn(function(e,t,i){return _r(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(_e(i));if(!l)return!1;var f=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||f==s.length?"":" ")+s.slice(f)||null}else return!1;return!0})}),addLineWidget:cn(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=ct(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 f=0;f<l.length;f++){var m=l[f];!(m.to!=null&&r==e.line&&e.ch>=m.to||m.from==null&&r!=e.line||m.from!=null&&r==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&n.push(m.marker.parent||m.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,Ve(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 Mn(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 Mn(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];_i(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){_i(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):mt(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:cn(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)})}),Mn.prototype.eachLine=Mn.prototype.iter;var as=0;function Tl(e){var t=this;if(ss(t),Xe(t,e)||pi(t.display,e))return;y(e),T&&(as=+new Date);var i=Bi(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,f=function(){++l==r&&hn(t,function(){i=o(t.doc,i);var ae={from:i,to:i,text:t.doc.splitLines(s.filter(function(Oe){return Oe!=null}).join(t.doc.lineSeparator())),origin:"paste"};rr(t.doc,ae),Va(t.doc,ki(o(t.doc,i),o(t.doc,Ti(ae))))})()},m=function(ae,Oe){if(t.options.allowDropFileTypes&&$(t.options.allowDropFileTypes,ae.type)==-1){f();return}var ze=new FileReader;ze.onerror=function(){return f()},ze.onload=function(){var Ye=ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ye)){f();return}s[Oe]=Ye,f()},ze.readAsText(ae)},v=0;v<n.length;v++)m(n[v],v);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 B=e.dataTransfer.getData("Text");if(B){var V;if(t.state.draggingText&&!t.state.draggingText.copy&&(V=t.listSelections()),qr(t.doc,ki(i,i)),V)for(var fe=0;fe<V.length;++fe)or(t.doc,"",V[fe].anchor,V[fe].head,"drag");t.replaceSelection(B,"around","paste"),t.display.input.focus()}}catch(ae){}}}function _l(e,t){if(T&&(!e.state.draggingText||+new Date-as<100)){j(t);return}if(Xe(e,t)||pi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ee){var i=R("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",_&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),_&&i.parentNode.removeChild(i)}}function Al(e,t){var i=Bi(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=R("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),de(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 Ll(){if(us)return;Ml(),us=!0}function Ml(){var e;Le(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Rl)},100))}),Le(window,"blur",function(){return ls(qi)})}function Rl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Li={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"},Or=0;Or<10;Or++)Li[Or+48]=Li[Or+96]=String(Or);for(var no=65;no<=90;no++)Li[no]=String.fromCharCode(no);for(var Dr=1;Dr<=12;Dr++)Li[Dr+111]=Li[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=ce?mi.macDefault:mi.pcDefault;function Ol(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var f=t[l];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))n=!0;else if(/^s(hift)?$/i.test(f))r=!0;else throw new Error("Unrecognized modifier name: "+f)}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=W(i.split(" "),Ol),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=n):(f=r.slice(0,s+1).join(" "),l="...");var m=t[f];if(!m)t[f]=l;else if(m!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var v in t)e[v]=t[v];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:Li[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),(De?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(De?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ds(e,t){if(_&&e.keyCode==34&&e.char)return!1;var i=Li[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,b(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 f=n.length-1;f>=0;f--)or(e.doc,"",n[f].from,n[f].to,"+delete");er(e)})}function Uo(e,t,i){var n=Be(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Ho(e,t,i){var n=Uo(e,t.ch,i);return n==null?null:new Ve(t.line,n,i<0?"after":"before")}function zo(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=ut(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),m=f?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var B=Ji(t,i);v=r<0?i.text.length-1:0;var V=ai(t,B,v).top;v=Ze(function(fe){return ai(t,B,fe).top==V},r<0==(l.level==1)?l.from:l.to-1,v),m=="before"&&(v=Uo(i,v,1))}else v=r<0?l.to:l.from;return new Ve(n,v,m)}}return new Ve(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=ut(t,e.doc.direction);if(!r)return Ho(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=nt(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 Ho(t,i,n);var f=function(Qe,rt){return Uo(t,Qe instanceof Ve?Qe.ch:Qe,rt)},m,v=function(Qe){return e.options.lineWrapping?(m=m||Ji(e,t),ma(e,t,m,Qe)):{begin:0,end:t.text.length}},B=v(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var V=l.level==1==n<0,fe=f(i,V?1:-1);if(fe!=null&&(V?fe<=l.to&&fe<=B.end:fe>=l.from&&fe>=B.begin)){var ae=V?"before":"after";return new Ve(i.line,fe,ae)}}var Oe=function(Qe,rt,qe){for(var lt=function(Yt,dn){return dn?new Ve(i.line,f(Yt,1),"before"):new Ve(i.line,Yt,"after")};Qe>=0&&Qe<r.length;Qe+=rt){var xt=r[Qe],gt=rt>0==(xt.level!=1),_t=gt?qe.begin:f(qe.end,-1);if(xt.from<=_t&&_t<xt.to)return lt(_t,gt);if(_t=gt?xt.from:f(xt.to,-1),qe.begin<=_t&&_t<qe.end)return lt(_t,gt)}},ze=Oe(s+n,n,B);if(ze)return ze;var Ye=n>0?B.end:f(B.begin,-1);return Ye!=null&&!(n>0&&Ye==t.text.length)&&(ze=Oe(n>0?0:r.length-1,n,v(Ye)),ze)?ze: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=ct(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Ve(t.head.line+1,0)}:{from:t.head,to:Ve(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return lr(e,function(t){return{from:Ve(t.from().line,0),to:o(e.doc,Ve(t.to().line+1,0))}})},delLineLeft:function(e){return lr(e,function(t){return{from:Ve(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(Ve(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ve(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")},he)},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")},he)},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},he)},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=E(e.getLine(s.line),s.ch,n);t.push(z(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=ct(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Ve(r.line,r.ch-1)),r.ch>0)r=new Ve(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Ve(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=ct(e.doc,r.line-1).text;l&&(r=new Ve(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ve(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ut(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=ct(e.doc,t),n=an(i);return n!=i&&(t=Rt(n)),zo(!0,e,n,t,1)}function Nl(e,t){var i=ct(e.doc,t),n=ri(i);return n!=i&&(t=Rt(n)),zo(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=ct(e.doc,i.line),r=ut(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 Ve(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)!=Me}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 jl=new H;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:jl.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")&&(y(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 Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var Wo=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=I(),Xe(t,e))return;T&&M<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);_&&(Wo=n?i:null,!n&&i==88&&!Dt&&(ce?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ne&&!ce&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;N(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(Ae(t,"CodeMirror-crosshair"),st(document,"keyup",i),st(document,"mouseover",i))}Le(document,"keyup",i),Le(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),Xe(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pi(t.display,e)||Xe(t,e)||e.ctrlKey&&!e.altKey||ce&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(_&&i==Wo){Wo=null,y(e);return}if(_&&(!e.which||e.which<10)&&gs(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Bl(t,e,r))return;t.display.input.onKeyPress(e)}var Ul=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+Ul>e&&Ct(t,this.pos)==0&&i==this.button};var Ir,jr;function Hl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new Go(i,e,t),Ir=null,"double"):(Ir=new Go(i,e,t),jr=null,"single")}function xs(e){var t=this,i=t.display;if(Xe(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){k||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Bi(t,e),r=ke(e),s=n?Hl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):pe(e)==i.scroller&&y(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(He?t.display.input.onContextMenu(e):Ca(t))}function zl(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 f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Me}finally{e.state.suppressEdits=!1}return f})}function Wl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Ue?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=ce?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(ce?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){T?setTimeout(p(xa,e),0):e.curOp.focus=I();var r=Wl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ke&&!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=hn(e,function(v){k&&(r.scroller.draggable=!1),e.state.draggingText=!1,st(r.wrapper.ownerDocument,"mouseup",l),st(r.wrapper.ownerDocument,"mousemove",f),st(r.scroller,"dragstart",m),st(r.scroller,"drop",l),s||(y(v),n.addNew||Qr(e.doc,i,null,null,n.extend),k&&!ee||T&&M==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},m=function(){return s=!0};k&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Le(r.wrapper.ownerDocument,"mouseup",l),Le(r.wrapper.ownerDocument,"mousemove",f),Le(r.scroller,"dragstart",m),Le(r.scroller,"drop",l),Ca(e),setTimeout(function(){return r.input.focus()},20)}function Cs(e,t,i){if(i=="char")return new Ut(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ut(Ve(t.line,0),o(e.doc,Ve(t.line+1,0)));var n=i(e,t);return new Ut(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;y(t);var l,f,m=s.sel,v=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=v[f]:l=new Ut(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ut(i,i)),i=Bi(e,t,!0,!0),f=-1;else{var B=Cs(e,i,n.unit);n.extend?l=Bo(l,B.anchor,B.head,n.extend):l=B}n.addNew?f==-1?(f=v.length,Cn(s,qn(e,v.concat([l]),f),{scroll:!1,origin:"*mouse"})):v.length>1&&v[f].empty()&&n.unit=="char"&&!n.extend?(Cn(s,qn(e,v.slice(0,f).concat(v.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):Fo(s,f,l,Ce):(f=0,Cn(s,new Gn([l],0),Ce),m=s.sel);var V=i;function fe(qe){if(Ct(V,qe)==0)return;if(V=qe,n.unit=="rectangle"){for(var lt=[],xt=e.options.tabSize,gt=E(ct(s,i.line).text,i.ch,xt),_t=E(ct(s,qe.line).text,qe.ch,xt),Yt=Math.min(gt,_t),dn=Math.max(gt,_t),Zt=Math.min(i.line,qe.line),Bn=Math.min(e.lastLine(),Math.max(i.line,qe.line));Zt<=Bn;Zt++){var Rn=ct(s,Zt).text,tn=ve(Rn,Yt,xt);Yt==dn?lt.push(new Ut(Ve(Zt,tn),Ve(Zt,tn))):Rn.length>tn&<.push(new Ut(Ve(Zt,tn),Ve(Zt,ve(Rn,dn,xt))))}lt.length||lt.push(new Ut(i,i)),Cn(s,qn(e,m.ranges.slice(0,f).concat(lt),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(qe)}else{var On=l,yn=Cs(e,qe,n.unit),sn=On.anchor,nn;Ct(yn.anchor,sn)>0?(nn=yn.head,sn=Ri(On.from(),yn.anchor)):(nn=yn.anchor,sn=di(On.to(),yn.head));var Qt=m.ranges.slice(0);Qt[f]=Kl(e,new Ut(o(s,sn),nn)),Cn(s,qn(e,Qt,f),Ce)}}var ae=r.wrapper.getBoundingClientRect(),Oe=0;function ze(qe){var lt=++Oe,xt=Bi(e,qe,!0,n.unit=="rectangle");if(!xt)return;if(Ct(xt,V)!=0){e.curOp.focus=I(),fe(xt);var gt=Xr(r,s);(xt.line>=gt.to||xt.line<gt.from)&&setTimeout(hn(e,function(){Oe==lt&&ze(qe)}),150)}else{var _t=qe.clientY<ae.top?-20:qe.clientY>ae.bottom?20:0;_t&&setTimeout(hn(e,function(){if(Oe!=lt)return;r.scroller.scrollTop+=_t,ze(qe)}),50)}}function Ye(qe){e.state.selectingText=!1,Oe=Infinity,qe&&(y(qe),r.input.focus()),st(r.wrapper.ownerDocument,"mousemove",Qe),st(r.wrapper.ownerDocument,"mouseup",rt),s.history.lastSelOrigin=null}var Qe=hn(e,function(qe){qe.buttons===0||!ke(qe)?Ye(qe):ze(qe)}),rt=hn(e,Ye);e.state.selectingText=rt,Le(r.wrapper.ownerDocument,"mousemove",Qe),Le(r.wrapper.ownerDocument,"mouseup",rt)}function Kl(e,t){var i=t.anchor,n=t.head,r=ct(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var s=ut(r);if(!s)return t;var l=nt(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var m=l+(f.from==i.ch==(f.level!=1)?0:1);if(m==0||m==s.length)return t;var v;if(n.line!=i.line)v=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var B=nt(s,n.ch,n.sticky),V=B-l||(n.ch-i.ch)*(f.level==1?-1:1);B==m-1||B==m?v=V<0:v=V>0}var fe=s[m+(v?-1:0)],ae=v==(fe.level==1),Oe=ae?fe.from:fe.to,ze=ae?"after":"before";return i.ch==Oe&&i.sticky==ze?t:new Ut(new Ve(i.line,Oe,ze),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(fe){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&y(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!Y(e,i))return O(t);s-=f.top-l.viewOffset;for(var m=0;m<e.display.gutterSpecs.length;++m){var v=l.gutters.childNodes[m];if(v&&v.getBoundingClientRect().right>=r){var B=Kn(e.doc,s),V=e.display.gutterSpecs[m];return Pe(e,i,e,B,V.className,t),O(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(Xe(e,t,"contextmenu"))return;He||e.display.input.onContextMenu(t)}function Yl(e,t){return Y(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(f,m,v){v!=ur&&s(f,m,v)}: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),Ln(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(m){for(var v=0;;){var B=m.text.indexOf(r,v);if(B==-1)break;v=B+r.length,s.push(Ve(l,B))}l++});for(var f=s.length-1;f>=0;f--)or(n.doc,r,s[f],Ve(s[f].line,s[f].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",dt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",le?"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",!Je),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Ss(n),Sr(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),f=s!=ur&&io(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||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){_a(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?Le:st;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?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ae(e.display.wrapper,"CodeMirror-wrap"),fi(e)),So(e),Ln(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?d(t):{},d(ks,t,!1);var n=t.value;typeof n=="string"?n=new Mn(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"),_a(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 H,keySeq:null,specialChars:null},t.autofocus&&!le&&s.input.focus(),T&&M<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ll(),zi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!le||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&To(i)},20):qi(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],ur);Ma(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Xo.length;++f)Xo[f](this);Wi(this),k&&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;Le(t.scroller,"mousedown",hn(e,xs)),T&&M<11?Le(t.scroller,"dblclick",hn(e,function(m){if(Xe(e,m))return;var v=Bi(e,m);if(!v||Vo(e,m)||pi(e.display,m))return;y(m);var B=e.findWordAt(v);Qr(e.doc,B.anchor,B.head)})):Le(t.scroller,"dblclick",function(m){return Xe(e,m)||y(m)}),Le(t.scroller,"contextmenu",function(m){return Es(e,m)}),Le(t.input.getField(),"contextmenu",function(m){t.scroller.contains(m.target)||Es(e,m)});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(m){if(m.touches.length!=1)return!1;var v=m.touches[0];return v.radiusX<=1&&v.radiusY<=1}function l(m,v){if(v.left==null)return!0;var B=v.left-m.left,V=v.top-m.top;return B*B+V*V>20*20}Le(t.scroller,"touchstart",function(m){if(!Xe(e,m)&&!s(m)&&!Vo(e,m)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Le(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Le(t.scroller,"touchend",function(m){var v=t.activeTouch;if(v&&!pi(t,m)&&v.left!=null&&!v.moved&&new Date-v.start<300){var B=e.coordsChar(t.activeTouch,"page"),V;!v.prev||l(v,v.prev)?V=new Ut(B,B):!v.prev.prev||l(v,v.prev.prev)?V=e.findWordAt(B):V=new Ut(Ve(B.line,0),o(e.doc,Ve(B.line+1,0))),e.setSelection(V.anchor,V.head),e.focus(),y(m)}r()}),Le(t.scroller,"touchcancel",r),Le(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Ui(e,t.scroller.scrollLeft,!0),Pe(e,"scroll",e))}),Le(t.scroller,"mousewheel",function(m){return Da(e,m)}),Le(t.scroller,"DOMMouseScroll",function(m){return Da(e,m)}),Le(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){Xe(e,m)||j(m)},over:function(m){Xe(e,m)||(Al(e,m),j(m))},start:function(m){return _l(e,m)},drop:hn(e,Tl),leave:function(m){Xe(e,m)||ss(e)}};var f=t.input.getField();Le(f,"keyup",function(m){return ys.call(e,m)}),Le(f,"keydown",hn(e,vs)),Le(f,"keypress",hn(e,bs)),Le(f,"focus",function(m){return To(e,m)}),Le(f,"blur",function(m){return qi(e,m)})}var Xo=[];$t.defineInitHook=function(e){return Xo.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=me(e,t).state:i="prev");var l=e.options.tabSize,f=ct(r,t),m=E(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var v=f.text.match(/^\s*/)[0],B;if(!n&&!/\S/.test(f.text))B=0,i="not";else if(i=="smart"&&(B=r.mode.indent(s,f.text.slice(v.length),f.text),B==Me||B>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?B=E(ct(r,t-1).text,null,l):B=0:i=="add"?B=m+e.options.indentUnit:i=="subtract"?B=m-e.options.indentUnit:typeof i=="number"&&(B=m+i),B=Math.max(0,B);var V="",fe=0;if(e.options.indentWithTabs)for(var ae=Math.floor(B/l);ae;--ae)fe+=l,V+=" ";if(fe<B&&(V+=z(B-fe)),V!=v)return or(r,V,Ve(t,0),Ve(t,v.length),"+input"),f.stateAfter=null,!0;for(var Oe=0;Oe<r.sel.ranges.length;Oe++){var ze=r.sel.ranges[Oe];if(ze.head.line==t&&ze.head.ch<v.length){var Ye=Ve(t,v.length);Fo(r,Oe,new Ut(Ye,Ye));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,f=r=="paste"||e.state.pasteIncoming>l,m=mt(t),v=null;if(f&&n.ranges.length>1)if(ei&&ei.text.join(`
|
|
`)==t){if(n.ranges.length%ei.text.length==0){v=[];for(var B=0;B<ei.text.length;B++)v.push(s.splitLines(ei.text[B]))}}else m.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(v=W(m,function(Qe){return[Qe]}));for(var V=e.curOp.updateInput,fe=n.ranges.length-1;fe>=0;fe--){var ae=n.ranges[fe],Oe=ae.from(),ze=ae.to();ae.empty()&&(i&&i>0?Oe=Ve(Oe.line,Oe.ch-i):e.state.overwrite&&!f?ze=Ve(ze.line,Math.min(ct(s,ze.line).text.length,ze.ch+b(m).length)):f&&ei&&ei.lineWise&&ei.text.join(`
|
|
`)==m.join(`
|
|
`)&&(Oe=ze=Ve(Oe.line,0)));var Ye={from:Oe,to:ze,text:v?v[fe%v.length]:m,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};rr(e.doc,Ye),Xt(e,"inputRead",e,Ye)}t&&!f&&_s(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=V),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ts(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 _s(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 f=0;f<s.electricChars.length;f++)if(t.indexOf(s.electricChars.charAt(f))>-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(ct(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&Xt(e,"electricInput",e,r.head.line)}}function As(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:Ve(r,0),head:Ve(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Ls(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ms(){var e=R("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=R("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return k?e.style.width="1000px":e.setAttribute("wrap","off"),X&&(e.style.border="1px solid black"),Ls(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)&&hn(this,t[n])(this,r,l),Pe(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:En(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");L(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Ln(this)}),removeOverlay:En(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++,Ln(this);return}}}),indentLine:En(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)&&Br(this,n,r,s)}),indentSelection:En(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var f=r[l];if(f.empty())f.head.line>s&&(Br(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&er(this));else{var m=f.from(),v=f.to(),B=Math.max(s,m.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var V=B;V<s;++V)Br(this,V,n);var fe=this.doc.sel.ranges;m.ch==0&&r.length==fe.length&&fe[l].from().ch>0&&Fo(this.doc,l,new Ut(m,fe[l].to()),be)}}}),getTokenAt:function(n,r){return Ht(this,n,r)},getLineTokens:function(n,r){return Ht(this,Ve(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=je(this,ct(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,m;if(f==0)m=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=f)l=v;else if(r[v*2+1]<f)s=v+1;else{m=r[v*2+2];break}}var B=m?m.indexOf("overlay "):-1;return B<0?m:B==0?null:m.slice(0,B-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],f=this.getModeAt(n);if(typeof f[r]=="string")l[f[r]]&&s.push(l[f[r]]);else if(f[r])for(var m=0;m<f[r].length;m++){var v=l[f[r][m]];v&&s.push(v)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var B=0;B<l._global.length;B++){var V=l._global[B];V.pred(f,this)&&$(s,V.val)==-1&&s.push(V.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=c(s,n==null?s.first+s.size-1:n),me(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,f;if(typeof n=="number"){var m=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>m&&(n=m,l=!0),f=ct(this.doc,n)}else f=n;return zr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-In(f):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,f){var m=this.display;n=Qn(this,o(this.doc,n));var v=n.bottom,B=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),m.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var V=Math.max(m.wrapper.clientHeight,this.doc.height),fe=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>V)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=V&&(v=n.bottom),B+r.offsetWidth>fe&&(B=fe-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",f=="right"?(B=m.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?B=0:f=="middle"&&(B=(m.sizer.clientWidth-r.offsetWidth)/2),r.style.left=B+"px"),s&&Js(this,{left:B,top:v,right:B+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:En(vs),triggerOnKeyPress:En(bs),triggerOnKeyUp:ys,triggerOnMouseDown:En(xs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:En(function(n){_s(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var m=o(this.doc,n),v=0;v<r&&!(m=Yo(this.doc,m,f,s,l),m.hitSide);++v);return m},moveH:En(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()},he)}),deleteH:En(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):lr(this,function(f){var m=Yo(l,f.head,n,r,!1);return n<0?{from:m,to:f.head}:{from:f.head,to:m}})}),findPosV:function(n,r,s,l){var f=1,m=l;r<0&&(f=-1,r=-r);for(var v=o(this.doc,n),B=0;B<r;++B){var V=Qn(this,v,"div");if(m==null?m=V.left:V.left=m,v=Rs(this,V,f,s),v.hitSide)break}return v},moveV:En(function(n,r){var s=this,l=this.doc,f=[],m=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(B){if(m)return n<0?B.from():B.to();var V=Qn(s,B.head,"div");B.goalColumn!=null&&(V.left=B.goalColumn),f.push(V.left);var fe=Rs(s,V,n,r);return r=="page"&&B==l.sel.primary()&&Ao(s,yo(s,fe,"div").top-V.top),fe},he),f.length)for(var v=0;v<l.sel.ranges.length;v++)l.sel.ranges[v].goalColumn=f[v]}),findWordAt:function(n){var r=this.doc,s=ct(r,n.line).text,l=n.ch,f=n.ch;if(s){var m=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var v=s.charAt(l),B=Ne(v,m)?function(V){return Ne(V,m)}:/\s/.test(v)?function(V){return/\s/.test(V)}:function(V){return!/\s/.test(V)&&!Ne(V)};l>0&&B(s.charAt(l-1));)--l;for(;f<s.length&&B(s.charAt(f));)++f}return new Ut(Ve(n.line,l),Ve(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):Ae(this.display.cursorDiv,"CodeMirror-overwrite"),Pe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==I()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:En(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:En(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:Ve(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:En(function(n,r){var s=this,l=function(m){return typeof m=="number"||/^\d+$/.test(String(m))?m+"px":m};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&ua(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(m){if(m.widgets){for(var v=0;v<m.widgets.length;v++)if(m.widgets[v].noHScroll){Ei(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Pe(this,"refresh",this)}),operation:function(n){return jn(this,n)},startOperation:function(){return zi(this)},endOperation:function(){return Wi(this)},refresh:En(function(){var n=this.display.cachedTextHeight;Ln(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Ro(this.display),(n==null||Math.abs(n-Zi(this.display))>.5||this.options.lineWrapping)&&So(this),Pe(this,"refresh",this)}),swapDoc:En(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),ja(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}},q(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,f=ct(e,t.line),m=r&&e.direction=="rtl"?-i:i;function v(){var rt=t.line+m;return rt<e.first||rt>=e.first+e.size?!1:(t=new Ve(rt,t.ch,t.sticky),f=ct(e,rt))}function B(rt){var qe;if(n=="codepoint"){var lt=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(lt)?qe=null:qe=new Ve(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(lt>=55296&<<56320?2:1))),-i)}else r?qe=Pl(e.cm,f,t,i):qe=Ho(f,t,i);if(qe==null)if(!rt&&v())t=zo(r,e.cm,f,t.line,m);else return!1;else t=qe;return!0}if(n=="char"||n=="codepoint")B();else if(n=="column")B(!0);else if(n=="word"||n=="group")for(var V=null,fe=n=="group",ae=e.cm&&e.cm.getHelper(t,"wordChars"),Oe=!0;!(i<0&&!B(!Oe));Oe=!1){var ze=f.text.charAt(t.ch)||`
|
|
`,Ye=Ne(ze,ae)?"w":fe&&ze==`
|
|
`?"n":!fe||/\s/.test(ze)?null:"p";if(fe&&!Oe&&!Ye&&(Ye="s"),V&&V!=Ye){i<0&&(i=1,B(),t.sticky="after");break}if(Ye&&(V=Ye),i>0&&!B(!Oe))break}var Qe=eo(e,t,s,l,!0);return ti(s,Qe)&&(Qe.hitSide=!0),Qe}function Rs(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),m=Math.max(f-.5*Zi(e.display),3);l=(i>0?t.bottom:t.top)+i*m}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var v;!(v=xo(e,s,l),!v.outside);){if(i<0?l<=0:l>=r.height){v.hitSide=!0;break}l+=i*5}return v}var Gt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,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;Ls(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Le(r,"paste",function(f){if(!s(f)||Xe(n,f)||Ts(f,n))return;M<=11&&setTimeout(hn(n,function(){return t.updateFromDOM()}),20)}),Le(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Le(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Le(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Le(r,"touchstart",function(){return i.forceCompositionEnd()}),Le(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||Xe(n,f))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var m=As(n);ao({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,be),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var v=ei.text.join(`
|
|
`);if(f.clipboardData.setData("Text",v),f.clipboardData.getData("Text")==v){f.preventDefault();return}}var B=Ms(),V=B.firstChild;n.display.lineSpace.insertBefore(B,n.display.lineSpace.firstChild),V.value=ei.text.join(`
|
|
`);var fe=document.activeElement;A(V),setTimeout(function(){n.display.lineSpace.removeChild(B),fe.focus(),fe==r&&i.showPrimarySelection()},50)}Le(r,"copy",l),Le(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(Ri(s,l),n)==0&&Ct(di(s,l),r)==0)return;var f=t.display.view,m=n.line>=t.display.viewFrom&&Os(t,n)||{node:f[0].measure.map[2],offset:0},v=r.line<t.display.viewTo&&Os(t,r);if(!v){var B=f[f.length-1].measure,V=B.maps?B.maps[B.maps.length-1]:B.map;v={node:V[V.length-1],offset:V[V.length-2]-V[V.length-3]}}if(!m||!v){e.removeAllRanges();return}var fe=e.rangeCount&&e.getRangeAt(0),ae;try{ae=ie(m.node,m.offset,v.offset,v.node)}catch(Oe){}ae&&(!ne&&t.state.focused?(e.collapse(m.node,m.offset),ae.collapsed||(e.removeAllRanges(),e.addRange(ae))):(e.removeAllRanges(),e.addRange(ae)),fe&&e.anchorNode==null?e.addRange(fe):ne&&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){de(this.cm.display.cursorDiv,e.cursors),de(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 C(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(J&&P&&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=Ve(n.line-1,ct(e.doc,n.line-1).length)),r.ch==ct(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Ve(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Fi(e,n.line))==0?(l=Rt(t.view[0].line),f=t.view[0].node):(l=Rt(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=Fi(e,r.line),v,B;if(m==t.view.length-1?(v=t.viewTo-1,B=t.lineDiv.lastChild):(v=Rt(t.view[m+1].line)-1,B=t.view[m+1].node.previousSibling),!f)return!1;for(var V=e.doc.splitLines(tu(e,f,B,l,v)),fe=Fn(e.doc,Ve(l,0),Ve(v,ct(e.doc,v).text.length));V.length>1&&fe.length>1;)if(b(V)==b(fe))V.pop(),fe.pop(),v--;else if(V[0]==fe[0])V.shift(),fe.shift(),l++;else break;for(var ae=0,Oe=0,ze=V[0],Ye=fe[0],Qe=Math.min(ze.length,Ye.length);ae<Qe&&ze.charCodeAt(ae)==Ye.charCodeAt(ae);)++ae;for(var rt=b(V),qe=b(fe),lt=Math.min(rt.length-(V.length==1?ae:0),qe.length-(fe.length==1?ae:0));Oe<lt&&rt.charCodeAt(rt.length-Oe-1)==qe.charCodeAt(qe.length-Oe-1);)++Oe;if(V.length==1&&fe.length==1&&l==n.line)for(;ae&&ae>n.ch&&rt.charCodeAt(rt.length-Oe-1)==qe.charCodeAt(qe.length-Oe-1);)ae--,Oe++;V[V.length-1]=rt.slice(0,rt.length-Oe).replace(/^\u200b+/,""),V[0]=V[0].slice(ae).replace(/\u200b+$/,"");var xt=Ve(l,ae),gt=Ve(v,fe.length?b(fe).length-Oe:0);if(V.length>1||V[0]||Ct(xt,gt))return or(e.doc,V,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 Ln(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()||hn(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 Os(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=ct(e.doc,t.line),r=ra(i,n,t.line),s=ut(n,e.doc.direction),l="left";if(s){var f=nt(s,t.ch);l=f%2?"right":"left"}var m=sa(r.map,t.ch,l);return m.offset=m.collapse=="right"?m.end:m.start,m}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,f=e.doc.lineSeparator(),m=!1;function v(ae){return function(Oe){return Oe.id==ae}}function B(){l&&(s+=f,m&&(s+=f),l=m=!1)}function V(ae){ae&&(B(),s+=ae)}function fe(ae){if(ae.nodeType==1){var Oe=ae.getAttribute("cm-text");if(Oe){V(Oe);return}var ze=ae.getAttribute("cm-marker"),Ye;if(ze){var Qe=e.findMarks(Ve(n,0),Ve(r+1,0),v(+ze));Qe.length&&(Ye=Qe[0].find(0))&&V(Fn(e.doc,Ye.from,Ye.to).join(f));return}if(ae.getAttribute("contenteditable")=="false")return;var rt=/^(pre|div|p|li|table|br)$/i.test(ae.nodeName);if(!/^br$/i.test(ae.nodeName)&&ae.textContent.length==0)return;rt&&B();for(var qe=0;qe<ae.childNodes.length;qe++)fe(ae.childNodes[qe]);/^(pre|p)$/i.test(ae.nodeName)&&(m=!0),rt&&(l=!0)}else ae.nodeType==3&&V(ae.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(fe(t),t==i);)t=t.nextSibling,m=!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(Ve(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||!C(n,t))return hr(Ve(Rt(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?b(e.rest):e.line;return hr(Ve(Rt(s),s.text.length),r)}var l=t.nodeType==3?t:null,f=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));f.parentNode!=n;)f=f.parentNode;var m=e.measure,v=m.maps;function B(Ye,Qe,rt){for(var qe=-1;qe<(v?v.length:0);qe++)for(var lt=qe<0?m.map:v[qe],xt=0;xt<lt.length;xt+=3){var gt=lt[xt+2];if(gt==Ye||gt==Qe){var _t=Rt(qe<0?e.line:e.rest[qe]),Yt=lt[xt]+rt;return(rt<0||gt!=Ye)&&(Yt=lt[xt+(rt?1:0)]),Ve(_t,Yt)}}}var V=B(l,f,i);if(V)return hr(V,r);for(var fe=f.nextSibling,ae=l?l.nodeValue.length-i:0;fe;fe=fe.nextSibling){if(V=B(fe,fe.firstChild,0),V)return hr(Ve(V.line,V.ch-ae),r);ae+=fe.textContent.length}for(var Oe=f.previousSibling,ze=i;Oe;Oe=Oe.previousSibling){if(V=B(Oe,Oe.firstChild,-1),V)return hr(Ve(V.line,V.ch+ze),r);ze+=Oe.textContent.length}}var en=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,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),X&&(r.style.width="0px"),Le(r,"input",function(){T&&M>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Le(r,"paste",function(l){if(Xe(n,l)||Ts(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Xe(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=As(n);ao({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,be):(i.prevInput="",r.value=f.text.join(`
|
|
`),A(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Le(r,"cut",s),Le(r,"copy",s),Le(e.scroller,"paste",function(l){if(pi(e,l)||Xe(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,r.dispatchEvent(f)}),Le(e.lineSpace,"selectstart",function(l){pi(e,l)||y(l)}),Le(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"})}}),Le(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},en.prototype.createField=function(e){this.wrapper=Ms(),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;de(i.cursorDiv,e.cursors),de(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&&A(this.textarea),T&&M>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",T&&M>=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"&&(!le||I()!=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||tt(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(T&&M>=9&&this.hasSelection===r||ce&&/[\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,f=Math.min(n.length,r.length);l<f&&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(){T&&M>=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=Bi(i,e),l=n.scroller.scrollTop;if(!s||_)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&hn(i,Cn)(i.doc,ki(s),be);var m=r.style.cssText,v=t.wrapper.style.cssText,B=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-B.top-5)+"px; left: "+(e.clientX-B.left-5)+`px;
|
|
z-index: 1000; background: `+(T?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var V;k&&(V=window.scrollY),n.input.focus(),k&&window.scrollTo(null,V),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=ae,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function fe(){if(r.selectionStart!=null){var ze=i.somethingSelected(),Ye="\u200B"+(ze?r.value:"");r.value="\u21DA",r.value=Ye,t.prevInput=ze?"":"\u200B",r.selectionStart=1,r.selectionEnd=Ye.length,n.selForContextMenu=i.doc.sel}}function ae(){if(t.contextMenuPending!=ae)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=m,T&&M<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!T||T&&M<9)&&fe();var ze=0,Ye=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?hn(i,Ja)(i):ze++<10?n.detectingSelectAll=setTimeout(Ye,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ye,200)}}if(T&&M>=9&&fe(),He){j(e);var Oe=function(){st(window,"mouseup",Oe),setTimeout(ae,20)};Le(window,"mouseup",Oe)}else setTimeout(ae,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?d(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=I();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(Le(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(m){}}t.finishInit=function(m){m.save=n,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,n(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(st(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=$t(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function ru(e){e.off=st,e.on=Le,e.wheelEventPixels=cl,e.Doc=Mn,e.splitLines=mt,e.countColumn=E,e.findColumn=ve,e.isWordChar=Te,e.Pass=Me,e.signal=Pe,e.Line=wi,e.changeEnd=Ti,e.scrollbarModel=Ta,e.Pos=Ve,e.cmpPos=Ct,e.modes=jt,e.mimeModes=kt,e.resolveMode=ft,e.getMode=Vn,e.modeExtensions=xn,e.extendMode=pn,e.copyState=kn,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=Rr,e.TextMarker=Ai,e.LineWidget=Mr,e.e_preventDefault=y,e.e_stopPropagation=S,e.e_stop=j,e.addClass=N,e.contains=C,e.rmClass=Ae,e.keyNames=Li}$l($t),ql($t);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in Mn.prototype)Mn.prototype.hasOwnProperty(lo)&&$(ou,lo)<0&&($t.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mn.prototype[lo]));return q(Mn),$t.inputStyles={textarea:en,contenteditable:Gt},$t.defineMode=function(e){!$t.defaults.mode&&e!="null"&&($t.defaults.mode=e),bn.apply(this,arguments)},$t.defineMIME=rn,$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){Mn.prototype[e]=t},$t.fromTextArea=iu,ru($t),$t.version="5.58.2",$t})},X0ci:function(ot,$e,x){},Y1PL:function(ot,$e,x){"use strict";x.r($e),x.d($e,"ResizableTextArea",function(){return $});var F=x("wx14"),ue=x("1OyB"),ne=x("vuIU"),ge=x("Ji7U"),se=x("LK+K"),G=x("q1tI"),T=x("VTBJ"),M=x("rePB"),k=x("Zm9Q"),D=x("Kwbf"),P=x("c+Xe"),_=x("m+aA"),ee=x("bdgK"),Z=new Map;function U(be){be.forEach(function(Ce){var he,ve=Ce.target;(he=Z.get(ve))===null||he===void 0||he.forEach(function(Q){return Q(ve)})})}var X=new ee.default(U),J=null,le=null;function ce(be,Ce){Z.has(be)||(Z.set(be,new Set),X.observe(be)),Z.get(be).add(Ce)}function Ue(be,Ce){Z.has(be)&&(Z.get(be).delete(Ce),Z.get(be).size||(X.unobserve(be),Z.delete(be)))}var Je=function(be){Object(ge.a)(he,be);var Ce=Object(se.a)(he);function he(){return Object(ue.a)(this,he),Ce.apply(this,arguments)}return Object(ne.a)(he,[{key:"render",value:function(){return this.props.children}}]),he}(G.Component),Se=G.createContext(null);function De(be){var Ce=be.children,he=be.onBatchResize,ve=G.useRef(0),Q=G.useRef([]),z=G.useContext(Se),b=G.useCallback(function(W,L,ye){ve.current+=1;var Ee=ve.current;Q.current.push({size:W,element:L,data:ye}),Promise.resolve().then(function(){Ee===ve.current&&(he==null||he(Q.current),Q.current=[])}),z==null||z(W,L,ye)},[he,z]);return G.createElement(Se.Provider,{value:b},Ce)}function He(be){var Ce=be.children,he=be.disabled,ve=G.useRef(null),Q=G.useRef(null),z=G.useContext(Se),b=G.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),W=G.isValidElement(Ce)&&Object(P.c)(Ce),L=W?Ce.ref:null,ye=G.useMemo(function(){return Object(P.a)(L,ve)},[L,ve]),Ee=G.useRef(be);Ee.current=be;var re=G.useCallback(function(Te){var Ne=Ee.current,Ge=Ne.onResize,Ie=Ne.data,Re=Te.getBoundingClientRect(),Be=Re.width,Ze=Re.height,at=Te.offsetWidth,et=Te.offsetHeight,nt=Math.floor(Be),pt=Math.floor(Ze);if(b.current.width!==nt||b.current.height!==pt||b.current.offsetWidth!==at||b.current.offsetHeight!==et){var ut={width:nt,height:pt,offsetWidth:at,offsetHeight:et};b.current=ut;var it=at===Math.round(Be)?Be:at,Le=et===Math.round(Ze)?Ze:et,vt=Object(T.a)(Object(T.a)({},ut),{},{offsetWidth:it,offsetHeight:Le});z==null||z(vt,Te,Ie),Ge&&Promise.resolve().then(function(){Ge(vt,Te)})}},[]);return G.useEffect(function(){var Te=Object(_.a)(ve.current)||Object(_.a)(Q.current);return Te&&!he&&ce(Te,re),function(){return Ue(Te,re)}},[ve.current,he]),G.createElement(Je,{ref:Q},W?G.cloneElement(Ce,{ref:ye}):Ce)}var _e="rc-observer-key";function Ae(be){var Ce=be.children,he=Object(k.a)(Ce);return he.map(function(ve,Q){var z=(ve==null?void 0:ve.key)||"".concat(_e,"-").concat(Q);return G.createElement(He,Object(F.a)({},be,{key:z}),ve)})}Ae.Collection=De;var we=Ae,de=x("bT9E"),R=x("TSYQ"),oe=x.n(R),ie=`
|
|
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
|
|
`,C=["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"],I={},N;function w(be){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(Ce&&I[he])return I[he];var ve=window.getComputedStyle(be),Q=ve.getPropertyValue("box-sizing")||ve.getPropertyValue("-moz-box-sizing")||ve.getPropertyValue("-webkit-box-sizing"),z=parseFloat(ve.getPropertyValue("padding-bottom"))+parseFloat(ve.getPropertyValue("padding-top")),b=parseFloat(ve.getPropertyValue("border-bottom-width"))+parseFloat(ve.getPropertyValue("border-top-width")),W=C.map(function(ye){return"".concat(ye,":").concat(ve.getPropertyValue(ye))}).join(";"),L={sizingStyle:W,paddingSize:z,borderSize:b,boxSizing:Q};return Ce&&he&&(I[he]=L),L}function A(be){var Ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,he=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ve=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),be.getAttribute("wrap")?N.setAttribute("wrap",be.getAttribute("wrap")):N.removeAttribute("wrap");var Q=w(be,Ce),z=Q.paddingSize,b=Q.borderSize,W=Q.boxSizing,L=Q.sizingStyle;N.setAttribute("style","".concat(L,";").concat(ie)),N.value=be.value||be.placeholder||"";var ye=Number.MIN_SAFE_INTEGER,Ee=Number.MAX_SAFE_INTEGER,re=N.scrollHeight,Te;if(W==="border-box"?re+=b:W==="content-box"&&(re-=z),he!==null||ve!==null){N.value=" ";var Ne=N.scrollHeight-z;he!==null&&(ye=Ne*he,W==="border-box"&&(ye=ye+z+b),re=Math.max(ye,re)),ve!==null&&(Ee=Ne*ve,W==="border-box"&&(Ee=Ee+z+b),Te=re>Ee?"":"hidden",re=Math.min(Ee,re))}return{height:re,minHeight:ye,maxHeight:Ee,overflowY:Te,resize:"none"}}var p=x("Gytx"),d=x.n(p),E;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(E||(E={}));var H=function(be){Object(ge.a)(he,be);var Ce=Object(se.a)(he);function he(ve){var Q;return Object(ue.a)(this,he),Q=Ce.call(this,ve),Q.nextFrameActionId=void 0,Q.resizeFrameId=void 0,Q.textArea=void 0,Q.saveTextArea=function(z){Q.textArea=z},Q.handleResize=function(z){var b=Q.state.resizeStatus,W=Q.props,L=W.autoSize,ye=W.onResize;if(b!==E.NONE)return;typeof ye=="function"&&ye(z),L&&Q.resizeOnNextFrame()},Q.resizeOnNextFrame=function(){cancelAnimationFrame(Q.nextFrameActionId),Q.nextFrameActionId=requestAnimationFrame(Q.resizeTextarea)},Q.resizeTextarea=function(){var z=Q.props.autoSize;if(!z||!Q.textArea)return;var b=z.minRows,W=z.maxRows,L=A(Q.textArea,!1,b,W);Q.setState({textareaStyles:L,resizeStatus:E.RESIZING},function(){cancelAnimationFrame(Q.resizeFrameId),Q.resizeFrameId=requestAnimationFrame(function(){Q.setState({resizeStatus:E.RESIZED},function(){Q.resizeFrameId=requestAnimationFrame(function(){Q.setState({resizeStatus:E.NONE}),Q.fixFirefoxAutoScroll()})})})})},Q.renderTextArea=function(){var z=Q.props,b=z.prefixCls,W=b===void 0?"rc-textarea":b,L=z.autoSize,ye=z.onResize,Ee=z.className,re=z.disabled,Te=Q.state,Ne=Te.textareaStyles,Ge=Te.resizeStatus,Ie=Object(de.a)(Q.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Re=oe()(W,Ee,Object(M.a)({},"".concat(W,"-disabled"),re));"value"in Ie&&(Ie.value=Ie.value||"");var Be=Object(T.a)(Object(T.a)(Object(T.a)({},Q.props.style),Ne),Ge===E.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return G.createElement(we,{onResize:Q.handleResize,disabled:!(L||ye)},G.createElement("textarea",Object(F.a)({},Ie,{className:Re,style:Be,ref:Q.saveTextArea})))},Q.state={textareaStyles:{},resizeStatus:E.NONE},Q}return Object(ne.a)(he,[{key:"componentDidUpdate",value:function(Q){(Q.value!==this.props.value||!d()(Q.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var Q=this.textArea.selectionStart,z=this.textArea.selectionEnd;this.textArea.setSelectionRange(Q,z)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),he}(G.Component),$=H,xe=function(be){Object(ge.a)(he,be);var Ce=Object(se.a)(he);function he(ve){var Q;Object(ue.a)(this,he),Q=Ce.call(this,ve),Q.resizableTextArea=void 0,Q.focus=function(){Q.resizableTextArea.textArea.focus()},Q.saveTextArea=function(b){Q.resizableTextArea=b},Q.handleChange=function(b){var W=Q.props.onChange;Q.setValue(b.target.value,function(){Q.resizableTextArea.resizeTextarea()}),W&&W(b)},Q.handleKeyDown=function(b){var W=Q.props,L=W.onPressEnter,ye=W.onKeyDown;b.keyCode===13&&L&&L(b),ye&&ye(b)};var z=typeof ve.value=="undefined"||ve.value===null?ve.defaultValue:ve.value;return Q.state={value:z},Q}return Object(ne.a)(he,[{key:"setValue",value:function(Q,z){"value"in this.props||this.setState({value:Q},z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return G.createElement($,Object(F.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(Q){return"value"in Q?{value:Q.value}:null}}]),he}(G.Component),Me=$e.default=xe},ZW9T:function(ot,$e,x){"use strict";x.d($e,"a",function(){return Je});var F=x("k1fw"),ue=x("miYZ"),ne=x("tsqr"),ge=x("rAM+"),se=x("tJVT"),G=x("PpiC"),T=x("q1tI"),M=x.n(T),k=x("bdgK");function D(Se,De,He,_e,Ae){var we=De.getWordUntilPosition(He),de={startLineNumber:He.lineNumber,endLineNumber:He.lineNumber,startColumn:we.startColumn,endColumn:we.endColumn},R=_e.map(function(oe){return{label:oe,kind:Se.languages.CompletionItemKind.Keyword,insertText:oe,insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:de}});return Ae.map(function(oe){R.push(Object(F.a)(Object(F.a)({},oe),{},{range:de}))}),R}var P=function(Se){var De={label:"ifelse",kind:Se.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet},He=["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"];Se.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(de,R){var oe=D(Se,de,R,He,[De]);return{suggestions:oe}}});var _e=["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"];Se.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(de,R){var oe=[{label:"print",kind:Se.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ie=D(Se,de,R,_e,oe);return{suggestions:ie}}});var Ae=["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"];Se.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(de,R){var oe=[De,{label:"main",kind:Se.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:Se.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ie=D(Se,de,R,Ae,oe);return{suggestions:ie}}})},_="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ee=x("LvDl");function Z(Se){return/^\d+$/.test(Se)?"".concat(Se,"px"):Se}function U(){}var X=!1,J={"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 le(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],De=Se;if(Array.isArray(Se)){for(var He=0;He<Se.length;He++){var _e=J[Se[He]];if(_e)return _e}return De[0]}return J[De]||De}var ce=null,Ue=$e.b=function(Se){var De=Se.width,He=De===void 0?"100%":De,_e=Se.height,Ae=_e===void 0?"100%":_e,we=Se.value,de=Se.language,R=de===void 0?"javascript":de,oe=Se.style,ie=oe===void 0?{}:oe,C=Se.options,I=C===void 0?{}:C,N=Se.overrideServices,w=N===void 0?{}:N,A=Se.theme,p=A===void 0?"vs-dark":A,d=Se.onEditBlur,E=Se.onSave,H=Se.autoHeight,$=H===void 0?!1:H,xe=Se.forbidCopy,Me=xe===void 0?!1:xe,be=Se.onChange,Ce=be===void 0?U:be,he=Se.editorDidMount,ve=he===void 0?U:he,Q=Se.onFocus,z=Q===void 0?U:Q,b=Se.filename,W=b===void 0?"educoder.txt":b,L=Object(G.a)(Se,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ye=Object(T.useRef)(),Ee=Object(T.useRef)({}),re=Object(T.useRef)(),Te=Object(T.useRef)(!1),Ne=Object(T.useRef)(),Ge=Object(T.useState)(!1),Ie=Object(se.a)(Ge,2),Re=Ie[0],Be=Ie[1];function Ze(){var O;return ye.current&&(O=new k.default(function(j){var pe=Object(ge.a)(j),ke;try{for(pe.s();!(ke=pe.n()).done;){var Ke=ke.value;(Ke.target.offsetHeight>0||Ke.target.offsetWidth>0)&&Ee.current.instance.layout()}}catch(yt){pe.e(yt)}finally{pe.f()}}),O.observe(ye.current)),O}function at(){ne.b.warn(decodeURIComponent(_))}var et=function(){var j=Ee.current.instance;if(we!=null&&j&&Re){var pe=j.getModel();pe&&we!==pe.getValue()&&(X=!0,pe.setValue(we),j.layout(),X=!1)}};Object(T.useEffect)(function(){re.current&&clearTimeout(re.current),re.current=setTimeout(function(){et()},500)},[we,Re,Ee.current]);function nt(){var O=Ee.current.instance;if(O){var j=O.getSelection(),pe=Ee.current.pastePos||{},ke=new ce.Range(pe.startLineNumber||j.endLineNumber,pe.startColumn||j.endColumn,pe.endLineNumber||j.endLineNumber,pe.endColumn||j.endColumn);setTimeout(function(){O.executeEdits("",[{range:ke,text:""}])},300)}}function pt(O){(window.navigator.platform.match("Mac")?O.metaKey:O.ctrlKey)&&O.keyCode==83&&(O.preventDefault(),E())}var ut=function(){if($&&Ee.current.instance){var j=Ee.current.instance.getContentHeight();y(j<Ae?Ae:j)}else y(Ae)};function it(O){var j=document.createEvent("MouseEvents");j.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),O.dispatchEvent(j)}function Le(O,j){var pe=window.URL||window.webkitURL||window,ke=new Blob([j]),Ke=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ke.href=pe.createObjectURL(ke),Ke.download=O,it(Ke)}Object(T.useEffect)(function(){ut()},[ut]),Object(T.useEffect)(function(){ye.current&&!Re&&x.e(27).then(x.t.bind(null,"M/lh",7)).then(function(O){try{ce=O,Ee.current.instance=ce.editor.create(ye.current,{value:we,language:le(R),theme:p,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},w);var j=Ee.current.instance;if(ve(j,ce),setTimeout(function(){ut(),Ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Le(W||"educoder.txt",j.getValue())}})},500),Ee.current.subscription=j.onDidChangeModelContent(function(ke){Te.current?clearTimeout(Ne.current):(ut(),Ce(j.getValue(),ke)),Ne.current=setTimeout(function(){Te.current=!1},500)}),window.Monaco||P(ce),Me&&(j.addCommand(ce.KeyMod.CtrlCmd|ce.KeyMod.Shift|ce.KeyCode.KEY_V,function(){return at(),null}),j.addCommand(ce.KeyMod.CtrlCmd|ce.KeyCode.KEY_C,function(){return at(),null})),window.Monaco=ce,d&&j.onDidBlurEditorWidget(function(){d(j.getValue())}),z&&j.onDidFocusEditorText(function(){z(j.getValue())}),Me){j.addCommand(ce.KeyMod.CtrlCmd|ce.KeyCode.KEY_V,function(){return at(),null}),j.onDidPaste(function(ke){Ee.current.pastePos=ke});try{window.addEventListener("paste",nt)}catch(ke){}}var pe=Ze();return Be(!0),function(){var ke=Ee.current.instance;ke.dispose();var Ke=ke.getModel();Ke&&Ke.dispose(),Ee.current.subscription&&Ee.current.subscription.dispose(),Me&&window.removeEventListener("paste",nt),pe.unobserve(ye.current)}}catch(ke){}})},[]),Object(T.useEffect)(function(){var O=Ee.current.instance;if(O&&Re)return document.addEventListener("keydown",pt,!1),function(){document.removeEventListener("keydown",pt)}},[E,Re]),Object(T.useEffect)(function(){var O=Ee.current.instance;if(O&&Re){var j=le(R);ce.editor.setModelLanguage(O.getModel(),j),console.log("language:",R,O.getModel(),j)}},[R,Re]),Object(T.useEffect)(function(){var O=Ee.current.instance;O&&Re&&ce.editor.setTheme(p)},[p,Re]),Object(T.useEffect)(function(){var O=Ee.current.instance;O&&Re&&(O.updateOptions(Object(F.a)({},I)),setTimeout(function(){O.getModel().updateOptions(Object(F.a)({},I))},200))},[JSON.stringify(I),Re]),Object(T.useEffect)(function(){var O=Ee.current.instance;O&&Re&&O.layout()},[He,Ae,Re]);var vt=Object(T.useState)(Z(He)),st=Object(se.a)(vt,2),Pe=st[0],Xe=st[1],te=Object(T.useState)(Z(Ae)),Y=Object(se.a)(te,2),q=Y[0],y=Y[1],S=Object(F.a)(Object(F.a)({},ie),{},{width:Pe,height:q});return M.a.createElement("div",{className:"my-monaco-editor",ref:ye,style:S})};function Je(Se){var De=Se.width,He=De===void 0?"100%":De,_e=Se.height,Ae=_e===void 0?"100%":_e,we=Se.original,de=Se.modified,R=Se.language,oe=Se.options,ie=oe===void 0?{}:oe,C=Object(T.useRef)(),I=Object(T.useState)(null),N=Object(se.a)(I,2),w=N[0],A=N[1];function p($){var xe;return C.current&&(xe=new k.default(function(Me){var be=Object(ge.a)(Me),Ce;try{for(be.s();!(Ce=be.n()).done;){var he=Ce.value;(he.target.offsetHeight>0||he.target.offsetWidth>0)&&$.layout()}}catch(ve){be.e(ve)}finally{be.f()}}),xe.observe(C.current)),xe}Object(T.useEffect)(function(){C.current&&x.e(27).then(x.t.bind(null,"M/lh",7)).then(function($){ce=$;var xe=ce.editor.createDiffEditor(C.current,Object(F.a)(Object(F.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},ie),{},{wordWrap:!0}));A(xe);var Me=p(xe);return function(){xe.dispose();var be=xe.getModel();be&&be.dispose(),Me.unobserve(C.current)}})},[]),Object(T.useEffect)(function(){w&&w.setModel({original:ce.editor.createModel(we,R),modified:ce.editor.createModel(de,R)})},[we,de,R,w]);var d=Z(He),E=Z(Ae),H={width:d,height:E};return M.a.createElement("div",{className:"my-diff-editor",ref:C,style:H})}},ZpRC:function(ot,$e,x){"use strict";function F(P){return typeof P=="object"&&P!=null&&P.nodeType===1}function ue(P,_){return(!_||P!=="hidden")&&P!=="visible"&&P!=="clip"}function ne(P,_){if(P.clientHeight<P.scrollHeight||P.clientWidth<P.scrollWidth){var ee=getComputedStyle(P,null);return ue(ee.overflowY,_)||ue(ee.overflowX,_)||function(Z){var U=function(X){if(!X.ownerDocument||!X.ownerDocument.defaultView)return null;try{return X.ownerDocument.defaultView.frameElement}catch(J){return null}}(Z);return!!U&&(U.clientHeight<Z.scrollHeight||U.clientWidth<Z.scrollWidth)}(P)}return!1}function ge(P,_,ee,Z,U,X,J,le){return X<P&&J>_||X>P&&J<_?0:X<=P&&le<=ee||J>=_&&le>=ee?X-P-Z:J>_&&le<ee||X<P&&le>ee?J-_+U:0}var se=function(P,_){var ee=window,Z=_.scrollMode,U=_.block,X=_.inline,J=_.boundary,le=_.skipOverflowHiddenElements,ce=typeof J=="function"?J:function(Ne){return Ne!==J};if(!F(P))throw new TypeError("Invalid target");for(var Ue=document.scrollingElement||document.documentElement,Je=[],Se=P;F(Se)&&ce(Se);){if((Se=Se.parentElement)===Ue){Je.push(Se);break}Se!=null&&Se===document.body&&ne(Se)&&!ne(document.documentElement)||Se!=null&&ne(Se,le)&&Je.push(Se)}for(var De=ee.visualViewport?ee.visualViewport.width:innerWidth,He=ee.visualViewport?ee.visualViewport.height:innerHeight,_e=window.scrollX||pageXOffset,Ae=window.scrollY||pageYOffset,we=P.getBoundingClientRect(),de=we.height,R=we.width,oe=we.top,ie=we.right,C=we.bottom,I=we.left,N=U==="start"||U==="nearest"?oe:U==="end"?C:oe+de/2,w=X==="center"?I+R/2:X==="end"?ie:I,A=[],p=0;p<Je.length;p++){var d=Je[p],E=d.getBoundingClientRect(),H=E.height,$=E.width,xe=E.top,Me=E.right,be=E.bottom,Ce=E.left;if(Z==="if-needed"&&oe>=0&&I>=0&&C<=He&&ie<=De&&oe>=xe&&C<=be&&I>=Ce&&ie<=Me)return A;var he=getComputedStyle(d),ve=parseInt(he.borderLeftWidth,10),Q=parseInt(he.borderTopWidth,10),z=parseInt(he.borderRightWidth,10),b=parseInt(he.borderBottomWidth,10),W=0,L=0,ye="offsetWidth"in d?d.offsetWidth-d.clientWidth-ve-z:0,Ee="offsetHeight"in d?d.offsetHeight-d.clientHeight-Q-b:0;if(Ue===d)W=U==="start"?N:U==="end"?N-He:U==="nearest"?ge(Ae,Ae+He,He,Q,b,Ae+N,Ae+N+de,de):N-He/2,L=X==="start"?w:X==="center"?w-De/2:X==="end"?w-De:ge(_e,_e+De,De,ve,z,_e+w,_e+w+R,R),W=Math.max(0,W+Ae),L=Math.max(0,L+_e);else{W=U==="start"?N-xe-Q:U==="end"?N-be+b+Ee:U==="nearest"?ge(xe,be,H,Q,b+Ee,N,N+de,de):N-(xe+H/2)+Ee/2,L=X==="start"?w-Ce-ve:X==="center"?w-(Ce+$/2)+ye/2:X==="end"?w-Me+z+ye:ge(Ce,Me,$,ve,z+ye,w,w+R,R);var re=d.scrollLeft,Te=d.scrollTop;N+=Te-(W=Math.max(0,Math.min(Te+W,d.scrollHeight-H+Ee))),w+=re-(L=Math.max(0,Math.min(re+L,d.scrollWidth-$+ye)))}A.push({el:d,top:W,left:L})}return A};function G(P){return P===Object(P)&&Object.keys(P).length!==0}function T(P,_){_===void 0&&(_="auto");var ee="scrollBehavior"in document.body.style;P.forEach(function(Z){var U=Z.el,X=Z.top,J=Z.left;U.scroll&&ee?U.scroll({top:X,left:J,behavior:_}):(U.scrollTop=X,U.scrollLeft=J)})}function M(P){return P===!1?{block:"end",inline:"nearest"}:G(P)?P:{block:"start",inline:"nearest"}}function k(P,_){var ee=!P.ownerDocument.documentElement.contains(P);if(G(_)&&typeof _.behavior=="function")return _.behavior(ee?[]:se(P,_));if(ee)return;var Z=M(_);return T(se(P,Z),Z.behavior)}var D=$e.a=k},Zss7:function(ot,$e,x){var F;(function(ue){var ne=/^\s+/,ge=/\s+$/,se=0,G=ue.round,T=ue.min,M=ue.max,k=ue.random;function D(b,W){if(b=b||"",W=W||{},b instanceof D)return b;if(!(this instanceof D))return new D(b,W);var L=P(b);this._originalInput=b,this._r=L.r,this._g=L.g,this._b=L.b,this._a=L.a,this._roundA=G(100*this._a)/100,this._format=W.format||L.format,this._gradientType=W.gradientType,this._r<1&&(this._r=G(this._r)),this._g<1&&(this._g=G(this._g)),this._b<1&&(this._b=G(this._b)),this._ok=L.ok,this._tc_id=se++}D.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var b=this.toRgb();return(b.r*299+b.g*587+b.b*114)/1e3},getLuminance:function(){var b=this.toRgb(),W,L,ye,Ee,re,Te;return W=b.r/255,L=b.g/255,ye=b.b/255,W<=.03928?Ee=W/12.92:Ee=ue.pow((W+.055)/1.055,2.4),L<=.03928?re=L/12.92:re=ue.pow((L+.055)/1.055,2.4),ye<=.03928?Te=ye/12.92:Te=ue.pow((ye+.055)/1.055,2.4),.2126*Ee+.7152*re+.0722*Te},setAlpha:function(b){return this._a=A(b),this._roundA=G(100*this._a)/100,this},toHsv:function(){var b=U(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=U(this._r,this._g,this._b),W=G(b.h*360),L=G(b.s*100),ye=G(b.v*100);return this._a==1?"hsv("+W+", "+L+"%, "+ye+"%)":"hsva("+W+", "+L+"%, "+ye+"%, "+this._roundA+")"},toHsl:function(){var b=ee(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=ee(this._r,this._g,this._b),W=G(b.h*360),L=G(b.s*100),ye=G(b.l*100);return this._a==1?"hsl("+W+", "+L+"%, "+ye+"%)":"hsla("+W+", "+L+"%, "+ye+"%, "+this._roundA+")"},toHex:function(b){return J(this._r,this._g,this._b,b)},toHexString:function(b){return"#"+this.toHex(b)},toHex8:function(b){return le(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:G(this._r),g:G(this._g),b:G(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+G(this._r)+", "+G(this._g)+", "+G(this._b)+")":"rgba("+G(this._r)+", "+G(this._g)+", "+G(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:G(p(this._r,255)*100)+"%",g:G(p(this._g,255)*100)+"%",b:G(p(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+G(p(this._r,255)*100)+"%, "+G(p(this._g,255)*100)+"%, "+G(p(this._b,255)*100)+"%)":"rgba("+G(p(this._r,255)*100)+"%, "+G(p(this._g,255)*100)+"%, "+G(p(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[J(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var W="#"+ce(this._r,this._g,this._b,this._a),L=W,ye=this._gradientType?"GradientType = 1, ":"";if(b){var Ee=D(b);L="#"+ce(Ee._r,Ee._g,Ee._b,Ee._a)}return"progid:DXImageTransform.Microsoft.gradient("+ye+"startColorstr="+W+",endColorstr="+L+")"},toString:function(b){var W=!!b;b=b||this._format;var L=!1,ye=this._a<1&&this._a>=0,Ee=!W&&ye&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return Ee?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(L=this.toRgbString()),b==="prgb"&&(L=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(L=this.toHexString()),b==="hex3"&&(L=this.toHexString(!0)),b==="hex4"&&(L=this.toHex8String(!0)),b==="hex8"&&(L=this.toHex8String()),b==="name"&&(L=this.toName()),b==="hsl"&&(L=this.toHslString()),b==="hsv"&&(L=this.toHsvString()),L||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(b,W){var L=b.apply(null,[this].concat([].slice.call(W)));return this._r=L._r,this._g=L._g,this._b=L._b,this.setAlpha(L._a),this},lighten:function(){return this._applyModification(De,arguments)},brighten:function(){return this._applyModification(He,arguments)},darken:function(){return this._applyModification(_e,arguments)},desaturate:function(){return this._applyModification(Ue,arguments)},saturate:function(){return this._applyModification(Je,arguments)},greyscale:function(){return this._applyModification(Se,arguments)},spin:function(){return this._applyModification(Ae,arguments)},_applyCombination:function(b,W){return b.apply(null,[this].concat([].slice.call(W)))},analogous:function(){return this._applyCombination(ie,arguments)},complement:function(){return this._applyCombination(we,arguments)},monochromatic:function(){return this._applyCombination(C,arguments)},splitcomplement:function(){return this._applyCombination(oe,arguments)},triad:function(){return this._applyCombination(de,arguments)},tetrad:function(){return this._applyCombination(R,arguments)}},D.fromRatio=function(b,W){if(typeof b=="object"){var L={};for(var ye in b)b.hasOwnProperty(ye)&&(ye==="a"?L[ye]=b[ye]:L[ye]=Me(b[ye]));b=L}return D(b,W)};function P(b){var W={r:0,g:0,b:0},L=1,ye=null,Ee=null,re=null,Te=!1,Ne=!1;return typeof b=="string"&&(b=Q(b)),typeof b=="object"&&(ve(b.r)&&ve(b.g)&&ve(b.b)?(W=_(b.r,b.g,b.b),Te=!0,Ne=String(b.r).substr(-1)==="%"?"prgb":"rgb"):ve(b.h)&&ve(b.s)&&ve(b.v)?(ye=Me(b.s),Ee=Me(b.v),W=X(b.h,ye,Ee),Te=!0,Ne="hsv"):ve(b.h)&&ve(b.s)&&ve(b.l)&&(ye=Me(b.s),re=Me(b.l),W=Z(b.h,ye,re),Te=!0,Ne="hsl"),b.hasOwnProperty("a")&&(L=b.a)),L=A(L),{ok:Te,format:b.format||Ne,r:T(255,M(W.r,0)),g:T(255,M(W.g,0)),b:T(255,M(W.b,0)),a:L}}function _(b,W,L){return{r:p(b,255)*255,g:p(W,255)*255,b:p(L,255)*255}}function ee(b,W,L){b=p(b,255),W=p(W,255),L=p(L,255);var ye=M(b,W,L),Ee=T(b,W,L),re,Te,Ne=(ye+Ee)/2;if(ye==Ee)re=Te=0;else{var Ge=ye-Ee;Te=Ne>.5?Ge/(2-ye-Ee):Ge/(ye+Ee);switch(ye){case b:re=(W-L)/Ge+(W<L?6:0);break;case W:re=(L-b)/Ge+2;break;case L:re=(b-W)/Ge+4;break}re/=6}return{h:re,s:Te,l:Ne}}function Z(b,W,L){var ye,Ee,re;b=p(b,360),W=p(W,100),L=p(L,100);function Te(Ie,Re,Be){return Be<0&&(Be+=1),Be>1&&(Be-=1),Be<1/6?Ie+(Re-Ie)*6*Be:Be<1/2?Re:Be<2/3?Ie+(Re-Ie)*(2/3-Be)*6:Ie}if(W===0)ye=Ee=re=L;else{var Ne=L<.5?L*(1+W):L+W-L*W,Ge=2*L-Ne;ye=Te(Ge,Ne,b+1/3),Ee=Te(Ge,Ne,b),re=Te(Ge,Ne,b-1/3)}return{r:ye*255,g:Ee*255,b:re*255}}function U(b,W,L){b=p(b,255),W=p(W,255),L=p(L,255);var ye=M(b,W,L),Ee=T(b,W,L),re,Te,Ne=ye,Ge=ye-Ee;if(Te=ye===0?0:Ge/ye,ye==Ee)re=0;else{switch(ye){case b:re=(W-L)/Ge+(W<L?6:0);break;case W:re=(L-b)/Ge+2;break;case L:re=(b-W)/Ge+4;break}re/=6}return{h:re,s:Te,v:Ne}}function X(b,W,L){b=p(b,360)*6,W=p(W,100),L=p(L,100);var ye=ue.floor(b),Ee=b-ye,re=L*(1-W),Te=L*(1-Ee*W),Ne=L*(1-(1-Ee)*W),Ge=ye%6,Ie=[L,Te,re,re,Ne,L][Ge],Re=[Ne,L,L,Te,re,re][Ge],Be=[re,re,Ne,L,L,Te][Ge];return{r:Ie*255,g:Re*255,b:Be*255}}function J(b,W,L,ye){var Ee=[xe(G(b).toString(16)),xe(G(W).toString(16)),xe(G(L).toString(16))];return ye&&Ee[0].charAt(0)==Ee[0].charAt(1)&&Ee[1].charAt(0)==Ee[1].charAt(1)&&Ee[2].charAt(0)==Ee[2].charAt(1)?Ee[0].charAt(0)+Ee[1].charAt(0)+Ee[2].charAt(0):Ee.join("")}function le(b,W,L,ye,Ee){var re=[xe(G(b).toString(16)),xe(G(W).toString(16)),xe(G(L).toString(16)),xe(be(ye))];return Ee&&re[0].charAt(0)==re[0].charAt(1)&&re[1].charAt(0)==re[1].charAt(1)&&re[2].charAt(0)==re[2].charAt(1)&&re[3].charAt(0)==re[3].charAt(1)?re[0].charAt(0)+re[1].charAt(0)+re[2].charAt(0)+re[3].charAt(0):re.join("")}function ce(b,W,L,ye){var Ee=[xe(be(ye)),xe(G(b).toString(16)),xe(G(W).toString(16)),xe(G(L).toString(16))];return Ee.join("")}D.equals=function(b,W){return!b||!W?!1:D(b).toRgbString()==D(W).toRgbString()},D.random=function(){return D.fromRatio({r:k(),g:k(),b:k()})};function Ue(b,W){W=W===0?0:W||10;var L=D(b).toHsl();return L.s-=W/100,L.s=d(L.s),D(L)}function Je(b,W){W=W===0?0:W||10;var L=D(b).toHsl();return L.s+=W/100,L.s=d(L.s),D(L)}function Se(b){return D(b).desaturate(100)}function De(b,W){W=W===0?0:W||10;var L=D(b).toHsl();return L.l+=W/100,L.l=d(L.l),D(L)}function He(b,W){W=W===0?0:W||10;var L=D(b).toRgb();return L.r=M(0,T(255,L.r-G(255*-(W/100)))),L.g=M(0,T(255,L.g-G(255*-(W/100)))),L.b=M(0,T(255,L.b-G(255*-(W/100)))),D(L)}function _e(b,W){W=W===0?0:W||10;var L=D(b).toHsl();return L.l-=W/100,L.l=d(L.l),D(L)}function Ae(b,W){var L=D(b).toHsl(),ye=(L.h+W)%360;return L.h=ye<0?360+ye:ye,D(L)}function we(b){var W=D(b).toHsl();return W.h=(W.h+180)%360,D(W)}function de(b){var W=D(b).toHsl(),L=W.h;return[D(b),D({h:(L+120)%360,s:W.s,l:W.l}),D({h:(L+240)%360,s:W.s,l:W.l})]}function R(b){var W=D(b).toHsl(),L=W.h;return[D(b),D({h:(L+90)%360,s:W.s,l:W.l}),D({h:(L+180)%360,s:W.s,l:W.l}),D({h:(L+270)%360,s:W.s,l:W.l})]}function oe(b){var W=D(b).toHsl(),L=W.h;return[D(b),D({h:(L+72)%360,s:W.s,l:W.l}),D({h:(L+216)%360,s:W.s,l:W.l})]}function ie(b,W,L){W=W||6,L=L||30;var ye=D(b).toHsl(),Ee=360/L,re=[D(b)];for(ye.h=(ye.h-(Ee*W>>1)+720)%360;--W;)ye.h=(ye.h+Ee)%360,re.push(D(ye));return re}function C(b,W){W=W||6;for(var L=D(b).toHsv(),ye=L.h,Ee=L.s,re=L.v,Te=[],Ne=1/W;W--;)Te.push(D({h:ye,s:Ee,v:re})),re=(re+Ne)%1;return Te}D.mix=function(b,W,L){L=L===0?0:L||50;var ye=D(b).toRgb(),Ee=D(W).toRgb(),re=L/100,Te={r:(Ee.r-ye.r)*re+ye.r,g:(Ee.g-ye.g)*re+ye.g,b:(Ee.b-ye.b)*re+ye.b,a:(Ee.a-ye.a)*re+ye.a};return D(Te)},D.readability=function(b,W){var L=D(b),ye=D(W);return(ue.max(L.getLuminance(),ye.getLuminance())+.05)/(ue.min(L.getLuminance(),ye.getLuminance())+.05)},D.isReadable=function(b,W,L){var ye=D.readability(b,W),Ee,re;re=!1,Ee=z(L);switch(Ee.level+Ee.size){case"AAsmall":case"AAAlarge":re=ye>=4.5;break;case"AAlarge":re=ye>=3;break;case"AAAsmall":re=ye>=7;break}return re},D.mostReadable=function(b,W,L){var ye=null,Ee=0,re,Te,Ne,Ge;L=L||{},Te=L.includeFallbackColors,Ne=L.level,Ge=L.size;for(var Ie=0;Ie<W.length;Ie++)re=D.readability(b,W[Ie]),re>Ee&&(Ee=re,ye=D(W[Ie]));return D.isReadable(b,ye,{level:Ne,size:Ge})||!Te?ye:(L.includeFallbackColors=!1,D.mostReadable(b,["#fff","#000"],L))};var I=D.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=D.hexNames=w(I);function w(b){var W={};for(var L in b)b.hasOwnProperty(L)&&(W[b[L]]=L);return W}function A(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function p(b,W){H(b)&&(b="100%");var L=$(b);return b=T(W,M(0,parseFloat(b))),L&&(b=parseInt(b*W,10)/100),ue.abs(b-W)<1e-6?1:b%W/parseFloat(W)}function d(b){return T(1,M(0,b))}function E(b){return parseInt(b,16)}function H(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function $(b){return typeof b=="string"&&b.indexOf("%")!=-1}function xe(b){return b.length==1?"0"+b:""+b}function Me(b){return b<=1&&(b=b*100+"%"),b}function be(b){return ue.round(parseFloat(b)*255).toString(16)}function Ce(b){return E(b)/255}var he=function(){var b="[-\\+]?\\d+%?",W="[-\\+]?\\d*\\.\\d+%?",L="(?:"+W+")|(?:"+b+")",ye="[\\s|\\(]+("+L+")[,|\\s]+("+L+")[,|\\s]+("+L+")\\s*\\)?",Ee="[\\s|\\(]+("+L+")[,|\\s]+("+L+")[,|\\s]+("+L+")[,|\\s]+("+L+")\\s*\\)?";return{CSS_UNIT:new RegExp(L),rgb:new RegExp("rgb"+ye),rgba:new RegExp("rgba"+Ee),hsl:new RegExp("hsl"+ye),hsla:new RegExp("hsla"+Ee),hsv:new RegExp("hsv"+ye),hsva:new RegExp("hsva"+Ee),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function ve(b){return!!he.CSS_UNIT.exec(b)}function Q(b){b=b.replace(ne,"").replace(ge,"").toLowerCase();var W=!1;if(I[b])b=I[b],W=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var L;return(L=he.rgb.exec(b))?{r:L[1],g:L[2],b:L[3]}:(L=he.rgba.exec(b))?{r:L[1],g:L[2],b:L[3],a:L[4]}:(L=he.hsl.exec(b))?{h:L[1],s:L[2],l:L[3]}:(L=he.hsla.exec(b))?{h:L[1],s:L[2],l:L[3],a:L[4]}:(L=he.hsv.exec(b))?{h:L[1],s:L[2],v:L[3]}:(L=he.hsva.exec(b))?{h:L[1],s:L[2],v:L[3],a:L[4]}:(L=he.hex8.exec(b))?{r:E(L[1]),g:E(L[2]),b:E(L[3]),a:Ce(L[4]),format:W?"name":"hex8"}:(L=he.hex6.exec(b))?{r:E(L[1]),g:E(L[2]),b:E(L[3]),format:W?"name":"hex"}:(L=he.hex4.exec(b))?{r:E(L[1]+""+L[1]),g:E(L[2]+""+L[2]),b:E(L[3]+""+L[3]),a:Ce(L[4]+""+L[4]),format:W?"name":"hex8"}:(L=he.hex3.exec(b))?{r:E(L[1]+""+L[1]),g:E(L[2]+""+L[2]),b:E(L[3]+""+L[3]),format:W?"name":"hex"}:!1}function z(b){var W,L;return b=b||{level:"AA",size:"small"},W=(b.level||"AA").toUpperCase(),L=(b.size||"small").toLowerCase(),W!=="AA"&&W!=="AAA"&&(W="AA"),L!=="small"&&L!=="large"&&(L="small"),{level:W,size:L}}ot.exports?ot.exports=D:!(F=function(){return D}.call($e,x,$e,ot),F!==void 0&&(ot.exports=F))})(Math)},aRTE:function(ot,$e){ot.exports={L:1,M:0,Q:3,H:2}},bT9E:function(ot,$e,x){"use strict";x.d($e,"a",function(){return ue});var F=x("VTBJ");function ue(ne,ge){var se=Object(F.a)({},ne);return Array.isArray(ge)&&ge.forEach(function(G){delete se[G]}),se}},c5Ni:function(ot,$e,x){},dQei:function(ot,$e){for(var x={glog:function(ue){if(ue<1)throw new Error("glog("+ue+")");return x.LOG_TABLE[ue]},gexp:function(ue){for(;ue<0;)ue+=255;for(;ue>=256;)ue-=255;return x.EXP_TABLE[ue]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},F=0;F<8;F++)x.EXP_TABLE[F]=1<<F;for(var F=8;F<256;F++)x.EXP_TABLE[F]=x.EXP_TABLE[F-4]^x.EXP_TABLE[F-5]^x.EXP_TABLE[F-6]^x.EXP_TABLE[F-8];for(var F=0;F<255;F++)x.LOG_TABLE[x.EXP_TABLE[F]]=F;ot.exports=x},dWSS:function(ot,$e,x){var F=x("dQei");function ue(ne,ge){if(ne.length==null)throw new Error(ne.length+"/"+ge);for(var se=0;se<ne.length&&ne[se]==0;)se++;this.num=new Array(ne.length-se+ge);for(var G=0;G<ne.length-se;G++)this.num[G]=ne[G+se]}ue.prototype={get:function(ne){return this.num[ne]},getLength:function(){return this.num.length},multiply:function(ne){for(var ge=new Array(this.getLength()+ne.getLength()-1),se=0;se<this.getLength();se++)for(var G=0;G<ne.getLength();G++)ge[se+G]^=F.gexp(F.glog(this.get(se))+F.glog(ne.get(G)));return new ue(ge,0)},mod:function(ne){if(this.getLength()-ne.getLength()<0)return this;for(var ge=F.glog(this.get(0))-F.glog(ne.get(0)),se=new Array(this.getLength()),G=0;G<this.getLength();G++)se[G]=this.get(G);for(var G=0;G<ne.getLength();G++)se[G]^=F.gexp(F.glog(ne.get(G))+ge);return new ue(se,0).mod(ne)}},ot.exports=ue},dejd:function(ot,$e,x){},dmUQ:function(ot,$e,x){"use strict";var F=x("Ff2n"),ue=x("rePB"),ne=x("1OyB"),ge=x("vuIU"),se=x("Ji7U"),G=x("md7G"),T=x("foSv"),M=x("q1tI"),k=x.n(M),D=x("TSYQ"),P=x.n(D),_=x("4IlW");function ee(de,R){var oe=Object.keys(de);if(Object.getOwnPropertySymbols){var ie=Object.getOwnPropertySymbols(de);R&&(ie=ie.filter(function(C){return Object.getOwnPropertyDescriptor(de,C).enumerable})),oe.push.apply(oe,ie)}return oe}function Z(de){for(var R=1;R<arguments.length;R++){var oe=arguments[R]!=null?arguments[R]:{};R%2?ee(Object(oe),!0).forEach(function(ie){Object(ue.a)(de,ie,oe[ie])}):Object.getOwnPropertyDescriptors?Object.defineProperties(de,Object.getOwnPropertyDescriptors(oe)):ee(Object(oe)).forEach(function(ie){Object.defineProperty(de,ie,Object.getOwnPropertyDescriptor(oe,ie))})}return de}function U(de){var R=X();return function(){var ie=Object(T.a)(de),C;if(R){var I=Object(T.a)(this).constructor;C=Reflect.construct(ie,arguments,I)}else C=ie.apply(this,arguments);return Object(G.a)(this,C)}}function X(){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(de){return!1}}function J(){}function le(de){de.preventDefault()}var ce=function(R){return R.replace(/[^\w.-]+/g,"")},Ue=200,Je=600,Se=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,De=function(R){return R!=null},He=function(R,oe){return oe===R||typeof oe=="number"&&typeof R=="number"&&isNaN(oe)&&isNaN(R)},_e=function(de){Object(se.a)(oe,de);var R=U(oe);function oe(ie){var C;Object(ne.a)(this,oe),C=R.call(this,ie),C.onKeyDown=function(w){var A=C.props,p=A.onKeyDown,d=A.onPressEnter;if(w.keyCode===_.a.UP){var E=C.getRatio(w);C.up(w,E,null),C.stop()}else if(w.keyCode===_.a.DOWN){var H=C.getRatio(w);C.down(w,H,null),C.stop()}else w.keyCode===_.a.ENTER&&d&&d(w);if(C.recordCursorPosition(),C.lastKeyCode=w.keyCode,p){for(var $=arguments.length,xe=new Array($>1?$-1:0),Me=1;Me<$;Me++)xe[Me-1]=arguments[Me];p.apply(void 0,[w].concat(xe))}},C.onKeyUp=function(w){var A=C.props.onKeyUp;if(C.stop(),C.recordCursorPosition(),A){for(var p=arguments.length,d=new Array(p>1?p-1:0),E=1;E<p;E++)d[E-1]=arguments[E];A.apply(void 0,[w].concat(d))}},C.onChange=function(w){var A=C.props.onChange;C.state.focused&&(C.inputting=!0),C.rawInput=C.props.parser(C.getValueFromEvent(w)),C.setState({inputValue:C.rawInput}),A(C.toNumber(C.rawInput))},C.onMouseUp=function(){var w=C.props.onMouseUp;C.recordCursorPosition(),w&&w.apply(void 0,arguments)},C.onFocus=function(){var w;C.setState({focused:!0}),(w=C.props).onFocus.apply(w,arguments)},C.onBlur=function(){var w=C.props.onBlur;C.inputting=!1,C.setState({focused:!1});var A=C.getCurrentValidValue(C.state.inputValue),p=C.setValue(A,J);if(w){var d=C.input.value,E=C.getInputDisplayValue({focus:!1,value:p});C.input.value=E&&Number(E),w.apply(void 0,arguments),C.input.value=d}},C.getRatio=function(w){var A=1;return w.metaKey||w.ctrlKey?A=.1:w.shiftKey&&(A=10),A},C.getFullNum=function(w){return isNaN(w)?w:/e/i.test(String(w))?Number(w).toFixed(18).replace(/\.?0+$/,""):w},C.getPrecision=function(w){if(De(C.props.precision))return C.props.precision;var A=String(w);if(A.indexOf("e-")>=0)return parseInt(A.slice(A.indexOf("e-")+2),10);var p=0;return A.indexOf(".")>=0&&(p=A.length-A.indexOf(".")-1),p},C.getInputDisplayValue=function(w){var A=w||C.state,p=A.focused,d=A.inputValue,E=A.value,H;p?H=d:H=C.toPrecisionAsStep(E),H==null&&(H="");var $=C.formatWrapper(H);return De(C.props.decimalSeparator)&&($=$.toString().replace(".",C.props.decimalSeparator)),$},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(w){}},C.restoreByAfter=function(w){if(w===void 0)return!1;var A=C.input.value,p=A.lastIndexOf(w);if(p===-1)return!1;var d=C.cursorBefore.length;return C.lastKeyCode===_.a.DELETE&&C.cursorBefore.charAt(d-1)===w[0]?(C.fixCaret(d,d),!0):p+w.length===A.length?(C.fixCaret(p,p),!0):!1},C.partRestoreByAfter=function(w){return w===void 0?!1:Array.prototype.some.call(w,function(A,p){var d=w.substring(p);return C.restoreByAfter(d)})},C.isNotCompleteNumber=function(w){return isNaN(w)||w===""||w===null||w&&w.toString().indexOf(".")===w.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(w,A,p){C.pressingUpOrDown=!0,C.step("down",w,A,p)},C.up=function(w,A,p){C.pressingUpOrDown=!0,C.step("up",w,A,p)},C.saveInput=function(w){C.input=w};var I=ie.value;I===void 0&&(I=ie.defaultValue),C.state={focused:ie.autoFocus};var N=C.getValidValue(C.toNumber(I));return C.state=Z(Z({},C.state),{},{inputValue:C.toPrecisionAsStep(N),value:N}),C}return Object(ge.a)(oe,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var I=this.props,N=I.value,w=I.onChange,A=I.max,p=I.min,d=this.state.focused;if(C){if(!He(C.value,N)||!He(C.max,A)||!He(C.min,p)){var E=d?N:this.getValidValue(N),H;this.pressingUpOrDown?H=E:this.inputting?H=this.rawInput:H=this.toPrecisionAsStep(E),this.setState({value:E,inputValue:H})}var $="value"in this.props?N:this.state.value;"max"in this.props&&C.max!==A&&typeof $=="number"&&$>A&&w&&w(A),"min"in this.props&&C.min!==p&&typeof $=="number"&&$<p&&w&&w(p)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var xe=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===_.a.BACKSPACE?xe=this.cursorStart-1:this.lastKeyCode===_.a.DELETE&&(xe=this.cursorStart):xe=this.input.value.length,this.fixCaret(xe,xe)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case _.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case _.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Me){}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(C){var I=C;return I===""?I="":this.isNotCompleteNumber(parseFloat(I))?I=this.state.value:I=this.getValidValue(I),this.toNumber(I)}},{key:"getValueFromEvent",value:function(C){var I=C.target.value.trim().replace(/。/g,".");return De(this.props.decimalSeparator)&&(I=I.replace(this.props.decimalSeparator,".")),I}},{key:"getValidValue",value:function(C){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,w=parseFloat(C);return isNaN(w)?C:(w<I&&(w=I),w>N&&(w=N),w)}},{key:"setValue",value:function(C,I){var N=this.props.precision,w=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),A=this.state.value,p=A===void 0?null:A,d=this.state.inputValue,E=d===void 0?null:d,H=typeof w=="number"?w.toFixed(N):"".concat(w),$=w!==p||H!=="".concat(E);return"value"in this.props?(E=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:E},I)):this.setState({value:w,inputValue:this.toPrecisionAsStep(C)},I),$&&this.props.onChange(w),w}},{key:"getMaxPrecision",value:function(C){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,w=N.precision,A=N.step;if(De(w))return w;var p=this.getPrecision(I),d=this.getPrecision(A),E=this.getPrecision(C);return C?Math.max(E,p+d):p+d}},{key:"getPrecisionFactor",value:function(C){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(C,I);return Math.pow(10,N)}},{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(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var I=Math.abs(this.getMaxPrecision(C));return isNaN(I)?C.toString():Number(C).toFixed(I)}},{key:"toNumber",value:function(C){var I=this.props.precision,N=this.state.focused,w=C&&C.length>16&&N;return this.isNotCompleteNumber(C)||w?C:De(I)?Math.round(C*Math.pow(10,I))/Math.pow(10,I):Number(C)}},{key:"upStep",value:function(C,I){var N=this.props.step,w=this.getPrecisionFactor(C,I),A=Math.abs(this.getMaxPrecision(C,I)),p=((w*C+w*N*I)/w).toFixed(A);return this.toNumber(p)}},{key:"downStep",value:function(C,I){var N=this.props.step,w=this.getPrecisionFactor(C,I),A=Math.abs(this.getMaxPrecision(C,I)),p=((w*C-w*N*I)/w).toFixed(A);return this.toNumber(p)}},{key:"step",value:function(C,I){var N=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,A=arguments.length>3?arguments[3]:void 0;this.stop(),I&&(I.persist(),I.preventDefault());var p=this.props;if(p.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var E=this["".concat(C,"Step")](d,w),H=E>p.max||E<p.min;if(E>p.max?E=p.max:E<p.min&&(E=p.min),this.setValue(E,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),H)return;this.autoStepTimer=setTimeout(function(){N[C](I,w,!0)},A?Ue:Je)}},{key:"fixCaret",value:function(C,I){if(C===void 0||I===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,w=this.input.selectionEnd;(C!==N||I!==w)&&this.input.setSelectionRange(C,I)}catch(A){}}},{key:"render",value:function(){var C,I=this.props,N=I.prefixCls,w=I.disabled,A=I.readOnly,p=I.useTouch,d=I.autoComplete,E=I.upHandler,H=I.downHandler,$=I.className,xe=I.max,Me=I.min,be=I.style,Ce=I.title,he=I.onMouseEnter,ve=I.onMouseLeave,Q=I.onMouseOver,z=I.onMouseOut,b=I.required,W=I.onClick,L=I.tabIndex,ye=I.type,Ee=I.placeholder,re=I.id,Te=I.inputMode,Ne=I.pattern,Ge=I.step,Ie=I.maxLength,Re=I.autoFocus,Be=I.name,Ze=I.onPaste,at=I.onInput,et=Object(F.a)(I,["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"]),nt=this.state,pt=nt.value,ut=nt.focused,it=P()(N,(C={},Object(ue.a)(C,$,!!$),Object(ue.a)(C,"".concat(N,"-disabled"),w),Object(ue.a)(C,"".concat(N,"-focused"),ut),C)),Le={};Object.keys(et).forEach(function(j){(j.substr(0,5)==="data-"||j.substr(0,5)==="aria-"||j==="role")&&(Le[j]=et[j])});var vt=!A&&!w,st=this.getInputDisplayValue(null),Pe=(pt||pt===0)&&(isNaN(pt)||Number(pt)>=xe),Xe=(pt||pt===0)&&(isNaN(pt)||Number(pt)<=Me),te=Pe||w||A,Y=Xe||w||A,q=P()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(ue.a)({},"".concat(N,"-handler-up-disabled"),te)),y=P()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(ue.a)({},"".concat(N,"-handler-down-disabled"),Y)),S=p?{onTouchStart:te?J:this.up,onTouchEnd:this.stop}:{onMouseDown:te?J:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},O=p?{onTouchStart:Y?J:this.down,onTouchEnd:this.stop}:{onMouseDown:Y?J:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:it,style:be,title:Ce,onMouseEnter:he,onMouseLeave:ve,onMouseOver:Q,onMouseOut:z,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(N,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},S,{role:"button","aria-label":"Increase Value","aria-disabled":te,className:q}),E||k.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:le})),k.a.createElement("span",Object.assign({unselectable:"on"},O,{role:"button","aria-label":"Decrease Value","aria-disabled":Y,className:y}),H||k.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:le}))),k.a.createElement("div",{className:"".concat(N,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Me,"aria-valuemax":xe,"aria-valuenow":pt,required:b,type:ye,placeholder:Ee,onPaste:Ze,onClick:W,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:L,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:J,onKeyUp:vt?this.onKeyUp:J,autoFocus:Re,maxLength:Ie,readOnly:A,disabled:w,max:xe,min:Me,step:Ge,name:Be,title:Ce,id:re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:Ne,inputMode:Te,onInput:at},Le))))}}]),oe}(k.a.Component);_e.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:Se,min:-Se,step:1,style:{},onChange:J,onKeyDown:J,onPressEnter:J,onFocus:J,onBlur:J,parser:ce,required:!1,autoComplete:"off"};var Ae=_e,we=$e.a=Ae},f4xo:function(ot,$e,x){var F=x("nVVt");function ue(ne){this.mode=F.MODE_8BIT_BYTE,this.data=ne}ue.prototype={getLength:function(ne){return this.data.length},write:function(ne){for(var ge=0;ge<this.data.length;ge++)ne.put(this.data.charCodeAt(ge),8)}},ot.exports=ue},h78n:function(ot,$e,x){"use strict";x.d($e,"a",function(){return C});var F=x("q1tI"),ue=x.n(F),ne=x("TSYQ"),ge=x.n(ne),se={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},G=function(w){var A=w.map(function(){return Object(F.useRef)()}),p=Object(F.useRef)();return Object(F.useEffect)(function(){var d=Date.now(),E=!1;Object.keys(A).forEach(function(H){var $=A[H].current;if(!$)return;E=!0;var xe=$.style;xe.transitionDuration=".3s, .3s, .3s, .06s",p.current&&d-p.current<100&&(xe.transitionDuration="0s, 0s")}),E&&(p.current=Date.now())}),[A]};function T(){return T=Object.assign||function(N){for(var w=1;w<arguments.length;w++){var A=arguments[w];for(var p in A)Object.prototype.hasOwnProperty.call(A,p)&&(N[p]=A[p])}return N},T.apply(this,arguments)}function M(N,w){return ee(N)||_(N,w)||D(N,w)||k()}function k(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(N,w){if(!N)return;if(typeof N=="string")return P(N,w);var A=Object.prototype.toString.call(N).slice(8,-1);if(A==="Object"&&N.constructor&&(A=N.constructor.name),A==="Map"||A==="Set")return Array.from(N);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return P(N,w)}function P(N,w){(w==null||w>N.length)&&(w=N.length);for(var A=0,p=new Array(w);A<w;A++)p[A]=N[A];return p}function _(N,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var A=[],p=!0,d=!1,E=void 0;try{for(var H=N[Symbol.iterator](),$;!(p=($=H.next()).done)&&!(A.push($.value),w&&A.length===w);p=!0);}catch(xe){d=!0,E=xe}finally{try{!p&&H.return!=null&&H.return()}finally{if(d)throw E}}return A}function ee(N){if(Array.isArray(N))return N}function Z(N,w){if(N==null)return{};var A=U(N,w),p,d;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(N);for(d=0;d<E.length;d++){if(p=E[d],w.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,p))continue;A[p]=N[p]}}return A}function U(N,w){if(N==null)return{};var A={},p=Object.keys(N),d,E;for(E=0;E<p.length;E++){if(d=p[E],w.indexOf(d)>=0)continue;A[d]=N[d]}return A}var X=function(w){var A=w.className,p=w.percent,d=w.prefixCls,E=w.strokeColor,H=w.strokeLinecap,$=w.strokeWidth,xe=w.style,Me=w.trailColor,be=w.trailWidth,Ce=w.transition,he=Z(w,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete he.gapPosition;var ve=Array.isArray(p)?p:[p],Q=Array.isArray(E)?E:[E],z=G(ve),b=M(z,1),W=b[0],L=$/2,ye=100-$/2,Ee="M ".concat(H==="round"?L:0,",").concat(L,`
|
|
L `).concat(H==="round"?ye:100,",").concat(L),re="0 0 100 ".concat($),Te=0;return ue.a.createElement("svg",T({className:ge()("".concat(d,"-line"),A),viewBox:re,preserveAspectRatio:"none",style:xe},he),ue.a.createElement("path",{className:"".concat(d,"-line-trail"),d:Ee,strokeLinecap:H,stroke:Me,strokeWidth:be||$,fillOpacity:"0"}),ve.map(function(Ne,Ge){var Ie={strokeDasharray:"".concat(Ne,"px, 100px"),strokeDashoffset:"-".concat(Te,"px"),transition:Ce||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Re=Q[Ge]||Q[Q.length-1];return Te+=Ne,ue.a.createElement("path",{key:Ge,className:"".concat(d,"-line-path"),d:Ee,strokeLinecap:H,stroke:Re,strokeWidth:$,fillOpacity:"0",ref:W[Ge],style:Ie})}))};X.defaultProps=se;var J=X;function le(){return le=Object.assign||function(N){for(var w=1;w<arguments.length;w++){var A=arguments[w];for(var p in A)Object.prototype.hasOwnProperty.call(A,p)&&(N[p]=A[p])}return N},le.apply(this,arguments)}function ce(N,w){return He(N)||De(N,w)||Je(N,w)||Ue()}function Ue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Je(N,w){if(!N)return;if(typeof N=="string")return Se(N,w);var A=Object.prototype.toString.call(N).slice(8,-1);if(A==="Object"&&N.constructor&&(A=N.constructor.name),A==="Map"||A==="Set")return Array.from(N);if(A==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(A))return Se(N,w)}function Se(N,w){(w==null||w>N.length)&&(w=N.length);for(var A=0,p=new Array(w);A<w;A++)p[A]=N[A];return p}function De(N,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var A=[],p=!0,d=!1,E=void 0;try{for(var H=N[Symbol.iterator](),$;!(p=($=H.next()).done)&&!(A.push($.value),w&&A.length===w);p=!0);}catch(xe){d=!0,E=xe}finally{try{!p&&H.return!=null&&H.return()}finally{if(d)throw E}}return A}function He(N){if(Array.isArray(N))return N}function _e(N,w){if(N==null)return{};var A=Ae(N,w),p,d;if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(N);for(d=0;d<E.length;d++){if(p=E[d],w.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,p))continue;A[p]=N[p]}}return A}function Ae(N,w){if(N==null)return{};var A={},p=Object.keys(N),d,E;for(E=0;E<p.length;E++){if(d=p[E],w.indexOf(d)>=0)continue;A[d]=N[d]}return A}var we=0;function de(N){return+N.replace("%","")}function R(N){return Array.isArray(N)?N:[N]}function oe(N,w,A,p){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,E=arguments.length>5?arguments[5]:void 0,H=50-p/2,$=0,xe=-H,Me=0,be=-2*H;switch(E){case"left":$=-H,xe=0,Me=2*H,be=0;break;case"right":$=H,xe=0,Me=-2*H,be=0;break;case"bottom":xe=H,be=2*H;break;default:}var Ce="M 50,50 m ".concat($,",").concat(xe,`
|
|
a `).concat(H,",").concat(H," 0 1 1 ").concat(Me,",").concat(-be,`
|
|
a `).concat(H,",").concat(H," 0 1 1 ").concat(-Me,",").concat(be),he=Math.PI*2*H,ve={stroke:A,strokeDasharray:"".concat(w/100*(he-d),"px ").concat(he,"px"),strokeDashoffset:"-".concat(d/2+N/100*(he-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Ce,pathStyle:ve}}var ie=function(w){var A=w.prefixCls,p=w.strokeWidth,d=w.trailWidth,E=w.gapDegree,H=w.gapPosition,$=w.trailColor,xe=w.strokeLinecap,Me=w.style,be=w.className,Ce=w.strokeColor,he=w.percent,ve=_e(w,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),Q=Object(F.useMemo)(function(){return we+=1,we},[]),z=oe(0,100,$,p,E,H),b=z.pathString,W=z.pathStyle,L=R(he),ye=R(Ce),Ee=ye.find(function(Ie){return Object.prototype.toString.call(Ie)==="[object Object]"}),re=G(L),Te=ce(re,1),Ne=Te[0],Ge=function(){var Re=0;return L.map(function(Be,Ze){var at=ye[Ze]||ye[ye.length-1],et=Object.prototype.toString.call(at)==="[object Object]"?"url(#".concat(A,"-gradient-").concat(Q,")"):"",nt=oe(Re,Be,at,p,E,H);return Re+=Be,ue.a.createElement("path",{key:Ze,className:"".concat(A,"-circle-path"),d:nt.pathString,stroke:et,strokeLinecap:xe,strokeWidth:p,opacity:Be===0?0:1,fillOpacity:"0",style:nt.pathStyle,ref:Ne[Ze]})})};return ue.a.createElement("svg",le({className:ge()("".concat(A,"-circle"),be),viewBox:"0 0 100 100",style:Me},ve),Ee&&ue.a.createElement("defs",null,ue.a.createElement("linearGradient",{id:"".concat(A,"-gradient-").concat(Q),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ee).sort(function(Ie,Re){return de(Ie)-de(Re)}).map(function(Ie,Re){return ue.a.createElement("stop",{key:Re,offset:Ie,stopColor:Ee[Ie]})}))),ue.a.createElement("path",{className:"".concat(A,"-circle-trail"),d:b,stroke:$,strokeLinecap:xe,strokeWidth:d||p,fillOpacity:"0",style:W}),Ge().reverse())};ie.defaultProps=se;var C=ie,I={Line:J,Circle:C}},iIVh:function(ot,$e,x){},kSUc:function(ot,$e,x){},lZu9:function(ot,$e,x){(function(F){F(x("VrN/"),x("1eCo"),x("8EBN"))})(function(F){"use strict";F.defineMode("markdown",function(ue,ne){var ge=F.getMode(ue,"text/html"),se=ge.name=="null";function G(p){if(F.findModeByName){var d=F.findModeByName(p);d&&(p=d.mime||d.mimes[0])}var E=F.getMode(ue,p);return E.name=="null"?null:E}ne.highlightFormatting===void 0&&(ne.highlightFormatting=!1),ne.maxBlockquoteDepth===void 0&&(ne.maxBlockquoteDepth=0),ne.taskLists===void 0&&(ne.taskLists=!1),ne.strikethrough===void 0&&(ne.strikethrough=!1),ne.emoji===void 0&&(ne.emoji=!1),ne.fencedCodeBlockHighlighting===void 0&&(ne.fencedCodeBlockHighlighting=!0),ne.fencedCodeBlockDefaultMode===void 0&&(ne.fencedCodeBlockDefaultMode="text/plain"),ne.xml===void 0&&(ne.xml=!0),ne.tokenTypeOverrides===void 0&&(ne.tokenTypeOverrides={});var T={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 M in T)T.hasOwnProperty(M)&&ne.tokenTypeOverrides[M]&&(T[M]=ne.tokenTypeOverrides[M]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,P=/^\[(x| )\](?=\s)/i,_=ne.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ee=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Z=/^[^#!\[\]*_\\<>` "'(~:]+/,U=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,X=/^\s*\[[^\]]+?\]:.*$/,J=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,le=" ";function ce(p,d,E){return d.f=d.inline=E,E(p,d)}function Ue(p,d,E){return d.f=d.block=E,E(p,d)}function Je(p){return!p||!/\S/.test(p.string)}function Se(p){if(p.linkTitle=!1,p.linkHref=!1,p.linkText=!1,p.em=!1,p.strong=!1,p.strikethrough=!1,p.quote=0,p.indentedCode=!1,p.f==He){var d=se;if(!d){var E=F.innerMode(ge,p.htmlState);d=E.mode.name=="xml"&&E.state.tagStart===null&&!E.state.context&&E.state.tokenize.isInText}d&&(p.f=de,p.block=De,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function De(p,d){var E=p.column()===d.indentation,H=Je(d.prevLine.stream),$=d.indentedCode,xe=d.prevLine.hr,Me=d.list!==!1,be=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var Ce=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Me)){for(d.list=null;Ce<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=Ce-d.listStack[d.listStack.length-1])}var he=!H&&!xe&&!d.prevLine.header&&(!Me||!$)&&!d.prevLine.fencedCodeEnd,ve=(d.list===!1||xe||H)&&d.indentation<=be&&p.match(k),Q=null;if(d.indentationDiff>=4&&($||d.prevLine.fencedCodeEnd||d.prevLine.header||H))return p.skipToEnd(),d.indentedCode=!0,T.code;if(p.eatSpace())return null;if(E&&d.indentation<=be&&(Q=p.match(_))&&Q[1].length<=6)return d.quote=0,d.header=Q[1].length,d.thisLine.header=!0,ne.highlightFormatting&&(d.formatting="header"),d.f=d.inline,Ae(d);if(d.indentation<=be&&p.eat(">"))return d.quote=E?1:d.quote+1,ne.highlightFormatting&&(d.formatting="quote"),p.eatSpace(),Ae(d);if(!ve&&!d.setext&&E&&d.indentation<=be&&(Q=p.match(D))){var z=Q[1]?"ol":"ul";return d.indentation=Ce+p.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,ne.taskLists&&p.match(P,!1)&&(d.taskList=!0),d.f=d.inline,ne.highlightFormatting&&(d.formatting=["list","list-"+z]),Ae(d)}else{if(E&&d.indentation<=be&&(Q=p.match(U,!0)))return d.quote=0,d.fencedEndRE=new RegExp(Q[1]+"+ *$"),d.localMode=ne.fencedCodeBlockHighlighting&&G(Q[2]||ne.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=F.startState(d.localMode)),d.f=d.block=_e,ne.highlightFormatting&&(d.formatting="code-block"),d.code=-1,Ae(d);if(d.setext||(!he||!Me)&&!d.quote&&d.list===!1&&!d.code&&!ve&&!X.test(p.string)&&(Q=p.lookAhead(1))&&(Q=Q.match(ee)))return d.setext?(d.header=d.setext,d.setext=0,p.skipToEnd(),ne.highlightFormatting&&(d.formatting="header")):(d.header=Q[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,Ae(d);if(ve)return p.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,T.hr;if(p.peek()==="[")return ce(p,d,I)}return ce(p,d,d.inline)}function He(p,d){var E=ge.token(p,d.htmlState);if(!se){var H=F.innerMode(ge,d.htmlState);(H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText||d.md_inside&&p.current().indexOf(">")>-1)&&(d.f=de,d.block=De,d.htmlState=null)}return E}function _e(p,d){var E=d.listStack[d.listStack.length-1]||0,H=d.indentation<E,$=E+3;if(d.fencedEndRE&&d.indentation<=$&&(H||p.match(d.fencedEndRE))){ne.highlightFormatting&&(d.formatting="code-block");var xe;return H||(xe=Ae(d)),d.localMode=d.localState=null,d.block=De,d.f=de,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,H?Ue(p,d,d.block):xe}else return d.localMode?d.localMode.token(p,d.localState):(p.skipToEnd(),T.code)}function Ae(p){var d=[];if(p.formatting){d.push(T.formatting),typeof p.formatting=="string"&&(p.formatting=[p.formatting]);for(var E=0;E<p.formatting.length;E++)d.push(T.formatting+"-"+p.formatting[E]),p.formatting[E]==="header"&&d.push(T.formatting+"-"+p.formatting[E]+"-"+p.header),p.formatting[E]==="quote"&&(!ne.maxBlockquoteDepth||ne.maxBlockquoteDepth>=p.quote?d.push(T.formatting+"-"+p.formatting[E]+"-"+p.quote):d.push("error"))}if(p.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(p.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(p.linkHref?d.push(T.linkHref,"url"):(p.strong&&d.push(T.strong),p.em&&d.push(T.em),p.strikethrough&&d.push(T.strikethrough),p.emoji&&d.push(T.emoji),p.linkText&&d.push(T.linkText),p.code&&d.push(T.code),p.image&&d.push(T.image),p.imageAltText&&d.push(T.imageAltText,"link"),p.imageMarker&&d.push(T.imageMarker)),p.header&&d.push(T.header,T.header+"-"+p.header),p.quote&&(d.push(T.quote),!ne.maxBlockquoteDepth||ne.maxBlockquoteDepth>=p.quote?d.push(T.quote+"-"+p.quote):d.push(T.quote+"-"+ne.maxBlockquoteDepth)),p.list!==!1){var H=(p.listStack.length-1)%3;H?H===1?d.push(T.list2):d.push(T.list3):d.push(T.list1)}return p.trailingSpaceNewLine?d.push("trailing-space-new-line"):p.trailingSpace&&d.push("trailing-space-"+(p.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function we(p,d){return p.match(Z,!0)?Ae(d):void 0}function de(p,d){var E=d.text(p,d);if(typeof E!="undefined")return E;if(d.list)return d.list=null,Ae(d);if(d.taskList){var H=p.match(P,!0)[1]===" ";return H?d.taskOpen=!0:d.taskClosed=!0,ne.highlightFormatting&&(d.formatting="task"),d.taskList=!1,Ae(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&p.match(/^#+$/,!0))return ne.highlightFormatting&&(d.formatting="header"),Ae(d);var $=p.next();if(d.linkTitle){d.linkTitle=!1;var xe=$;$==="("&&(xe=")"),xe=(xe+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Me="^\\s*(?:[^"+xe+"\\\\]+|\\\\\\\\|\\\\.)"+xe;if(p.match(new RegExp(Me),!0))return T.linkHref}if($==="`"){var be=d.formatting;ne.highlightFormatting&&(d.formatting="code"),p.eatWhile("`");var Ce=p.current().length;if(d.code==0&&(!d.quote||Ce==1))return d.code=Ce,Ae(d);if(Ce==d.code){var he=Ae(d);return d.code=0,he}else return d.formatting=be,Ae(d)}else if(d.code)return Ae(d);if($==="\\"&&(p.next(),ne.highlightFormatting)){var ve=Ae(d),Q=T.formatting+"-escape";return ve?ve+" "+Q:Q}if($==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,ne.highlightFormatting&&(d.formatting="image"),Ae(d);if($==="["&&d.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,ne.highlightFormatting&&(d.formatting="image"),Ae(d);if($==="]"&&d.imageAltText){ne.highlightFormatting&&(d.formatting="image");var ve=Ae(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=oe,ve}if($==="["&&!d.image)return d.linkText&&p.match(/^.*?\]/)||(d.linkText=!0,ne.highlightFormatting&&(d.formatting="link")),Ae(d);if($==="]"&&d.linkText){ne.highlightFormatting&&(d.formatting="link");var ve=Ae(d);return d.linkText=!1,d.inline=d.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?oe:de,ve}if($==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=R,ne.highlightFormatting&&(d.formatting="link");var ve=Ae(d);return ve?ve+=" ":ve="",ve+T.linkInline}if($==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=R,ne.highlightFormatting&&(d.formatting="link");var ve=Ae(d);return ve?ve+=" ":ve="",ve+T.linkEmail}if(ne.xml&&$==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var z=p.string.indexOf(">",p.pos);if(z!=-1){var b=p.string.substring(p.start,z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(d.md_inside=!0)}return p.backUp(1),d.htmlState=F.startState(ge),Ue(p,d,He)}if(ne.xml&&$==="<"&&p.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if($==="*"||$==="_"){for(var W=1,L=p.pos==1?" ":p.string.charAt(p.pos-2);W<3&&p.eat($);)W++;var ye=p.peek()||" ",Ee=!/\s/.test(ye)&&(!J.test(ye)||/\s/.test(L)||J.test(L)),re=!/\s/.test(L)&&(!J.test(L)||/\s/.test(ye)||J.test(ye)),Te=null,Ne=null;if(W%2&&(!d.em&&Ee&&($==="*"||!re||J.test(L))?Te=!0:d.em==$&&re&&($==="*"||!Ee||J.test(ye))&&(Te=!1)),W>1&&(!d.strong&&Ee&&($==="*"||!re||J.test(L))?Ne=!0:d.strong==$&&re&&($==="*"||!Ee||J.test(ye))&&(Ne=!1)),Ne!=null||Te!=null){ne.highlightFormatting&&(d.formatting=Te==null?"strong":Ne==null?"em":"strong em"),Te===!0&&(d.em=$),Ne===!0&&(d.strong=$);var he=Ae(d);return Te===!1&&(d.em=!1),Ne===!1&&(d.strong=!1),he}}else if($===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return Ae(d);p.backUp(1)}if(ne.strikethrough){if($==="~"&&p.eatWhile($)){if(d.strikethrough){ne.highlightFormatting&&(d.formatting="strikethrough");var he=Ae(d);return d.strikethrough=!1,he}else if(p.match(/^[^\s]/,!1))return d.strikethrough=!0,ne.highlightFormatting&&(d.formatting="strikethrough"),Ae(d)}else if($===" "&&p.match(/^~~/,!0)){if(p.peek()===" ")return Ae(d);p.backUp(2)}}if(ne.emoji&&$===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,ne.highlightFormatting&&(d.formatting="emoji");var Ge=Ae(d);return d.emoji=!1,Ge}return $===" "&&(p.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),Ae(d)}function R(p,d){var E=p.next();if(E===">"){d.f=d.inline=de,ne.highlightFormatting&&(d.formatting="link");var H=Ae(d);return H?H+=" ":H="",H+T.linkInline}return p.match(/^[^>]+/,!0),T.linkInline}function oe(p,d){if(p.eatSpace())return null;var E=p.next();return E==="("||E==="["?(d.f=d.inline=C(E==="("?")":"]"),ne.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,Ae(d)):"error"}var ie={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(p){return function(d,E){var H=d.next();if(H===p){E.f=E.inline=de,ne.highlightFormatting&&(E.formatting="link-string");var $=Ae(E);return E.linkHref=!1,$}return d.match(ie[p]),E.linkHref=!0,Ae(E)}}function I(p,d){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=N,p.next(),ne.highlightFormatting&&(d.formatting="link"),d.linkText=!0,Ae(d)):ce(p,d,de)}function N(p,d){if(p.match(/^\]:/,!0)){d.f=d.inline=w,ne.highlightFormatting&&(d.formatting="link");var E=Ae(d);return d.linkText=!1,E}return p.match(/^([^\]\\]|\\.)+/,!0),T.linkText}function w(p,d){return p.eatSpace()?null:(p.match(/^[^\s]+/,!0),p.peek()===void 0?d.linkTitle=!0:p.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),d.f=d.inline=de,T.linkHref+" url")}var A={startState:function(){return{f:De,prevLine:{stream:null},thisLine:{stream:null},block:De,htmlState:null,indentation:0,inline:de,text:we,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(p){return{f:p.f,prevLine:p.prevLine,thisLine:p.thisLine,block:p.block,htmlState:p.htmlState&&F.copyState(ge,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?F.copyState(p.localMode,p.localState):null,inline:p.inline,text:p.text,formatting:!1,linkText:p.linkText,linkTitle:p.linkTitle,linkHref:p.linkHref,code:p.code,em:p.em,strong:p.strong,strikethrough:p.strikethrough,emoji:p.emoji,header:p.header,setext:p.setext,hr:p.hr,taskList:p.taskList,list:p.list,listStack:p.listStack.slice(0),quote:p.quote,indentedCode:p.indentedCode,trailingSpace:p.trailingSpace,trailingSpaceNewLine:p.trailingSpaceNewLine,md_inside:p.md_inside,fencedEndRE:p.fencedEndRE}},token:function(p,d){if(d.formatting=!1,p!=d.thisLine.stream){if(d.header=0,d.hr=!1,p.match(/^\s*$/,!0))return Se(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:p},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=He)){var E=p.match(/^\s*/,!0)[0].replace(/\t/g,le).length;if(d.indentation=E,d.indentationDiff=null,E>0)return null}}return d.f(p,d)},innerMode:function(p){return p.block==He?{state:p.htmlState,mode:ge}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:A}},indent:function(p,d,E){return p.block==He&&ge.indent?ge.indent(p.htmlState,d,E):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,d,E):F.Pass},blankLine:Se,getType:Ae,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return A},"xml"),F.defineMIME("text/markdown","markdown"),F.defineMIME("text/x-markdown","markdown")})},nVVt:function(ot,$e){ot.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},nojB:function(ot,$e,x){"use strict";x.r($e);var F=x("T2oS"),ue=x("W9HT"),ne=x("9og8"),ge=x("tJVT"),se=x("k1fw"),G=x("WmNS"),T=x.n(G),M=x("q1tI"),k=x.n(M),D=x("X0ci"),P=x("iIVh"),_=x("Ty5D"),ee=x("55Ip"),Z=x("+L6B"),U=x("2/Rp"),X=x("5NDa"),J=x("5rEg"),le=x("2qtc"),ce=x("kLXV"),Ue=x("miYZ"),Je=x("tsqr"),Se=x("PpiC"),De=x("y8nQ"),He=x("Vl3Y"),_e=x("DZo9"),Ae=x("8z0m"),we=x("sRBo"),de=x("kaz8"),R=x("LtfV"),oe=x("m3rI"),ie=x("Ot1p"),C=de.a.Group,I=Ae.a.Dragger;function N($,xe){var Me=new FileReader;Me.addEventListener("load",function(){return xe(Me.result)}),Me.readAsDataURL($)}var w=function($){var xe=$.callback,Me=$.tags,be=Me===void 0?[]:Me,Ce=$.initialValues,he=Ce===void 0?{}:Ce,ve=$.removeAttachment,Q=Object(M.useState)(""),z=Object(ge.a)(Q,2),b=z[0],W=z[1],L=He.a.useForm(),ye=Object(ge.a)(L,1),Ee=ye[0];function re(Re){var Be=Re.cover_id,Ze=Re.attachment_ids,at=Object(Se.a)(Re,["cover_id","attachment_ids"]);xe(Object(se.a)(Object(se.a)({},at),{},{cover_id:Be==null?void 0:Be.map(function(et){return et.response?et.response.id:et.uid})[(Be==null?void 0:Be.length)-1],attachment_ids:Ze?Ze==null?void 0:Ze.map(function(et){return et.response?et.response.id:et.uid}):[]}))}function Te(Re){return Array.isArray(Re)?Re:Re&&Re.fileList}var Ne={multiple:!0,beforeUpload:function(Be){var Ze=Be.size/1024/1024<100;if(!Ze)return Je.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(100MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20"),Ze},action:"".concat(oe.a.API_SERVER,"/api/attachments.json"),onRemove:function(Be){ce.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",content:"\u662F\u5426\u786E\u8BA4\u5220\u9664?",onOk:function(){return ve(Be.response?Be.response.id:Be.uid)},onCancel:function(){return!1}})}};function Ge(Re){Re.file.status==="done"&&N(Re.file.originFileObj,function(Be){return W(Be)})}var Ie={showUploadList:!1,withCredentials:!0,action:"".concat(oe.a.API_SERVER,"/api/attachments.json"),onChange:Ge};return Object(M.useEffect)(function(){he.title&&(Ee.setFieldsValue(he),he.cover_id.length>0&&W(oe.a.IMG_SERVER+he.cover_id[0].url))},[he]),k.a.createElement(He.a,{form:Ee,initialValues:he,className:"moop-panel",onFinish:re},k.a.createElement(He.a.Item,{label:"\u6807\u9898",name:"title",extra:k.a.createElement("p",{className:"tip"},"\u7B80\u660E\u627C\u8981\u4ECB\u7ECD\u6587\u6863/\u89C6\u9891\u6240\u5305\u542B\u7684\u4E3B\u8981\u7684\u5185\u5BB9"),rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898"}]},k.a.createElement(J.a,{placeholder:"\u4F8B\u5982\uFF1A\u8F6F\u4EF6\u5DE5\u7A0B\u6559\u5B66\u6848\u4F8B"})),k.a.createElement("div",{className:"flex-container"},k.a.createElement(He.a.Item,{label:"\u4F5C\u8005",name:"author_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u540D\u79F0"}]},k.a.createElement(J.a,{placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D",style:{marginRight:20,width:200}})),k.a.createElement(He.a.Item,{name:"author_school_name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0"}]},k.a.createElement(J.a,{placeholder:"\u8BF7\u8F93\u5165\u4F5C\u8005\u5355\u4F4D\u540D\u79F0",style:{width:200}}))),k.a.createElement(He.a.Item,{name:"tag_ids",label:"\u6807\u7B7E",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4E00\u4E2A\u6807\u7B7E"}]},k.a.createElement(C,null,be.map(function(Re){return k.a.createElement(de.a,{key:Re.id,value:Re.id}," ",Re.name," ")}))),k.a.createElement(He.a.Item,{name:"publish",valuePropName:"checked"},k.a.createElement(de.a,null,"\u662F\u5426\u7533\u8BF7\u53D1\u5E03")),k.a.createElement(He.a.Item,{name:"content",label:"\u63CF\u8FF0",valuePropName:"defaultValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u63CF\u8FF0\u5185\u5BB9"}]},k.a.createElement(ie.a,{id:"moop_cases_content",height:400})),k.a.createElement(He.a.Item,{name:"attachment_ids",valuePropName:"fileList",getValueFromEvent:Te},k.a.createElement(I,Ne,k.a.createElement("p",{className:"c-blue",style:{marginBottom:10,fontSize:18}},"\u4E0A\u4F20\u9644\u4EF6"),k.a.createElement("p",{className:"c-grey-c"},"\u4ECE\u6211\u7684\u7535\u8111\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u6863\uFF1A\u6309\u4F4FCTRL\u53EF\u4EE5\u4E0A\u4F20\u591A\u4EFD\u6587\u6863\u3002\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\uFF1A100MB"))),k.a.createElement(He.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",extra:"\u4E0A\u4F20\u5C3A\u5BF8\uFF1A120*90 px",getValueFromEvent:Te,valuePropName:"fileList",rules:[{required:!0,message:"\u8BF7\u4E0A\u4F20\u5C01\u9762\u56FE"}]},k.a.createElement(Ae.a,Ie,b?k.a.createElement("img",{src:b,width:120}):k.a.createElement("a",{title:"\u4E0A\u4F20\u5C01\u9762\u56FE",className:"upload-cover"}," ",k.a.createElement(R.a,null)," "))),k.a.createElement("div",{className:"desc"},k.a.createElement("h3",null,"\u5BA1\u6838\u8BF4\u660E"),k.a.createElement("p",null," \u5E73\u53F0\u7BA1\u7406\u5458\u5C06\u5BF9\u6BCF\u5929\u65B0\u4E0A\u4F20\u7684\u6587\u6863\u8FDB\u884C\u5BA1\u6838\uFF0C\u5BA1\u6838\u901A\u8FC7\u7684\u6587\u6863\u5C06\u516C\u5F00\u663E\u793A\uFF0C\u5426\u5219\u5C06\u79C1\u6709\u5316\u6216\u79FB\u9664 ")),k.a.createElement("div",{className:"desc"},k.a.createElement("h3",null,"\u6E29\u99A8\u63D0\u793A"),k.a.createElement("ul",{style:{padding:0}},k.a.createElement("li",null,"1.\u8BF7\u52FF\u4E0A\u4F20\u5DF2\u8BBE\u7F6E\u52A0\u5BC6\u53E3\u4EE4\u7684\u6587\u6863\u8D44\u6E90\uFF1B"),k.a.createElement("li",null,"2.\u53EF\u4EE5\u4E0A\u4F20\u7B26\u5408\u6559\u5B66\u6848\u4F8B\u6807\u51C6\u7684\u6587\u6863\u8D44\u6599\uFF0C\u5982",k.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34799",target:"_blank"}," \u6848\u4F8B\u5165\u5E93\u6807\u51C6 ")," \u3001",k.a.createElement("a",{href:"https://www.educoder.net/courses/1309/boards/5909/messages/34798",target:"_blank"},"\u6848\u4F8B\u4F7F\u7528\u8BF4\u660E\u4E66"),"\u4EE5\u53CA\u5176\u4ED6\u8D44\u6599\u7B49\uFF0C\u4E0A\u4F20\u652F\u6301\u7684\u6587\u4EF6\u6700\u5927\u5BB9\u91CF\uFF1A100MB\uFF1B"),k.a.createElement("li",null,"3.\u8BF7\u786E\u4FDD\u4E0A\u4F20\u5185\u5BB9\u65E0\u4FB5\u6743\u6216\u8FDD\u53CD\u56FD\u5BB6\u5173\u4E8E\u4E92\u8054\u7F51\u653F\u7B56\u7684\u4E0D\u826F\u884C\u4E3A\uFF1B"),k.a.createElement("li",null,"4.\u8BF7\u4F7F\u7528Chrome\uFF0CFirefox\uFF0CSafari\uFF0CIE11\uFF08\u53CA\u4EE5\u4E0A\u7248\u672C\uFF09\u6D4F\u89C8\u5668\uFF1B"))),k.a.createElement(He.a.Item,{style:{marginTop:10}},k.a.createElement(U.a,{type:"primary",htmlType:"submit"},"\u63D0\u4EA4")))},A=x("wzkS"),p={loading:!1,data:{},tags:[]},d;(function($){$[$.GET_DATA=0]="GET_DATA",$[$.SET_LOADING=1]="SET_LOADING",$[$.GET_TAGS=2]="GET_TAGS"})(d||(d={}));function E($,xe){switch(xe.type){case d.GET_DATA:return Object(se.a)(Object(se.a)({},$),xe.payload);case d.GET_TAGS:return Object(se.a)(Object(se.a)({},$),{},{tags:xe.payload});case d.SET_LOADING:return Object(se.a)(Object(se.a)({},$),{},{loading:xe.payload});default:throw new Error}}var H=$e.default=function(){var $=Object(_.i)(),xe=$.caseId,Me=Object(_.g)(),be=Object(M.useReducer)(E,p),Ce=Object(ge.a)(be,2),he=Ce[0],ve=Ce[1],Q=he.loading,z=he.tags,b=he.data;Object(M.useEffect)(function(){function Ee(){return re.apply(this,arguments)}function re(){return re=Object(ne.a)(T.a.mark(function Te(){var Ne;return T.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:return Ie.next=2,Object(A.b)();case 2:Ne=Ie.sent,ve({type:d.GET_TAGS,payload:Ne.library_tags});case 4:case"end":return Ie.stop()}},Te)})),re.apply(this,arguments)}Ee()},[]),Object(M.useEffect)(function(){var Ee=!1;function re(){return Te.apply(this,arguments)}function Te(){return Te=Object(ne.a)(T.a.mark(function Ne(){var Ge,Ie,Re,Be,Ze,at,et,nt,pt;return T.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return ve({type:d.SET_LOADING,payload:!1}),it.next=3,Object(A.c)(xe);case 3:Ge=it.sent,Ie=Ge.author_name,Re=Ge.author_school_name,Be=Ge.content,Ze=Ge.cover,at=Ge.attachments,et=Ge.status,nt=Ge.title,pt=Ge.tags,Ee||(Ge.status===404?Me.push("/moop_cases"):ve({type:d.GET_DATA,payload:{data:{title:nt,author_name:Ie,author_school_name:Re,content:Be,tag_ids:pt.map(function(Le){return Le.id}),publish:et==="published",attachment_ids:at.map(function(Le){return{uid:Le.id,id:Le.id,name:Le.title,url:Le.url,filesize:Le.filesize,status:"done"}}),cover_id:Ze!=null&&Ze.id?[{uid:Ze==null?void 0:Ze.id,id:Ze==null?void 0:Ze.id,name:Ze==null?void 0:Ze.title,url:Ze==null?void 0:Ze.url,filesize:Ze==null?void 0:Ze.filesize,status:"done"}]:[]},loading:!1}}));case 6:case"end":return it.stop()}},Ne)})),Te.apply(this,arguments)}return!Ee&&xe&&re(),function(){Ee=!0}},[xe]);function W(Ee){return L.apply(this,arguments)}function L(){return L=Object(ne.a)(T.a.mark(function Ee(re){var Te,Ne;return T.a.wrap(function(Ie){for(;;)switch(Ie.prev=Ie.next){case 0:if(!xe){Ie.next=6;break}return Ie.next=3,Object(A.e)(xe,re);case 3:Me.push("/moop_cases/".concat(xe,"/publish-success")),Ie.next=11;break;case 6:return Ie.next=8,Object(A.a)(re);case 8:Te=Ie.sent,Ne=Te.id,Ne&&Me.push("/moop_cases/".concat(Ne,"/publish-success"));case 11:case"end":return Ie.stop()}},Ee)})),L.apply(this,arguments)}var ye={initialValues:b,tags:z,removeAttachment:A.d,callback:W};return k.a.createElement(ue.a,{spinning:Q,delay:500},k.a.createElement("div",{className:"moop-info"},k.a.createElement("div",{className:"crumb"},k.a.createElement(ee.a,{to:"/moop_cases"},"\u6559\u5B66\u6848\u4F8B > "),k.a.createElement("span",null,"\u65B0\u5EFA")),k.a.createElement("div",{className:"title"},k.a.createElement("h2",null,"\u4E0A\u4F20\u6559\u5B66\u6848\u4F8B"),k.a.createElement(ee.a,{to:"/moop_cases"},"\u8FD4\u56DE")),k.a.createElement(w,ye)))}},osHv:function(ot,$e,x){(function(F){F(x("VrN/"))})(function(F){"use strict";var ue=F.Pos;function ne(J,le){return J.line-le.line||J.ch-le.ch}var ge="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",se=ge+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",G=new RegExp("<(/?)(["+ge+"]["+se+"]*)","g");function T(J,le,ce,Ue){this.line=le,this.ch=ce,this.cm=J,this.text=J.getLine(le),this.min=Ue?Math.max(Ue.from,J.firstLine()):J.firstLine(),this.max=Ue?Math.min(Ue.to-1,J.lastLine()):J.lastLine()}function M(J,le){var ce=J.cm.getTokenTypeAt(ue(J.line,le));return ce&&/\btag\b/.test(ce)}function k(J){return J.line>=J.max?void 0:(J.ch=0,J.text=J.cm.getLine(++J.line),!0)}function D(J){return J.line<=J.min?void 0:(J.text=J.cm.getLine(--J.line),J.ch=J.text.length,!0)}function P(J){for(;;){var le=J.text.indexOf(">",J.ch);if(le==-1){if(k(J))continue;return}if(!M(J,le+1)){J.ch=le+1;continue}var ce=J.text.lastIndexOf("/",le),Ue=ce>-1&&!/\S/.test(J.text.slice(ce+1,le));return J.ch=le+1,Ue?"selfClose":"regular"}}function _(J){for(;;){var le=J.ch?J.text.lastIndexOf("<",J.ch-1):-1;if(le==-1){if(D(J))continue;return}if(!M(J,le+1)){J.ch=le;continue}G.lastIndex=le,J.ch=le;var ce=G.exec(J.text);if(ce&&ce.index==le)return ce}}function ee(J){for(;;){G.lastIndex=J.ch;var le=G.exec(J.text);if(!le){if(k(J))continue;return}if(!M(J,le.index+1)){J.ch=le.index+1;continue}return J.ch=le.index+le[0].length,le}}function Z(J){for(;;){var le=J.ch?J.text.lastIndexOf(">",J.ch-1):-1;if(le==-1){if(D(J))continue;return}if(!M(J,le+1)){J.ch=le;continue}var ce=J.text.lastIndexOf("/",le),Ue=ce>-1&&!/\S/.test(J.text.slice(ce+1,le));return J.ch=le+1,Ue?"selfClose":"regular"}}function U(J,le){for(var ce=[];;){var Ue=ee(J),Je,Se=J.line,De=J.ch-(Ue?Ue[0].length:0);if(!Ue||!(Je=P(J)))return;if(Je=="selfClose")continue;if(Ue[1]){for(var He=ce.length-1;He>=0;--He)if(ce[He]==Ue[2]){ce.length=He;break}if(He<0&&(!le||le==Ue[2]))return{tag:Ue[2],from:ue(Se,De),to:ue(J.line,J.ch)}}else ce.push(Ue[2])}}function X(J,le){for(var ce=[];;){var Ue=Z(J);if(!Ue)return;if(Ue=="selfClose"){_(J);continue}var Je=J.line,Se=J.ch,De=_(J);if(!De)return;if(De[1])ce.push(De[2]);else{for(var He=ce.length-1;He>=0;--He)if(ce[He]==De[2]){ce.length=He;break}if(He<0&&(!le||le==De[2]))return{tag:De[2],from:ue(J.line,J.ch),to:ue(Je,Se)}}}}F.registerHelper("fold","xml",function(J,le){for(var ce=new T(J,le.line,0);;){var Ue=ee(ce);if(!Ue||ce.line!=le.line)return;var Je=P(ce);if(!Je)return;if(!Ue[1]&&Je!="selfClose"){var Se=ue(ce.line,ce.ch),De=U(ce,Ue[2]);return De&&ne(De.from,Se)>0?{from:Se,to:De.from}:null}}}),F.findMatchingTag=function(J,le,ce){var Ue=new T(J,le.line,le.ch,ce);if(Ue.text.indexOf(">")==-1&&Ue.text.indexOf("<")==-1)return;var Je=P(Ue),Se=Je&&ue(Ue.line,Ue.ch),De=Je&&_(Ue);if(!Je||!De||ne(Ue,le)>0)return;var He={from:ue(Ue.line,Ue.ch),to:Se,tag:De[2]};return Je=="selfClose"?{open:He,close:null,at:"open"}:De[1]?{open:X(Ue,De[2]),close:He,at:"close"}:(Ue=new T(J,Se.line,Se.ch,ce),{open:He,close:U(Ue,De[2]),at:"open"})},F.findEnclosingTag=function(J,le,ce,Ue){for(var Je=new T(J,le.line,le.ch,ce);;){var Se=X(Je,Ue);if(!Se)break;var De=new T(J,le.line,le.ch,ce),He=U(De,Se.tag);if(He)return{open:Se,close:He}}},F.scanForClosingTag=function(J,le,ce,Ue){var Je=new T(J,le.line,le.ch,Ue?{from:0,to:Ue}:null);return U(Je,ce)}})},p5ED:function(ot,$e,x){"use strict";var F=x("+L6B"),ue=x("2/Rp"),ne=x("5Dmo"),ge=x("3S7+"),se=x("k1fw"),G=x("tJVT"),T=x("q1tI"),M=x.n(T),k=x("vHTk"),D=x.n(k),P=x("yEEn"),_=x("ZW9T"),ee=x("1vsH");$e.a=function(Z){var U=Z.name,X=Z.data,J=Z.theme,le=Z.type,ce=Z.filename,Ue=Z.monacoEditor,Je=Z.className,Se=Z.style,De=Z.close,He=Z.onClose,_e=Z.hasMask,Ae=Object(T.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),we=Object(G.a)(Ae,2),de=we[0],R=we[1],oe=Object(T.useState)(""),ie=Object(G.a)(oe,2),C=ie[0],I=ie[1],N=Object(T.useRef)();ce&&(Ue.filename=ce),Object(T.useEffect)(function(){var p,d,E=(p=document.cookie)===null||p===void 0||((d=p.replace(/\s/g,""))===null||d===void 0)?void 0:d.split(";");E==null||E.map(function(H){var $=H.split("=");$[0]==="_educoder_session"&&I($[1])})},[]);var w=function(){if(X.startsWith("http")||X.startsWith("/")){A();return}Object(ee.x)(ce||"educoder",X,ce)},A=function(){Object(ee.v)(ce||U,X)};return console.log("data:",X,"fileanme:",ce," name:",U),M.a.createElement("div",{style:Object(se.a)({},Se||{}),className:"".concat(_e&&D.a.bgBlack," ").concat(le?D.a.wrp:"hide")},De&&M.a.createElement("div",{className:D.a.close,ref:N},M.a.createElement(ge.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return N.current}},M.a.createElement("span",{onClick:A},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(ge.a,{title:"\u5173\u95ED",getPopupContainer:function(){return N.current}},M.a.createElement("span",{className:"",onClick:He},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(D.a[Je]," ").concat(Je," ").concat(D.a.monaco," ").concat(le==="txt"?"show":"hide")},le==="txt"&&M.a.createElement(_.b,Ue)),le==="audio"&&M.a.createElement("audio",{src:"".concat(X!=null&&X.startsWith("/")||(X==null?void 0:X.indexOf("https://"))>-1?X:"data:audio/mp3;base64,").concat(X),autoPlay:!0}),le==="video"&&M.a.createElement(M.a.Fragment,null,X!=null&&X.startsWith("/")?M.a.createElement("video",{controls:!0,src:"".concat(X),autoPlay:!0}):M.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(X),autoPlay:!0})),le==="html"&&M.a.createElement("iframe",{src:X+"&disposition=inline"}),le==="pdf"&&M.a.createElement("embed",{className:D.a.embed,src:X}),le==="image"&&M.a.createElement(M.a.Fragment,null,M.a.createElement("img",{src:"".concat(X!=null&&X.startsWith("/")||(X==null?void 0:X.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(X)})),le==="other"&&M.a.createElement("div",null,M.a.createElement(ue.a,{type:"primary",size:"large",onClick:w},M.a.createElement(P.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(le==="download"||le==="office")&&M.a.createElement(ue.a,{type:"primary",size:"large",onClick:w},M.a.createElement(P.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ot,$e,x){},"rAM+":function(ot,$e,x){"use strict";x.d($e,"a",function(){return ue});var F=x("Qw5x");function ue(ne,ge){var se;if(typeof Symbol=="undefined"||ne[Symbol.iterator]==null){if(Array.isArray(ne)||(se=Object(F.a)(ne))||ge&&ne&&typeof ne.length=="number"){se&&(ne=se);var G=0,T=function(){};return{s:T,n:function(){return G>=ne.length?{done:!0}:{done:!1,value:ne[G++]}},e:function(_){throw _},f:T}}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 M=!0,k=!1,D;return{s:function(){se=ne[Symbol.iterator]()},n:function(){var _=se.next();return M=_.done,_},e:function(_){k=!0,D=_},f:function(){try{!M&&se.return!=null&&se.return()}finally{if(k)throw D}}}}},rUJ1:function(ot,$e){const x=/[&<>"']/,F=/[&<>"']/g,ue=/[<>"']|&(?!#?\w+;)/,ne=/[<>"']|&(?!#?\w+;)/g,ge={"&":"&","<":"<",">":">",'"':""","'":"'"},se=_e=>ge[_e];function G(_e,Ae){if(Ae){if(x.test(_e))return _e.replace(F,se)}else if(ue.test(_e))return _e.replace(ne,se);return _e}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(_e){return _e.replace(T,(Ae,we)=>(we=we.toLowerCase(),we==="colon"?":":we.charAt(0)==="#"?we.charAt(1)==="x"?String.fromCharCode(parseInt(we.substring(2),16)):String.fromCharCode(+we.substring(1)):""))}const k=/(^|[^\[])\^/g;function D(_e,Ae){_e=_e.source||_e,Ae=Ae||"";const we={replace:(de,R)=>(R=R.source||R,R=R.replace(k,"$1"),_e=_e.replace(de,R),we),getRegex:()=>new RegExp(_e,Ae)};return we}const P=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ee(_e,Ae,we){if(_e){let de;try{de=decodeURIComponent(M(we)).replace(P,"").toLowerCase()}catch(R){return null}if(de.indexOf("javascript:")===0||de.indexOf("vbscript:")===0||de.indexOf("data:")===0)return null}Ae&&!_.test(we)&&(we=le(Ae,we));try{we=encodeURI(we).replace(/%25/g,"%")}catch(de){return null}return we}const Z={},U=/^[^:]+:\/*[^/]*$/,X=/^([^:]+:)[\s\S]*$/,J=/^([^:]+:\/*[^/]*)[\s\S]*$/;function le(_e,Ae){Z[" "+_e]||(U.test(_e)?Z[" "+_e]=_e+"/":Z[" "+_e]=Se(_e,"/",!0)),_e=Z[" "+_e];const we=_e.indexOf(":")===-1;return Ae.substring(0,2)==="//"?we?Ae:_e.replace(X,"$1")+Ae:Ae.charAt(0)==="/"?we?Ae:_e.replace(J,"$1")+Ae:_e+Ae}const ce={exec:function(){}};function Ue(_e){let Ae=1,we,de;for(;Ae<arguments.length;Ae++){we=arguments[Ae];for(de in we)Object.prototype.hasOwnProperty.call(we,de)&&(_e[de]=we[de])}return _e}function Je(_e,Ae){const we=_e.replace(/\|/g,(oe,ie,C)=>{let I=!1,N=ie;for(;--N>=0&&C[N]==="\\";)I=!I;return I?"|":" |"}),de=we.split(/ \|/);let R=0;if(de.length>Ae)de.splice(Ae);else for(;de.length<Ae;)de.push("");for(;R<de.length;R++)de[R]=de[R].trim().replace(/\\\|/g,"|");return de}function Se(_e,Ae,we){const de=_e.length;if(de===0)return"";let R=0;for(;R<de;){const oe=_e.charAt(de-R-1);if(oe===Ae&&!we)R++;else if(oe!==Ae&&we)R++;else break}return _e.substr(0,de-R)}function De(_e,Ae){if(_e.indexOf(Ae[1])===-1)return-1;const we=_e.length;let de=0,R=0;for(;R<we;R++)if(_e[R]==="\\")R++;else if(_e[R]===Ae[0])de++;else if(_e[R]===Ae[1]&&(de--,de<0))return R;return-1}function He(_e){_e&&_e.sanitize&&!_e.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")}ot.exports={escape:G,unescape:M,edit:D,cleanUrl:ee,resolveUrl:le,noopTest:ce,merge:Ue,splitCells:Je,rtrim:Se,findClosingBracket:De,checkSanitizeDeprecation:He}},rcnY:function(ot,$e,x){var F=x("aRTE");function ue(ne,ge){this.totalCount=ne,this.dataCount=ge}ue.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]],ue.getRSBlocks=function(ne,ge){var se=ue.getRsBlockTable(ne,ge);if(se==null)throw new Error("bad rs block @ typeNumber:"+ne+"/errorCorrectLevel:"+ge);for(var G=se.length/3,T=new Array,M=0;M<G;M++)for(var k=se[M*3+0],D=se[M*3+1],P=se[M*3+2],_=0;_<k;_++)T.push(new ue(D,P));return T},ue.getRsBlockTable=function(ne,ge){switch(ge){case F.L:return ue.RS_BLOCK_TABLE[(ne-1)*4+0];case F.M:return ue.RS_BLOCK_TABLE[(ne-1)*4+1];case F.Q:return ue.RS_BLOCK_TABLE[(ne-1)*4+2];case F.H:return ue.RS_BLOCK_TABLE[(ne-1)*4+3];default:return}},ot.exports=ue},vHTk:function(ot,$e,x){ot.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(ot,$e){function x(){this.buffer=new Array,this.length=0}x.prototype={get:function(F){var ue=Math.floor(F/8);return(this.buffer[ue]>>>7-F%8&1)==1},put:function(F,ue){for(var ne=0;ne<ue;ne++)this.putBit((F>>>ue-ne-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(F){var ue=Math.floor(this.length/8);this.buffer.length<=ue&&this.buffer.push(0),F&&(this.buffer[ue]|=128>>>this.length%8),this.length++}},ot.exports=x},wzkS:function(ot,$e,x){"use strict";x.d($e,"c",function(){return se}),x.d($e,"b",function(){return G}),x.d($e,"d",function(){return T}),x.d($e,"a",function(){return k}),x.d($e,"e",function(){return D});var F=x("9og8"),ue=x("WmNS"),ne=x.n(ue),ge=x("ErOA");function se(P){return Object(ge.c)("libraries/".concat(P,".json"))}function G(){return Object(ge.c)("library_tags.json")}function T(P){return M.apply(this,arguments)}function M(){return M=Object(F.a)(ne.a.mark(function P(_){var ee;return ne.a.wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,Object(ge.b)("attachments/".concat(_,".json"));case 2:return ee=U.sent,U.abrupt("return",ee.status===0);case 4:case"end":return U.stop()}},P)})),M.apply(this,arguments)}function k(P){return Object(ge.f)("libraries.json",P)}function D(P,_){return Object(ge.g)("libraries/".concat(P,".json"),_)}}}]);
|