You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__HttpStatus__HpcCourse.30...

350 lines
612 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[155,6,7,17],{"+NIl":function(ot,Qe,k){(function(U){U(k("VrN/"))})(function(U){"use strict";U.defineMode("stex",function(se,ie){"use strict";function xe($,H){$.cmdState.push(H)}function fe($){return $.cmdState.length>0?$.cmdState[$.cmdState.length-1]:null}function z($){var H=$.cmdState.pop();H&&H.closeBracket()}function T($){for(var H=$.cmdState,X=H.length-1;X>=0;X--){var J=H[X];if(J.name=="DEFAULT")continue;return J}return{styleIdentifier:function(){return null}}}function M($,H,X){return function(){this.name=$,this.bracketNo=0,this.style=H,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 j={};j.importmodule=M("importmodule","tag",["string","builtin"]),j.documentclass=M("documentclass","tag",["","atom"]),j.usepackage=M("usepackage","tag",["atom"]),j.begin=M("begin","tag",["atom"]),j.end=M("end","tag",["atom"]),j.label=M("label","tag",["atom"]),j.ref=M("ref","tag",["atom"]),j.eqref=M("eqref","tag",["atom"]),j.cite=M("cite","tag",["atom"]),j.bibitem=M("bibitem","tag",["atom"]),j.Bibitem=M("Bibitem","tag",["atom"]),j.RBibitem=M("RBibitem","tag",["atom"]),j.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L($,H){$.f=H}function _($,H){var X;if($.match(/^\\[a-zA-Z@]+/)){var J=$.current().slice(1);return X=j.hasOwnProperty(J)?j[J]:j.DEFAULT,X=new X,xe(H,X),L(H,te),X.style}if($.match(/^\\[$&%#{}_]/))return"tag";if($.match(/^\\[,;!\/\\]/))return"tag";if($.match("\\["))return L(H,function(de,Be){return E(de,Be,"\\]")}),"keyword";if($.match("\\("))return L(H,function(de,Be){return E(de,Be,"\\)")}),"keyword";if($.match("$$"))return L(H,function(de,Be){return E(de,Be,"$$")}),"keyword";if($.match("$"))return L(H,function(de,Be){return E(de,Be,"$")}),"keyword";var ae=$.next();if(ae=="%")return $.skipToEnd(),"comment";if(ae=="}"||ae=="]"){if(X=fe(H),X)X.closeBracket(ae),L(H,te);else return"error";return"bracket"}else return ae=="{"||ae=="["?(X=j.DEFAULT,X=new X,xe(H,X),"bracket"):/\d/.test(ae)?($.eatWhile(/[\w.%]/),"atom"):($.eatWhile(/[\w\-_]/),X=T(H),X.name=="begin"&&(X.argument=$.current()),X.styleIdentifier())}function E($,H,X){if($.eatSpace())return null;if(X&&$.match(X))return L(H,_),"keyword";if($.match(/^\\[a-zA-Z@]+/))return"tag";if($.match(/^[a-zA-Z]+/))return"variable-2";if($.match(/^\\[$&%#{}_]/))return"tag";if($.match(/^\\[,;!\/]/))return"tag";if($.match(/^[\^_&]/))return"tag";if($.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if($.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var J=$.next();return J=="{"||J=="}"||J=="["||J=="]"||J=="("||J==")"?"bracket":J=="%"?($.skipToEnd(),"comment"):"error"}function te($,H){var X=$.peek(),J;return X=="{"||X=="["?(J=fe(H),J.openBracket(X),$.eat(X),L(H,_),"bracket"):/[ \t\r]/.test(X)?($.eat(X),null):(L(H,_),z(H),_($,H))}return{startState:function(){var $=ie.inMathMode?function(H,X){return E(H,X)}:_;return{cmdState:[],f:$}},copyState:function($){return{cmdState:$.cmdState.slice(),f:$.f}},token:function($,H){return H.f($,H)},blankLine:function($){$.f=_,$.cmdState.length=0},lineComment:"%"}}),U.defineMIME("text/x-stex","stex"),U.defineMIME("text/x-latex","stex")})},"19Vz":function(ot,Qe,k){(function(U){U(k("VrN/"))})(function(U){U.defineOption("placeholder","",function(M,j,L){var _=L&&L!=U.Init;if(j&&!_)M.on("blur",fe),M.on("change",z),M.on("swapDoc",z),U.on(M.getInputField(),"compositionupdate",M.state.placeholderCompose=function(){xe(M)}),z(M);else if(!j&&_){M.off("blur",fe),M.off("change",z),M.off("swapDoc",z),U.off(M.getInputField(),"compositionupdate",M.state.placeholderCompose),se(M);var E=M.getWrapperElement();E.className=E.className.replace(" CodeMirror-empty","")}j&&!M.hasFocus()&&fe(M)});function se(M){M.state.placeholder&&(M.state.placeholder.parentNode.removeChild(M.state.placeholder),M.state.placeholder=null)}function ie(M){se(M);var j=M.state.placeholder=document.createElement("pre");j.style.cssText="height: 0; overflow: visible",j.style.direction=M.getOption("direction"),j.className="CodeMirror-placeholder CodeMirror-line-like";var L=M.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),j.appendChild(L),M.display.lineSpace.insertBefore(j,M.display.lineSpace.firstChild)}function xe(M){setTimeout(function(){var j=!1,L=M.getInputField();L.nodeName=="TEXTAREA"?j=!L.value:M.lineCount()==1&&(j=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),j?ie(M):se(M)},20)}function fe(M){T(M)&&ie(M)}function z(M){var j=M.getWrapperElement(),L=T(M);j.className=j.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?ie(M):se(M)}function T(M){return M.lineCount()===1&&M.getLine(0)===""}})},"1eCo":function(ot,Qe,k){(function(U){U(k("VrN/"))})(function(U){"use strict";var se={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},ie={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};U.defineMode("xml",function(xe,fe){var z=xe.indentUnit,T={},M=fe.htmlMode?se:ie;for(var j in M)T[j]=M[j];for(var j in fe)T[j]=fe[j];var L,_;function E(O,ce){function ne(P){return ce.tokenize=P,P(O,ce)}var w=O.next();if(w=="<")return O.eat("!")?O.eat("[")?O.match("CDATA[")?ne(H("atom","]]>")):null:O.match("--")?ne(H("comment","-->")):O.match("DOCTYPE",!0,!0)?(O.eatWhile(/[\w\._\-]/),ne(X(1))):null:O.eat("?")?(O.eatWhile(/[\w\._\-]/),ce.tokenize=H("meta","?>"),"meta"):(L=O.eat("/")?"closeTag":"openTag",ce.tokenize=te,"tag bracket");if(w=="&"){var B;return O.eat("#")?O.eat("x")?B=O.eatWhile(/[a-fA-F\d]/)&&O.eat(";"):B=O.eatWhile(/[\d]/)&&O.eat(";"):B=O.eatWhile(/[\w\.\-:]/)&&O.eat(";"),B?"atom":"error"}else return O.eatWhile(/[^&<]/),null}E.isInText=!0;function te(O,ce){var ne=O.next();if(ne==">"||ne=="/"&&O.eat(">"))return ce.tokenize=E,L=ne==">"?"endTag":"selfcloseTag","tag bracket";if(ne=="=")return L="equals",null;if(ne=="<"){ce.tokenize=E,ce.state=Be,ce.tagName=ce.tagStart=null;var w=ce.tokenize(O,ce);return w?w+" tag error":"tag error"}else return/[\'\"]/.test(ne)?(ce.tokenize=$(ne),ce.stringStartCol=O.column(),ce.tokenize(O,ce)):(O.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function $(O){var ce=function(ne,w){for(;!ne.eol();)if(ne.next()==O){w.tokenize=te;break}return"string"};return ce.isInAttribute=!0,ce}function H(O,ce){return function(ne,w){for(;!ne.eol();){if(ne.match(ce)){w.tokenize=E;break}ne.next()}return O}}function X(O){return function(ce,ne){for(var w;(w=ce.next())!=null;){if(w=="<")return ne.tokenize=X(O+1),ne.tokenize(ce,ne);if(w==">")if(O==1){ne.tokenize=E;break}else return ne.tokenize=X(O-1),ne.tokenize(ce,ne)}return"meta"}}function J(O,ce,ne){this.prev=O.context,this.tagName=ce,this.indent=O.indented,this.startOfLine=ne,(T.doNotIndent.hasOwnProperty(ce)||O.context&&O.context.noIndent)&&(this.noIndent=!0)}function ae(O){O.context&&(O.context=O.context.prev)}function de(O,ce){for(var ne;;){if(!O.context)return;if(ne=O.context.tagName,!T.contextGrabbers.hasOwnProperty(ne)||!T.contextGrabbers[ne].hasOwnProperty(ce))return;ae(O)}}function Be(O,ce,ne){return O=="openTag"?(ne.tagStart=ce.column(),$e):O=="closeTag"?Se:Be}function $e(O,ce,ne){return O=="word"?(ne.tagName=ce.current(),_="tag",ke):T.allowMissingTagName&&O=="endTag"?(_="tag bracket",ke(O,ce,ne)):(_="error",$e)}function Se(O,ce,ne){if(O=="word"){var w=ce.current();return ne.context&&ne.context.tagName!=w&&T.implicitlyClosed.hasOwnProperty(ne.context.tagName)&&ae(ne),ne.context&&ne.context.tagName==w||T.matchClosing===!1?(_="tag",De):(_="tag error",Ve)}else return T.allowMissingTagName&&O=="endTag"?(_="tag bracket",De(O,ce,ne)):(_="error",Ve)}function De(O,ce,ne){return O!="endTag"?(_="error",De):(ae(ne),Be)}function Ve(O,ce,ne){return _="error",De(O,ce,ne)}function ke(O,ce,ne){if(O=="word")return _="attribute",Te;if(O=="endTag"||O=="selfcloseTag"){var w=ne.tagName,B=ne.tagStart;return ne.tagName=ne.tagStart=null,O=="selfcloseTag"||T.autoSelfClosers.hasOwnProperty(w)?de(ne,w):(de(ne,w),ne.context=new J(ne,w,B==ne.indented)),Be}return _="error",ke}function Te(O,ce,ne){return O=="equals"?Ne:(T.allowMissing||(_="error"),ke(O,ce,ne))}function Ne(O,ce,ne){return O=="string"?be:O=="word"&&T.allowUnquoted?(_="string",ke):(_="error",ke(O,ce,ne))}function be(O,ce,ne){return O=="string"?be:ke(O,ce,ne)}return{startState:function(O){var ce={tokenize:E,state:Be,indented:O||0,tagName:null,tagStart:null,context:null};return O!=null&&(ce.baseIndent=O),ce},token:function(O,ce){if(!ce.tagName&&O.sol()&&(ce.indented=O.indentation()),O.eatSpace())return null;L=null;var ne=ce.tokenize(O,ce);return(ne||L)&&ne!="comment"&&(_=null,ce.state=ce.state(L||ne,O,ce),_&&(ne=_=="error"?ne+" error":_)),ne},indent:function(O,ce,ne){var w=O.context;if(O.tokenize.isInAttribute)return O.tagStart==O.indented?O.stringStartCol+1:O.indented+z;if(w&&w.noIndent)return U.Pass;if(O.tokenize!=te&&O.tokenize!=E)return ne?ne.match(/^(\s*)/)[0].length:0;if(O.tagName)return T.multilineTagIndentPastTag!==!1?O.tagStart+O.tagName.length+2:O.tagStart+z*(T.multilineTagIndentFactor||1);if(T.alignCDATA&&/<!\[CDATA\[/.test(ce))return 0;var B=ce&&/^<(\/)?([\w_:\.-]*)/.exec(ce);if(B&&B[1])for(;w;)if(w.tagName==B[2]){w=w.prev;break}else if(T.implicitlyClosed.hasOwnProperty(w.tagName))w=w.prev;else break;else if(B)for(;w;){var P=T.contextGrabbers[w.tagName];if(P&&P.hasOwnProperty(B[2]))w=w.prev;else break}for(;w&&w.prev&&!w.startOfLine;)w=w.prev;return w?w.indent+z:O.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:T.htmlMode?"html":"xml",helperType:T.htmlMode?"html":"xml",skipAttribute:function(O){O.state==Ne&&(O.state=ke)},xmlCurrentTag:function(O){return O.tagName?{name:O.tagName,close:O.type=="closeTag"}:null},xmlCurrentContext:function(O){for(var ce=[],ne=O.context;ne;ne=ne.prev)ne.tagName&&ce.push(ne.tagName);return ce.reverse()}}}),U.defineMIME("text/xml","xml"),U.defineMIME("application/xml","xml"),U.mimeModes.hasOwnProperty("text/html")||U.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(ot,Qe,k){"use strict";var U=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),se=new Uint8Array(16);function ie(){if(!U)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return U(se)}var xe=/^(?:[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 fe(te){return typeof te=="string"&&xe.test(te)}for(var z=fe,T=[],M=0;M<256;++M)T.push((M+256).toString(16).substr(1));function j(te){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,H=(T[te[$+0]]+T[te[$+1]]+T[te[$+2]]+T[te[$+3]]+"-"+T[te[$+4]]+T[te[$+5]]+"-"+T[te[$+6]]+T[te[$+7]]+"-"+T[te[$+8]]+T[te[$+9]]+"-"+T[te[$+10]]+T[te[$+11]]+T[te[$+12]]+T[te[$+13]]+T[te[$+14]]+T[te[$+15]]).toLowerCase();if(!z(H))throw TypeError("Stringified UUID is invalid");return H}var L=j;function _(te,$,H){te=te||{};var X=te.random||(te.rng||ie)();if(X[6]=X[6]&15|64,X[8]=X[8]&63|128,$){H=H||0;for(var J=0;J<16;++J)$[H+J]=X[J];return $}return L(X)}var E=Qe.a=_},"7ahc":function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return $e});var U=k("k1fw"),se=k("0Owb"),ie=k("+L6B"),xe=k("2/Rp"),fe=k("y8nQ"),z=k("Vl3Y"),T=k("tJVT"),M=k("OaEy"),j=k("2fM7"),L=k("q1tI"),_=k.n(L),E=k("VrN/"),te=k.n(E),$=k("p77/"),H=k.n($),X=k("c5Ni"),J=k.n(X),ae=j.a.Option,de={labelCol:{span:4},wrapperCol:{span:20}},Be={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"]};Qe.b=function(Se){var De=Se.callback,Ve=Se.onCancel,ke=Object(L.useState)("python"),Te=Object(T.a)(ke,2),Ne=Te[0],be=Te[1];function O(ne){be(Be[ne][1])}function ce(ne){De(ne)}return _.a.createElement(z.a,Object(se.a)({},de,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ce}),_.a.createElement(z.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},_.a.createElement(j.a,{onChange:O},Object.keys(Be).map(function(ne){return _.a.createElement(ae,{key:ne,value:ne},Be[ne][0])}))),_.a.createElement(z.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},_.a.createElement($e,{mode:Ne})),_.a.createElement("div",{className:"flex-container flex-end"},_.a.createElement(xe.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),_.a.createElement(xe.a,{type:"ghost",onClick:Ve},"\u53D6\u6D88")))};function $e(Se){var De=Se.value,Ve=Se.onChange,ke=Se.mode,Te=Se.options,Ne=Te===void 0?{}:Te,be=Object(L.useRef)(),O=Object(L.useState)(),ce=Object(T.a)(O,2),ne=ce[0],w=ce[1];return Object(L.useEffect)(function(){if(ne){function B(P){var S=P.getValue();Ve&&Ve(S)}return ne.on("change",B),function(){ne.off("change",B)}}},[ne,Ve]),Object(L.useEffect)(function(){ne&&ne.setOption("mode",ke)},[ne,ke]),Object(L.useEffect)(function(){ne&&((De!==ne.getValue()||De==="")&&setTimeout(function(){ne.setValue(De||" ")},300))},[ne,De]),Object(L.useEffect)(function(){if(be.current&&!ne){var B=te.a.fromTextArea(be.current,Object(U.a)({mode:ke,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Ne));w(B)}},[be.current,ne]),_.a.createElement("div",{className:"my-codemirror-container"},_.a.createElement("textarea",{ref:be}))}},"7ixt":function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return ie});var U={adjustX:1,adjustY:1},se=[0,0],ie={left:{points:["cr","cl"],overflow:U,offset:[-4,0],targetOffset:se},right:{points:["cl","cr"],overflow:U,offset:[4,0],targetOffset:se},top:{points:["bc","tc"],overflow:U,offset:[0,-4],targetOffset:se},bottom:{points:["tc","bc"],overflow:U,offset:[0,4],targetOffset:se},topLeft:{points:["bl","tl"],overflow:U,offset:[0,-4],targetOffset:se},leftTop:{points:["tr","tl"],overflow:U,offset:[-4,0],targetOffset:se},topRight:{points:["br","tr"],overflow:U,offset:[0,-4],targetOffset:se},rightTop:{points:["tl","tr"],overflow:U,offset:[4,0],targetOffset:se},bottomRight:{points:["tr","br"],overflow:U,offset:[0,4],targetOffset:se},rightBottom:{points:["bl","br"],overflow:U,offset:[4,0],targetOffset:se},bottomLeft:{points:["tl","bl"],overflow:U,offset:[0,4],targetOffset:se},leftBottom:{points:["br","bl"],overflow:U,offset:[-4,0],targetOffset:se}},xe=ie},"8EBN":function(ot,Qe,k){(function(U){U(k("VrN/"))})(function(U){"use strict";U.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 se=0;se<U.modeInfo.length;se++){var ie=U.modeInfo[se];ie.mimes&&(ie.mime=ie.mimes[0])}U.findModeByMIME=function(xe){xe=xe.toLowerCase();for(var fe=0;fe<U.modeInfo.length;fe++){var z=U.modeInfo[fe];if(z.mime==xe)return z;if(z.mimes){for(var T=0;T<z.mimes.length;T++)if(z.mimes[T]==xe)return z}}if(/\+xml$/.test(xe))return U.findModeByMIME("application/xml");if(/\+json$/.test(xe))return U.findModeByMIME("application/json")},U.findModeByExtension=function(xe){xe=xe.toLowerCase();for(var fe=0;fe<U.modeInfo.length;fe++){var z=U.modeInfo[fe];if(z.ext){for(var T=0;T<z.ext.length;T++)if(z.ext[T]==xe)return z}}},U.findModeByFileName=function(xe){for(var fe=0;fe<U.modeInfo.length;fe++){var z=U.modeInfo[fe];if(z.file&&z.file.test(xe))return z}var T=xe.lastIndexOf("."),M=T>-1&&xe.substring(T+1,xe.length);if(M)return U.findModeByExtension(M)},U.findModeByName=function(xe){xe=xe.toLowerCase();for(var fe=0;fe<U.modeInfo.length;fe++){var z=U.modeInfo[fe];if(z.name.toLowerCase()==xe)return z;if(z.alias){for(var T=0;T<z.alias.length;T++)if(z.alias[T].toLowerCase()==xe)return z}}}})},"8hTe":function(ot,Qe,k){ot.exports={button:"button___1wy9m"}},"9Bee":function(ot,Qe,k){"use strict";var U=k("DYRE"),se=k("zeV3"),ie=k("+L6B"),xe=k("2/Rp"),fe=k("k1fw"),z=k("9og8"),T=k("tJVT"),M=k("WmNS"),j=k.n(M),L=k("q1tI"),_=k.n(L),E=k("vg9a"),te=k("DlQD"),$=k.n(te),H=k("rUJ1");function X(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(m){var h=m.match(/^\s+/);if(h===null)return m;var K=Object(T.a)(h,1),Pe=K[0];return Pe.length>=u.length?m.slice(u.length):m}).join(`
`)}var J=[],ae=["<ul>"],de=new $.a.Renderer,Be=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function $e(){J.length=0,ae=["<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 m=c[o];u.push("<li><a href='#"+m.anchor+"'>"+m.text+"</a>"),o++;var h=[];return o=De(c,o,m.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 Ve(){return De(J,0,0,ae),ae.push("</ul>"),ae.join("")}var ke={heading:function(o){var a=Be.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],m=X(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var K=be(),Pe=m;m=K,O[K]={type:"block",expression:Pe}}return{type:"code",raw:u,lang:h,text:m}}}},Te=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Ne=0,be=function(){return"__special_katext_id_".concat(Ne++,"__")},O={};function ce(){return O}function ne(){Ne=0,O={}}function w(c){return c=c.replace(Te,function(o,a){var u=be();return O[u]={type:"inline",expression:a},u}),c}var B=de.listitem;de.listitem=function(c){return B(w(c))};var P=de.paragraph;de.paragraph=function(c){return P(w(c))};var S=de.tablecell;de.tablecell=function(c,o){return S(w(c),o)},de.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(H.escape)(c,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(H.escape)(c,!0))+"</code></pre>"},de.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+">"},$.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),$.a.use({tokenizer:ke,renderer:de});var D=$.a,p=k("SJMd"),d=k("ulZh"),C=k.n(d),F=k("m3rI"),Q=k("Oy/b"),Ce=k("p5ED"),Oe=k("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 me=function(c,o){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var m in u)Object.prototype.hasOwnProperty.call(u,m)&&(a[m]=u[m])})(c,o)};function ve(c,o){function a(){this.constructor=c}me(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ge(c,o,a,u){return new(a||(a=Promise))(function(m,h){function K(ht){try{pe(u.next(ht))}catch(je){h(je)}}function Pe(ht){try{pe(u.throw(ht))}catch(je){h(je)}}function pe(ht){var je;ht.done?m(ht.value):(je=ht.value,je instanceof a?je:new a(function(Et){Et(je)})).then(K,Pe)}pe((u=u.apply(c,o||[])).next())})}function ue(c,o){var a,u,m,h,K={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return h={next:Pe(0),throw:Pe(1),return:Pe(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function Pe(pe){return function(ht){return function(je){if(a)throw new TypeError("Generator is already executing.");for(;K;)try{if(a=1,u&&(m=2&je[0]?u.return:je[0]?u.throw||((m=u.return)&&m.call(u),0):u.next)&&!(m=m.call(u,je[1])).done)return m;switch(u=0,m&&(je=[2&je[0],m.value]),je[0]){case 0:case 1:m=je;break;case 4:return K.label++,{value:je[1],done:!1};case 5:K.label++,u=je[1],je=[0];continue;case 7:je=K.ops.pop(),K.trys.pop();continue;default:if(!(m=K.trys,(m=m.length>0&&m[m.length-1])||je[0]!==6&&je[0]!==2)){K=0;continue}if(je[0]===3&&(!m||je[1]>m[0]&&je[1]<m[3])){K.label=je[1];break}if(je[0]===6&&K.label<m[1]){K.label=m[1],m=je;break}if(m&&K.label<m[2]){K.label=m[2],K.ops.push(je);break}m[2]&&K.ops.pop(),K.trys.pop();continue}je=o.call(c,K)}catch(Et){je=[6,Et],u=0}finally{a=m=0}if(5&je[0])throw je[1];return{value:je[0]?je[1]:void 0,done:!0}}([pe,ht])}}}function q(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),m=0;for(o=0;o<a;o++)for(var h=arguments[o],K=0,Pe=h.length;K<Pe;K++,m++)u[m]=h[K];return u}var W=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,m=a;u<m.length;u++){var h=m[u],K=h[0],Pe=h[1];o.setAttribute(K,Pe)}},c.createRect=function(o,a,u){var m=document.createElementNS("http://www.w3.org/2000/svg","rect");return m.setAttribute("width",o.toString()),m.setAttribute("height",a.toString()),u&&c.setAttributes(m,u),m},c.createLine=function(o,a,u,m,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",m.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 m=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return m.setAttribute("cx",(o/2).toString()),m.setAttribute("cy",(a/2).toString()),m.setAttribute("rx",(o/2).toString()),m.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(m,u),m},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,m,h,K,Pe){var pe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(pe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",m.toString()],["refX",h.toString()],["refY",K.toString()]]),pe.appendChild(Pe),pe},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}(),V=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var m=this;return new Promise(function(h){var K=u!==void 0?u:document.createElement("canvas");o===null&&(m.markersOnly=!0,m.naturalSize=!1);var Pe=document.createElementNS("http://www.w3.org/2000/svg","svg");Pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Pe.setAttribute("width",a.width.baseVal.valueAsString),Pe.setAttribute("height",a.height.baseVal.valueAsString),Pe.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Pe.innerHTML=a.innerHTML,m.naturalSize===!0?(Pe.width.baseVal.value=o.naturalWidth,Pe.height.baseVal.value=o.naturalHeight):m.width!==void 0&&m.height!==void 0&&(Pe.width.baseVal.value=m.width,Pe.height.baseVal.value=m.height),K.width=Pe.width.baseVal.value,K.height=Pe.height.baseVal.value;var pe=Pe.outerHTML,ht=K.getContext("2d");m.markersOnly!==!0&&ht.drawImage(o,0,0,K.width,K.height);var je=window.URL,Et=new Image(K.width,K.height);Et.setAttribute("crossOrigin","anonymous");var It=new Blob([pe],{type:"image/svg+xml"}),zt=je.createObjectURL(It);Et.onload=function(){ht.drawImage(Et,0,0),je.revokeObjectURL(zt);var Fn=K.toDataURL(m.imageType,m.imageQuality);h(Fn)},Et.src=zt})},c}(),R=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},Le=function(){function c(o,a,u,m,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=m,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 m=document.createElement("div");m.className=this.toolbarBlockStyleClass.name,m.style.whiteSpace="nowrap",m.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(m),this.addActionButton(m,'<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(m,'<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 m=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){m.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}(),Ue=function(){function c(o,a,u,m){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=m,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,m=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=m.uiStyleSettings;var Pe=document.createElement("div");Pe.className=m.toolboxButtonStyleClass.name+" "+((K=m.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&K!==void 0?K:m.toolboxButtonStyleColorsClass.name),Pe.innerHTML=h.icon,Pe.title=h.title,Pe.addEventListener("click",function(){m.panelButtonClick(h)}),m.panelButtons.push(Pe),m.buttonRow.appendChild(Pe)}),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 m=o.getUi();m.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(m),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 Pe,pe;h.className=a.toolboxButtonStyleClass.name+" "+(K===u?""+((Pe=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:a.toolboxActiveButtonStyleColorsClass.name):""+((pe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&pe!==void 0?pe:a.toolboxButtonStyleColorsClass.name))})},c}(),Ke=function(c,o){this.title=c,this.icon=o},Fe=function(c){function o(a,u,m,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=m,K.setCurrentColor=K.setCurrentColor.bind(K),K.getColorBox=K.getColorBox.bind(K),K}return ve(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(m){var h=a.getColorBox(m);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,m=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-m,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 Pe=document.createElement("div");return Pe.style.display="inline-block",Pe.style.width=h-2+"px",Pe.style.height=h-2+"px",Pe.style.backgroundColor=a,Pe.style.borderRadius=h/2+"px",a==="transparent"&&(Pe.style.fill=this.uiStyleSettings.toolboxAccentColor,Pe.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(Pe),K},o.prototype.setCurrentColor=function(a,u){var m=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Ke),Ie=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}(),Xe=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}(),mt=function(){function c(){this.GRIP_SIZE=10,this.visual=W.createGroup(),this.visual.appendChild(W.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(W.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}(),tt=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}(),it=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||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(W.createTransform()),h.setupControlBox(),h}return ve(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=W.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 m=this.unrotatePoint(a);if(this.manipulationStartX=m.x,this.manipulationStartY=m.y,this.offsetX=m.x-this.left,this.offsetY=m.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,m=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,m=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:m=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}m>=0?(this.left=u,this.width=m):(this.left=u+m,this.width=-m),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(),m=W.createPoint(a.x,a.y);return{x:(m=m.matrixTransform(u)).x,y:m.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var m=W.createPoint(a.x,a.y);return{x:(m=m.matrixTransform(u)).x,y:m.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=W.createGroup();var a=W.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=W.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=W.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 Xe,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 mt;return a.visual.transform.baseVal.appendItem(W.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,m=u,h=(this.width+this.CB_DISTANCE)/2-a/2,K=(this.height+this.CB_DISTANCE)/2-a/2,Pe=this.height+this.CB_DISTANCE-a/2,pe=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,m),this.positionGrip(this.controlGrips.topCenter.visual,h,m),this.positionGrip(this.controlGrips.topRight.visual,pe,m),this.positionGrip(this.controlGrips.centerLeft.visual,u,K),this.positionGrip(this.controlGrips.centerRight.visual,pe,K),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Pe),this.positionGrip(this.controlGrips.bottomCenter.visual,h,Pe),this.positionGrip(this.controlGrips.bottomRight.visual,pe,Pe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,m-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,m){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,m),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:tt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:tt.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(tt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(tt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var m=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:m.x*a,y:m.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Ie),et=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||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 ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=W.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),W.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&&W.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&W.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&W.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&W.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}(it),gt=function(c){function o(a,u,m,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=m,K.setCurrentWidth=K.setCurrentWidth.bind(K),K}return ve(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(m){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=m===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(m,h)}),u.appendChild(h);var K=document.createElement("div");K.innerText=m.toString(),K.style.marginRight="5px",h.appendChild(K);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.display="flex",Pe.style.alignItems="center";var pe=document.createElement("hr");pe.style.minWidth="20px",pe.style.border="0px",pe.style.borderTop=m+"px solid "+a.uiStyleSettings.toolboxColor,pe.style.flexGrow="2",Pe.appendChild(pe),h.appendChild(Pe),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var m=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Ke),lt=function(c){function o(a,u,m,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=m,K.setCurrentStyle=K.setCurrentStyle.bind(K),K}return ve(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(m){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=m===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(m,h)}),u.appendChild(h);var K=document.createElement("div");K.style.minHeight="20px",K.style.flexGrow="2",K.style.overflow="hidden";var Pe=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(m!==""?'stroke-dasharray="'+m+'"':"")+` />
</svg>`;K.innerHTML=Pe,h.appendChild(K),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var m=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Ke),at=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.strokeColor=m.defaultColor,h.strokeWidth=m.defaultStrokeWidth,h.strokeDasharray=m.defaultStrokeDasharray,h.strokePanel=new Fe("Line color",m.defaultColorSet,m.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",m.defaultStrokeDasharrays,m.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(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}(et),_e=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,m){var h=c.call(this,a,u,m)||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 ve(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=W.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 mt;return a.visual.transform.baseVal.appendItem(W.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,m){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,m),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}(Ie),rt=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||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=m.defaultColor,h.strokeWidth=m.defaultStrokeWidth,h.strokeDasharray=m.defaultStrokeDasharray,h.strokePanel=new Fe("Line color",m.defaultColorSet,m.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",m.defaultStrokeDasharrays,m.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(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=W.createGroup(),this.selectorLine=W.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=W.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()),W.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),W.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),W.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),Re=function(c){function o(a,u,m,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=m,K.setCurrentFont=K.setCurrentFont.bind(K),K}return ve(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(m){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=m===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(m,h)}),u.appendChild(h);var K=document.createElement("div");K.style.display="flex",K.style.minHeight="20px",K.style.flexGrow="2",K.style.fontFamily=m,K.style.overflow="hidden";var Pe=document.createElement("div");Pe.style.whiteSpace="nowrap",Pe.style.overflow="hidden",Pe.style.textOverflow="ellipsis",Pe.innerHTML="The quick brown fox jumps over the lazy dog",K.appendChild(Pe),h.appendChild(K),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var m=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Ke),ze=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=m.defaultColor,h.fontFamily=m.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 Fe("Color",m.defaultColorSet,m.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Re("Font",m.defaultFontFamilies,m.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return ve(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(m){m===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=W.createGroup(),this.bgRectangle=W.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=W.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(W.createTransform()),this.textElement.transform.baseVal.appendItem(W.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(W.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 m=(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(m,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),m=0,h=0;return u.width>0&&u.height>0&&(m=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:m,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),m=this.getTextPosition(u);m.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+m.x+"px, "+m.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(m.x,m.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&&(W.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),W.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 m=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(m)),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}),m=this.textElement.getBBox(),h={x:m.width*a,y:m.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&&W.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&&W.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}(it),ee=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=m.defaultColor,h.lineWidth=m.defaultStrokeWidth,h.pixelRatio=m.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 Fe("Color",m.defaultColorSet,m.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return ve(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=W.createGroup(),this.drawingImage=W.createImage(),this.visual.appendChild(this.drawingImage);var a=W.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),W.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),W.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],m=u[0],h=u[1],K=u[2],Pe=u[3],pe=!1,ht=0;ht<this.canvasElement.height;ht++)for(var je=0;je<this.canvasElement.width;je++)a.data[ht*this.canvasElement.width*4+4*je+3]>0&&(pe=!0,ht<h&&(h=ht),je<m&&(m=je),ht>Pe&&(Pe=ht),je>K&&(K=je));if(pe){this.left=m/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(K-m)/this.pixelRatio,this.height=(Pe-h)/this.pixelRatio;var Et=document.createElement("canvas");Et.width=K-m,Et.height=Pe-h,Et.getContext("2d").putImageData(this.canvasContext.getImageData(m,h,K-m,Pe-h),0,0),this.drawingImgUrl=Et.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){W.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),W.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}(it),Y=function(c){function o(a,u,m){var h=c.call(this,a,m||'<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 ve(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 m=function(Pe){var pe="both";switch(Pe){case 0:pe="both";break;case 1:pe="start";break;case 2:pe="end";break;case 3:pe="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=pe===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ht.addEventListener("click",function(){a.setCurrentType(pe,ht)}),u.appendChild(ht),pe==="both"||pe==="start"){var je=document.createElement("div");je.style.display="flex",je.style.alignItems="center",je.style.minHeight="20px",je.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>`,je.style.marginLeft="5px",ht.appendChild(je)}var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.minHeight="20px",Et.style.flexGrow="2";var It=document.createElement("hr");if(It.style.minWidth="20px",It.style.border="0px",It.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),It.style.flexGrow="2",Et.appendChild(It),ht.appendChild(Et),pe==="both"||pe==="end"){var zt=document.createElement("div");zt.style.display="flex",zt.style.alignItems="center",zt.style.minHeight="20px",zt.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>`,zt.style.marginRight="5px",ht.appendChild(zt)}h.typeBoxes.push(ht)},h=this,K=0;K<4;K++)m(K);return u},o.prototype.setCurrentType=function(a,u){var m=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings!==void 0?m.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Ke),Z=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||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 ve(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 m=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-m/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+m/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=W.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=W.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(W.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",W.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),W.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 m=this.arrow2.transform.baseVal.getItem(0);m.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(m,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}(rt),y=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.fillColor=m.defaultFillColor,h.strokeWidth=0,h.fillPanel=new Fe("Color",m.defaultColorSet,m.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return ve(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}(et),x=function(c){function o(a,u,m,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=m,K.setCurrentOpacity=K.setCurrentOpacity.bind(K),K}return ve(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(m){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=m===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(m,h)}),u.appendChild(h);var K=document.createElement("div");K.innerText=100*m+"%",h.appendChild(K),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var m=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?m.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Ke),A=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=m.defaultHighlightColor,h.strokeWidth=0,h.opacity=m.defaultHighlightOpacity,h.fillPanel=new Fe("Color",m.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new x("Opacity",m.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ve(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&W.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),N='<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>',le=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||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=m.defaultStrokeColor,h.bgColor=m.defaultFillColor,h.fontFamily=m.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 Fe("Text color",m.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 Fe("Fill color",m.defaultColorSet,h.bgColor,N),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Re("Font",m.defaultFontFamilies,m.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new mt,h.tipGrip.visual.transform.baseVal.appendItem(W.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return ve(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(){W.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=W.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&&(W.setAttributes(this.bgRectangle,[["fill",a]]),W.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),m=this.height/5;a&&(this.tipPosition={x:u+m/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))?(m=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+m,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+m}):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))?(m=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-m,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+m}):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))?(m=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-m,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-m},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(m=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+m,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-m})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){W.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}(ze),we=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=m.defaultColor,h.strokeWidth=m.defaultStrokeWidth,h.strokeDasharray=m.defaultStrokeDasharray,h.fillColor=m.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 Fe("Line color",q(m.defaultColorSet,["transparent"]),m.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new Fe("Fill color",q(m.defaultColorSet,["transparent"]),h.fillColor,N),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",m.defaultStrokeDasharrays,m.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new x("Opacity",m.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=W.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),W.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&&W.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&W.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&W.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&W.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&W.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}(it),Ge=function(c){function o(a,u,m){return c.call(this,a,u,m)||this}return ve(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=W.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(W.createTransform()),this.visual.appendChild(this.tip1),this.tip2=W.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(W.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&&(W.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()]]),W.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 m=this.tip2.transform.baseVal.getItem(0);m.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(m,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}(rt),st=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||this;return h.strokePanel.colors=m.defaultColorSet,h.fillColor="transparent",h}return ve(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}(we),Ct=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}(),Ae=function(c){function o(a,u,m){var h=c.call(this,a,u,m)||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=m.defaultColor,h.strokeWidth=m.defaultStrokeWidth,h.strokeDasharray=m.defaultStrokeDasharray,h.strokePanel=new Fe("Line color",m.defaultColorSet,m.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new gt("Line width",m.defaultStrokeWidths,m.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new lt("Line style",m.defaultStrokeDasharrays,m.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(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=W.createGroup(),this.selectorCurve=W.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=W.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()),W.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),W.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),W.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=W.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=W.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),bt=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}(),dt=function(c){function o(a,u,m){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=m,h}return ve(o,c),o}(bt),qe=function(c){function o(a,u,m){m===void 0&&(m=!1);var h=c.call(this,a,m)||this;return h.marker=u,h}return ve(o,c),o}(bt),_t=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}(),Ot=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 _e,this._isOpen=!1,this.undoRedoManager=new Ct,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 _t,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[at,ee,Z,ze,st,we,A,le,Ge,y,rt,Ae]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[at,ee,Z,ze,we,A,le]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[at,ee,Z,ze,A]},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 m=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});m!==void 0&&a._availableMarkerTypes.push(m)}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&&R.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=R.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new bt(o))})},c.prototype.render=function(){return ge(this,void 0,void 0,function(){var o;return ue(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new V).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(m){var h=new bt(a,!0);m(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(m){return m(new bt(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,m=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,m),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,m=this;this._currentMarker&&this._currentMarker instanceof ze?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==m._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=W.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 Le(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 Ue(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(m){var h=new qe(o,o._currentMarker,!0);m(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(m){return m(new qe(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(K){var Pe=new qe(o,void 0,!0);K(Pe),Pe.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(K){var Pe=m.markers[K];m.setCurrentMarker(m.markers[K]),m._currentMarker.dispose(),m.markerImage.removeChild(m._currentMarker.container),m.markers.splice(m.markers.indexOf(m._currentMarker),1),m.eventListeners.markerdelete.forEach(function(pe){return pe(new qe(o,Pe))})},m=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 m=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),m<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new bt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new bt(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 bt(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 bt(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 ge(this,void 0,void 0,function(){var o,a,u=this;return ue(this,function(m){switch(m.label){case 0:return[4,this.render()];case 1:return o=m.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new dt(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 m=a._availableMarkerTypes.find(function(K){return K.typeName===u.typeName});if(m!==void 0){var h=a.addNewMarker(m);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 bt(a))})},c.prototype.addNewMarker=function(o){var a=W.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(m){return m.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(m){return m(new qe(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 ee&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ee):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new qe(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 qe(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 qe(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 qe(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 bt(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 bt(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 At=function(c,o){return(At=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var m in u)Object.prototype.hasOwnProperty.call(u,m)&&(a[m]=u[m])})(c,o)};function Mt(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}At(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Tt(c,o,a,u){return new(a||(a=Promise))(function(m,h){function K(ht){try{pe(u.next(ht))}catch(je){h(je)}}function Pe(ht){try{pe(u.throw(ht))}catch(je){h(je)}}function pe(ht){var je;ht.done?m(ht.value):(je=ht.value,je instanceof a?je:new a(function(Et){Et(je)})).then(K,Pe)}pe((u=u.apply(c,o||[])).next())})}function tn(c,o){var a,u,m,h,K={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return h={next:Pe(0),throw:Pe(1),return:Pe(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function Pe(pe){return function(ht){return function(je){if(a)throw new TypeError("Generator is already executing.");for(;K;)try{if(a=1,u&&(m=2&je[0]?u.return:je[0]?u.throw||((m=u.return)&&m.call(u),0):u.next)&&!(m=m.call(u,je[1])).done)return m;switch(u=0,m&&(je=[2&je[0],m.value]),je[0]){case 0:case 1:m=je;break;case 4:return K.label++,{value:je[1],done:!1};case 5:K.label++,u=je[1],je=[0];continue;case 7:je=K.ops.pop(),K.trys.pop();continue;default:if(!(m=K.trys,(m=m.length>0&&m[m.length-1])||je[0]!==6&&je[0]!==2)){K=0;continue}if(je[0]===3&&(!m||je[1]>m[0]&&je[1]<m[3])){K.label=je[1];break}if(je[0]===6&&K.label<m[1]){K.label=m[1],m=je;break}if(m&&K.label<m[2]){K.label=m[2],K.ops.push(je);break}m[2]&&K.ops.pop(),K.trys.pop();continue}je=o.call(c,K)}catch(Et){je=[6,Et],u=0}finally{a=m=0}if(5&je[0])throw je[1];return{value:je[0]?je[1]:void 0,done:!0}}([pe,ht])}}}var on=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}(),pt=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,m=a;u<m.length;u++){var h=m[u],K=h[0],Pe=h[1];o.setAttribute(K,Pe)}},c.createRect=function(o,a,u){var m=document.createElementNS("http://www.w3.org/2000/svg","rect");return m.setAttribute("width",o.toString()),m.setAttribute("height",a.toString()),u&&c.setAttributes(m,u),m},c.createLine=function(o,a,u,m,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",m.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 m=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return m.setAttribute("cx",(o/2).toString()),m.setAttribute("cy",(a/2).toString()),m.setAttribute("rx",(o/2).toString()),m.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(m,u),m},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,m,h,K,Pe){var pe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(pe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",m.toString()],["refX",h.toString()],["refY",K.toString()]]),pe.appendChild(Pe),pe},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,m,h,K,Pe,pe){return"M"+o+","+a+"V"+(a+m)+"H"+(o+u)+"V"+a+"H"+h+"V"+K+"H"+(h+Pe)+"V"+(K+pe)+"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 gn("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new gn("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),xn=function(c,o){this.selector=c,this.style=o},gn=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 Mt(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),jt=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 Mt(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),Un=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 Un(o,a),m=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 Pe=pt.createDefs();K.appendChild(Pe);var pe=pt.createElement("clipPath",[["id","text-bg-clip"]]);Pe.appendChild(pe);var ht=pt.createPath(pt.getHollowRectanglePath((24-m)/2,(24-h)/2,m,h,(24-m)/2+2,(24-h)/2+2,m-4,h-4));K.appendChild(ht);var je=pt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);je.appendChild(pt.createTSpan(o+":"+a)),K.appendChild(je);var Et=je.getBBox();pt.setAttributes(je,[["x",((24-Et.width)/2).toString()],["y",((24-Et.height)/2-Et.y).toString()]]);var It=pt.createPath(pt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Et.width))/2,(24-Math.ceil(Et.height))/2,Math.ceil(Et.width),Math.ceil(Et.height)));return pe.appendChild(It),pt.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,m){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=m,h}return Mt(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}(jt),Pt=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=pt.createGroup(),this.visual.appendChild(pt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(pt.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 pt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Kn=function(){function c(o,a,u,m){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=m,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&&pt.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=pt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=pt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(pt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(pt.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=pt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Pt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Pt(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),pt.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 Pe=a.y+u*(K+1);pt.setAttributes(h,[["x1",""+a.x],["y1",""+Pe],["x2",""+(a.x+a.width)],["y2",""+Pe]])});var m=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,K){var Pe=a.x+m*(K+1);pt.setAttributes(h,[["x1",""+Pe],["y1",""+a.y],["x2",""+Pe],["y2",""+(a.y+a.height)]])}),pt.setAttributes(this.cropShadeElement,[["d",pt.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,m=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+=m,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+=m}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),m=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<m/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=m,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,m,h,K){var Pe=u/o,pe=m/a;return{x:(h.x-K)*Pe+K,y:(h.y-K)*pe+K,width:h.width*Pe,height:h.height*pe}},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();pt.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 m=u%5==0?this.height/3:this.height/6;a+="h4v"+-m+"h1v"+m}a+="v1H0Z",this.scaleShape=pt.createPath(a);var h=pt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=pt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=pt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var K=pt.createTSpan("");return K.innerHTML="&deg;",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,m,h,K,Pe){var pe=this;return new Promise(function(ht){var je=document.createElement("canvas");je.width=o.width.baseVal.value-2*m,je.height=o.height.baseVal.value-2*m;var Et=1,It=1;pe.naturalSize===!0?(Et=a.naturalWidth/(o.width.baseVal.value-2*m)/K,It=a.naturalHeight/(o.height.baseVal.value-2*m)/Pe,je.width=a.naturalWidth/K,je.height=a.naturalHeight/Pe):pe.width!==void 0&&pe.height!==void 0&&(Et=pe.width/u.width,It=pe.height/u.height,je.width*=Et,je.height*=It);var zt=je.getContext("2d");zt.translate(je.width/2,je.height/2),zt.rotate(h*Math.PI/180),zt.scale(K,Pe),zt.translate(-je.width/2,-je.height/2),zt.drawImage(a,0,0,je.width,je.height);var Fn=document.createElement("canvas");Fn.width=u.width*Et,Fn.height=u.height*It,Fn.getContext("2d").putImageData(zt.getImageData((u.x-m)*Et,(u.y-m)*It,u.width*Et,u.height*It),0,0),ht(Fn.toDataURL(pe.imageType,pe.imageQuality))})},c}(),We=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",pt.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();pt.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=pt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=pt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=pt.createGroup(),this.editingTargetRotationScaleContainer=pt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=pt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=pt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=pt.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=pt.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(It){var zt=new jt(ui.getIcon(It.horizontal,It.vertical),It.horizontal===0&&It.vertical===0?"FREE":It.horizontal+":"+It.vertical);zt.onClick=function(){return o.ratioButtonClicked(It)},u.push(zt)}),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 m=new jt('<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");m.isActive=this.isGridVisible,m.onClick=function(){o.isGridVisible=!o.isGridVisible,m.isActive=o.isGridVisible},a.addButton(m);var h=new jt('<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),!on.isLicensed){var K=new ct;this.topToolbar.addElementBlock(K);var Pe=document.createElement("div");Pe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var pe=document.createElement("a");pe.style.color="currentColor",pe.href="https://markerjs.com/products/cropro",pe.target="_blank",pe.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>',Pe.appendChild(pe),K.addElement(Pe)}var ht=new Xn;ht.minWidth=3*this.toolbarHeight+"px",ht.contentAlign="end",this.topToolbar.addButtonBlock(ht);var je=new jt('<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");je.onClick=this.startRenderAndClose,ht.addButton(je),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(je.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Et=new jt('<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");Et.onClick=this.close,ht.addButton(Et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Et.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 jt('<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 m=new jt('<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");m.onClick=this.rotateRightButtonClicked,a.addButton(m);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 Pe=new jt('<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");Pe.onClick=this.flipHorizontallyButtonClicked,K.addButton(Pe);var pe=new jt('<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");pe.onClick=this.flipVerticallyButtonClicked,K.addButton(pe)},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 Un(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 Tt(this,void 0,void 0,function(){var o,a;return tn(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(m){return m(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return Tt(this,void 0,void 0,function(){var o;return tn(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(),pt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new gn("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new gn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new gn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new gn("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*o)+`px;
height: `+(this.toolbarHeight-2*o)+`px;
padding: `+o+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new gn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new gn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new 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 gn("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new gn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new gn("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new gn("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*o)+`px;
padding: `+o+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new gn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},c.instanceCounter=0,c}(),St=k("8hTe"),ti=k.n(St),ci=/<pre[^>]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Oi=Qe.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,m=u===void 0?!1:u,h=c.className,K=c.showTextOnly,Pe=c.showLines,pe=c.replaces,ht=c.zoomImg,je=c.hasMask,Et=c.style,It=Et===void 0?{}:Et,zt=c.stylesPrev,Fn=zt===void 0?{}:zt,Hn=String(a),un=Object(L.useRef)(),Yn=Object(L.useRef)(),Xi=Object(L.useState)(""),An=Object(T.a)(Xi,2),Ln=An[0],ni=An[1],yi=Object(L.useState)("office"),Jn=Object(T.a)(yi,2),ii=Jn[0],zn=Jn[1],fr=function(){var Ut=new We(Yn.current);Ut.displayMode="popup",Ut.addRenderEventListener(function(){var mn=Object(z.a)(j.a.mark(function Ft(vn){var Kt;return j.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return un.current.style.display="none",an.next=3,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:vn}});case 3:Kt=an.sent,Kt!=null&&Kt.id&&pe(Yn.current.getAttribute("src").replace(F.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 5:case"end":return an.stop()}},Ft)}));return function(Ft){return mn.apply(this,arguments)}}()),Ut.show()},Ki=function(){var Ut=new Ot(Yn.current);Ut.settings.displayMode="popup",Ut.addEventListener("render",function(){var mn=Object(z.a)(j.a.mark(function Ft(vn){var Kt;return j.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:if(un.current.style.display="none",!Yn.current){an.next=6;break}return an.next=4,Object(Oe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:vn.dataUrl}});case 4:Kt=an.sent,Kt!=null&&Kt.id&&pe(Yn.current.getAttribute("src").replace(F.a.API_SERVER,""),"/api/attachments/".concat(Kt==null?void 0:Kt.id,"?type=").concat(Kt.content_type));case 6:case"end":return an.stop()}},Ft)}));return function(Ft){return mn.apply(this,arguments)}}()),Ut.show(),window.markerArea=Ut},Pn=Object(L.useMemo)(function(){try{var qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ut=/\"\/api\/attachments\/|\"\/attachments\/download\//g,mn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hn=Hn.replace(qt,"("+F.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+F.a.API_SERVER+"/api/attachments/").replace(mn,'"'+F.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=D(Hn),vn=ce();if(Hn.match(/\[TOC\]/)&&(Ft=Ft.replace("<p>[TOC]</p>",Ve()),$e()),Ft=Ft.replace(/(__special_katext_id_\d+__)/g,function(bi,an){var sn=vn[an],ri=sn.type,xi=sn.expression;return Object(Q.renderToString)(di(xi)||"",{displayMode:ri==="block",throwOnError:!1,output:"html"})}),Ft=Ft.replace(/▁/g,"\u2581\u2581\u2581"),ne(),K){var Kt=document.createElement("div");return Kt.innerHTML=Ft,Kt.innerText}return setTimeout(function(){return Di()},500),Ft},[Hn]),Nn=Object(L.useRef)();Se.WebkitLineClamp=Pe,Pe&&(It=Object(fe.a)(Object(fe.a)({},It),Se));function Ri(qt){var Ut=qt.target;if(Ut.tagName.toUpperCase()==="IMG"){if(ht){var mn=Ut.getAttribute("src");ni(mn),zn("image")}}else if(Ut.tagName.toUpperCase()==="A"){var Ft=Ut.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 vn=document.getElementById(Ft.replace("#",""));vn&&vn.scrollIntoView(!0)}}}var Di=function(){var Ut,mn=(Ut=Nn.current)===null||Ut===void 0?void 0:Ut.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(C.a.isSupported()){var vn=new C.a;vn.loadSource(Ft.src),vn.attachMedia(Ft)}}})};Object(L.useEffect)(function(){if(Nn.current&&Pn&&(Pn.match(ci)&&window.PR.prettyPrint()),Nn.current)return Nn.current.addEventListener("click",Ri),function(){Nn.current.removeEventListener("click",Ri),ne(),$e()}},[Pn,Nn.current,Ri]);var Pi=function(Ut){if(!m)return;Ut.target.nodeName==="IMG"?(un.current.style.display="flex",un.current.style.width=Ut.target.clientWidth+"px",un.current.style.height=Ut.target.clientHeight+"px",un.current.style.top=Ut.target.offsetTop+"px",un.current.style.left=Ut.target.offsetLeft+"px",Yn.current.src=Ut.target.getAttribute("src")):un.current.style.display="none"};return _.a.createElement("div",{style:{position:"relative"}},_.a.createElement("div",{ref:Nn,style:Object(fe.a)({},It),className:"".concat(h||""," markdown-body ").concat(ti.a.mdBody),onMouseOver:Pi,dangerouslySetInnerHTML:{__html:Pn}}),_.a.createElement("div",{ref:un,className:ti.a.button},_.a.createElement(se.a,null,_.a.createElement(xe.a,{onClick:function(){return fr()}},"\u88C1\u526A"),_.a.createElement(xe.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),_.a.createElement("img",{ref:Yn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),_.a.createElement(Ce.a,{close:!0,data:Ln,hasMask:je,type:Ln!=null&&Ln.length?ii:"",style:Object(fe.a)({},Fn),onClose:function(){return ni("")}}))}},"9VGf":function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return ie});var U=k("q1tI"),se=k.n(U);function ie(xe,fe){var z=Object(U.useRef)();Object(U.useEffect)(function(){z.current=xe}),Object(U.useEffect)(function(){function T(){z.current()}if(fe!==null){var M=setInterval(T,fe);return function(){return clearInterval(M)}}},[fe])}},"9ivq":function(ot,Qe,k){},Bd2K:function(ot,Qe,k){(function(U){U(k("VrN/"),k("osHv"))})(function(U){U.defineOption("autoCloseTags",!1,function(j,L,_){if(_!=U.Init&&_&&j.removeKeyMap("autoCloseTags"),!L)return;var E={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(E["'/'"]=function(te){return z(te)}),(typeof L!="object"||L.whenOpening!==!1)&&(E["'>'"]=function(te){return xe(te)}),j.addKeyMap(E)});var se=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ie=["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 xe(j){if(j.getOption("disableInput"))return U.Pass;for(var L=j.listSelections(),_=[],E=j.getOption("autoCloseTags"),te=0;te<L.length;te++){if(!L[te].empty())return U.Pass;var $=L[te].head,H=j.getTokenAt($),X=U.innerMode(j.getMode(),H.state),J=X.state,ae=X.mode.xmlCurrentTag&&X.mode.xmlCurrentTag(J),de=ae&&ae.name;if(!de)return U.Pass;var Be=X.mode.configuration=="html",$e=typeof E=="object"&&E.dontCloseTags||Be&&se,Se=typeof E=="object"&&E.indentTags||Be&&ie;H.end>$.ch&&(de=de.slice(0,de.length-H.end+$.ch));var De=de.toLowerCase();if(!de||H.type=="string"&&(H.end!=$.ch||!/[\"\']/.test(H.string.charAt(H.string.length-1))||H.string.length==1)||H.type=="tag"&&ae.close||H.string.indexOf("/")==$.ch-H.start-1||$e&&T($e,De)>-1||M(j,X.mode.xmlCurrentContext&&X.mode.xmlCurrentContext(J)||[],de,$,!0))return U.Pass;var Ve=typeof E=="object"&&E.emptyTags;if(Ve&&T(Ve,de)>-1){_[te]={text:"/>",newPos:U.Pos($.line,$.ch+2)};continue}var ke=Se&&T(Se,De)>-1;_[te]={indent:ke,text:">"+(ke?`
`:"")+"</"+de+">",newPos:ke?U.Pos($.line+1,0):U.Pos($.line,$.ch+1)}}for(var Te=typeof E=="object"&&E.dontIndentOnAutoClose,te=L.length-1;te>=0;te--){var Ne=_[te];j.replaceRange(Ne.text,L[te].head,L[te].anchor,"+insert");var be=j.listSelections().slice(0);be[te]={head:Ne.newPos,anchor:Ne.newPos},j.setSelections(be),!Te&&Ne.indent&&(j.indentLine(Ne.newPos.line,null,!0),j.indentLine(Ne.newPos.line+1,null,!0))}}function fe(j,L){for(var _=j.listSelections(),E=[],te=L?"/":"</",$=j.getOption("autoCloseTags"),H=typeof $=="object"&&$.dontIndentOnSlash,X=0;X<_.length;X++){if(!_[X].empty())return U.Pass;var J=_[X].head,ae=j.getTokenAt(J),de=U.innerMode(j.getMode(),ae.state),Be=de.state;if(L&&(ae.type=="string"||ae.string.charAt(0)!="<"||ae.start!=J.ch-1))return U.Pass;var $e,Se=de.mode.name!="xml"&&j.getMode().name=="htmlmixed";if(Se&&de.mode.name=="javascript")$e=te+"script";else if(Se&&de.mode.name=="css")$e=te+"style";else{var De=de.mode.xmlCurrentContext&&de.mode.xmlCurrentContext(Be);if(!De||De.length&&M(j,De,De[De.length-1],J))return U.Pass;$e=te+De[De.length-1]}j.getLine(J.line).charAt(ae.end)!=">"&&($e+=">"),E[X]=$e}if(j.replaceSelections(E),_=j.listSelections(),!H)for(var X=0;X<_.length;X++)(X==_.length-1||_[X].head.line<_[X+1].head.line)&&j.indentLine(_[X].head.line)}function z(j){return j.getOption("disableInput")?U.Pass:fe(j,!0)}U.commands.closeTag=function(j){return fe(j)};function T(j,L){if(j.indexOf)return j.indexOf(L);for(var _=0,E=j.length;_<E;++_)if(j[_]==L)return _;return-1}function M(j,L,_,E,te){if(!U.scanForClosingTag)return!1;var $=Math.min(j.lastLine()+1,E.line+500),H=U.scanForClosingTag(j,E,null,$);if(!H||H.tag!=_)return!1;for(var X=te?1:0,J=L.length-1;J>=0&&L[J]==_;J--)++X;E=H.to;for(var J=1;J<X;J++){var ae=U.scanForClosingTag(j,E,null,$);if(!ae||ae.tag!=_)return!1;E=ae.to}return!0}})},BjJ7:function(ot,Qe,k){"use strict";k.d(Qe,"d",function(){return se}),k.d(Qe,"c",function(){return ie}),k.d(Qe,"e",function(){return xe}),k.d(Qe,"b",function(){return fe}),k.d(Qe,"a",function(){return T});var U=k("m3rI");function se(M){var j=!0;if(M.length>0){for(var L=0;L<M.length;L++)if(M[L].compile_success==0||!M[L].compile_success){j=!1;break}}else j=!1;return j}function ie(M){for(var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",L=[],_=0;_<M.length;_++){var E=M[_],te=j?"".concat(j,"/").concat(E.name):"".concat(E.name);L.push({title:E.name,isLeaf:!(E.type==="tree"),key:te})}return L}function xe(M,j,L){for(var _=0;_<M.length;_++){var E=M[_];if(E.key===j){E.children=L;break}E.children&&xe(E.children,j,L)}return M}function fe(M,j,L){var _;return function(){var E=this,te=arguments,$=function(){_=null,L||M.apply(E,te)},H=L&&!_;clearTimeout(_),_=setTimeout($,j),H&&M.apply(E,te)}}var z=!0,T=U.a.API_SERVER},"C+DQ":function(ot,Qe,k){},D1Df:function(ot,Qe,k){"use strict";function U(w){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?U=function(P){return typeof P}:U=function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},U(w)}function se(){return se=Object.assign||function(w){for(var B=1;B<arguments.length;B++){var P=arguments[B];for(var S in P)Object.prototype.hasOwnProperty.call(P,S)&&(w[S]=P[S])}return w},se.apply(this,arguments)}function ie(w,B){var P=Object.keys(w);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(w);B&&(S=S.filter(function(D){return Object.getOwnPropertyDescriptor(w,D).enumerable})),P.push.apply(P,S)}return P}function xe(w){for(var B=1;B<arguments.length;B++){var P=arguments[B]!=null?arguments[B]:{};B%2?ie(P,!0).forEach(function(S){H(w,S,P[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(P)):ie(P).forEach(function(S){Object.defineProperty(w,S,Object.getOwnPropertyDescriptor(P,S))})}return w}function fe(w,B){if(w==null)return{};var P=z(w,B),S,D;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(w);for(D=0;D<p.length;D++){if(S=p[D],B.indexOf(S)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(w,S))continue;P[S]=w[S]}}return P}function z(w,B){if(w==null)return{};var P={},S=Object.keys(w),D,p;for(p=0;p<S.length;p++){if(D=S[p],B.indexOf(D)>=0)continue;P[D]=w[D]}return P}function T(w,B){if(!(w instanceof B))throw new TypeError("Cannot call a class as a function")}function M(w,B){for(var P=0;P<B.length;P++){var S=B[P];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(w,S.key,S)}}function j(w,B,P){return B&&M(w.prototype,B),P&&M(w,P),w}function L(w,B){return B&&(U(B)==="object"||typeof B=="function")?B:E(w)}function _(w){return _=Object.setPrototypeOf?Object.getPrototypeOf:function(P){return P.__proto__||Object.getPrototypeOf(P)},_(w)}function E(w){if(w===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w}function te(w,B){if(typeof B!="function"&&B!==null)throw new TypeError("Super expression must either be null or a function");w.prototype=Object.create(B&&B.prototype,{constructor:{value:w,writable:!0,configurable:!0}}),B&&$(w,B)}function $(w,B){return $=Object.setPrototypeOf||function(S,D){return S.__proto__=D,S},$(w,B)}function H(w,B,P){return B in w?Object.defineProperty(w,B,{value:P,enumerable:!0,configurable:!0,writable:!0}):w[B]=P,w}var X=k("q1tI"),J=k("17x9"),ae=k("H38U"),de=k("aRTE");function Be(w){for(var B="",P=0;P<w.length;P++){var S=w.charCodeAt(P);S<128?B+=String.fromCharCode(S):S<2048?(B+=String.fromCharCode(192|S>>6),B+=String.fromCharCode(128|S&63)):S<55296||S>=57344?(B+=String.fromCharCode(224|S>>12),B+=String.fromCharCode(128|S>>6&63),B+=String.fromCharCode(128|S&63)):(P++,S=65536+((S&1023)<<10|w.charCodeAt(P)&1023),B+=String.fromCharCode(240|S>>18),B+=String.fromCharCode(128|S>>12&63),B+=String.fromCharCode(128|S>>6&63),B+=String.fromCharCode(128|S&63))}return B}var $e={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},Se={},De=4,Ve=.1;function ke(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=[];return w.forEach(function(S,D){var p=null;S.forEach(function(d,C){if(!d&&p!==null){P.push("M".concat(p+B," ").concat(D+B,"h").concat(C-p,"v1H").concat(p+B,"z")),p=null;return}if(C===S.length-1){if(!d)return;p===null?P.push("M".concat(C+B,",").concat(D+B," h1v1H").concat(C+B,"z")):P.push("M".concat(p+B,",").concat(D+B," h").concat(C+1-p,"v1H").concat(p+B,"z"));return}d&&p===null&&(p=C)})}),P.join("")}function Te(w,B){return w.slice().map(function(P,S){return S<B.y||S>=B.y+B.h?P:P.map(function(D,p){return p<B.x||p>=B.x+B.w?D:!1})})}function Ne(w,B){var P=w.imageSettings,S=w.size,D=w.includeMargin;if(P==null)return null;var p=D?De:0,d=B.length+p*2,C=Math.floor(S*Ve),F=d/S,Q=(P.width||C)*F,Ce=(P.height||C)*F,Oe=P.x==null?B.length/2-Q/2:P.x*F,me=P.y==null?B.length/2-Ce/2:P.y*F,ve=null;if(P.excavate){var ge=Math.floor(Oe),ue=Math.floor(me),q=Math.ceil(Q+Oe-ge),W=Math.ceil(Ce+me-ue);ve={x:ge,y:ue,w:q,h:W}}return{x:Oe,y:me,h:Ce,w:Q,excavation:ve}}var be=function(){try{new Path2D().addPath(new Path2D)}catch(w){return!1}return!0}(),O=function(w){te(B,w);function B(){var P,S;T(this,B);for(var D=arguments.length,p=new Array(D),d=0;d<D;d++)p[d]=arguments[d];return S=L(this,(P=_(B)).call.apply(P,[this].concat(p))),H(E(S),"_canvas",void 0),H(E(S),"_image",void 0),H(E(S),"state",{imgLoaded:!1}),H(E(S),"handleImageLoad",function(){S.setState({imgLoaded:!0})}),S}return j(B,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var S=this.props,D=S.value,p=S.size,d=S.level,C=S.bgColor,F=S.fgColor,Q=S.includeMargin,Ce=S.imageSettings,Oe=new ae(-1,de[d]);if(Oe.addData(Be(D)),Oe.make(),this._canvas!=null){var me=this._canvas,ve=me.getContext("2d");if(!ve)return;var ge=Oe.modules;if(ge===null)return;var ue=Q?De:0,q=ge.length+ue*2,W=Ne(this.props,ge);Ce!=null&&W!=null&&(W.excavation!=null&&(ge=Te(ge,W.excavation)));var b=window.devicePixelRatio||1;me.height=me.width=p*b;var V=p/q*b;ve.scale(V,V),ve.fillStyle=C,ve.fillRect(0,0,q,q),ve.fillStyle=F,be?ve.fill(new Path2D(ke(ge,ue))):ge.forEach(function(R,ye){R.forEach(function(Ee,re){Ee&&ve.fillRect(re+ue,ye+ue,1,1)})}),this.state.imgLoaded&&this._image&&W!=null&&ve.drawImage(this._image,W.x+ue,W.y+ue,W.w,W.h)}}},{key:"render",value:function(){var S=this,D=this.props,p=D.value,d=D.size,C=D.level,F=D.bgColor,Q=D.fgColor,Ce=D.style,Oe=D.includeMargin,me=D.imageSettings,ve=fe(D,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),ge=xe({height:d,width:d},Ce),ue=null,q=me&&me.src;return me!=null&&q!=null&&(ue=X.createElement("img",{src:q,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(b){return S._image=b}})),X.createElement(X.Fragment,null,X.createElement("canvas",se({style:ge,height:d,width:d,ref:function(b){return S._canvas=b}},ve)),ue)}}]),B}(X.PureComponent);H(O,"defaultProps",$e);var ce=function(w){te(B,w);function B(){return T(this,B),L(this,_(B).apply(this,arguments))}return j(B,[{key:"render",value:function(){var S=this.props,D=S.value,p=S.size,d=S.level,C=S.bgColor,F=S.fgColor,Q=S.includeMargin,Ce=S.imageSettings,Oe=fe(S,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),me=new ae(-1,de[d]);me.addData(Be(D)),me.make();var ve=me.modules;if(ve===null)return null;var ge=Q?De:0,ue=ve.length+ge*2,q=Ne(this.props,ve),W=null;Ce!=null&&q!=null&&(q.excavation!=null&&(ve=Te(ve,q.excavation)),W=X.createElement("image",{xlinkHref:Ce.src,height:q.h,width:q.w,x:q.x+ge,y:q.y+ge,preserveAspectRatio:"none"}));var b=ke(ve,ge);return X.createElement("svg",se({shapeRendering:"crispEdges",height:p,width:p,viewBox:"0 0 ".concat(ue," ").concat(ue)},Oe),X.createElement("path",{fill:C,d:"M0,0 h".concat(ue,"v").concat(ue,"H0z")}),X.createElement("path",{fill:F,d:b}),W)}}]),B}(X.PureComponent);H(ce,"defaultProps",$e);var ne=function(B){var P=B.renderAs,S=fe(B,["renderAs"]),D=P==="svg"?ce:O;return X.createElement(D,S)};ne.defaultProps=xe({renderAs:"canvas"},$e),ot.exports=ne},DlQD:function(ot,Qe,k){(function(U,se){ot.exports=se()})(this,function(){"use strict";function U(ee,Y){for(var Z=0;Z<Y.length;Z++){var y=Y[Z];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(ee,y.key,y)}}function se(ee,Y,Z){return Y&&U(ee.prototype,Y),Z&&U(ee,Z),ee}function ie(ee,Y){if(!ee)return;if(typeof ee=="string")return xe(ee,Y);var Z=Object.prototype.toString.call(ee).slice(8,-1);if(Z==="Object"&&ee.constructor&&(Z=ee.constructor.name),Z==="Map"||Z==="Set")return Array.from(ee);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return xe(ee,Y)}function xe(ee,Y){(Y==null||Y>ee.length)&&(Y=ee.length);for(var Z=0,y=new Array(Y);Z<Y;Z++)y[Z]=ee[Z];return y}function fe(ee,Y){var Z;if(typeof Symbol=="undefined"||ee[Symbol.iterator]==null){if(Array.isArray(ee)||(Z=ie(ee))||Y&&ee&&typeof ee.length=="number"){Z&&(ee=Z);var y=0;return function(){return y>=ee.length?{done:!0}:{done:!1,value:ee[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 Z=ee[Symbol.iterator](),Z.next.bind(Z)}function z(ee,Y){return Y={exports:{}},ee(Y,Y.exports),Y.exports}var T=z(function(ee){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 Z(y){ee.exports.defaults=y}ee.exports={defaults:Y(),getDefaults:Y,changeDefaults:Z}}),M=T.defaults,j=T.getDefaults,L=T.changeDefaults,_=/[&<>"']/,E=/[&<>"']/g,te=/[<>"']|&(?!#?\w+;)/,$=/[<>"']|&(?!#?\w+;)/g,H={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},X=function(Y){return H[Y]};function J(ee,Y){if(Y){if(_.test(ee))return ee.replace(E,X)}else if(te.test(ee))return ee.replace($,X);return ee}var ae=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function de(ee){return ee.replace(ae,function(Y,Z){return Z=Z.toLowerCase(),Z==="colon"?":":Z.charAt(0)==="#"?Z.charAt(1)==="x"?String.fromCharCode(parseInt(Z.substring(2),16)):String.fromCharCode(+Z.substring(1)):""})}var Be=/(^|[^\[])\^/g;function $e(ee,Y){ee=ee.source||ee,Y=Y||"";var Z={replace:function(x,A){return A=A.source||A,A=A.replace(Be,"$1"),ee=ee.replace(x,A),Z},getRegex:function(){return new RegExp(ee,Y)}};return Z}var Se=/[^\w:]/g,De=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ve(ee,Y,Z){if(ee){var y;try{y=decodeURIComponent(de(Z)).replace(Se,"").toLowerCase()}catch(x){return null}if(y.indexOf("javascript:")===0||y.indexOf("vbscript:")===0||y.indexOf("data:")===0)return null}Y&&!De.test(Z)&&(Z=O(Y,Z));try{Z=encodeURI(Z).replace(/%25/g,"%")}catch(x){return null}return Z}var ke={},Te=/^[^:]+:\/*[^/]*$/,Ne=/^([^:]+:)[\s\S]*$/,be=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(ee,Y){ke[" "+ee]||(Te.test(ee)?ke[" "+ee]=ee+"/":ke[" "+ee]=B(ee,"/",!0)),ee=ke[" "+ee];var Z=ee.indexOf(":")===-1;return Y.substring(0,2)==="//"?Z?Y:ee.replace(Ne,"$1")+Y:Y.charAt(0)==="/"?Z?Y:ee.replace(be,"$1")+Y:ee+Y}var ce={exec:function(){}};function ne(ee){for(var Y=1,Z,y;Y<arguments.length;Y++){Z=arguments[Y];for(y in Z)Object.prototype.hasOwnProperty.call(Z,y)&&(ee[y]=Z[y])}return ee}function w(ee,Y){var Z=ee.replace(/\|/g,function(A,N,le){for(var we=!1,Ge=N;--Ge>=0&&le[Ge]==="\\";)we=!we;return we?"|":" |"}),y=Z.split(/ \|/),x=0;if(y.length>Y)y.splice(Y);else for(;y.length<Y;)y.push("");for(;x<y.length;x++)y[x]=y[x].trim().replace(/\\\|/g,"|");return y}function B(ee,Y,Z){var y=ee.length;if(y===0)return"";for(var x=0;x<y;){var A=ee.charAt(y-x-1);if(A===Y&&!Z)x++;else if(A!==Y&&Z)x++;else break}return ee.substr(0,y-x)}function P(ee,Y){if(ee.indexOf(Y[1])===-1)return-1;for(var Z=ee.length,y=0,x=0;x<Z;x++)if(ee[x]==="\\")x++;else if(ee[x]===Y[0])y++;else if(ee[x]===Y[1]&&(y--,y<0))return x;return-1}function S(ee){ee&&ee.sanitize&&!ee.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 D={escape:J,unescape:de,edit:$e,cleanUrl:Ve,resolveUrl:O,noopTest:ce,merge:ne,splitCells:w,rtrim:B,findClosingBracket:P,checkSanitizeDeprecation:S},p=T.defaults,d=D.rtrim,C=D.splitCells,F=D.escape,Q=D.findClosingBracket;function Ce(ee,Y,Z){var y=Y.href,x=Y.title?F(Y.title):null,A=ee[1].replace(/\\([\[\]])/g,"$1");return ee[0].charAt(0)!=="!"?{type:"link",raw:Z,href:y,title:x,text:A}:{type:"image",raw:Z,href:y,title:x,text:F(A)}}function Oe(ee,Y){var Z=ee.match(/^(\s+)(?:```)/);if(Z===null)return Y;var y=Z[1];return Y.split(`
`).map(function(x){var A=x.match(/^\s+/);if(A===null)return x;var N=A[0];return N.length>=y.length?x.slice(y.length):x}).join(`
`)}var me=function(){function ee(Z){this.options=Z||p}var Y=ee.prototype;return Y.space=function(y){var x=this.rules.block.newline.exec(y);if(x)return x[0].length>1?{type:"space",raw:x[0]}:{raw:`
`}},Y.code=function(y,x){var A=this.rules.block.code.exec(y);if(A){var N=x[x.length-1];if(N&&N.type==="paragraph")return{raw:A[0],text:A[0].trimRight()};var le=A[0].replace(/^ {4}/gm,"");return{type:"code",raw:A[0],codeBlockStyle:"indented",text:this.options.pedantic?le:d(le,`
`)}}},Y.fences=function(y){var x=this.rules.block.fences.exec(y);if(x){var A=x[0],N=Oe(A,x[3]||"");return{type:"code",raw:A,lang:x[2]?x[2].trim():x[2],text:N}}},Y.heading=function(y){var x=this.rules.block.heading.exec(y);if(x)return{type:"heading",raw:x[0],depth:x[1].length,text:x[2]}},Y.nptable=function(y){var x=this.rules.block.nptable.exec(y);if(x){var A={type:"table",header:C(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(`
`):[],raw:x[0]};if(A.header.length===A.align.length){var N=A.align.length,le;for(le=0;le<N;le++)/^ *-+: *$/.test(A.align[le])?A.align[le]="right":/^ *:-+: *$/.test(A.align[le])?A.align[le]="center":/^ *:-+ *$/.test(A.align[le])?A.align[le]="left":A.align[le]=null;for(N=A.cells.length,le=0;le<N;le++)A.cells[le]=C(A.cells[le],A.header.length);return A}}},Y.hr=function(y){var x=this.rules.block.hr.exec(y);if(x)return{type:"hr",raw:x[0]}},Y.blockquote=function(y){var x=this.rules.block.blockquote.exec(y);if(x){var A=x[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:x[0],text:A}}},Y.list=function(y){var x=this.rules.block.list.exec(y);if(x){for(var A=x[0],N=x[2],le=N.length>1,we=N[N.length-1]===")",Ge={type:"list",raw:A,ordered:le,start:le?+N.slice(0,-1):"",loose:!1,items:[]},st=x[0].match(this.rules.block.item),Ct=!1,Ae,bt,dt,qe,_t,Ot,At,Mt=st.length,Tt=0;Tt<Mt;Tt++)Ae=st[Tt],A=Ae,bt=Ae.length,Ae=Ae.replace(/^ *([*+-]|\d+[.)]) */,""),~Ae.indexOf(`
`)&&(bt-=Ae.length,Ae=this.options.pedantic?Ae.replace(/^ {1,4}/gm,""):Ae.replace(new RegExp("^ {1,"+bt+"}","gm"),"")),Tt!==Mt-1&&(dt=this.rules.block.bullet.exec(st[Tt+1])[0],(le?dt.length===1||!we&&dt[dt.length-1]===")":dt.length>1||this.options.smartLists&&dt!==N)&&(qe=st.slice(Tt+1).join(`
`),Ge.raw=Ge.raw.substring(0,Ge.raw.length-qe.length),Tt=Mt-1)),_t=Ct||/\n\n(?!\s*$)/.test(Ae),Tt!==Mt-1&&(Ct=Ae.charAt(Ae.length-1)===`
`,_t||(_t=Ct)),_t&&(Ge.loose=!0),Ot=/^\[[ xX]\] /.test(Ae),At=void 0,Ot&&(At=Ae[1]!==" ",Ae=Ae.replace(/^\[[ xX]\] +/,"")),Ge.items.push({type:"list_item",raw:A,task:Ot,checked:At,loose:_t,text:Ae});return Ge}},Y.html=function(y){var x=this.rules.block.html.exec(y);if(x)return{type:this.options.sanitize?"paragraph":"html",raw:x[0],pre:!this.options.sanitizer&&(x[1]==="pre"||x[1]==="script"||x[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(x[0]):F(x[0]):x[0]}},Y.def=function(y){var x=this.rules.block.def.exec(y);if(x){x[3]&&(x[3]=x[3].substring(1,x[3].length-1));var A=x[1].toLowerCase().replace(/\s+/g," ");return{tag:A,raw:x[0],href:x[2],title:x[3]}}},Y.table=function(y){var x=this.rules.block.table.exec(y);if(x){var A={type:"table",header:C(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(`
`):[]};if(A.header.length===A.align.length){A.raw=x[0];var N=A.align.length,le;for(le=0;le<N;le++)/^ *-+: *$/.test(A.align[le])?A.align[le]="right":/^ *:-+: *$/.test(A.align[le])?A.align[le]="center":/^ *:-+ *$/.test(A.align[le])?A.align[le]="left":A.align[le]=null;for(N=A.cells.length,le=0;le<N;le++)A.cells[le]=C(A.cells[le].replace(/^ *\| *| *\| *$/g,""),A.header.length);return A}}},Y.lheading=function(y){var x=this.rules.block.lheading.exec(y);if(x)return{type:"heading",raw:x[0],depth:x[2].charAt(0)==="="?1:2,text:x[1]}},Y.paragraph=function(y){var x=this.rules.block.paragraph.exec(y);if(x)return{type:"paragraph",raw:x[0],text:x[1].charAt(x[1].length-1)===`
`?x[1].slice(0,-1):x[1]}},Y.text=function(y,x){var A=this.rules.block.text.exec(y);if(A){var N=x[x.length-1];return N&&N.type==="text"?{raw:A[0],text:A[0]}:{type:"text",raw:A[0],text:A[0]}}},Y.escape=function(y){var x=this.rules.inline.escape.exec(y);if(x)return{type:"escape",raw:x[0],text:F(x[1])}},Y.tag=function(y,x,A){var N=this.rules.inline.tag.exec(y);if(N)return!x&&/^<a /i.test(N[0])?x=!0:x&&/^<\/a>/i.test(N[0])&&(x=!1),!A&&/^<(pre|code|kbd|script)(\s|>)/i.test(N[0])?A=!0:A&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(N[0])&&(A=!1),{type:this.options.sanitize?"text":"html",raw:N[0],inLink:x,inRawBlock:A,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):F(N[0]):N[0]}},Y.link=function(y){var x=this.rules.inline.link.exec(y);if(x){var A=Q(x[2],"()");if(A>-1){var N=x[0].indexOf("!")===0?5:4,le=N+x[1].length+A;x[2]=x[2].substring(0,A),x[0]=x[0].substring(0,le).trim(),x[3]=""}var we=x[2],Ge="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);st?(we=st[1],Ge=st[3]):Ge=""}else Ge=x[3]?x[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var Ct=Ce(x,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},x[0]);return Ct}},Y.reflink=function(y,x){var A;if((A=this.rules.inline.reflink.exec(y))||(A=this.rules.inline.nolink.exec(y))){var N=(A[2]||A[1]).replace(/\s+/g," ");if(N=x[N.toLowerCase()],!N||!N.href){var le=A[0].charAt(0);return{type:"text",raw:le,text:le}}var we=Ce(A,N,A[0]);return we}},Y.strong=function(y,x,A){A===void 0&&(A="");var N=this.rules.inline.strong.start.exec(y);if(N&&(!N[1]||N[1]&&(A===""||this.rules.inline.punctuation.exec(A)))){x=x.slice(-1*y.length);var le=N[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;le.lastIndex=0;for(var we;(N=le.exec(x))!=null;)if(we=this.rules.inline.strong.middle.exec(x.slice(0,N.index+3)),we)return{type:"strong",raw:y.slice(0,we[0].length),text:y.slice(2,we[0].length-2)}}},Y.em=function(y,x,A){A===void 0&&(A="");var N=this.rules.inline.em.start.exec(y);if(N&&(!N[1]||N[1]&&(A===""||this.rules.inline.punctuation.exec(A)))){x=x.slice(-1*y.length);var le=N[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;le.lastIndex=0;for(var we;(N=le.exec(x))!=null;)if(we=this.rules.inline.em.middle.exec(x.slice(0,N.index+2)),we)return{type:"em",raw:y.slice(0,we[0].length),text:y.slice(1,we[0].length-1)}}},Y.codespan=function(y){var x=this.rules.inline.code.exec(y);if(x){var A=x[2].replace(/\n/g," "),N=/[^ ]/.test(A),le=A.startsWith(" ")&&A.endsWith(" ");return N&&le&&(A=A.substring(1,A.length-1)),A=F(A,!0),{type:"codespan",raw:x[0],text:A}}},Y.br=function(y){var x=this.rules.inline.br.exec(y);if(x)return{type:"br",raw:x[0]}},Y.del=function(y){var x=this.rules.inline.del.exec(y);if(x)return{type:"del",raw:x[0],text:x[1]}},Y.autolink=function(y,x){var A=this.rules.inline.autolink.exec(y);if(A){var N,le;return A[2]==="@"?(N=F(this.options.mangle?x(A[1]):A[1]),le="mailto:"+N):(N=F(A[1]),le=N),{type:"link",raw:A[0],text:N,href:le,tokens:[{type:"text",raw:N,text:N}]}}},Y.url=function(y,x){var A;if(A=this.rules.inline.url.exec(y)){var N,le;if(A[2]==="@")N=F(this.options.mangle?x(A[0]):A[0]),le="mailto:"+N;else{var we;do we=A[0],A[0]=this.rules.inline._backpedal.exec(A[0])[0];while(we!==A[0]);N=F(A[0]),A[1]==="www."?le="http://"+N:le=N}return{type:"link",raw:A[0],text:N,href:le,tokens:[{type:"text",raw:N,text:N}]}}},Y.inlineText=function(y,x,A){var N=this.rules.inline.text.exec(y);if(N){var le;return x?le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):F(N[0]):N[0]:le=F(this.options.smartypants?A(N[0]):N[0]),{type:"text",raw:N[0],text:le}}},ee}(),ve=D.noopTest,ge=D.edit,ue=D.merge,q={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ve,table:ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};q._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,q._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,q.def=ge(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=ge(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.list=ge(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=ge(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=ge(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=ge(q.blockquote).replace("paragraph",q.paragraph).getRegex(),q.normal=ue({},q),q.gfm=ue({},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=ge(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=ge(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=ue({},q.normal,{html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",q._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ve,paragraph:ge(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 W={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ve,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ve,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};W._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",W.punctuation=ge(W.punctuation).replace(/punctuation/g,W._punctuation).getRegex(),W._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",W._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",W.em.start=ge(W.em.start).replace(/punctuation/g,W._punctuation).getRegex(),W.em.middle=ge(W.em.middle).replace(/punctuation/g,W._punctuation).replace(/overlapSkip/g,W._overlapSkip).getRegex(),W.em.endAst=ge(W.em.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.em.endUnd=ge(W.em.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.start=ge(W.strong.start).replace(/punctuation/g,W._punctuation).getRegex(),W.strong.middle=ge(W.strong.middle).replace(/punctuation/g,W._punctuation).replace(/blockSkip/g,W._blockSkip).getRegex(),W.strong.endAst=ge(W.strong.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.endUnd=ge(W.strong.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.blockSkip=ge(W._blockSkip,"g").getRegex(),W.overlapSkip=ge(W._overlapSkip,"g").getRegex(),W._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,W._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,W._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])?)+(?![-_])/,W.autolink=ge(W.autolink).replace("scheme",W._scheme).replace("email",W._email).getRegex(),W._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,W.tag=ge(W.tag).replace("comment",q._comment).replace("attribute",W._attribute).getRegex(),W._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,W._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,W._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,W.link=ge(W.link).replace("label",W._label).replace("href",W._href).replace("title",W._title).getRegex(),W.reflink=ge(W.reflink).replace("label",W._label).getRegex(),W.reflinkSearch=ge(W.reflinkSearch,"g").replace("reflink",W.reflink).replace("nolink",W.nolink).getRegex(),W.normal=ue({},W),W.pedantic=ue({},W.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:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",W._label).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W._label).getRegex()}),W.gfm=ue({},W.normal,{escape:ge(W.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),W.gfm.url=ge(W.gfm.url,"i").replace("email",W.gfm._extended_email).getRegex(),W.breaks=ue({},W.gfm,{br:ge(W.br).replace("{2,}","*").getRegex(),text:ge(W.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:q,inline:W},V=T.defaults,R=b.block,ye=b.inline;function Ee(ee){return ee.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(ee){var Y="",Z,y,x=ee.length;for(Z=0;Z<x;Z++)y=ee.charCodeAt(Z),Math.random()>.5&&(y="x"+y.toString(16)),Y+="&#"+y+";";return Y}var Le=function(){function ee(Z){this.tokens=[],this.tokens.links=Object.create(null),this.options=Z||V,this.options.tokenizer=this.options.tokenizer||new me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var y={block:R.normal,inline:ye.normal};this.options.pedantic?(y.block=R.pedantic,y.inline=ye.pedantic):this.options.gfm&&(y.block=R.gfm,this.options.breaks?y.inline=ye.breaks:y.inline=ye.gfm),this.tokenizer.rules=y}ee.lex=function(y,x){var A=new ee(x);return A.lex(y)};var Y=ee.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,x,A){x===void 0&&(x=[]),A===void 0&&(A=!0),y=y.replace(/^ +$/gm,"");for(var N,le,we,Ge;y;){if(N=this.tokenizer.space(y)){y=y.substring(N.raw.length),N.type&&x.push(N);continue}if(N=this.tokenizer.code(y,x)){y=y.substring(N.raw.length),N.type?x.push(N):(Ge=x[x.length-1],Ge.raw+=`
`+N.raw,Ge.text+=`
`+N.text);continue}if(N=this.tokenizer.fences(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.heading(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.nptable(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.hr(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.blockquote(y)){y=y.substring(N.raw.length),N.tokens=this.blockTokens(N.text,[],A),x.push(N);continue}if(N=this.tokenizer.list(y)){for(y=y.substring(N.raw.length),we=N.items.length,le=0;le<we;le++)N.items[le].tokens=this.blockTokens(N.items[le].text,[],!1);x.push(N);continue}if(N=this.tokenizer.html(y)){y=y.substring(N.raw.length),x.push(N);continue}if(A&&(N=this.tokenizer.def(y))){y=y.substring(N.raw.length),this.tokens.links[N.tag]||(this.tokens.links[N.tag]={href:N.href,title:N.title});continue}if(N=this.tokenizer.table(y)){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.lheading(y)){y=y.substring(N.raw.length),x.push(N);continue}if(A&&(N=this.tokenizer.paragraph(y))){y=y.substring(N.raw.length),x.push(N);continue}if(N=this.tokenizer.text(y,x)){y=y.substring(N.raw.length),N.type?x.push(N):(Ge=x[x.length-1],Ge.raw+=`
`+N.raw,Ge.text+=`
`+N.text);continue}if(y){var st="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(st);break}else throw new Error(st)}}return x},Y.inline=function(y){var x,A,N,le,we,Ge,st=y.length;for(x=0;x<st;x++){Ge=y[x];switch(Ge.type){case"paragraph":case"text":case"heading":{Ge.tokens=[],this.inlineTokens(Ge.text,Ge.tokens);break}case"table":{for(Ge.tokens={header:[],cells:[]},le=Ge.header.length,A=0;A<le;A++)Ge.tokens.header[A]=[],this.inlineTokens(Ge.header[A],Ge.tokens.header[A]);for(le=Ge.cells.length,A=0;A<le;A++)for(we=Ge.cells[A],Ge.tokens.cells[A]=[],N=0;N<we.length;N++)Ge.tokens.cells[A][N]=[],this.inlineTokens(we[N],Ge.tokens.cells[A][N]);break}case"blockquote":{this.inline(Ge.tokens);break}case"list":{for(le=Ge.items.length,A=0;A<le;A++)this.inline(Ge.items[A].tokens);break}}}return y},Y.inlineTokens=function(y,x,A,N,le){x===void 0&&(x=[]),A===void 0&&(A=!1),N===void 0&&(N=!1),le===void 0&&(le="");var we,Ge=y,st;if(this.tokens.links){var Ct=Object.keys(this.tokens.links);if(Ct.length>0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(Ge))!=null;)Ct.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(Ge))!=null;)Ge=Ge.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;y;){if(we=this.tokenizer.escape(y)){y=y.substring(we.raw.length),x.push(we);continue}if(we=this.tokenizer.tag(y,A,N)){y=y.substring(we.raw.length),A=we.inLink,N=we.inRawBlock,x.push(we);continue}if(we=this.tokenizer.link(y)){y=y.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,N)),x.push(we);continue}if(we=this.tokenizer.reflink(y,this.tokens.links)){y=y.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,N)),x.push(we);continue}if(we=this.tokenizer.strong(y,Ge,le)){y=y.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],A,N),x.push(we);continue}if(we=this.tokenizer.em(y,Ge,le)){y=y.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],A,N),x.push(we);continue}if(we=this.tokenizer.codespan(y)){y=y.substring(we.raw.length),x.push(we);continue}if(we=this.tokenizer.br(y)){y=y.substring(we.raw.length),x.push(we);continue}if(we=this.tokenizer.del(y)){y=y.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],A,N),x.push(we);continue}if(we=this.tokenizer.autolink(y,re)){y=y.substring(we.raw.length),x.push(we);continue}if(!A&&(we=this.tokenizer.url(y,re))){y=y.substring(we.raw.length),x.push(we);continue}if(we=this.tokenizer.inlineText(y,N,Ee)){y=y.substring(we.raw.length),le=we.raw.slice(-1),x.push(we);continue}if(y){var Ae="Infinite loop on byte: "+y.charCodeAt(0);if(this.options.silent){console.error(Ae);break}else throw new Error(Ae)}}return x},se(ee,null,[{key:"rules",get:function(){return{block:R,inline:ye}}}]),ee}(),Ue=T.defaults,Ke=D.cleanUrl,Fe=D.escape,Ie=function(){function ee(Z){this.options=Z||Ue}var Y=ee.prototype;return Y.code=function(y,x,A){var N=(x||"").match(/\S*/)[0];if(this.options.highlight){var le=this.options.highlight(y,N);le!=null&&le!==y&&(A=!0,y=le)}return N?'<pre><code class="'+this.options.langPrefix+Fe(N,!0)+'">'+(A?y:Fe(y,!0))+`</code></pre>
`:"<pre><code>"+(A?y:Fe(y,!0))+`</code></pre>
`},Y.blockquote=function(y){return`<blockquote>
`+y+`</blockquote>
`},Y.html=function(y){return y},Y.heading=function(y,x,A,N){return this.options.headerIds?"<h"+x+' id="'+this.options.headerPrefix+N.slug(A)+'">'+y+"</h"+x+`>
`:"<h"+x+">"+y+"</h"+x+`>
`},Y.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Y.list=function(y,x,A){var N=x?"ol":"ul",le=x&&A!==1?' start="'+A+'"':"";return"<"+N+le+`>
`+y+"</"+N+`>
`},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,x){return x&&(x="<tbody>"+x+"</tbody>"),`<table>
<thead>
`+y+`</thead>
`+x+`</table>
`},Y.tablerow=function(y){return`<tr>
`+y+`</tr>
`},Y.tablecell=function(y,x){var A=x.header?"th":"td",N=x.align?"<"+A+' align="'+x.align+'">':"<"+A+">";return N+y+"</"+A+`>
`},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,x,A){if(y=Ke(this.options.sanitize,this.options.baseUrl,y),y===null)return A;var N='<a href="'+Fe(y)+'"';return x&&(N+=' title="'+x+'"'),N+=">"+A+"</a>",N},Y.image=function(y,x,A){if(y=Ke(this.options.sanitize,this.options.baseUrl,y),y===null)return A;var N='<img src="'+y+'" alt="'+A+'"';return x&&(N+=' title="'+x+'"'),N+=this.options.xhtml?"/>":">",N},Y.text=function(y){return y},ee}(),Xe=function(){function ee(){}var Y=ee.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,x,A){return""+A},Y.image=function(y,x,A){return""+A},Y.br=function(){return""},ee}(),mt=function(){function ee(){this.seen={}}var Y=ee.prototype;return Y.slug=function(y){var x=y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(x)){var A=x;do this.seen[A]++,x=A+"-"+this.seen[A];while(this.seen.hasOwnProperty(x))}return this.seen[x]=0,x},ee}(),tt=T.defaults,it=D.unescape,et=function(){function ee(Z){this.options=Z||tt,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Xe,this.slugger=new mt}ee.parse=function(y,x){var A=new ee(x);return A.parse(y)};var Y=ee.prototype;return Y.parse=function(y,x){x===void 0&&(x=!0);var A="",N,le,we,Ge,st,Ct,Ae,bt,dt,qe,_t,Ot,At,Mt,Tt,tn,on,pt,Vn=y.length;for(N=0;N<Vn;N++){qe=y[N];switch(qe.type){case"space":continue;case"hr":{A+=this.renderer.hr();continue}case"heading":{A+=this.renderer.heading(this.parseInline(qe.tokens),qe.depth,it(this.parseInline(qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{A+=this.renderer.code(qe.text,qe.lang,qe.escaped);continue}case"table":{for(bt="",Ae="",Ge=qe.header.length,le=0;le<Ge;le++)Ae+=this.renderer.tablecell(this.parseInline(qe.tokens.header[le]),{header:!0,align:qe.align[le]});for(bt+=this.renderer.tablerow(Ae),dt="",Ge=qe.cells.length,le=0;le<Ge;le++){for(Ct=qe.tokens.cells[le],Ae="",st=Ct.length,we=0;we<st;we++)Ae+=this.renderer.tablecell(this.parseInline(Ct[we]),{header:!1,align:qe.align[we]});dt+=this.renderer.tablerow(Ae)}A+=this.renderer.table(bt,dt);continue}case"blockquote":{dt=this.parse(qe.tokens),A+=this.renderer.blockquote(dt);continue}case"list":{for(_t=qe.ordered,Ot=qe.start,At=qe.loose,Ge=qe.items.length,dt="",le=0;le<Ge;le++)Tt=qe.items[le],tn=Tt.checked,on=Tt.task,Mt="",Tt.task&&(pt=this.renderer.checkbox(tn),At?Tt.tokens.length>0&&Tt.tokens[0].type==="text"?(Tt.tokens[0].text=pt+" "+Tt.tokens[0].text,Tt.tokens[0].tokens&&Tt.tokens[0].tokens.length>0&&Tt.tokens[0].tokens[0].type==="text"&&(Tt.tokens[0].tokens[0].text=pt+" "+Tt.tokens[0].tokens[0].text)):Tt.tokens.unshift({type:"text",text:pt}):Mt+=pt),Mt+=this.parse(Tt.tokens,At),dt+=this.renderer.listitem(Mt,on,tn);A+=this.renderer.list(dt,_t,Ot);continue}case"html":{A+=this.renderer.html(qe.text);continue}case"paragraph":{A+=this.renderer.paragraph(this.parseInline(qe.tokens));continue}case"text":{for(dt=qe.tokens?this.parseInline(qe.tokens):qe.text;N+1<Vn&&y[N+1].type==="text";)qe=y[++N],dt+=`
`+(qe.tokens?this.parseInline(qe.tokens):qe.text);A+=x?this.renderer.paragraph(dt):dt;continue}default:{var xn='Token with "'+qe.type+'" type was not found.';if(this.options.silent){console.error(xn);return}else throw new Error(xn)}}}return A},Y.parseInline=function(y,x){x=x||this.renderer;var A="",N,le,we=y.length;for(N=0;N<we;N++){le=y[N];switch(le.type){case"escape":{A+=x.text(le.text);break}case"html":{A+=x.html(le.text);break}case"link":{A+=x.link(le.href,le.title,this.parseInline(le.tokens,x));break}case"image":{A+=x.image(le.href,le.title,le.text);break}case"strong":{A+=x.strong(this.parseInline(le.tokens,x));break}case"em":{A+=x.em(this.parseInline(le.tokens,x));break}case"codespan":{A+=x.codespan(le.text);break}case"br":{A+=x.br();break}case"del":{A+=x.del(this.parseInline(le.tokens,x));break}case"text":{A+=x.text(le.text);break}default:{var Ge='Token with "'+le.type+'" type was not found.';if(this.options.silent){console.error(Ge);return}else throw new Error(Ge)}}}return A},ee}(),gt=D.merge,lt=D.checkSanitizeDeprecation,at=D.escape,_e=T.getDefaults,vt=T.changeDefaults,rt=T.defaults;function Re(ee,Y,Z){if(typeof ee=="undefined"||ee===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ee!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ee)+", string expected");if(typeof Y=="function"&&(Z=Y,Y=null),Y=gt({},Re.defaults,Y||{}),lt(Y),Z){var y=Y.highlight,x;try{x=Le.lex(ee,Y)}catch(we){return Z(we)}var A=function(Ge){var st;if(!Ge)try{st=et.parse(x,Y)}catch(Ct){Ge=Ct}return Y.highlight=y,Ge?Z(Ge):Z(null,st)};if(!y||y.length<3)return A();if(delete Y.highlight,!x.length)return A();var N=0;Re.walkTokens(x,function(we){we.type==="code"&&(N++,setTimeout(function(){y(we.text,we.lang,function(Ge,st){if(Ge)return A(Ge);st!=null&&st!==we.text&&(we.text=st,we.escaped=!0),N--,N===0&&A()})},0))}),N===0&&A();return}try{var le=Le.lex(ee,Y);return Y.walkTokens&&Re.walkTokens(le,Y.walkTokens),et.parse(le,Y)}catch(we){if(we.message+=`
Please report this to https://github.com/markedjs/marked.`,Y.silent)return"<p>An error occurred:</p><pre>"+at(we.message+"",!0)+"</pre>";throw we}}Re.options=Re.setOptions=function(ee){return gt(Re.defaults,ee),vt(Re.defaults),Re},Re.getDefaults=_e,Re.defaults=rt,Re.use=function(ee){var Y=gt({},ee);if(ee.renderer&&function(){var y=Re.defaults.renderer||new Ie,x=function(le){var we=y[le];y[le]=function(){for(var Ge=arguments.length,st=new Array(Ge),Ct=0;Ct<Ge;Ct++)st[Ct]=arguments[Ct];var Ae=ee.renderer[le].apply(y,st);return Ae===!1&&(Ae=we.apply(y,st)),Ae}};for(var A in ee.renderer)x(A);Y.renderer=y}(),ee.tokenizer&&function(){var y=Re.defaults.tokenizer||new me,x=function(le){var we=y[le];y[le]=function(){for(var Ge=arguments.length,st=new Array(Ge),Ct=0;Ct<Ge;Ct++)st[Ct]=arguments[Ct];var Ae=ee.tokenizer[le].apply(y,st);return Ae===!1&&(Ae=we.apply(y,st)),Ae}};for(var A in ee.tokenizer)x(A);Y.tokenizer=y}(),ee.walkTokens){var Z=Re.defaults.walkTokens;Y.walkTokens=function(y){ee.walkTokens(y),Z&&Z(y)}}Re.setOptions(Y)},Re.walkTokens=function(ee,Y){for(var Z=fe(ee),y;!(y=Z()).done;){var x=y.value;Y(x);switch(x.type){case"table":{for(var A=fe(x.tokens.header),N;!(N=A()).done;){var le=N.value;Re.walkTokens(le,Y)}for(var we=fe(x.tokens.cells),Ge;!(Ge=we()).done;)for(var st=Ge.value,Ct=fe(st),Ae;!(Ae=Ct()).done;){var bt=Ae.value;Re.walkTokens(bt,Y)}break}case"list":{Re.walkTokens(x.items,Y);break}default:x.tokens&&Re.walkTokens(x.tokens,Y)}}},Re.Parser=et,Re.parser=et.parse,Re.Renderer=Ie,Re.TextRenderer=Xe,Re.Lexer=Le,Re.lexer=Le.lex,Re.Tokenizer=me,Re.Slugger=mt,Re.parse=Re;var ze=Re;return ze})},ELLl:function(ot,Qe,k){(function(U){U(k("VrN/"))})(function(U){var se={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ie=U.Pos;U.defineOption("autoCloseBrackets",!1,function(H,X,J){J&&J!=U.Init&&(H.removeKeyMap(fe),H.state.closeBrackets=null),X&&(z(xe(X,"pairs")),H.state.closeBrackets=X,H.addKeyMap(fe))});function xe(H,X){return X=="pairs"&&typeof H=="string"?H:typeof H=="object"&&H[X]!=null?H[X]:se[X]}var fe={Backspace:j,Enter:L};function z(H){for(var X=0;X<H.length;X++){var J=H.charAt(X),ae="'"+J+"'";fe[ae]||(fe[ae]=T(J))}}z(se.pairs+"`");function T(H){return function(X){return E(X,H)}}function M(H){var X=H.state.closeBrackets;if(!X||X.override)return X;var J=H.getModeAt(H.getCursor());return J.closeBrackets||X}function j(H){var X=M(H);if(!X||H.getOption("disableInput"))return U.Pass;for(var J=xe(X,"pairs"),ae=H.listSelections(),de=0;de<ae.length;de++){if(!ae[de].empty())return U.Pass;var Be=te(H,ae[de].head);if(!Be||J.indexOf(Be)%2!=0)return U.Pass}for(var de=ae.length-1;de>=0;de--){var $e=ae[de].head;H.replaceRange("",ie($e.line,$e.ch-1),ie($e.line,$e.ch+1),"+delete")}}function L(H){var X=M(H),J=X&&xe(X,"explode");if(!J||H.getOption("disableInput"))return U.Pass;for(var ae=H.listSelections(),de=0;de<ae.length;de++){if(!ae[de].empty())return U.Pass;var Be=te(H,ae[de].head);if(!Be||J.indexOf(Be)%2!=0)return U.Pass}H.operation(function(){var $e=H.lineSeparator()||`
`;H.replaceSelection($e+$e,null),H.execCommand("goCharLeft"),ae=H.listSelections();for(var Se=0;Se<ae.length;Se++){var De=ae[Se].head.line;H.indentLine(De,null,!0),H.indentLine(De+1,null,!0)}})}function _(H){var X=U.cmpPos(H.anchor,H.head)>0;return{anchor:new ie(H.anchor.line,H.anchor.ch+(X?-1:1)),head:new ie(H.head.line,H.head.ch+(X?1:-1))}}function E(H,X){var J=M(H);if(!J||H.getOption("disableInput"))return U.Pass;var ae=xe(J,"pairs"),de=ae.indexOf(X);if(de==-1)return U.Pass;for(var Be=xe(J,"closeBefore"),$e=xe(J,"triples"),Se=ae.charAt(de+1)==X,De=H.listSelections(),Ve=de%2==0,ke,Te=0;Te<De.length;Te++){var Ne=De[Te],be=Ne.head,O,ce=H.getRange(be,ie(be.line,be.ch+1));if(Ve&&!Ne.empty())O="surround";else if((Se||!Ve)&&ce==X)Se&&$(H,be)?O="both":$e.indexOf(X)>=0&&H.getRange(be,ie(be.line,be.ch+3))==X+X+X?O="skipThree":O="skip";else if(Se&&be.ch>1&&$e.indexOf(X)>=0&&H.getRange(ie(be.line,be.ch-2),be)==X+X){if(be.ch>2&&/\bstring/.test(H.getTokenTypeAt(ie(be.line,be.ch-2))))return U.Pass;O="addFour"}else if(Se){var ne=be.ch==0?" ":H.getRange(ie(be.line,be.ch-1),be);if(!U.isWordChar(ce)&&ne!=X&&!U.isWordChar(ne))O="both";else return U.Pass}else if(Ve&&(ce.length===0||/\s/.test(ce)||Be.indexOf(ce)>-1))O="both";else return U.Pass;if(!ke)ke=O;else if(ke!=O)return U.Pass}var w=de%2?ae.charAt(de-1):X,B=de%2?X:ae.charAt(de+1);H.operation(function(){if(ke=="skip")H.execCommand("goCharRight");else if(ke=="skipThree")for(var P=0;P<3;P++)H.execCommand("goCharRight");else if(ke=="surround"){for(var S=H.getSelections(),P=0;P<S.length;P++)S[P]=w+S[P]+B;H.replaceSelections(S,"around"),S=H.listSelections().slice();for(var P=0;P<S.length;P++)S[P]=_(S[P]);H.setSelections(S)}else ke=="both"?(H.replaceSelection(w+B,null),H.triggerElectric(w+B),H.execCommand("goCharLeft")):ke=="addFour"&&(H.replaceSelection(w+w+w+w,"before"),H.execCommand("goCharRight"))})}function te(H,X){var J=H.getRange(ie(X.line,X.ch-1),ie(X.line,X.ch+1));return J.length==2?J:null}function $(H,X){var J=H.getTokenAt(ie(X.line,X.ch+1));return/\bstring/.test(J.type)&&J.start==X.ch&&(X.ch==0||!/\bstring/.test(H.getTokenTypeAt(X)))}})},GfqC:function(ot,Qe,k){"use strict";var U=k("q1tI"),se=k.n(U),ie=k("TSYQ"),xe=k.n(ie);function fe(D,p){var d="cannot "+D.method+" "+D.action+" "+p.status+"'",C=new Error(d);return C.status=p.status,C.method=D.method,C.url=D.action,C}function z(D){var p=D.responseText||D.response;if(!p)return p;try{return JSON.parse(p)}catch(d){return p}}function T(D){var p=new XMLHttpRequest;D.onProgress&&p.upload&&(p.upload.onprogress=function(Q){Q.total>0&&(Q.percent=Q.loaded/Q.total*100),D.onProgress(Q)});var d=new FormData;D.data&&Object.keys(D.data).forEach(function(F){var Q=D.data[F];if(Array.isArray(Q)){Q.forEach(function(Ce){d.append(F+"[]",Ce)});return}d.append(F,D.data[F])}),D.file instanceof Blob?d.append(D.filename,D.file,D.file.name):d.append(D.filename,D.file),p.onerror=function(Q){D.onError(Q)},p.onload=function(){return p.status<200||p.status>=300?D.onError(fe(D,p),z(p)):D.onSuccess(z(p),p)},p.open(D.method,D.action,!0),D.withCredentials&&"withCredentials"in p&&(p.withCredentials=!0);var C=D.headers||{};return C["X-Requested-With"]!==null&&p.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(C).forEach(function(F){C[F]!==null&&p.setRequestHeader(F,C[F])}),p.send(d),{abort:function(){p.abort()}}}var M=+new Date,j=0;function L(){return"rc-upload-"+M+"-"+ ++j}function _(D,p){return D.indexOf(p,D.length-p.length)!==-1}var E=function(D,p){if(D&&p){var d=Array.isArray(p)?p:p.split(","),C=D.name||"",F=D.type||"",Q=F.replace(/\/.*$/,"");return d.some(function(Ce){var Oe=Ce.trim();return Oe.charAt(0)==="."?_(C.toLowerCase(),Oe.toLowerCase()):/\/\*$/.test(Oe)?Q===Oe.replace(/\/.*$/,""):F===Oe})}return!0};function te(D,p){var d=D.createReader(),C=[];function F(){d.readEntries(function(Q){var Ce=Array.prototype.slice.apply(Q);C=C.concat(Ce);var Oe=!Ce.length;Oe?p(C):F()})}F()}var $=function(p,d,C){var F=function Q(Ce,Oe){Oe=Oe||"",Ce.isFile?Ce.file(function(me){C(me)&&(Ce.fullPath&&!me.webkitRelativePath&&(Object.defineProperties(me,{webkitRelativePath:{writable:!0}}),me.webkitRelativePath=Ce.fullPath.replace(/^\//,""),Object.defineProperties(me,{webkitRelativePath:{writable:!1}})),d([me]))}):Ce.isDirectory&&te(Ce,function(me){me.forEach(function(ve){Q(ve,""+Oe+Ce.name+"/")})})};p.forEach(function(Q){F(Q.webkitGetAsEntry())})},H=$,X=Object.assign||function(D){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var C in d)Object.prototype.hasOwnProperty.call(d,C)&&(D[C]=d[C])}return D},J=function(){function D(p,d){var C=[],F=!0,Q=!1,Ce=void 0;try{for(var Oe=p[Symbol.iterator](),me;!(F=(me=Oe.next()).done)&&!(C.push(me.value),d&&C.length===d);F=!0);}catch(ve){Q=!0,Ce=ve}finally{try{!F&&Oe.return&&Oe.return()}finally{if(Q)throw Ce}}return C}return function(p,d){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return D(p,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),ae=function(){function D(p,d){for(var C=0;C<d.length;C++){var F=d[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}return function(p,d,C){return d&&D(p.prototype,d),C&&D(p,C),p}}();function de(D,p,d){return p in D?Object.defineProperty(D,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):D[p]=d,D}function Be(D,p){var d={};for(var C in D){if(p.indexOf(C)>=0)continue;if(!Object.prototype.hasOwnProperty.call(D,C))continue;d[C]=D[C]}return d}function $e(D,p){if(!(D instanceof p))throw new TypeError("Cannot call a class as a function")}function Se(D,p){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:D}function De(D,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);D.prototype=Object.create(p&&p.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(D,p):D.__proto__=p)}var Ve=function(p){return Object.keys(p).reduce(function(d,C){return(C.substr(0,5)==="data-"||C.substr(0,5)==="aria-"||C==="role")&&(d[C]=p[C]),d},{})},ke=function(D){De(p,D);function p(){var d,C,F,Q;$e(this,p);for(var Ce=arguments.length,Oe=Array(Ce),me=0;me<Ce;me++)Oe[me]=arguments[me];return Q=(C=(F=Se(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Oe))),F),F.state={uid:L()},F.reqs={},F.onChange=function(ve){var ge=ve.target.files;F.uploadFiles(ge),F.reset()},F.onClick=function(ve){var ge=F.fileInput;if(!ge)return;var ue=F.props,q=ue.children,W=ue.onClick;q&&q.type==="button"&&(ge.parentNode.focus(),ge.parentNode.querySelector("button").blur()),ge.click(),W&&W(ve)},F.onKeyDown=function(ve){ve.key==="Enter"&&F.onClick()},F.onFileDrop=function(ve){var ge=F.props.multiple;if(ve.preventDefault(),ve.type==="dragover")return;if(F.props.directory)H(Array.prototype.slice.call(ve.dataTransfer.items),F.uploadFiles,function(q){return E(q,F.props.accept)});else{var ue=Array.prototype.slice.call(ve.dataTransfer.files).filter(function(q){return E(q,F.props.accept)});ge===!1&&(ue=ue.slice(0,1)),F.uploadFiles(ue)}},F.uploadFiles=function(ve){var ge=Array.prototype.slice.call(ve);ge.map(function(ue){return ue.uid=L(),ue}).forEach(function(ue){F.upload(ue,ge)})},F.saveFileInput=function(ve){F.fileInput=ve},C),Se(F,Q)}return ae(p,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(C,F){var Q=this,Ce=this.props;if(!Ce.beforeUpload)return setTimeout(function(){return Q.post(C)},0);var Oe=Ce.beforeUpload(C,F);Oe&&Oe.then?Oe.then(function(me){var ve=Object.prototype.toString.call(me);return ve==="[object File]"||ve==="[object Blob]"?Q.post(me):Q.post(C)}).catch(function(me){console.log(me)}):Oe!==!1&&setTimeout(function(){return Q.post(C)},0);return}},{key:"post",value:function(C){var F=this;if(!this._isMounted)return;var Q=this.props,Ce=Q.onStart,Oe=Q.onProgress,me=Q.transformFile,ve=me===void 0?function(ge){return ge}:me;new Promise(function(ge){var ue=Q.action;return typeof ue=="function"&&(ue=ue(C)),ge(ue)}).then(function(ge){var ue=C.uid,q=Q.customRequest||T,W=Promise.resolve(ve(C)).then(function(b){var V=Q.data;return typeof V=="function"&&(V=V(b)),Promise.all([b,V])}).catch(function(b){console.error(b)});W.then(function(b){var V=J(b,2),R=V[0],ye=V[1],Ee={action:ge,filename:Q.name,data:ye,file:R,headers:Q.headers,withCredentials:Q.withCredentials,method:Q.method||"post",onProgress:Oe?function(re){Oe(re,C)}:null,onSuccess:function(Le,Ue){delete F.reqs[ue],Q.onSuccess(Le,C,Ue)},onError:function(Le,Ue){delete F.reqs[ue],Q.onError(Le,Ue,C)}};Ce(C),F.reqs[ue]=q(Ee)})})}},{key:"reset",value:function(){this.setState({uid:L()})}},{key:"abort",value:function(C){var F=this.reqs;if(C){var Q=C;C&&C.uid&&(Q=C.uid),F[Q]&&F[Q].abort&&F[Q].abort(),delete F[Q]}else Object.keys(F).forEach(function(Ce){F[Ce]&&F[Ce].abort&&F[Ce].abort(),delete F[Ce]})}},{key:"render",value:function(){var C,F=this.props,Q=F.component,Ce=F.prefixCls,Oe=F.className,me=F.disabled,ve=F.id,ge=F.style,ue=F.multiple,q=F.accept,W=F.children,b=F.directory,V=F.openFileDialogOnClick,R=F.onMouseEnter,ye=F.onMouseLeave,Ee=Be(F,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),re=xe()((C={},de(C,Ce,!0),de(C,Ce+"-disabled",me),de(C,Oe,Oe),C)),Le=me?{}:{onClick:V?this.onClick:function(){},onKeyDown:V?this.onKeyDown:function(){},onMouseEnter:R,onMouseLeave:ye,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return se.a.createElement(Q,X({},Le,{className:re,role:"button",style:ge}),se.a.createElement("input",X({},Ve(Ee),{id:ve,type:"file",ref:this.saveFileInput,onClick:function(Ke){return Ke.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:q,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:ue,onChange:this.onChange})),W)}}]),p}(U.Component),Te=ke,Ne=Object.assign||function(D){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var C in d)Object.prototype.hasOwnProperty.call(d,C)&&(D[C]=d[C])}return D},be=function(){function D(p,d){for(var C=0;C<d.length;C++){var F=d[C];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}return function(p,d,C){return d&&D(p.prototype,d),C&&D(p,C),p}}();function O(D,p){if(!(D instanceof p))throw new TypeError("Cannot call a class as a function")}function ce(D,p){if(!D)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:D}function ne(D,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);D.prototype=Object.create(p&&p.prototype,{constructor:{value:D,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(D,p):D.__proto__=p)}function w(){}var B=function(D){ne(p,D);function p(){var d,C,F,Q;O(this,p);for(var Ce=arguments.length,Oe=Array(Ce),me=0;me<Ce;me++)Oe[me]=arguments[me];return Q=(C=(F=ce(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Oe))),F),F.saveUploader=function(ve){F.uploader=ve},C),ce(F,Q)}return be(p,[{key:"abort",value:function(C){this.uploader.abort(C)}},{key:"render",value:function(){return se.a.createElement(Te,Ne({},this.props,{ref:this.saveUploader}))}}]),p}(U.Component);B.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:w,onError:w,onSuccess:w,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var P=B,S=Qe.a=P},Gytx:function(ot,Qe){ot.exports=function(U,se,ie,xe){var fe=ie?ie.call(xe,U,se):void 0;if(fe!==void 0)return!!fe;if(U===se)return!0;if(typeof U!="object"||!U||typeof se!="object"||!se)return!1;var z=Object.keys(U),T=Object.keys(se);if(z.length!==T.length)return!1;for(var M=Object.prototype.hasOwnProperty.bind(se),j=0;j<z.length;j++){var L=z[j];if(!M(L))return!1;var _=U[L],E=se[L];if(fe=ie?ie.call(xe,_,E,L):void 0,fe===!1||fe===void 0&&_!==E)return!1}return!0}},H38U:function(ot,Qe,k){var U=k("f4xo"),se=k("rcnY"),ie=k("wU8J"),xe=k("Iq15"),fe=k("dWSS");function z(M,j){this.typeNumber=M,this.errorCorrectLevel=j,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var T=z.prototype;T.addData=function(M){var j=new U(M);this.dataList.push(j),this.dataCache=null},T.isDark=function(M,j){if(M<0||this.moduleCount<=M||j<0||this.moduleCount<=j)throw new Error(M+","+j);return this.modules[M][j]},T.getModuleCount=function(){return this.moduleCount},T.make=function(){if(this.typeNumber<1){var M=1;for(M=1;M<40;M++){for(var j=se.getRSBlocks(M,this.errorCorrectLevel),L=new ie,_=0,E=0;E<j.length;E++)_+=j[E].dataCount;for(var E=0;E<this.dataList.length;E++){var te=this.dataList[E];L.put(te.mode,4),L.put(te.getLength(),xe.getLengthInBits(te.mode,M)),te.write(L)}if(L.getLengthInBits()<=_*8)break}this.typeNumber=M}this.makeImpl(!1,this.getBestMaskPattern())},T.makeImpl=function(M,j){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var L=0;L<this.moduleCount;L++){this.modules[L]=new Array(this.moduleCount);for(var _=0;_<this.moduleCount;_++)this.modules[L][_]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(M,j),this.typeNumber>=7&&this.setupTypeNumber(M),this.dataCache==null&&(this.dataCache=z.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,j)},T.setupPositionProbePattern=function(M,j){for(var L=-1;L<=7;L++){if(M+L<=-1||this.moduleCount<=M+L)continue;for(var _=-1;_<=7;_++){if(j+_<=-1||this.moduleCount<=j+_)continue;0<=L&&L<=6&&(_==0||_==6)||0<=_&&_<=6&&(L==0||L==6)||2<=L&&L<=4&&2<=_&&_<=4?this.modules[M+L][j+_]=!0:this.modules[M+L][j+_]=!1}}},T.getBestMaskPattern=function(){for(var M=0,j=0,L=0;L<8;L++){this.makeImpl(!0,L);var _=xe.getLostPoint(this);(L==0||M>_)&&(M=_,j=L)}return j},T.createMovieClip=function(M,j,L){var _=M.createEmptyMovieClip(j,L),E=1;this.make();for(var te=0;te<this.modules.length;te++)for(var $=te*E,H=0;H<this.modules[te].length;H++){var X=H*E,J=this.modules[te][H];J&&(_.beginFill(0,100),_.moveTo(X,$),_.lineTo(X+E,$),_.lineTo(X+E,$+E),_.lineTo(X,$+E),_.endFill())}return _},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 j=8;j<this.moduleCount-8;j++){if(this.modules[6][j]!=null)continue;this.modules[6][j]=j%2==0}},T.setupPositionAdjustPattern=function(){for(var M=xe.getPatternPosition(this.typeNumber),j=0;j<M.length;j++)for(var L=0;L<M.length;L++){var _=M[j],E=M[L];if(this.modules[_][E]!=null)continue;for(var te=-2;te<=2;te++)for(var $=-2;$<=2;$++)te==-2||te==2||$==-2||$==2||te==0&&$==0?this.modules[_+te][E+$]=!0:this.modules[_+te][E+$]=!1}},T.setupTypeNumber=function(M){for(var j=xe.getBCHTypeNumber(this.typeNumber),L=0;L<18;L++){var _=!M&&(j>>L&1)==1;this.modules[Math.floor(L/3)][L%3+this.moduleCount-8-3]=_}for(var L=0;L<18;L++){var _=!M&&(j>>L&1)==1;this.modules[L%3+this.moduleCount-8-3][Math.floor(L/3)]=_}},T.setupTypeInfo=function(M,j){for(var L=this.errorCorrectLevel<<3|j,_=xe.getBCHTypeInfo(L),E=0;E<15;E++){var te=!M&&(_>>E&1)==1;E<6?this.modules[E][8]=te:E<8?this.modules[E+1][8]=te:this.modules[this.moduleCount-15+E][8]=te}for(var E=0;E<15;E++){var te=!M&&(_>>E&1)==1;E<8?this.modules[8][this.moduleCount-E-1]=te:E<9?this.modules[8][15-E-1+1]=te:this.modules[8][15-E-1]=te}this.modules[this.moduleCount-8][8]=!M},T.mapData=function(M,j){for(var L=-1,_=this.moduleCount-1,E=7,te=0,$=this.moduleCount-1;$>0;$-=2)for($==6&&$--;;){for(var H=0;H<2;H++)if(this.modules[_][$-H]==null){var X=!1;te<M.length&&(X=(M[te]>>>E&1)==1);var J=xe.getMask(j,_,$-H);J&&(X=!X),this.modules[_][$-H]=X,E--,E==-1&&(te++,E=7)}if(_+=L,_<0||this.moduleCount<=_){_-=L,L=-L;break}}},z.PAD0=236,z.PAD1=17,z.createData=function(M,j,L){for(var _=se.getRSBlocks(M,j),E=new ie,te=0;te<L.length;te++){var $=L[te];E.put($.mode,4),E.put($.getLength(),xe.getLengthInBits($.mode,M)),$.write(E)}for(var H=0,te=0;te<_.length;te++)H+=_[te].dataCount;if(E.getLengthInBits()>H*8)throw new Error("code length overflow. ("+E.getLengthInBits()+">"+H*8+")");for(E.getLengthInBits()+4<=H*8&&E.put(0,4);E.getLengthInBits()%8!=0;)E.putBit(!1);for(;!(E.getLengthInBits()>=H*8);){if(E.put(z.PAD0,8),E.getLengthInBits()>=H*8)break;E.put(z.PAD1,8)}return z.createBytes(E,_)},z.createBytes=function(M,j){for(var L=0,_=0,E=0,te=new Array(j.length),$=new Array(j.length),H=0;H<j.length;H++){var X=j[H].dataCount,J=j[H].totalCount-X;_=Math.max(_,X),E=Math.max(E,J),te[H]=new Array(X);for(var ae=0;ae<te[H].length;ae++)te[H][ae]=255&M.buffer[ae+L];L+=X;var de=xe.getErrorCorrectPolynomial(J),Be=new fe(te[H],de.getLength()-1),$e=Be.mod(de);$[H]=new Array(de.getLength()-1);for(var ae=0;ae<$[H].length;ae++){var Se=ae+$e.getLength()-$[H].length;$[H][ae]=Se>=0?$e.get(Se):0}}for(var De=0,ae=0;ae<j.length;ae++)De+=j[ae].totalCount;for(var Ve=new Array(De),ke=0,ae=0;ae<_;ae++)for(var H=0;H<j.length;H++)ae<te[H].length&&(Ve[ke++]=te[H][ae]);for(var ae=0;ae<E;ae++)for(var H=0;H<j.length;H++)ae<$[H].length&&(Ve[ke++]=$[H][ae]);return Ve},ot.exports=z},HmJG:function(ot,Qe,k){},Iq15:function(ot,Qe,k){var U=k("nVVt"),se=k("dWSS"),ie=k("dQei"),xe={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},fe={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(z){for(var T=z<<10;fe.getBCHDigit(T)-fe.getBCHDigit(fe.G15)>=0;)T^=fe.G15<<fe.getBCHDigit(T)-fe.getBCHDigit(fe.G15);return(z<<10|T)^fe.G15_MASK},getBCHTypeNumber:function(z){for(var T=z<<12;fe.getBCHDigit(T)-fe.getBCHDigit(fe.G18)>=0;)T^=fe.G18<<fe.getBCHDigit(T)-fe.getBCHDigit(fe.G18);return z<<12|T},getBCHDigit:function(z){for(var T=0;z!=0;)T++,z>>>=1;return T},getPatternPosition:function(z){return fe.PATTERN_POSITION_TABLE[z-1]},getMask:function(z,T,M){switch(z){case xe.PATTERN000:return(T+M)%2==0;case xe.PATTERN001:return T%2==0;case xe.PATTERN010:return M%3==0;case xe.PATTERN011:return(T+M)%3==0;case xe.PATTERN100:return(Math.floor(T/2)+Math.floor(M/3))%2==0;case xe.PATTERN101:return T*M%2+T*M%3==0;case xe.PATTERN110:return(T*M%2+T*M%3)%2==0;case xe.PATTERN111:return(T*M%3+(T+M)%2)%2==0;default:throw new Error("bad maskPattern:"+z)}},getErrorCorrectPolynomial:function(z){for(var T=new se([1],0),M=0;M<z;M++)T=T.multiply(new se([1,ie.gexp(M)],0));return T},getLengthInBits:function(z,T){if(1<=T&&T<10)switch(z){case U.MODE_NUMBER:return 10;case U.MODE_ALPHA_NUM:return 9;case U.MODE_8BIT_BYTE:return 8;case U.MODE_KANJI:return 8;default:throw new Error("mode:"+z)}else if(T<27)switch(z){case U.MODE_NUMBER:return 12;case U.MODE_ALPHA_NUM:return 11;case U.MODE_8BIT_BYTE:return 16;case U.MODE_KANJI:return 10;default:throw new Error("mode:"+z)}else if(T<41)switch(z){case U.MODE_NUMBER:return 14;case U.MODE_ALPHA_NUM:return 13;case U.MODE_8BIT_BYTE:return 16;case U.MODE_KANJI:return 12;default:throw new Error("mode:"+z)}else throw new Error("type:"+T)},getLostPoint:function(z){for(var T=z.getModuleCount(),M=0,j=0;j<T;j++)for(var L=0;L<T;L++){for(var _=0,E=z.isDark(j,L),te=-1;te<=1;te++){if(j+te<0||T<=j+te)continue;for(var $=-1;$<=1;$++){if(L+$<0||T<=L+$)continue;if(te==0&&$==0)continue;E==z.isDark(j+te,L+$)&&_++}}_>5&&(M+=3+_-5)}for(var j=0;j<T-1;j++)for(var L=0;L<T-1;L++){var H=0;z.isDark(j,L)&&H++,z.isDark(j+1,L)&&H++,z.isDark(j,L+1)&&H++,z.isDark(j+1,L+1)&&H++,(H==0||H==4)&&(M+=3)}for(var j=0;j<T;j++)for(var L=0;L<T-6;L++)z.isDark(j,L)&&!z.isDark(j,L+1)&&z.isDark(j,L+2)&&z.isDark(j,L+3)&&z.isDark(j,L+4)&&!z.isDark(j,L+5)&&z.isDark(j,L+6)&&(M+=40);for(var L=0;L<T;L++)for(var j=0;j<T-6;j++)z.isDark(j,L)&&!z.isDark(j+1,L)&&z.isDark(j+2,L)&&z.isDark(j+3,L)&&z.isDark(j+4,L)&&!z.isDark(j+5,L)&&z.isDark(j+6,L)&&(M+=40);for(var X=0,L=0;L<T;L++)for(var j=0;j<T;j++)z.isDark(j,L)&&X++;var J=Math.abs(100*X/T/T-50)/5;return M+=J*10,M}};ot.exports=fe},LdHM:function(ot,Qe,k){"use strict";k.d(Qe,"b",function(){return Be}),k.d(Qe,"a",function(){return Se});var U=k("1OyB"),se=k("vuIU"),ie=k("Ji7U"),xe=k("LK+K"),fe=k("q1tI"),z=k("rePB"),T=k("Ff2n"),M=k("ODXe"),j=k("4IlW"),L=k("bX4T"),_=k("YrtM"),E=k("TSYQ"),te=k.n(E),$=k("+nKL"),H=k("8OUc"),X=function(C,F){var Q=C.prefixCls,Ce=C.id,Oe=C.flattenOptions,me=C.childrenAsData,ve=C.values,ge=C.searchValue,ue=C.multiple,q=C.defaultActiveFirstOption,W=C.height,b=C.itemHeight,V=C.notFoundContent,R=C.open,ye=C.menuItemSelectedIcon,Ee=C.virtual,re=C.onSelect,Le=C.onToggleOpen,Ue=C.onActiveValue,Ke=C.onScroll,Fe=C.onMouseEnter,Ie="".concat(Q,"-item"),Xe=Object(_.a)(function(){return Oe},[R,Oe],function(ze,ee){return ee[0]&&ze[1]!==ee[1]}),mt=fe.useRef(null),tt=function(ee){ee.preventDefault()},it=function(ee){mt.current&&mt.current.scrollTo({index:ee})},et=function(ee){for(var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Z=Xe.length,y=0;y<Z;y+=1){var x=(ee+y*Y+Z)%Z,A=Xe[x],N=A.group,le=A.data;if(!N&&!le.disabled)return x}return-1},gt=fe.useState(function(){return et(0)}),lt=Object(M.a)(gt,2),at=lt[0],_e=lt[1],vt=function(ee){_e(ee);var Y=Xe[ee];if(!Y){Ue(null,-1);return}Ue(Y.data.value,ee)};fe.useEffect(function(){vt(q!==!1?et(0):-1)},[Xe.length,ge]),fe.useEffect(function(){var ze=setTimeout(function(){if(!ue&&R&&ve.size===1){var ee=Array.from(ve)[0],Y=Xe.findIndex(function(Z){var y=Z.data;return y.value===ee});vt(Y),it(Y)}});return function(){return clearTimeout(ze)}},[R]);var rt=function(ee){ee!==void 0&&re(ee,{selected:!ve.has(ee)}),ue||Le(!1)};if(fe.useImperativeHandle(F,function(){return{onKeyDown:function(ee){var Y=ee.which;switch(Y){case j.a.UP:case j.a.DOWN:{var Z=0;if(Y===j.a.UP?Z=-1:Y===j.a.DOWN&&(Z=1),Z!==0){var y=et(at+Z,Z);it(y),vt(y)}break}case j.a.ENTER:{var x=Xe[at];x&&!x.data.disabled?rt(x.data.value):rt(void 0),R&&ee.preventDefault();break}case j.a.ESC:Le(!1)}},onKeyUp:function(){},scrollTo:function(ee){it(ee)}}}),Xe.length===0)return fe.createElement("div",{role:"listbox",id:"".concat(Ce,"_list"),className:"".concat(Ie,"-empty"),onMouseDown:tt},V);function Re(ze){var ee=Xe[ze];if(!ee)return null;var Y=ee.data||{},Z=Y.value,y=Y.label,x=Y.children,A=Object(L.a)(Y,!0),N=me?x:y;return ee?fe.createElement("div",Object.assign({"aria-label":typeof N=="string"?N:null},A,{key:ze,role:"option",id:"".concat(Ce,"_list_").concat(ze),"aria-selected":ve.has(Z)}),Z):null}return fe.createElement(fe.Fragment,null,fe.createElement("div",{role:"listbox",id:"".concat(Ce,"_list"),style:{height:0,width:0,overflow:"hidden"}},Re(at-1),Re(at),Re(at+1)),fe.createElement($.a,{itemKey:"key",ref:mt,data:Xe,height:W,itemHeight:b,fullHeight:!1,onMouseDown:tt,onScroll:Ke,virtual:Ee,onMouseEnter:Fe},function(ze,ee){var Y,Z=ze.group,y=ze.groupOption,x=ze.data,A=x.label,N=x.key;if(Z)return fe.createElement("div",{className:te()(Ie,"".concat(Ie,"-group"))},A!==void 0?A:N);var le=x.disabled,we=x.value,Ge=x.title,st=x.children,Ct=x.style,Ae=x.className,bt=Object(T.a)(x,["disabled","value","title","children","style","className"]),dt=ve.has(we),qe="".concat(Ie,"-option"),_t=te()(Ie,qe,Ae,(Y={},Object(z.a)(Y,"".concat(qe,"-grouped"),y),Object(z.a)(Y,"".concat(qe,"-active"),at===ee&&!le),Object(z.a)(Y,"".concat(qe,"-disabled"),le),Object(z.a)(Y,"".concat(qe,"-selected"),dt),Y)),Ot=me?st:A,At=!ye||typeof ye=="function"||dt;return fe.createElement("div",Object.assign({},bt,{"aria-selected":dt,className:_t,title:Ge,onMouseMove:function(){if(at===ee||le)return;vt(ee)},onClick:function(){le||rt(we)},style:Ct}),fe.createElement("div",{className:"".concat(qe,"-content")},Ot||we),fe.isValidElement(ye)||dt,At&&fe.createElement(H.a,{className:"".concat(Ie,"-option-state"),customizeIcon:ye,customizeIconProps:{isSelected:dt}},dt?"\u2713":null))}))},J=fe.forwardRef(X);J.displayName="OptionList";var ae=J,de=function(){return null};de.isSelectOption=!0;var Be=de,$e=function(){return null};$e.isSelectOptGroup=!0;var Se=$e,De=k("VTBJ"),Ve=k("Zm9Q");function ke(d){var C=d.key,F=d.props,Q=F.children,Ce=F.value,Oe=Object(T.a)(F,["children","value"]);return Object(De.a)({key:C,value:Ce!==void 0?Ce:C,children:Q},Oe)}function Te(d){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ve.a)(d).map(function(F,Q){if(!fe.isValidElement(F)||!F.type)return null;var Ce=F.type.isSelectOptGroup,Oe=F.key,me=F.props,ve=me.children,ge=Object(T.a)(me,["children"]);return C||!Ce?ke(F):Object(De.a)(Object(De.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?Q:Oe,"__"),label:Oe},ge),{},{options:Te(ve)})}).filter(function(F){return F})}var Ne=k("2Qr1"),be=k("qNPg"),O=k("U8pU"),ce=k("Kwbf"),ne=k("WKfj");function w(d){var C=d.mode,F=d.options,Q=d.children,Ce=d.backfill,Oe=d.allowClear,me=d.placeholder,ve=d.getInputElement,ge=d.showSearch,ue=d.onSearch,q=d.defaultOpen,W=d.autoFocus,b=d.labelInValue,V=d.value,R=d.inputValue,ye=d.optionLabelProp,Ee=C==="multiple"||C==="tags",re=ge!==void 0?ge:Ee||C==="combobox",Le=F||Te(Q);if(Object(ce.a)(C!=="tags"||Le.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),C==="tags"||C==="combobox"){var Ue=Le.some(function(Ie){return Ie.options?Ie.options.some(function(Xe){return typeof("value"in Xe?Xe.value:Xe.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(ce.a)(!Ue,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ce.a)(C!=="combobox"||!ye,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ce.a)(C==="combobox"||!Ce,"`backfill` only works with `combobox` mode."),Object(ce.a)(C==="combobox"||!ve,"`getInputElement` only work with `combobox` mode."),Object(ce.b)(C!=="combobox"||!ve||!Oe||!me,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ue&&!re&&C!=="combobox"&&C!=="tags"&&Object(ce.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ce.b)(!q||W,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),V!=null){var Ke=Object(ne.d)(V);Object(ce.a)(!b||Ke.every(function(Ie){return Object(O.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ce.a)(!Ee||Array.isArray(V),"`value` should be array when `mode` is `multiple` or `tags`")}if(Q){var Fe=null;Object(Ve.a)(Q).some(function(Ie){if(!fe.isValidElement(Ie)||!Ie.type)return!1;var Xe=Ie.type;if(Xe.isSelectOption)return!1;if(Xe.isSelectOptGroup){var mt=Object(Ve.a)(Ie.props.children).every(function(tt){return!fe.isValidElement(tt)||!Ie.type||tt.type.isSelectOption?!0:(Fe=tt.type,!1)});return!mt}return Fe=Xe,!0}),Fe&&Object(ce.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(ce.a)(R===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=w,P=Object(be.a)({prefixCls:"rc-select",components:{optionList:ae},convertChildrenToData:Te,flattenOptions:Ne.d,getLabeledValue:Ne.e,filterOptions:Ne.b,isValueDisabled:Ne.g,findValueOption:Ne.c,warningProps:B,fillOptionsWithMissingValue:Ne.a}),S=function(d){Object(ie.a)(F,d);var C=Object(xe.a)(F);function F(){var Q;return Object(U.a)(this,F),Q=C.apply(this,arguments),Q.selectRef=fe.createRef(),Q.focus=function(){Q.selectRef.current.focus()},Q.blur=function(){Q.selectRef.current.blur()},Q}return Object(se.a)(F,[{key:"render",value:function(){return fe.createElement(P,Object.assign({ref:this.selectRef},this.props))}}]),F}(fe.Component);S.Option=Be,S.OptGroup=Se;var D=S,p=Qe.c=D},M8RZ:function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return j});var U=k("fWQN"),se=k("mtLc"),ie=k("yKVA"),xe=k("879j"),fe=k("q1tI"),z=k.n(fe),T=k("i8i4"),M=k.n(T),j=function(L){Object(ie.a)(E,L);var _=Object(xe.a)(E);function E(te){var $;Object(U.a)(this,E),$=_.call(this,te);var H=window.document;return $.node=H.createElement("div"),H.body.appendChild($.node),$}return Object(se.a)(E,[{key:"render",value:function(){var $=this.props.children;return Object(T.createPortal)($,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),E}(z.a.Component)},OLES:function(ot,Qe,k){"use strict";var U=k("U8pU"),se=k("VTBJ"),ie=k("Ff2n"),xe=k("q1tI"),fe=k("uciX"),z=k("7ixt"),T=function(te){var $=te.overlay,H=te.prefixCls,X=te.id,J=te.overlayInnerStyle;return xe.createElement("div",{className:"".concat(H,"-inner"),id:X,role:"tooltip",style:J},typeof $=="function"?$():$)},M=T,j=function(te,$){var H=te.overlayClassName,X=te.trigger,J=X===void 0?["hover"]:X,ae=te.mouseEnterDelay,de=ae===void 0?0:ae,Be=te.mouseLeaveDelay,$e=Be===void 0?.1:Be,Se=te.overlayStyle,De=te.prefixCls,Ve=De===void 0?"rc-tooltip":De,ke=te.children,Te=te.onVisibleChange,Ne=te.afterVisibleChange,be=te.transitionName,O=te.animation,ce=te.placement,ne=ce===void 0?"right":ce,w=te.align,B=w===void 0?{}:w,P=te.destroyTooltipOnHide,S=P===void 0?!1:P,D=te.defaultVisible,p=te.getTooltipContainer,d=te.overlayInnerStyle,C=Object(ie.a)(te,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),F=Object(xe.useRef)(null);Object(xe.useImperativeHandle)($,function(){return F.current});var Q=Object(se.a)({},C);"visible"in te&&(Q.popupVisible=te.visible);var Ce=function(){var ue=te.arrowContent,q=ue===void 0?null:ue,W=te.overlay,b=te.id;return[xe.createElement("div",{className:"".concat(Ve,"-arrow"),key:"arrow"},q),xe.createElement(M,{key:"content",prefixCls:Ve,id:b,overlay:W,overlayInnerStyle:d})]},Oe=!1,me=!1;if(typeof S=="boolean")Oe=S;else if(S&&Object(U.a)(S)==="object"){var ve=S.keepParent;Oe=ve===!0,me=ve===!1}return xe.createElement(fe.a,Object.assign({popupClassName:H,prefixCls:Ve,popup:Ce,action:J,builtinPlacements:z.a,popupPlacement:ne,ref:F,popupAlign:B,getPopupContainer:p,onPopupVisibleChange:Te,afterPopupVisibleChange:Ne,popupTransitionName:be,popupAnimation:O,defaultPopupVisible:D,destroyPopupOnHide:Oe,autoDestroy:me,mouseLeaveDelay:$e,popupStyle:Se,mouseEnterDelay:de},Q),ke)},L=Object(xe.forwardRef)(j),_=Qe.a=L},Ot1p:function(ot,Qe,k){"use strict";var U=k("2qtc"),se=k("kLXV"),ie=k("rAM+"),xe=k("miYZ"),fe=k("tsqr"),z=k("9og8"),T=k("tJVT"),M=k("jrin"),j=k("WmNS"),L=k.n(j),_=k("q1tI"),E=k.n(_),te=k("VrN/"),$=k.n(te),H=k("bdgK"),X=k("p77/"),J=k("Bd2K"),ae=k("ELLl"),de=k("19Vz"),Be=k("lZu9"),$e=k("+NIl"),Se=k("kSUc"),De=k("9Bee"),Ve=function(Ae){var bt=Ae.value,dt=bt===void 0?"":bt,qe=Ae.className,_t=Ae.showTextOnly,Ot=Ae.showLines,At=Ae.style,Mt=At===void 0?{}:At,Tt=Object(_.useMemo)(function(){return""},[dt]);return E.a.createElement(E.a.Fragment,null,E.a.createElement("div",{dangerouslySetInnerHTML:{__html:Tt}}))},ke=k("Q9mQ"),Te=k("diRs"),Ne=k("0Owb"),be=k("dejd"),O=k("C+DQ"),ce=k("D1Df"),ne=k.n(ce),w=k("1vsH"),B=k("m3rI"),P=[{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 S(Ae){var bt=Ae.onActionCallback,dt=Ae.title,qe=Ae.icon,_t=Ae.actionName,Ot=Ae.className,At=Ot===void 0?"":Ot,Mt=Ae.children;function Tt(){bt(_t)}return E.a.createElement("a",{title:dt,className:At,onClick:Tt},E.a.createElement("i",{className:"md-iconfont ".concat(qe)}),Mt)}var D=function(Ae){var bt=Ae.watch,dt=Ae.showNullButton,qe=Ae.onActionCallback,_t=Ae.fullScreen,Ot=Ae.insertTemp,At=Ae.hidetoolBar,Mt=Ae.uuid,Tt=Ae.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(w.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(w.E)("_educoder_session"),"&key=").concat(Mt,"&api=").concat(encodeURIComponent(B.a.PROXY_SERVER)));var tn=[].concat(P,[{title:"".concat(bt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(bt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return E.a.createElement("ul",{className:"markdown-toolbar-container"},!At&&tn.map(function(on,pt){return E.a.createElement("li",{key:pt},on.actionName?E.a.createElement(S,Object(Ne.a)({},on,{onActionCallback:qe})):E.a.createElement("span",{className:"v-line"}))}),dt?E.a.createElement("li",null,E.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:qe},E.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ot&&E.a.createElement("li",null,E.a.createElement(S,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ot),onActionCallback:qe},E.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),E.a.createElement("li",null,E.a.createElement(Te.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:E.a.createElement("div",null,E.a.createElement(ne.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(w.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(w.E)("_educoder_session"),"&key=").concat(Mt,"&api=").concat(encodeURIComponent(B.a.PROXY_SERVER))}))},E.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return Tt(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),E.a.createElement("li",{className:"btn-full-screen"},E.a.createElement(S,{icon:"".concat(_t?"icon-shrink":"icon-enlarge"),title:_t?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:qe})))},p=k("M8RZ"),d=k("+L6B"),C=k("2/Rp"),F=k("y8nQ"),Q=k("Vl3Y"),Ce=k("5NDa"),Oe=k("5rEg"),me={labelCol:{span:4},wrapperCol:{span:20}},ve=function(Ae){var bt=Ae.callback,dt=Ae.onCancel;function qe(_t){bt(_t)}return E.a.createElement(Q.a,Object(Ne.a)({},me,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:qe}),E.a.createElement(Q.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},E.a.createElement(Oe.a,null)),E.a.createElement(Q.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},E.a.createElement(Oe.a,null)),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(C.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))},ge=k("7ahc"),ue=k("k1fw"),q=k("HmJG"),W=k("BjJ7"),b=Q.a.useForm,V={width:280,marginRight:10},R={labelCol:{span:5},wrapperCol:{span:19}},ye=function(Ae){var bt=Ae.callback,dt=Ae.onCancel,qe=b(),_t=Object(T.a)(qe,1),Ot=_t[0],At=Object(_.useRef)();function Mt(on){bt(Object(ue.a)(Object(ue.a)({},on),{},{name:At.current}))}function Tt(on,pt){Ot.setFieldsValue({src:"/api/attachments/".concat(on.id,"?type=").concat(on.content_type),type:pt.type})}function tn(on){var pt=on.target.files[0];At.current=pt.name,re(pt,Tt)}return E.a.createElement(Q.a,Object(Ne.a)({form:Ot},R,{className:"upload-image-panel",onFinish:Mt}),E.a.createElement(Q.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},E.a.createElement("div",{className:"flex-container"},E.a.createElement(Q.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},E.a.createElement(Oe.a,{style:V})),E.a.createElement(Ee,{onFileChange:tn}))),E.a.createElement(Q.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},E.a.createElement(Oe.a,{style:{width:264}})),E.a.createElement(Q.a.Item,{style:{textAlign:"right"}},E.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(C.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))};function Ee(Ae){var bt=Ae.onFileChange;return E.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",E.a.createElement("input",{type:"file",onChange:bt}))}function re(Ae,bt){if(!Ae)throw new String("\u6CA1\u6709\u6587\u4EF6");var dt=new FormData;dt.append("editormd-image-file",Ae),dt.append("file_param_name","editormd-image-file"),dt.append("byxhr","true");var qe=new window.XMLHttpRequest;qe.withCredentials=!0,qe.addEventListener("load",function(_t){bt(JSON.parse(_t.target.responseText),Ae)},!1),qe.addEventListener("error",function(_t){console.error(_t)},!1),qe.open("POST","".concat(W.a,"/api/attachments.json")),qe.send(dt)}var Le=k("giR+"),Ue=k("fyUT"),Ke=k("7Kak"),Fe=k("9yH6"),Ie=Fe.a.Group,Xe={margin:"0 8px"},mt=function(Ae){var bt=Ae.callback,dt=Ae.onCancel;function qe(_t){bt(_t)}return E.a.createElement(Q.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:qe},E.a.createElement("div",{className:"flex-container"},E.a.createElement("span",{style:Xe},"\u5355\u5143\u683C\u6570\uFF1A"),E.a.createElement("span",{style:Xe},"\u884C\u6570"),E.a.createElement(Q.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},E.a.createElement(Ue.a,null)),E.a.createElement("span",{style:Xe},"\u5217\u6570"),E.a.createElement(Q.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},E.a.createElement(Ue.a,null))),E.a.createElement("div",{className:"flex-container",style:{marginTop:12}},E.a.createElement("span",{style:Xe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),E.a.createElement(Q.a.Item,{name:"align"},E.a.createElement(Ie,null,E.a.createElement(Fe.a,{value:"default"},E.a.createElement("i",{className:"fa fa-align-justify"})),E.a.createElement(Fe.a,{value:"left"},E.a.createElement("i",{className:"fa fa-align-left"})),E.a.createElement(Fe.a,{value:"center"},E.a.createElement("i",{className:"fa fa-align-center"})),E.a.createElement(Fe.a,{value:"right"},E.a.createElement("i",{className:"fa fa-align-right"}))))),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(C.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(C.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))},tt=k("ErOA"),it=k("7Cbv"),et="link",gt="upload-image",lt="code-block",at="add-table",_e="------------",vt={default:_e,left:":".concat(_e),center:":".concat(_e,":"),right:"".concat(_e,":")},rt=k("9VGf"),Re,ze;function ee(){}var Y=0,Z=1e4,y="\u2581",x=`
**\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 A(Ae){return/^\d+$/.test(Ae)?"".concat(Ae,"px"):Ae}var N=navigator.platform.toUpperCase().indexOf("MAC")>=0,le=N?"Cmd":"Ctrl",we=["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"],Ge=(Re={},Object(M.a)(Re,le+"-B","bold"),Object(M.a)(Re,le+"-I","italic"),Re),st=(ze={},Object(M.a)(ze,et,"\u6DFB\u52A0\u94FE\u63A5"),Object(M.a)(ze,lt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(M.a)(ze,gt,"\u6DFB\u52A0\u6587\u4EF6"),Object(M.a)(ze,at,"\u6DFB\u52A0\u8868\u683C"),ze),Ct=Qe.a=function(Ae){var bt=Ae.defaultValue,dt=bt===void 0?"":bt,qe=Ae.onChange,_t=Ae.width,Ot=_t===void 0?"100%":_t,At=Ae.height,Mt=At===void 0?400:At,Tt=Ae.miniToolbar,tn=Tt===void 0?!1:Tt,on=Ae.isFocus,pt=on===void 0?!1:on,Vn=Ae.watch,xn=Ae.insertTemp,gn=Ae.mode,kn=gn===void 0?"markdown":gn,li=Ae.id,Xn=li===void 0?"markdown-editor-id":li,jt=Ae.showResizeBar,ct=jt===void 0?!1:jt,Un=Ae.noStorage,ui=Un===void 0?!1:Un,Tn=Ae.showNullButton,Pt=Tn===void 0?!1:Tn,Kn=Ae.hidetoolBar,hi=Kn===void 0?!1:Kn,vi=Ae.fullScreen,We=vi===void 0?!1:vi,St=Ae.onBlur,ti=Ae.onCMBeforeChange,ci=Ae.onFullScreen,di=Ae.className,Oi=di===void 0?"":di,c=Ae.disablePaste,o=c===void 0?!1:c,a=Ae.placeholder,u=a===void 0?"":a,m=Ae.values,h=m===void 0?"":m,K=Object(_.useState)(null),Pe=Object(T.a)(K,2),pe=Pe[0],ht=Pe[1],je=Object(_.useState)(dt),Et=Object(T.a)(je,2),It=Et[0],zt=Et[1],Fn=Object(_.useState)(Vn),Hn=Object(T.a)(Fn,2),un=Hn[0],Yn=Hn[1],Xi=Object(_.useState)(We),An=Object(T.a)(Xi,2),Ln=An[0],ni=An[1],yi=Object(_.useState)(""),Jn=Object(T.a)(yi,2),ii=Jn[0],zn=Jn[1],fr=Object(_.useState)(0),Ki=Object(T.a)(fr,2),Pn=Ki[0],Nn=Ki[1],Ri=Object(_.useState)(Mt),Di=Object(T.a)(Ri,2),Pi=Di[0],qt=Di[1],Ut=Object(_.useState)(!1),mn=Object(T.a)(Ut,2),Ft=mn[0],vn=mn[1],Kt=Object(_.useRef)(Object(it.a)()),bi=Object(_.useRef)(!1),an=Object(_.useRef)(),sn=Object(_.useRef)(),ri=Object(_.useRef)(),xi=Object(_.useRef)(),wi=Object(_.useRef)(),Ur=function(){var ft=Object(z.a)(L.a.mark(function kt(){var xt,Rt;return L.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Wt.next=2,Object(tt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Kt.current}});case 2:Rt=Wt.sent,Rt!=null&&(xt=Rt.attachments)!==null&&xt!==void 0&&xt.length&&(console.log("cm:",pe,sn),Rt.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?pe.replaceSelection("![,](/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?pe.replaceSelection('<video width="100%" controls src="'.concat(B.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Nt.content_type.indexOf("pdf")>-1?pe.replaceSelection('<a href="'.concat(B.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,'&disposition=inline" target="_blank">').concat(Nt.name,"</a>")):pe.replaceSelection("[".concat(Nt.name,"](").concat(B.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Wt.stop()}},kt)}));return function(){return ft.apply(this,arguments)}}();Object(_.useEffect)(function(){zt(h),pe==null||pe.setValue(h)},[h]),Object(_.useEffect)(function(){ci==null||ci(Ln)},[Ln]),Object(_.useEffect)(function(){if(sn.current){var ft=$.a.fromTextArea(sn.current,{mode:kn,lineNumbers:!tn,lineWrapping:!0,value:dt,autoCloseTags:!0,autoCloseBrackets:!0});pt&&ft.focus();function kt(xt,Rt){if(o){Rt.preventDefault();return}var Bt=Rt.clipboardData;if(Bt){var Wt=Bt.types.toString(),Nt=Bt.items;if(Wt==="Files"||Bt.types.indexOf("Files")>-1){if(Rt.preventDefault(),kn=="stex")return;try{var Jt,hn=Nt[1];((Jt=Nt[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(hn=Nt[0]);var Dt=hn.getAsFile(),Ni=Dt.name.split(".").pop();re(Dt,function(Gt){if(Gt.id){var yn,Xt,$n;(Dt==null||((yn=Dt.type)===null||yn===void 0)?void 0:yn.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):(Dt==null||((Xt=Dt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(B.a.API_SERVER,"/api/attachments/").concat(Gt.id,'"></video>')):(Dt==null||(($n=Dt.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(B.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):we.includes(Ni)?ft.replaceSelection('<a href="'.concat(B.a.API_SERVER,"/api/attachments/").concat(Gt.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ft.replaceSelection("[".concat(Dt.name,"](").concat(B.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})}catch(Gt){fe.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ft.on("paste",kt),ft.on("dragleave",function(xt,Rt){ri.current.classList.remove("mouse-hover-md")}),ft.on("dragover",function(xt,Rt){ri.current.classList.add("mouse-hover-md")}),ft.on("drop",function(xt,Rt){ri.current.classList.add("mouse-hover-md");var Bt;if(Bt=Rt.dataTransfer.files,Bt.length>0){Rt.preventDefault(),Rt.stopPropagation();for(var Wt=function(hn){var Dt=Bt[hn],Ni=Dt.name.split(".").pop();re(Dt,function(Gt){if(Gt.id){var yn,Xt,$n;(Dt==null||((yn=Dt.type)===null||yn===void 0)?void 0:yn.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):(Dt==null||((Xt=Dt.type)===null||Xt===void 0)?void 0:Xt.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(B.a.API_SERVER,"/api/attachments/").concat(Gt.id,'"></video>')):(Dt==null||(($n=Dt.type)===null||$n===void 0)?void 0:$n.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(B.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Dt.type,'&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):we.includes(Ni)?ft.replaceSelection('<a href="'.concat(B.a.API_SERVER,"/api/attachments/").concat(Gt.id,'?type=office&disposition=inline" target="_blank">').concat(Dt.name,"</a>")):ft.replaceSelection("[".concat(Dt.name,"](").concat(B.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}else(Gt==null?void 0:Gt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt<Bt.length;Nt++)Wt(Nt)}}),ht(ft),function(){ft.off("paste",kt)}}},[]);var Zn=Object(_.useCallback)(function(){if(ri.current)try{}catch(ft){console.log(ft,"---- to set md editor body height")}},[Pi,ri,Ln]);Object(_.useEffect)(function(){function ft(){var xt=new H.default(function(Rt){var Bt=Object(ie.a)(Rt),Wt;try{for(Bt.s();!(Wt=Bt.n()).done;){var Nt=Wt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&(Zn(),pe.setSize("100%","100%"),pe.refresh())}}catch(Jt){Bt.e(Jt)}finally{Bt.f()}});return xt.observe(sn.current.parentElement),xt}if(pe){var kt=ft();return function(){kt.unobserve(sn.current.parentElement)}}},[pe,Zn]),Object(_.useEffect)(function(){if(pe){for(var ft=[],kt=function(){var Nt=Rt[xt];Bt=Object(T.a)(Nt,2);var Jt=Bt[0],hn=Bt[1],Dt=Object(M.a)({},Jt,function(){Yi(hn)});ft.push(Dt),pe.addKeyMap(Dt)},xt=0,Rt=Object.entries(Ge);xt<Rt.length;xt++){var Bt;kt()}return an.current=setInterval(function(){bi.current&&Ur()},4e3),function(){clearInterval(an.current);var Wt=Object(ie.a)(ft),Nt;try{for(Wt.s();!(Nt=Wt.n()).done;){var Jt=Nt.value;pe.removeKeyMap(Jt)}}catch(hn){Wt.e(hn)}finally{Wt.f()}}}},[pe]),Object(_.useEffect)(function(){We!==Ln&&ni(We)},[We]),Object(rt.a)(function(){if(!ui&&Pn>0){var ft=new Date().getTime(),kt=window.sessionStorage.getItem(Xn);ft>=Pn+Z&&(!kt||kt!==It)&&(window.sessionStorage.setItem(Xn,It),vn(!0))}},Z),Object(_.useEffect)(function(){Yn(Vn)},[pe,Vn]),Object(_.useEffect)(function(){pe&&(pt&&pe.focus())},[pe,pt]),Object(_.useEffect)(function(){if(un&&pe){var ft=pe.getScrollerElement();function kt(xt){var Rt=xt.target;if(wi.current){var Bt=Rt.scrollTop/Rt.scrollHeight;wi.current.scrollTop=wi.current.scrollHeight*Bt}}return ft.addEventListener("scroll",kt),function(){ft.removeEventListener("scroll",kt)}}},[pe,un]),Object(_.useEffect)(function(){if(pe&&ti){function ft(kt,xt){ti(kt,xt)}return pe.on("beforeChange",ft),function(){pe.off("beforeChange",ft)}}},[pe,ti]),Object(_.useEffect)(function(){if(pe&&St){function ft(){St(pe.getValue())}return pe.on("blur",ft),function(){pe.off("blur",ft)}}},[pe,St]),Object(_.useEffect)(function(){if(pe){function ft(kt){var xt=kt.getValue();zt(xt),Nn(new Date().getTime()),kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),qe&&qe(xt)}return pe.on("change",ft),function(){pe.off("change",ft)}}},[pe,qe]),Object(_.useEffect)(function(){pe&&(dt==null?(pe.setValue(""),zt("")):dt!==pe.getValue()&&(pe.setValue(dt),zt(dt),pe.setCursor(pe.lineCount(),0)))},[pe,dt]);var Yi=Object(_.useCallback)(function(ft){var kt=pe.getCursor(),xt=pe.getSelection(),Rt=xt.split(`
`);switch(ft){case"bold":return pe.replaceSelection("**"+xt+"**"),xt===""&&pe.setCursor(kt.line,kt.ch+2),pe.focus();case"italic":return pe.replaceSelection("*"+xt+"*"),xt===""&&pe.setCursor(kt.line,kt.ch+1),pe.focus();case"code":return pe.replaceSelection("`"+xt+"`"),xt===""&&pe.setCursor(kt.line,kt.ch+1),pe.focus();case"inline-latex":return pe.replaceSelection("`$$"+xt+"$$`"),xt===""&&pe.setCursor(kt.line,kt.ch+3),pe.focus();case"latex":return pe.replaceSelection("```latex\n"+xt+"\n```"),pe.setCursor(kt.line+1,xt.length+1),pe.focus();case"line-break":return pe.replaceSelection(`<br/>
`),pe.focus();case"list-ul":return xt===""?pe.replaceSelection("- "+xt):pe.replaceSelection(Rt.map(function(Bt){return Bt===""?"":"- ".concat(Bt)}).join(`
`)),pe.focus();case"list-ol":return xt===""?pe.replaceSelection("1. "+xt):pe.replaceSelection(Rt.map(function(Bt,Wt){return Bt===""?"":"".concat(Wt+1,". ").concat(Bt)}).join(`
`)),pe.focus();case"add-null-ch":return xt===""&&pe.setCursor(kt.line,kt.ch+1),pe.replaceSelection(y),pe.focus();case"inster-template-1":return xt===""&&pe.setCursor(kt.line,kt.ch),pe.replaceSelection(x),pe.focus();case"eraser":return pe.setValue(""),pe.focus();case"trigger-watch":return Yn(!un),pe.focus();case"trigger-full-screen":return ni(!Ln),pe.focus();case et:zn(et);return;case lt:zn(lt);return;case gt:zn(gt);return;case at:zn(at);return;default:throw new Error}},[pe,un,Ln]),In=Object(_.useCallback)(function(ft){zn("");switch(ii){case et:var kt=ft.title,xt=ft.link;return pe.replaceSelection("[".concat(kt,"](").concat(xt,")")),pe.focus();case lt:var Rt=ft.language,Bt=ft.content;return pe.replaceSelection(["```"+Rt,Bt,"```"].join(`
`)),pe.focus();case gt:var Wt=ft.src,Nt=ft.alt,Jt=ft.name;return Wt.indexOf("type=image")>-1?pe.replaceSelection("![ ".concat(Nt||""," ]( ").concat(Wt,' "').concat(Nt||"",'" )')):Wt.indexOf("type=application/pdf")>-1?pe.replaceSelection('<a href="'.concat(Wt,'&disposition=inline" target="_blank">').concat(Jt,"</a>")):pe.replaceSelection('<a href="'.concat(Wt,'" target="_blank">').concat(Jt,"</a>")),pe.focus();case at:for(var hn=ft.row,Dt=ft.col,Ni=ft.align,Gt=`
`,yn=0;yn<hn;yn++){for(var Xt=[],$n=[],pr=0;pr<Dt;pr++)yn===1&&$n.push(vt[Ni]),Xt.push(" ");yn===1&&(Gt+="| ".concat($n.join(" | "),` |
`)),Gt+="| ".concat(Xt.join(Dt===1?"":" | "),` |
`)}return pe.replaceSelection(Gt+`
`),pe.focus();default:throw new Error}},[pe,ii]),$i=Object(_.useMemo)(function(){switch(ii){case et:return E.a.createElement(ve,{callback:In,onCancel:fi});case lt:return E.a.createElement(ge.b,{callback:In,onCancel:fi});case gt:return E.a.createElement(ye,{callback:In,onCancel:fi});case at:return E.a.createElement(mt,{callback:In,onCancel:fi});default:return null}},[ii]);function fi(){zn("")}Object(_.useEffect)(function(){if(xi.current){var ft=xi.current,kt=!1,xt=0;function Rt(Nt){kt=!0,xt=Nt.pageY}function Bt(){kt=!1}function Wt(Nt){if(kt){var Jt=Nt.pageY-xt;Jt<0&&(Jt=0),Jt>300&&(Jt=300);var hn=Mt+Jt+"px";qt(hn)}}return ft.addEventListener("mousedown",Rt),document.addEventListener("mousemove",Wt),document.addEventListener("mouseup",Bt),function(){ft.removeEventListener("mousedown",Rt),document.removeEventListener("mousemove",Wt),document.removeEventListener("mouseup",Bt)}}},[pe,xi]),Object(_.useEffect)(function(){qt(Mt)},[Mt]);var Ci=A(Ot),uo=A(Pi),ho={width:Ci,height:uo},Zo=Object(_.useMemo)(function(){if(Pn){var ft=new Date(Pn),kt=ft.getHours(),xt=ft.getMinutes(),Rt=ft.getSeconds();return kt=kt<10?"0"+kt:kt,xt=xt<10?"0"+xt:xt,Rt=Rt<10?"0"+Rt:Rt,"".concat(kt,":").concat(xt,":").concat(Rt)}return 0},[Pn]);function Qo(){window.sessionStorage.removeItem(Xn),vn(!1),Nn(0)}function co(){vn(!1),Nn(0),pe.setValue(window.sessionStorage.getItem(Xn))}function Fr(ft,kt){var xt=pe.getValue();xt=xt.replace(ft,kt),zt(xt),pe==null||pe.setValue(xt)}return E.a.createElement(_.Fragment,null,E.a.createElement("div",{className:"markdown-editor-wrapper",ref:ri},E.a.createElement("div",{className:"markdown-editor-container ".concat(Oi," ").concat(un?"on-preview":""," ").concat(tn?"mini":""," ").concat(Ln?"full-screen":""),style:ho},E.a.createElement(D,{insertTemp:xn,watch:un,fullScreen:Ln,showNullButton:Pt,onActionCallback:Yi,hidetoolBar:hi,uuid:Kt.current,setOpenPhones:function(){bi.current=!0}}),E.a.createElement("div",{className:"markdown-editor-body"},E.a.createElement("div",{className:"codemirror-container"},E.a.createElement("textarea",{ref:sn,placeholder:u})),un?E.a.createElement("div",{ref:wi,className:"preview-container"},kn==="stex"&&E.a.createElement(Ve,{value:It}),kn!=="stex"&&E.a.createElement(De.a,{edit:!0,value:It,replaces:Fr})):null))),ct?E.a.createElement("a",{ref:xi,className:"editor-resize"}):null,E.a.createElement(p.a,null,st[ii]?E.a.createElement(se.a,{centered:!0,title:st[ii],visible:!0,onCancel:fi,footer:null},$i):null))}},SJMd:function(ot,Qe){/**
* @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 k,U,se,ie=!1,xe,fe;window.PR_SHOULD_USE_CONTINUATION=!0;var z,T;(function(){var M=window,j=["break,continue,do,else,for,if,return,while"],L=[j,"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"],_=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],E=[_,"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"],te=[_,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],$=[_,"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"],H="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=[_,"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",ae=[j,"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"],de=[j,"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"],Be=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],$e=[E,$,te,X,J,ae,de,Be],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",Ve="kwd",ke="com",Te="typ",Ne="lit",be="pun",O="pln",ce="tag",ne="dec",w="src",B="atn",P="atv",S="nocode",D="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function p(re){for(var Le=0,Ue=!1,Ke=!1,Fe=0,Ie=re.length;Fe<Ie;++Fe){var Xe=re[Fe];if(Xe.ignoreCase)Ke=!0;else if(/[a-z]/i.test(Xe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ue=!0,Ke=!1;break}}var mt={b:8,t:9,n:10,v:11,f:12,r:13};function tt(at){var _e=at.charCodeAt(0);if(_e!==92)return _e;var vt=at.charAt(1);return _e=mt[vt],_e||("0"<=vt&&vt<="7"?parseInt(at.substring(1),8):vt==="u"||vt==="x"?parseInt(at.substring(2),16):at.charCodeAt(1))}function it(at){if(at<32)return(at<16?"\\x0":"\\x")+at.toString(16);var _e=String.fromCharCode(at);return _e==="\\"||_e==="-"||_e==="]"||_e==="^"?"\\"+_e:_e}function et(at){var _e=at.substring(1,at.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=[],rt=_e[0]==="^",Re=["["];rt&&Re.push("^");for(var ze=rt?1:0,ee=_e.length;ze<ee;++ze){var Y=_e[ze];if(/\\[bdsw]/i.test(Y))Re.push(Y);else{var Z=tt(Y),y;ze+2<ee&&_e[ze+1]==="-"?(y=tt(_e[ze+2]),ze+=2):y=Z,vt.push([Z,y]),y<65||Z>122||(y<65||Z>90||vt.push([Math.max(65,Z)|32,Math.min(y,90)|32]),y<97||Z>122||vt.push([Math.max(97,Z)&~32,Math.min(y,122)&~32]))}}vt.sort(function(le,we){return le[0]-we[0]||we[1]-le[1]});for(var x=[],A=[],ze=0;ze<vt.length;++ze){var N=vt[ze];N[0]<=A[1]+1?A[1]=Math.max(A[1],N[1]):x.push(A=N)}for(var ze=0;ze<x.length;++ze){var N=x[ze];Re.push(it(N[0])),N[1]>N[0]&&(N[1]+1>N[0]&&Re.push("-"),Re.push(it(N[1])))}return Re.push("]"),Re.join("")}function gt(at){for(var _e=at.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=_e.length,rt=[],Re=0,ze=0;Re<vt;++Re){var ee=_e[Re];if(ee==="(")++ze;else if(ee.charAt(0)==="\\"){var Y=+ee.substring(1);Y&&(Y<=ze?rt[Y]=-1:_e[Re]=it(Y))}}for(var Re=1;Re<rt.length;++Re)rt[Re]===-1&&(rt[Re]=++Le);for(var Re=0,ze=0;Re<vt;++Re){var ee=_e[Re];if(ee==="(")++ze,rt[ze]||(_e[Re]="(?:");else if(ee.charAt(0)==="\\"){var Y=+ee.substring(1);Y&&Y<=ze&&(_e[Re]="\\"+rt[Y])}}for(var Re=0;Re<vt;++Re)_e[Re]==="^"&&_e[Re+1]!=="^"&&(_e[Re]="");if(at.ignoreCase&&Ue)for(var Re=0;Re<vt;++Re){var ee=_e[Re],Z=ee.charAt(0);ee.length>=2&&Z==="["?_e[Re]=et(ee):Z!=="\\"&&(_e[Re]=ee.replace(/[a-zA-Z]/g,function(A){var N=A.charCodeAt(0);return"["+String.fromCharCode(N&~32,N|32)+"]"}))}return _e.join("")}for(var lt=[],Fe=0,Ie=re.length;Fe<Ie;++Fe){var Xe=re[Fe];if(Xe.global||Xe.multiline)throw new Error(""+Xe);lt.push("(?:"+gt(Xe)+")")}return new RegExp(lt.join("|"),Ke?"gi":"g")}function d(re,Le){var Ue=/(?:^|\s)nocode(?:\s|$)/,Ke=[],Fe=0,Ie=[],Xe=0;function mt(tt){var it=tt.nodeType;if(it==1){if(Ue.test(tt.className))return;for(var et=tt.firstChild;et;et=et.nextSibling)mt(et);var gt=tt.nodeName.toLowerCase();(gt==="br"||gt==="li")&&(Ke[Xe]=`
`,Ie[Xe<<1]=Fe++,Ie[Xe++<<1|1]=tt)}else if(it==3||it==4){var lt=tt.nodeValue;lt.length&&(Le?lt=lt.replace(/\r\n?/g,`
`):lt=lt.replace(/[ \t\r\n]+/g," "),Ke[Xe]=lt,Ie[Xe<<1]=Fe,Fe+=lt.length,Ie[Xe++<<1|1]=tt)}}return mt(re),{sourceCode:Ke.join("").replace(/\n$/,""),spans:Ie}}function C(re,Le,Ue,Ke,Fe){if(!Ue)return;var Ie={sourceNode:re,pre:1,langExtension:null,numberLines:null,sourceCode:Ue,spans:null,basePos:Le,decorations:null};Ke(Ie),Fe.push.apply(Fe,Ie.decorations)}var F=/\S/;function Q(re){for(var Le=void 0,Ue=re.firstChild;Ue;Ue=Ue.nextSibling){var Ke=Ue.nodeType;Le=Ke===1?Le?re:Ue:Ke===3&&F.test(Ue.nodeValue)?re:Le}return Le===re?void 0:Le}function Ce(re,Le){var Ue={},Ke;(function(){for(var Xe=re.concat(Le),mt=[],tt={},it=0,et=Xe.length;it<et;++it){var gt=Xe[it],lt=gt[3];if(lt)for(var at=lt.length;--at>=0;)Ue[lt.charAt(at)]=gt;var _e=gt[1],vt=""+_e;tt.hasOwnProperty(vt)||(mt.push(_e),tt[vt]=null)}mt.push(/[\0-\uffff]/),Ke=p(mt)})();var Fe=Le.length,Ie=function(Xe){for(var mt=Xe.sourceCode,tt=Xe.basePos,it=Xe.sourceNode,et=[tt,O],gt=0,lt=mt.match(Ke)||[],at={},_e=0,vt=lt.length;_e<vt;++_e){var rt=lt[_e],Re=at[rt],ze=void 0,ee;if(typeof Re=="string")ee=!1;else{var Y=Ue[rt.charAt(0)];if(Y)ze=rt.match(Y[1]),Re=Y[0];else{for(var Z=0;Z<Fe;++Z)if(Y=Le[Z],ze=rt.match(Y[1]),ze){Re=Y[0];break}ze||(Re=O)}ee=Re.length>=5&&Re.substring(0,5)==="lang-",ee&&!(ze&&typeof ze[1]=="string")&&(ee=!1,Re=w),ee||(at[rt]=Re)}var y=gt;if(gt+=rt.length,!ee)et.push(tt+y,Re);else{var x=ze[1],A=rt.indexOf(x),N=A+x.length;ze[2]&&(N=rt.length-ze[2].length,A=N-x.length);var le=Re.substring(5);C(it,tt+y,rt.substring(0,A),Ie,et),C(it,tt+y+A,x,W(le,x),et),C(it,tt+y+N,rt.substring(N),Ie,et)}}Xe.decorations=et};return Ie}function Oe(re){var Le=[],Ue=[];re.tripleQuotedStrings?Le.push([De,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):re.multiLineStrings?Le.push([De,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Le.push([De,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),re.verbatimStrings&&Ue.push([De,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ke=re.hashComments;Ke&&(re.cStyleComments?(Ke>1?Le.push([ke,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Le.push([ke,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ue.push([De,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Le.push([ke,/^#[^\r\n]*/,null,"#"])),re.cStyleComments&&(Ue.push([ke,/^\/\/[^\r\n]*/,null]),Ue.push([ke,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=re.regexLiterals;if(Fe){var Ie=Fe>1?"":`
\r`,Xe=Ie?".":"[\\S\\s]",mt="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+Xe+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+Xe+")*(?:\\x5D|$))+/";Ue.push(["lang-regex",RegExp("^"+D+"("+mt+")")])}var tt=re.types;tt&&Ue.push([Te,tt]);var it=(""+re.keywords).replace(/^ | $/g,"");it.length&&Ue.push([Ve,new RegExp("^(?:"+it.replace(/[\s,]+/g,"|")+")\\b"),null]),Le.push([O,/^\s+/,null,` \r
\xA0`]);var et="^.[^\\s\\w.$@'\"`/\\\\]*";return re.regexLiterals&&(et+="(?!s*/)"),Ue.push([Ne,/^@[a-z_$][a-z_$@0-9]*/i,null],[Te,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[O,/^[a-z_$][a-z_$@0-9]*/i,null],[Ne,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[O,/^\\[\s\S]?/,null],[be,new RegExp(et),null]),Ce(Le,Ue)}var me=Oe({keywords:$e,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ve(re,Le,Ue){for(var Ke=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,Ie=re.ownerDocument,Xe=Ie.createElement("li");re.firstChild;)Xe.appendChild(re.firstChild);var mt=[Xe];function tt(_e){var vt=_e.nodeType;if(vt==1&&!Ke.test(_e.className))if(_e.nodeName==="br")it(_e),_e.parentNode&&_e.parentNode.removeChild(_e);else for(var rt=_e.firstChild;rt;rt=rt.nextSibling)tt(rt);else if((vt==3||vt==4)&&Ue){var Re=_e.nodeValue,ze=Re.match(Fe);if(ze){var ee=Re.substring(0,ze.index);_e.nodeValue=ee;var Y=Re.substring(ze.index+ze[0].length);if(Y){var Z=_e.parentNode;Z.insertBefore(Ie.createTextNode(Y),_e.nextSibling)}it(_e),ee||_e.parentNode.removeChild(_e)}}}function it(_e){for(;!_e.nextSibling;)if(_e=_e.parentNode,!_e)return;function vt(ze,ee){var Y=ee?ze.cloneNode(!1):ze,Z=ze.parentNode;if(Z){var y=vt(Z,1),x=ze.nextSibling;y.appendChild(Y);for(var A=x;A;A=x)x=A.nextSibling,y.appendChild(A)}return Y}for(var rt=vt(_e.nextSibling,0),Re;(Re=rt.parentNode)&&Re.nodeType===1;)rt=Re;mt.push(rt)}for(var et=0;et<mt.length;++et)tt(mt[et]);Le===(Le|0)&&mt[0].setAttribute("value",Le);var gt=Ie.createElement("ol");gt.className="linenums";for(var lt=Math.max(0,Le-1|0)||0,et=0,at=mt.length;et<at;++et)Xe=mt[et],Xe.className="L"+(et+lt)%10,Xe.firstChild||Xe.appendChild(Ie.createTextNode("\xA0")),gt.appendChild(Xe);re.appendChild(gt)}function ge(re){var Le=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Le=Le&&+Le[1]<=8;var Ue=/\n/g,Ke=re.sourceCode,Fe=Ke.length,Ie=0,Xe=re.spans,mt=Xe.length,tt=0,it=re.decorations,et=it.length,gt=0;it[et]=Fe;var lt,at;for(at=lt=0;at<et;)it[at]!==it[at+2]?(it[lt++]=it[at++],it[lt++]=it[at++]):at+=2;for(et=lt,at=lt=0;at<et;){for(var _e=it[at],vt=it[at+1],rt=at+2;rt+2<=et&&it[rt+1]===vt;)rt+=2;it[lt++]=_e,it[lt++]=vt,at=rt}et=it.length=lt;var Re=re.sourceNode,ze="";Re&&(ze=Re.style.display,Re.style.display="none");try{for(var ee=null;tt<mt;){var Y=Xe[tt],Z=Xe[tt+2]||Fe,y=it[gt+2]||Fe,rt=Math.min(Z,y),x=Xe[tt+1],A;if(x.nodeType!==1&&(A=Ke.substring(Ie,rt))){Le&&(A=A.replace(Ue,"\r")),x.nodeValue=A;var N=x.ownerDocument,le=N.createElement("span");le.className=it[gt+1];var we=x.parentNode;we.replaceChild(le,x),le.appendChild(x),Ie<Z&&(Xe[tt+1]=x=N.createTextNode(Ke.substring(rt,Z)),we.insertBefore(x,le.nextSibling))}Ie=rt,Ie>=Z&&(tt+=2),Ie>=y&&(gt+=2)}}finally{Re&&(Re.style.display=ze)}}var ue={};function q(re,Le){for(var Ue=Le.length;--Ue>=0;){var Ke=Le[Ue];ue.hasOwnProperty(Ke)?M.console&&console.warn("cannot override language handler %s",Ke):ue[Ke]=re}}function W(re,Le){return re&&ue.hasOwnProperty(re)||(re=/^\s*</.test(Le)?"default-markup":"default-code"),ue[re]}q(me,["default-code"]),q(Ce([],[[O,/^[^<?]+/],[ne,/^<!\w[^>]*(?:>|$)/],[ke,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[be,/^(?:<[%?]|[%?]>)/],["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(Ce([[O,/^[\s]+/,null,` \r
`],[P,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ce,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[be,/^[=<>\/]+/],["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(Ce([],[[P,/^[\s\S]+/]]),["uq.val"]),q(Oe({keywords:E,hashComments:!0,cStyleComments:!0,types:Se}),["c","cc","cpp","cxx","cyc","m"]),q(Oe({keywords:"null,true,false"}),["json"]),q(Oe({keywords:$,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Se}),["cs"]),q(Oe({keywords:te,cStyleComments:!0}),["java"]),q(Oe({keywords:Be,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),q(Oe({keywords:ae,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),q(Oe({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),q(Oe({keywords:de,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),q(Oe({keywords:X,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),q(Oe({keywords:H,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),q(Ce([],[[De,/^[\s\S]+/]]),["regex"]);function b(re){var Le=re.langExtension;try{var Ue=d(re.sourceNode,re.pre),Ke=Ue.sourceCode;re.sourceCode=Ke,re.spans=Ue.spans,re.basePos=0,W(Le,Ke)(re),ge(re)}catch(Fe){M.console&&console.log(Fe&&Fe.stack||Fe)}}function V(re,Le,Ue){var Ke=Ue||!1,Fe=Le||null,Ie=document.createElement("div");Ie.innerHTML="<pre>"+re+"</pre>",Ie=Ie.firstChild,Ke&&ve(Ie,Ke,!0);var Xe={langExtension:Fe,numberLines:Ke,sourceNode:Ie,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Xe),Ie.innerHTML}function R(re,Le){var Ue=Le||document.body,Ke=Ue.ownerDocument||document;function Fe(Y){return Ue.getElementsByTagName(Y)}for(var Ie=[Fe("pre"),Fe("code"),Fe("xmp")],Xe=[],mt=0;mt<Ie.length;++mt)for(var tt=0,it=Ie[mt].length;tt<it;++tt)Xe.push(Ie[mt][tt]);Ie=null;var et=Date;et.now||(et={now:function(){return+new Date}});var gt=0,lt=/\blang(?:uage)?-([\w.]+)(?!\S)/,at=/\bprettyprint\b/,_e=/\bprettyprinted\b/,vt=/pre|xmp/i,rt=/^code$/i,Re=/^(?:pre|code|xmp)$/i,ze={};function ee(){for(var Y=M.PR_SHOULD_USE_CONTINUATION?et.now()+250:Infinity;gt<Xe.length&&et.now()<Y;gt++){for(var Z=Xe[gt],y=ze,x=Z;x=x.previousSibling;){var A=x.nodeType,N=(A===7||A===8)&&x.nodeValue;if(N?!/^\??prettify\b/.test(N):A!==3||/\S/.test(x.nodeValue))break;if(N){y={},N.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Mt,Tt,tn){y[Tt]=tn});break}}var le=Z.className;if((y!==ze||at.test(le))&&!_e.test(le)){for(var we=!1,Ge=Z.parentNode;Ge;Ge=Ge.parentNode){var st=Ge.tagName;if(Re.test(st)&&Ge.className&&at.test(Ge.className)){we=!0;break}}if(!we){Z.className+=" prettyprinted";var Ct=y.lang;if(!Ct){Ct=le.match(lt);var Ae;!Ct&&(Ae=Q(Z))&&rt.test(Ae.tagName)&&(Ct=Ae.className.match(lt)),Ct&&(Ct=Ct[1])}var bt;if(vt.test(Z.tagName))bt=1;else{var dt=Z.currentStyle,qe=Ke.defaultView,_t=dt?dt.whiteSpace:qe&&qe.getComputedStyle?qe.getComputedStyle(Z,null).getPropertyValue("white-space"):0;bt=_t&&_t.substring(0,3)==="pre"}var Ot=y.linenums;(Ot=Ot==="true"||+Ot)||(Ot=le.match(/\blinenums\b(?::(\d+))?/),Ot=Ot?Ot[1]&&Ot[1].length?+Ot[1]:!0:!1),Ot&&ve(Z,Ot,bt);var At={langExtension:Ct,sourceNode:Z,numberLines:Ot,pre:bt,sourceCode:null,basePos:null,spans:null,decorations:null};b(At)}}}gt<Xe.length?M.setTimeout(ee,250):typeof re=="function"&&re()}ee()}var ye=M.PR={createSimpleLexer:Ce,registerLangHandler:q,sourceDecorator:Oe,PR_ATTRIB_NAME:B,PR_ATTRIB_VALUE:P,PR_COMMENT:ke,PR_DECLARATION:ne,PR_KEYWORD:Ve,PR_LITERAL:Ne,PR_NOCODE:S,PR_PLAIN:O,PR_PUNCTUATION:be,PR_SOURCE:w,PR_STRING:De,PR_TAG:ce,PR_TYPE:Te,prettyPrintOne:ie?M.prettyPrintOne=V:z=V,prettyPrint:T=ie?M.prettyPrint=R:T=R},Ee=M.define;typeof Ee=="function"&&Ee.amd&&Ee("google-code-prettify",[],function(){return ye})})()},"VrN/":function(ot,Qe,k){(function(U,se){ot.exports=se()})(this,function(){"use strict";var U=navigator.userAgent,se=navigator.platform,ie=/gecko\/\d/i.test(U),xe=/MSIE \d/.test(U),fe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(U),z=/Edge\/(\d+)/.exec(U),T=xe||fe||z,M=T&&(xe?document.documentMode||6:+(z||fe)[1]),j=!z&&/WebKit\//.test(U),L=j&&/Qt\/\d+\.\d+/.test(U),_=!z&&/Chrome\//.test(U),E=/Opera\//.test(U),te=/Apple Computer/.test(navigator.vendor),$=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(U),H=/PhantomJS/.test(U),X=!z&&/AppleWebKit/.test(U)&&/Mobile\/\w+/.test(U),J=/Android/.test(U),ae=X||J||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(U),de=X||/Mac/.test(se),Be=/\bCrOS\b/.test(U),$e=/win/i.test(se),Se=E&&U.match(/Version\/(\d*\.\d*)/);Se&&(Se=Number(Se[1])),Se&&Se>=15&&(E=!1,j=!0);var De=de&&(L||E&&(Se==null||Se<12.11)),Ve=ie||T&&M>=9;function ke(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Te=function(e,t){var i=e.className,n=ke(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 Ne(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function be(e,t){return Ne(e).appendChild(t)}function O(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 ce(e,t,i,n){var r=O(e,t,i,n);return r.setAttribute("role","presentation"),r}var ne;document.createRange?ne=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:ne=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 w(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function P(e,t){var i=e.className;ke(t).test(i)||(e.className+=(i?" ":"")+t)}function S(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!ke(i[n]).test(t)&&(t+=" "+i[n]);return t}var D=function(e){e.select()};X?D=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:T&&(D=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 C(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 F=function(){this.id=null,this.f=null,this.time=0,this.handler=p(this.onTimeout,this)};F.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},F.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 Q(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ce=50,Oe={toString:function(){return"CodeMirror.Pass"}},me={scroll:!1},ve={origin:"*mouse"},ge={origin:"+move"};function ue(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 W(e){for(;q.length<=e;)q.push(b(q)+" ");return q[e]}function b(e){return e[e.length-1]}function V(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function R(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 Le(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||re.test(e))}function Ue(e,t){return t?t.source.indexOf("\\w")>-1&&Le(e)?!0:t.test(e):Le(e)}function Ke(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Fe=/[\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 Ie(e){return e.charCodeAt(0)>=768&&Fe.test(e)}function Xe(e,t,i){for(;(i<0?t>0:t<e.length)&&Ie(e.charAt(t));)t+=i;return t}function mt(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 tt(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 it=null;function et(e,t,i){var n;it=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:it=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:it=r)}return n!=null?n:it}var gt=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 g(v,I,G){this.level=v,this.from=I,this.to=G}return function(v,I){var G=I=="ltr"?"L":"R";if(v.length==0||I=="ltr"&&!n.test(v))return!1;for(var he=v.length,oe=[],Me=0;Me<he;++Me)oe.push(i(v.charCodeAt(Me)));for(var He=0,Ye=G;He<he;++He){var Je=oe[He];Je=="m"?oe[He]=Ye:Ye=Je}for(var nt=0,Ze=G;nt<he;++nt){var ut=oe[nt];ut=="1"&&Ze=="r"?oe[nt]="n":s.test(ut)&&(Ze=ut,ut=="r"&&(oe[nt]="R"))}for(var wt=1,yt=oe[0];wt<he-1;++wt){var Lt=oe[wt];Lt=="+"&&yt=="1"&&oe[wt+1]=="1"?oe[wt]="1":Lt==","&&yt==oe[wt+1]&&(yt=="1"||yt=="n")&&(oe[wt]=yt),yt=Lt}for(var Yt=0;Yt<he;++Yt){var fn=oe[Yt];if(fn==",")oe[Yt]="N";else if(fn=="%"){var Zt=void 0;for(Zt=Yt+1;Zt<he&&oe[Zt]=="%";++Zt);for(var Bn=Yt&&oe[Yt-1]=="!"||Zt<he&&oe[Zt]=="1"?"1":"N",On=Yt;On<Zt;++On)oe[On]=Bn;Yt=Zt-1}}for(var nn=0,Rn=G;nn<he;++nn){var bn=oe[nn];Rn=="L"&&bn=="1"?oe[nn]="L":s.test(bn)&&(Rn=bn)}for(var ln=0;ln<he;++ln)if(r.test(oe[ln])){var rn=void 0;for(rn=ln+1;rn<he&&r.test(oe[rn]);++rn);for(var Qt=(ln?oe[ln-1]:G)=="L",Dn=(rn<he?oe[rn]:G)=="L",cr=Qt==Dn?Qt?"L":"R":G,Mi=ln;Mi<rn;++Mi)oe[Mi]=cr;ln=rn-1}for(var Cn=[],si,pn=0;pn<he;)if(l.test(oe[pn])){var $o=pn;for(++pn;pn<he&&l.test(oe[pn]);++pn);Cn.push(new g(0,$o,pn))}else{var mi=pn,Gi=Cn.length,Vi=I=="rtl"?1:0;for(++pn;pn<he&&oe[pn]!="L";++pn);for(var En=mi;En<pn;)if(f.test(oe[En])){mi<En&&(Cn.splice(Gi,0,new g(1,mi,En)),Gi+=Vi);var dr=En;for(++En;En<pn&&f.test(oe[En]);++En);Cn.splice(Gi,0,new g(2,dr,En)),Gi+=Vi,mi=En}else++En;mi<pn&&Cn.splice(Gi,0,new g(1,mi,pn))}return I=="ltr"&&(Cn[0].level==1&&(si=v.match(/^\s+/))&&(Cn[0].from=si[0].length,Cn.unshift(new g(0,0,si[0].length))),b(Cn).level==1&&(si=v.match(/\s+$/))&&(b(Cn).to-=si[0].length,Cn.push(new g(0,he-si[0].length,he)))),I=="rtl"?Cn.reverse():Cn}}();function lt(e,t){var i=e.order;return i==null&&(i=e.order=gt(e.text,t)),i}var at=[],_e=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]||at).concat(i)}};function vt(e,t){return e._handlers&&e._handlers[t]||at}function rt(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=Q(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Re(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 ze(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Re(e,i||t.type,e,t),A(t)||t.codemirrorIgnore}function ee(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)Q(i,t[n])==-1&&i.push(t[n])}function Y(e,t){return vt(e,t).length>0}function Z(e){e.prototype.on=function(t,i){_e(this,t,i)},e.prototype.off=function(t,i){rt(this,t,i)}}function y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function x(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function A(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function N(e){y(e),x(e)}function le(e){return e.target||e.srcElement}function we(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),de&&e.ctrlKey&&t==1&&(t=3),t}var Ge=function(){if(T&&M<9)return!1;var e=O("div");return"draggable"in e||"dragDrop"in e}(),st;function Ct(e){if(st==null){var t=O("span","\u200B");be(e,O("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(st=t.offsetWidth<=1&&t.offsetHeight>2&&!(T&&M<8))}var i=st?O("span","\u200B"):O("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ae;function bt(e){if(Ae!=null)return Ae;var t=be(e,document.createTextNode("A\u062EA")),i=ne(t,0,1).getBoundingClientRect(),n=ne(t,1,2).getBoundingClientRect();return Ne(e),!i||i.left==i.right?!1:Ae=n.right-i.right<3}var dt=`
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/)},qe=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},_t=function(){var e=O("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Ot=null;function At(e){if(Ot!=null)return Ot;var t=be(e,O("span","x")),i=t.getBoundingClientRect(),n=ne(t,0,1).getBoundingClientRect();return Ot=Math.abs(i.left-n.left)>1}var Mt={},Tt={};function tn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Mt[e]=t}function on(e,t){Tt[e]=t}function pt(e){if(typeof e=="string"&&Tt.hasOwnProperty(e))e=Tt[e];else if(e&&typeof e.name=="string"&&Tt.hasOwnProperty(e.name)){var t=Tt[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 pt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return pt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Vn(e,t){t=pt(t);var i=Mt[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 gn(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 jt=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};jt.prototype.eol=function(){return this.pos>=this.string.length},jt.prototype.sol=function(){return this.pos==this.lineStart},jt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},jt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},jt.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},jt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},jt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},jt.prototype.skipToEnd=function(){this.pos=this.string.length},jt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},jt.prototype.backUp=function(e){this.pos-=e},jt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=C(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?C(this.string,this.lineStart,this.tabSize):0)},jt.prototype.indentation=function(){return C(this.string,null,this.tabSize)-(this.lineStart?C(this.string,this.lineStart,this.tabSize):0)},jt.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)}},jt.prototype.current=function(){return this.string.slice(this.start,this.pos)},jt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},jt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},jt.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 Un(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 Pt(e){if(e.parent==null)return null;for(var t=e.parent,i=Q(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],g=f.height;if(t<g)break;t-=g}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 We(e,t,i){if(i===void 0&&(i=null),!(this instanceof We))return new We(e,t,i);this.line=e,this.ch=t,this.sticky=i}function St(e,t){return e.line-t.line||e.ch-t.ch}function ti(e,t){return e.sticky==t.sticky&&St(e,t)==0}function ci(e){return We(e.line,e.ch)}function di(e,t){return St(e,t)<0?t:e}function Oi(e,t){return St(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 We(e.first,0);var i=e.first+e.size-1;return t.line>i?We(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?We(e.line,t):i<0?We(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 m=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 m?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 m(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,I){return r.push(v,I)},s,n);for(var l=i.state,f=function(v){i.baseTokens=r;var I=e.state.overlays[v],G=1,he=0;i.state=!0,Hn(e,t.text,I.mode,i,function(oe,Me){for(var He=G;he<oe;){var Ye=r[G];Ye>oe&&r.splice(G,1,oe,r[G+1],Ye),G+=2,he=Math.min(oe,Ye)}if(!Me)return;if(I.opaque)r.splice(He,G-He,oe,"overlay "+Me),G=He+2;else for(;He<G;He+=2){var Je=r[He+1];r[He+1]=(Je?Je+" ":"")+"overlay "+Me}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)f(g);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Pe(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=pe(e,Pt(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 pe(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=un(e,t,i),l=s>n.first&&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(g){ht(e,g.text,f);var v=f.line;g.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 jt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&je(r,i.state);!s.eol();)Et(r,s,i.state),s.start=s.pos}function je(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 Et(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 It=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function zt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=ct(r,t.line),g=pe(e,t.line,i),v=new jt(f.text,e.options.tabSize,g),I;for(n&&(I=[]);(n||v.pos<t.ch)&&!v.eol();)v.start=v.pos,l=Et(s,v,g.state),n&&I.push(new It(v,l,kn(r.mode,g.state)));return n?I:new It(v,l,g.state)}function Fn(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 g=0,v=null,I=new jt(t,e.options.tabSize,n),G,he=e.options.addModeClass&&[null];for(t==""&&Fn(je(i,n.state),s);!I.eol();){if(I.pos>e.options.maxHighlightLength?(f=!1,l&&ht(e,t,n,I.pos),I.pos=t.length,G=null):G=Fn(Et(i,I,n.state,he),s),he){var oe=he[0].name;oe&&(G="m-"+(G?oe+" "+G:oe))}if(!f||v!=G){for(;g<I.start;)g=Math.min(I.start,g+5e3),r(g,v);v=G}I.start=I.pos}for(;g<I.pos;){var Me=Math.min(I.pos,g+5e3);r(Me,v),g=Me}}function un(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 g=ct(s,f-1),v=g.stateAfter;if(v&&(!i||f+(v instanceof m?v.lookAhead:0)<=s.modeFrontier))return f;var I=C(g.text,null,e.options.tabSize);(r==null||n>I)&&(r=f-1,n=I)}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 m)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Xi=!1,An=!1;function Ln(){Xi=!0}function ni(){An=!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 g=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new yi(l,s.from,g?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 g=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new yi(l,g?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=St(t.from,t.to)==0,f=fr(i,r,l),g=Ki(n,s,l),v=t.text.length==1,I=b(t.text).length+(v?r:0);if(f)for(var G=0;G<f.length;++G){var he=f[G];if(he.to==null){var oe=Jn(g,he.marker);oe?v&&(he.to=oe.to==null?null:oe.to+I):he.to=r}}if(g)for(var Me=0;Me<g.length;++Me){var He=g[Me];if(He.to!=null&&(He.to+=I),He.from==null){var Ye=Jn(f,He.marker);Ye||(He.from=I,v&&(f||(f=[])).push(He))}else He.from+=I,v&&(f||(f=[])).push(He)}f&&(f=Nn(f)),g&&g!=f&&(g=Nn(g));var Je=[f];if(!v){var nt=t.text.length-2,Ze;if(nt>0&&f)for(var ut=0;ut<f.length;++ut)f[ut].to==null&&(Ze||(Ze=[])).push(new yi(f[ut].marker,null,null));for(var wt=0;wt<nt;++wt)Je.push(Ze);Je.push(g)}return Je}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 Ri(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(oe){if(oe.markedSpans)for(var Me=0;Me<oe.markedSpans.length;++Me){var He=oe.markedSpans[Me].marker;He.readOnly&&(!n||Q(n,He)==-1)&&(n||(n=[])).push(He)}}),!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),g=0;g<r.length;++g){var v=r[g];if(St(v.to,f.from)<0||St(v.from,f.to)>0)continue;var I=[g,1],G=St(v.from,f.from),he=St(v.to,f.to);(G<0||!l.inclusiveLeft&&!G)&&I.push({from:v.from,to:f.from}),(he>0||!l.inclusiveRight&&!he)&&I.push({from:f.to,to:v.to}),r.splice.apply(r,I),g+=I.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 Ut(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=St(n.from,r.from)||qt(e)-qt(t);if(s)return-s;var l=St(n.to,r.to)||Ut(e)-Ut(t);return l||t.id-e.id}function Ft(e,t){var i=An&&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 vn(e){return Ft(e,!0)}function Kt(e){return Ft(e,!1)}function bi(e,t){var i=An&&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 an(e,t,i,n,r){var s=ct(e,t),l=An&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var g=l[f];if(!g.marker.collapsed)continue;var v=g.marker.find(0),I=St(v.from,i)||qt(g.marker)-qt(r),G=St(v.to,n)||Ut(g.marker)-Ut(r);if(I>=0&&G<=0||I<=0&&G>=0)continue;if(I<=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?St(v.to,i)>=0:St(v.to,i)>0)||I>=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?St(v.from,n)<=0:St(v.from,n)<0))return!0}}function sn(e){for(var t;t=vn(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 wi(e,t){var i=ct(e,t),n=sn(i);return i==n?t:Pt(n)}function Ur(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 Pt(i)+1}function Zn(e,t){var i=An&&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=sn(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=vn(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 Ci=function(e,t,i){this.text=e,Pi(this,t),this.height=i?i(this):1};Ci.prototype.lineNo=function(){return Pt(this)},Z(Ci);function uo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Di(e),Pi(e,i);var r=n?n(e):1;r!=e.height&&Tn(e,r)}function ho(e){e.parent=null,Di(e)}var Zo={},Qo={};function co(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:Zo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Fr(e,t){var i=ce("span",null,null,j?"padding-right: .1px":null),n={pre:ce("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=kt,bt(e.display.measure)&&(l=lt(s,e.doc.direction))&&(n.addToken=Rt(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Pt(s);Wt(s,n,Pe(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=S(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=S(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Ct(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(j){var g=n.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Re(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=S(n.pre.className,n.textClass||"")),n}function ft(e){var t=O("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function kt(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?xt(t,e.trailingSpace):t,g=e.cm.state.specialChars,v=!1,I;if(!g.test(t))e.col+=t.length,I=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,I),T&&M<9&&(v=!0),e.pos+=t.length;else{I=document.createDocumentFragment();for(var G=0;;){g.lastIndex=G;var he=g.exec(t),oe=he?he.index-G:t.length-G;if(oe){var Me=document.createTextNode(f.slice(G,G+oe));T&&M<9?I.appendChild(O("span",[Me])):I.appendChild(Me),e.map.push(e.pos,e.pos+oe,Me),e.col+=oe,e.pos+=oe}if(!he)break;G+=oe+1;var He=void 0;if(he[0]==" "){var Ye=e.cm.options.tabSize,Je=Ye-e.col%Ye;He=I.appendChild(O("span",W(Je),"cm-tab")),He.setAttribute("role","presentation"),He.setAttribute("cm-text"," "),e.col+=Je}else he[0]=="\r"||he[0]==`
`?(He=I.appendChild(O("span",he[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),He.setAttribute("cm-text",he[0]),e.col+=1):(He=e.cm.options.specialCharPlaceholder(he[0]),He.setAttribute("cm-text",he[0]),T&&M<9?I.appendChild(O("span",[He])):I.appendChild(He),e.col+=1);e.map.push(e.pos,e.pos+1,He),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var nt=i||"";n&&(nt+=n),r&&(nt+=r);var Ze=O("span",[I],nt,s);if(l)for(var ut in l)l.hasOwnProperty(ut)&&ut!="style"&&ut!="class"&&Ze.setAttribute(ut,l[ut]);return e.content.appendChild(Ze)}e.content.appendChild(I)}function xt(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 Rt(e,t){return function(i,n,r,s,l,f,g){r=r?r+" cm-force-border":"cm-force-border";for(var v=i.pos,I=v+n.length;;){for(var G=void 0,he=0;he<t.length&&!(G=t[he],G.to>v&&G.from<=v);he++);if(G.to>=I)return e(i,n,r,s,l,f,g);e(i,n.slice(0,G.to-v),r,s,null,f,g),s=null,n=n.slice(G.to-v),v=G.to}}}function Bt(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 Wt(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,g=0,v=1,I="",G,he,oe=0,Me,He,Ye,Je,nt;;){if(oe==g){Me=He=Ye=he="",nt=null,Je=null,oe=Infinity;for(var Ze=[],ut=void 0,wt=0;wt<n.length;++wt){var yt=n[wt],Lt=yt.marker;if(Lt.type=="bookmark"&&yt.from==g&&Lt.widgetNode)Ze.push(Lt);else if(yt.from<=g&&(yt.to==null||yt.to>g||Lt.collapsed&&yt.to==g&&yt.from==g)){if(yt.to!=null&&yt.to!=g&&oe>yt.to&&(oe=yt.to,He=""),Lt.className&&(Me+=" "+Lt.className),Lt.css&&(he=(he?he+";":"")+Lt.css),Lt.startStyle&&yt.from==g&&(Ye+=" "+Lt.startStyle),Lt.endStyle&&yt.to==oe&&(ut||(ut=[])).push(Lt.endStyle,yt.to),Lt.title&&((nt||(nt={})).title=Lt.title),Lt.attributes)for(var Yt in Lt.attributes)(nt||(nt={}))[Yt]=Lt.attributes[Yt];Lt.collapsed&&(!Je||mn(Je.marker,Lt)<0)&&(Je=yt)}else yt.from>g&&oe>yt.from&&(oe=yt.from)}if(ut)for(var fn=0;fn<ut.length;fn+=2)ut[fn+1]==oe&&(He+=" "+ut[fn]);if(!Je||Je.from==g)for(var Zt=0;Zt<Ze.length;++Zt)Bt(t,0,Ze[Zt]);if(Je&&(Je.from||0)==g){if(Bt(t,(Je.to==null?f+1:Je.to)-g,Je.marker,Je.from==null),Je.to==null)return;Je.to==g&&(Je=!1)}}if(g>=f)break;for(var Bn=Math.min(f,oe);;){if(I){var On=g+I.length;if(!Je){var nn=On>Bn?I.slice(0,Bn-g):I;t.addToken(t,nn,G?G+Me:Me,Ye,g+nn.length==oe?He:"",he,nt)}if(On>=Bn){I=I.slice(Bn-g),g=Bn;break}g=On,Ye=""}I=r.slice(s,s=i[v++]),G=co(i[v++],t.cm.options)}}}function Nt(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Pt(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 Nt(e.doc,ct(e.doc,s),s);r=s+l.size,n.push(l)}return n}var hn=null;function Dt(e){hn?hn.ops.push(e):e.ownsGroup=hn={ops:[e],delayedCallbacks:[]}}function Ni(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(i<t.length)}function Gt(e,t){var i=e.ownsGroup;if(!i)return;try{Ni(i)}finally{hn=null,t(i)}}var yn=null;function Xt(e,t){var i=vt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;hn?r=hn.delayedCallbacks:yn?r=yn:(r=yn=[],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=yn;yn=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 gr(e){return e.node==e.text&&(e.node=O("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=gr(t);t.background=n.insertBefore(O("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function qo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Fr(e,t)}function Ps(e,t){var i=t.text.className,n=qo(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,fo(e,t)):i&&(t.text.className=i)}function fo(e,t){Ds(e,t),t.line.wrapClass?gr(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=gr(t);t.gutterBackground=O("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=gr(t),f=t.gutter=O("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(O("div",vi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var g=0;g<e.display.gutterSpecs.length;++g){var v=e.display.gutterSpecs[g].className,I=s.hasOwnProperty(v)&&s[v];I&&f.appendChild(O("div",[I],"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=ke("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=gr(i),l=0,f=t.widgets;l<f.length;++l){var g=f[l],v=O("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),js(g,v,i,n),e.display.input.setUneditable(v),r&&g.above?s.insertBefore(v,i.gutter||i.text):s.appendChild(v),Xt(g,"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 mr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!w(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;"),be(t.display.measure,O("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=le(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=be(e.measure,O("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 Ce-e.display.nativeBarWidth}function Ii(e){return e.display.scroller.clientWidth-oi(e)-e.display.barWidth}function go(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 g=l[f],v=l[f+1];Math.abs(g.bottom-v.bottom)>2&&s.push((g.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(Pt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=sn(t);var i=Pt(t),n=e.display.externalMeasured=new Nt(e.doc,t,i);n.lineN=i;var r=n.built=Fr(e,n);return n.text=r.pre,be(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return ai(e,Ji(e,t),i,n)}function mo(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ui(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Ji(e,t){var i=Pt(t),n=mo(e,i);n&&!n.text?n=null:n&&n.changes&&(pr(e,n,i,Co(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var r=ra(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ai(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(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,g,v=0;v<e.length;v+=3)if(f=e[v],g=e[v+1],t<f?(r=0,s=1,l="left"):t<g?(r=t-f,s=r+1):(v==e.length-3||t==g&&e[v+3]>t)&&(s=g-f,r=s-1,t>=g&&(l="right")),r!=null){if(n=e[v+2],f==g&&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==g-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:g}}function Fs(e,t){var i=aa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function Hs(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,f=r.end,g=r.collapse,v;if(s.nodeType==3){for(var I=0;I<4;I++){for(;l&&Ie(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Ie(t.line.text.charAt(r.coverStart+f));)++f;if(T&&M<9&&l==0&&f==r.coverEnd-r.coverStart?v=s.parentNode.getBoundingClientRect():v=Fs(ne(s,l,f).getClientRects(),n),v.left||v.right||l==0)break;f=l,l=l-1,g="right"}T&&M<11&&(v=zs(e.display.measure,v))}else{l>0&&(g=n="right");var G;e.options.lineWrapping&&(G=s.getClientRects()).length>1?v=G[n=="right"?G.length-1:0]:v=s.getBoundingClientRect()}if(T&&M<9&&!l&&(!v||!v.left&&!v.right)){var he=s.parentNode.getClientRects()[0];he?v={left:he.left,right:he.left+Qi(e.display),top:he.top,bottom:he.bottom}:v=aa}for(var oe=v.top-t.rect.top,Me=v.bottom-t.rect.top,He=(oe+Me)/2,Ye=t.view.measure.heights,Je=0;Je<Ye.length-1&&!(He<Ye[Je]);Je++);var nt=Je?Ye[Je-1]:0,Ze=Ye[Je],ut={left:(g=="right"?v.right:v.left)-t.rect.left,right:(g=="left"?v.left:v.right)-t.rect.left,top:nt,bottom:Ze};return!v.left&&!v.right&&(ut.bogus=!0),e.options.singleCursorHeightPerLine||(ut.rtop=oe,ut.rbottom=Me),ut}function zs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!At(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,Ne(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 _&&J?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ca(){return _&&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+=mr(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 g=f.left+(n=="window"?0:ha());i.left+=g,i.right+=g}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(Me,He){var Ye=ai(e,r,Me,He?"right":"left",s);return He?Ye.left=Ye.right:Ye.right=Ye.left,zr(e,n,Ye,i)}var f=lt(n,e.doc.direction),g=t.ch,v=t.sticky;if(g>=n.text.length?(g=n.text.length,v="before"):g<=0&&(g=0,v="after"),!f)return l(v=="before"?g-1:g,v=="before");function I(Me,He,Ye){var Je=f[He],nt=Je.level==1;return l(Ye?Me-1:Me,nt!=Ye)}var G=et(f,g,v),he=it,oe=I(g,G,v=="before");return he!=null&&(oe.other=I(g,he,v!="before")),oe}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=We(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),g=bi(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!g)return f;var v=g.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=mt(function(l){return ai(e,i,l-1).bottom<=n},r,0);return r=mt(function(l){return ai(e,i,l).top>n},s,r),{begin:s,end:r}}function ga(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 wo(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,g=t.text.length,v=!0,I=lt(t,e.doc.direction);if(I){var G=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,I,n,r);v=G.level!=1,f=v?G.from:G.to-1,g=v?G.to:G.from-1}var he=null,oe=null,Me=mt(function(wt){var yt=ai(e,s,wt);return yt.top+=l,yt.bottom+=l,wo(yt,n,r,!1)?(yt.top<=r&&yt.left<=n&&(he=wt,oe=yt),!0):!1},f,g),He,Ye,Je=!1;if(oe){var nt=n-oe.left<oe.right-n,Ze=nt==v;Me=he+(Ze?0:1),Ye=Ze?"after":"before",He=nt?oe.left:oe.right}else{!v&&(Me==g||Me==f)&&Me++,Ye=Me==0?"after":Me==t.text.length?"before":ai(e,s,Me-(v?1:0)).bottom+l<=r==v?"after":"before";var ut=Qn(e,We(i,Me,Ye),"line",t,s);He=ut.left,Je=r<ut.top?-1:r>=ut.bottom?1:0}return Me=Xe(t.text,Me,1),bo(i,Me,Ye,Je,n-He)}function Gs(e,t,i,n,r,s,l){var f=mt(function(G){var he=r[G],oe=he.level!=1;return wo(Qn(e,We(i,oe?he.to:he.from,oe?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),g=r[f];if(f>0){var v=g.level!=1,I=Qn(e,We(i,v?g.from:g.to,v?"after":"before"),"line",t,n);wo(I,s,l,!0)&&I.top>l&&(g=r[f-1])}return g}function Vs(e,t,i,n,r,s,l){var f=pa(e,t,n,l),g=f.begin,v=f.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var I=null,G=null,he=0;he<r.length;he++){var oe=r[he];if(oe.from>=v||oe.to<=g)continue;var Me=oe.level!=1,He=ai(e,n,Me?Math.min(v,oe.to)-1:Math.max(g,oe.from)).right,Ye=He<s?s-He+1e9:He-s;(!I||G>Ye)&&(I=oe,G=Ye)}return I||(I=r[r.length-1]),I.from<g&&(I={from:g,to:I.to,level:I.level}),I.to>v&&(I={from:I.from,to:v,level:I.level}),I}var ji;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ji==null){ji=O("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ji.appendChild(document.createTextNode("x")),ji.appendChild(O("br"));ji.appendChild(document.createTextNode("x"))}be(e.measure,ji);var i=ji.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Ne(e.measure),i||1}function Qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=O("span","xxxxxxxxxx"),i=O("pre",[t],"CodeMirror-line-like");be(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Co(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:So(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function So(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(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 Eo(e){var t=e.doc,i=ma(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&&le(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(G){return null}var g=xo(e,s,l),v;if(n&&g.xRel>0&&(v=ct(e.doc,g.line).text).length==g.ch){var I=C(v,v.length,e.options.tabSize)-v.length;g=We(g.line,Math.max(0,Math.round((s-ia(e.display).left)/Qi(e.display))-I))}return g}function Ui(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function _n(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)An&&wi(e.doc,t)<r.viewTo&&Ei(e);else if(i<=r.viewFrom)An&&Ur(e.doc,i+n)>r.viewFrom?Ei(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ei(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):Ei(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):Ei(e)}else{var f=Wr(e,t,t,-1),g=Wr(e,i,i+n,1);f&&g?(r.view=r.view.slice(0,f.index).concat(Jt(e,f.lineN,g.lineN)).concat(r.view.slice(g.index)),r.viewTo+=n):Ei(e)}var v=r.externalMeasured;v&&(i<v.lineN?v.lineN+=n:t<v.lineN+v.size&&(r.externalMeasured=null))}function Si(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[Ui(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Q(l,i)==-1&&l.push(i)}function Ei(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=Ui(e,t),s,l=e.display.view;if(!An||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,g=0;g<r;g++)f+=l[g].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(;wi(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Xs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Jt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Jt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ui(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Jt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ui(e,i)))),n.viewTo=i}function va(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ya(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var f=i.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var g=f.empty();(g||e.options.showCursorWhenSelecting)&&ba(e,f.head,r),g||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(O("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(O("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,g=Math.max(n.sizerWidth,Ii(e)-n.sizer.offsetLeft)-l.right,v=r.direction=="ltr";function I(Ze,ut,wt,yt){ut<0&&(ut=0),ut=Math.round(ut),yt=Math.round(yt),s.appendChild(O("div",null,"CodeMirror-selected","position: absolute; left: "+Ze+`px;
top: `+ut+"px; width: "+(wt==null?g-Ze:wt)+`px;
height: `+(yt-ut)+"px"))}function G(Ze,ut,wt){var yt=ct(r,Ze),Lt=yt.text.length,Yt,fn;function Zt(nn,Rn){return yo(e,We(Ze,nn),"div",yt,Rn)}function Bn(nn,Rn,bn){var ln=ga(e,yt,null,nn),rn=Rn=="ltr"==(bn=="after")?"left":"right",Qt=bn=="after"?ln.begin:ln.end-(/\s/.test(yt.text.charAt(ln.end-1))?2:1);return Zt(Qt,rn)[rn]}var On=lt(yt,r.direction);return tt(On,ut||0,wt==null?Lt:wt,function(nn,Rn,bn,ln){var rn=bn=="ltr",Qt=Zt(nn,rn?"left":"right"),Dn=Zt(Rn-1,rn?"right":"left"),cr=ut==null&&nn==0,Mi=wt==null&&Rn==Lt,Cn=ln==0,si=!On||ln==On.length-1;if(Dn.top-Qt.top<=3){var pn=(v?cr:Mi)&&Cn,$o=(v?Mi:cr)&&si,mi=pn?f:(rn?Qt:Dn).left,Gi=$o?g:(rn?Dn:Qt).right;I(mi,Qt.top,Gi-mi,Qt.bottom)}else{var Vi,En,dr,Jo;rn?(Vi=v&&cr&&Cn?f:Qt.left,En=v?g:Bn(nn,bn,"before"),dr=v?f:Bn(Rn,bn,"after"),Jo=v&&Mi&&si?g:Dn.right):(Vi=v?Bn(nn,bn,"before"):f,En=!v&&cr&&Cn?g:Qt.right,dr=!v&&Mi&&si?f:Dn.left,Jo=v?Bn(Rn,bn,"after"):g),I(Vi,Qt.top,En-Vi,Qt.bottom),Qt.bottom<Dn.top&&I(f,Qt.bottom,null,Dn.top),I(dr,Dn.top,Jo-dr,Dn.bottom)}(!Yt||Gr(Qt,Yt)<0)&&(Yt=Qt),Gr(Dn,Yt)<0&&(Yt=Dn),(!fn||Gr(Qt,fn)<0)&&(fn=Qt),Gr(Dn,fn)<0&&(fn=Dn)}),{start:Yt,end:fn}}var he=t.from(),oe=t.to();if(he.line==oe.line)G(he.line,he.ch,oe.ch);else{var Me=ct(r,he.line),He=ct(r,oe.line),Ye=sn(Me)==sn(He),Je=G(he.line,he.ch,Ye?Me.text.length+1:null).end,nt=G(oe.line,Ye?0:null,oe.ch).start;Ye&&(Je.top<nt.top-2?(I(Je.right,Je.top,null,Je.bottom),I(f,nt.top,nt.left,nt.bottom)):I(Je.right,Je.top,nt.left-Je.right,Je.bottom)),Je.bottom<nt.top&&I(f,Je.bottom,null,nt.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 wa(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||(Re(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),j&&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&&(Re(e,"blur",e,t),e.state.focused=!1,Te(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 g=r.node.offsetTop+r.node.offsetHeight;l=g-i,i=g}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 I=r.line.height-l;if((I>.005||I<-.005)&&(Tn(r.line,l),Ca(r.line),r.rest))for(var G=0;G<r.rest.length;G++)Ca(r.rest[G]);if(f>e.display.sizerWidth){var he=Math.ceil(f/Qi(e.display));he>e.display.maxLineLength&&(e.display.maxLineLength=he,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ca(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,g=i.ensure.to.line;f<s?(s=f,l=Kn(t,In(ct(t,f))+e.wrapper.clientHeight)):Math.min(g,t.lastLine())>=l&&(s=Kn(t,In(ct(t,g))-e.wrapper.clientHeight),l=g)}return{from:s,to:Math.max(l,s+1)}}function Ys(e,t){if(ze(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&&!H){var s=O("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?We(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?We(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Qn(e,t),g=!i||i==t?f:Qn(e,i);r={left:Math.min(f.left,g.left),top:Math.min(f.top,g.top)-n,right:Math.max(f.left,g.left),bottom:Math.max(f.bottom,g.bottom)+n};var v=Ao(e,r),I=e.doc.scrollTop,G=e.doc.scrollLeft;if(v.scrollTop!=null&&(xr(e,v.scrollTop),Math.abs(e.doc.scrollTop-I)>1&&(l=!0)),v.scrollLeft!=null&&(Fi(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-G)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=Ao(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&Fi(e,i.scrollLeft)}function Ao(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=go(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+po(i),g=t.top<n,v=t.bottom>f-n;if(t.top<r)l.scrollTop=g?0:t.top;else if(t.bottom>r+s){var I=Math.min(t.top,(v?f:t.bottom)-s);I!=r&&(l.scrollTop=I)}var G=e.options.fixedGutter?0:i.gutters.offsetWidth,he=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-G,oe=Ii(e)-i.gutters.offsetWidth,Me=t.right-t.left>oe;return Me&&(t.right=t.left+oe),t.left<10?l.scrollLeft=0:t.left<he?l.scrollLeft=Math.max(0,t.left+G-(Me?0:10)):t.right>oe+he-3&&(l.scrollLeft=t.right+(Me?0:10)-oe),l}function Lo(e,t){if(t==null)return;Kr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function er(e){Kr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Kr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Kr(e),e.curOp.scrollToPos=t}function Kr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=fa(e,t.from),n=fa(e,t.to);Sa(e,i,n,t.margin)}}function Sa(e,t,i,n){var r=Ao(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;ie||Mo(e,{top:t}),Ea(e,t,!0),ie&&Mo(e),Sr(e,100)}function Ea(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Fi(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,_a(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function wr(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=O("div",[O("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=O("div",[O("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),_e(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),_e(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=de&&!$?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},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 Cr=function(){};Cr.prototype.update=function(){return{bottom:0,right:0}},Cr.prototype.setScrollLeft=function(){},Cr.prototype.setScrollTop=function(){},Cr.prototype.clear=function(){};function tr(e,t){t||(t=wr(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,wr(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:Cr};function Aa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Te(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),_e(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Fi(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&P(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},Dt(e.curOp)}function Wi(e){var t=e.curOp;t&&Gt(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&&_o(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=wr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oa(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+oi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ii(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&tr(t,e.barMeasure),e.updatedDisplay&&Ro(t,e.barMeasure),e.selectionChanged&&ko(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&xa(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&La(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ea(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Fi(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$s(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||Re(s[f],"hide");if(l)for(var g=0;g<l.length;++g)l[g].lines.length&&Re(l[g],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Re(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 cn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);zi(e);try{return t.apply(e,arguments)}finally{Wi(e)}}}function Sn(e){return function(){if(this.curOp)return e.apply(this,arguments);zi(this);try{return e.apply(this,arguments)}finally{Wi(this)}}}function dn(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 Sr(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=pe(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,g=K(e,s,n,!0);f&&(n.state=f),s.styles=g.styles;var v=s.styleClasses,I=g.classes;I?s.styleClasses=I:v&&(s.styleClasses=null);for(var G=!l||l.length!=s.styles.length||v!=I&&(!v||!I||v.bgClass!=I.bgClass||v.textClass!=I.textClass),he=0;!G&&he<l.length;++he)G=l[he]!=s.styles[he];G&&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 Sr(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++)Si(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=Co(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++)Re.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=B();if(!t||!w(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&w(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==B())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&w(document.body,e.anchorNode)&&w(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function _o(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Ei(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)&&(Ei(e),t.dims=Co(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)),An&&(s=wi(e.doc,s),l=Ur(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 g=va(e);if(!f&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=sl(e);return g>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(v),Ne(i.cursorDiv),Ne(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Sr(e,400)),i.updateLineNumbers=null,!0}function La(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ii(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-go(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(!_o(e,t))break;Vr(e);var r=wr(e);yr(e),tr(e,r),Ro(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Mo(e,t){var i=new Yr(e,t);if(_o(e,i)){Vr(e),La(e,i);var n=wr(e);yr(e),tr(e,n),Ro(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(Me){var He=Me.nextSibling;return j&&de&&e.display.currentWheelTarget==Me?Me.style.display="none":Me.parentNode.removeChild(Me),He}for(var g=n.view,v=n.viewFrom,I=0;I<g.length;I++){var G=g[I];if(!G.hidden)if(!G.node||G.node.parentNode!=s){var he=Is(e,G,v,i);s.insertBefore(he,l)}else{for(;l!=G.node;)l=f(l);var oe=r&&t!=null&&t<=v&&G.lineNumber;G.changes&&(Q(G.changes,"gutter")>-1&&(oe=!1),pr(e,G,v,i)),oe&&(Ne(G.lineNumber),G.lineNumber.appendChild(document.createTextNode(vi(e.options,v)))),l=G.node.nextSibling}v+=G.size}for(;l;)l=f(l)}function Oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ro(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+oi(e)+"px"}function _a(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=So(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 g=0;g<f.length;g++)f[g].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(O("div",[O("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oo(e.display),!0}return!1}function Do(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Oa(e){var t=e.gutters,i=e.gutterSpecs;Ne(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(O("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",Oo(e)}function Er(e){Oa(e.display),_n(e),_a(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=O("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=O("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ce("div",null,"CodeMirror-code"),r.selectionDiv=O("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=O("div",null,"CodeMirror-cursors"),r.measure=O("div",null,"CodeMirror-measure"),r.lineMeasure=O("div",null,"CodeMirror-measure"),r.lineSpace=ce("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=ce("div",[r.lineSpace],"CodeMirror-lines");r.mover=O("div",[s],null,"position: relative"),r.sizer=O("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=O("div",null,null,"position: absolute; height: "+Ce+"px; width: 1px;"),r.gutters=O("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=O("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=O("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),T&&M<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!j&&!(ie&&ae)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Do(n.gutters,n.lineNumbers),Oa(r),i.init(r)}var $r=0,Wn=null;T?Wn=-.53:ie?Wn=15:_?Wn=-.7:te&&(Wn=-1/3);function Ra(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Ra(e);return t.x*=Wn,t.y*=Wn,t}function Da(e,t){var i=Ra(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,g=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&g))return;if(r&&de&&j){e:for(var v=t.target,I=s.view;v!=l;v=v.parentNode)for(var G=0;G<I.length;G++)if(I[G].node==v){e.display.currentWheelTarget=v;break e}}if(n&&!ie&&!E&&Wn!=null){r&&g&&xr(e,Math.max(0,l.scrollTop+r*Wn)),Fi(e,Math.max(0,l.scrollLeft+n*Wn)),(!r||r&&g)&&y(t),s.wheelStartX=null;return}if(r&&Wn!=null){var he=r*Wn,oe=e.doc.scrollTop,Me=oe+s.wrapper.clientHeight;he<0?oe=Math.max(0,oe+he-50):Me=Math.min(e.doc.height,Me+he+50),Mo(e,{top:oe,bottom:Me})}$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 He=l.scrollLeft-s.wheelStartX,Ye=l.scrollTop-s.wheelStartY,Je=Ye&&s.wheelDY&&Ye/s.wheelDY||He&&s.wheelDX&&He/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!Je)return;Wn=(Wn*$r+Je)/($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 Ht(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(St(t,n.from())>=0&&St(e,n.to())<=0)return i}return-1};var Ht=function(e,t){this.anchor=e,this.head=t};Ht.prototype.from=function(){return Oi(this.anchor,this.head)},Ht.prototype.to=function(){return di(this.anchor,this.head)},Ht.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(he,oe){return St(he.from(),oe.from())}),i=Q(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],g=St(f.to(),l.from());if(n&&!l.empty()?g>0:g>=0){var v=Oi(f.from(),l.from()),I=di(f.to(),l.to()),G=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ht(G?I:v,G?v:I))}}return new Gn(t,i)}function ki(e,t){return new Gn([new Ht(e,t||e)],0)}function Ti(e){return e.text?We(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(St(e,t.from)<0)return e;if(St(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),We(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 Ht(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?We(i.line,e.ch-t.ch+i.ch):We(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=We(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],g=Na(f.from,r,s),v=Na(Ti(f),r,s);if(r=f.to,s=v,i=="around"){var I=e.sel.ranges[l],G=St(I.head,I.anchor)<0;n[l]=new Ht(G?v:g,G?g:v)}else n[l]=new Ht(g,g)}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,Sr(e,100),e.state.modeGen++,e.curOp&&_n(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(nt){return i?i[nt]:null}function s(nt,Ze,ut){uo(nt,Ze,ut,n),Xt(nt,"change",nt,t)}function l(nt,Ze){for(var ut=[],wt=nt;wt<Ze;++wt)ut.push(new Ci(v[wt],r(wt),n));return ut}var f=t.from,g=t.to,v=t.text,I=ct(e,f.line),G=ct(e,g.line),he=b(v),oe=r(v.length-1),Me=g.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 He=l(0,v.length-1);s(G,G.text,oe),Me&&e.remove(f.line,Me),He.length&&e.insert(f.line,He)}else if(I==G)if(v.length==1)s(I,I.text.slice(0,f.ch)+he+I.text.slice(g.ch),oe);else{var Ye=l(1,v.length-1);Ye.push(new Ci(he+I.text.slice(g.ch),oe,n)),s(I,I.text.slice(0,f.ch)+v[0],r(0)),e.insert(f.line+1,Ye)}else if(v.length==1)s(I,I.text.slice(0,f.ch)+v[0]+G.text.slice(g.ch),r(0)),e.remove(f.line+1,Me);else{s(I,I.text.slice(0,f.ch)+v[0],r(0)),s(G,he+G.text.slice(g.ch),oe);var Je=l(1,v.length-1);Me>1&&e.remove(f.line+1,Me-1),e.insert(f.line+1,Je)}Xt(e,"change",e,t)}function Ai(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var g=r.linked[f];if(g.doc==s)continue;var v=l&&g.sharedHist;if(i&&!v)continue;t(g.doc,v),n(g.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,Eo(e),No(e),Ba(e),e.options.lineWrapping||fi(e),e.options.mode=t.modeOption,_n(e)}function Ba(e){(e.doc.direction=="rtl"?P:Te)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){jn(e,function(){Ba(e),_n(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:Un(e,t.from,t.to)};return Ha(e,i,t.from.line,t.to.line+1),Ai(e,function(n){return Ha(n,i,t.from.line,t.to.line+1)},!0),i}function Ua(e){for(;e.length;){var t=b(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ua(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 Fa(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),St(t.from,t.to)==0&&St(t.from,f.to)==0?f.to=Ti(t):l.changes.push(jo(e,t));else{var g=b(r.done);for((!g||!g.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||Re(e,"historyAdded")}function gl(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 ml(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||gl(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&&Ua(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 g=l[f],v=0;v<s.length;++v)if(s[v].marker==g.marker)continue e;s.push(g)}}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 g=0;g<l.length;++g){var v=l[g],I=void 0;if(f.push({from:v.from,to:v.to,text:v.text}),t)for(var G in v)(I=G.match(/^spans_(\d+)$/))&&(Q(t,Number(I[1]))>-1&&(b(f)[G]=v[G],delete v[G]))}}return n}function Bo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=St(t,r)<0;s!=St(i,r)<0?(r=t,t=i):s!=St(t,i)<0&&(t=i)}return new Ht(r,t)}else return new Ht(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),wn(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);wn(e,l,i)}function Uo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,wn(e,qn(e.cm,r,e.sel.primIndex),n)}function Ga(e,t,i,n){wn(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 Ht(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Re(e,"beforeSelectionChange",e,n),e.cm&&Re(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)):wn(e,t,i)}function wn(e,t,i){qr(e,t,i),ml(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||(St(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,ee(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],g=eo(e,l.anchor,f&&f.anchor,i,n),v=eo(e,l.head,f&&f.head,i,n);(r||g!=l.anchor||v!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ht(g,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],g=f.marker,v="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,I="selectRight"in g?!g.selectRight:g.inclusiveRight;if((f.from==null||(v?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(I?f.to>=t.ch:f.to>t.ch))){if(r&&(Re(g,"beforeCursorEnter"),g.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!g.atomic)continue;if(i){var G=g.find(n<0?1:-1),he=void 0;if((n<0?I:v)&&(G=$a(e,G,-n,G&&G.line==t.line?s:null)),G&&G.line==t.line&&(he=St(G,i))&&(n<0?he<0:he>0))return ir(e,G,t,n,r)}var oe=g.find(n<0?-1:1);return(n<0?v:I)&&(oe=$a(e,oe,n,oe.line==t.line?s:null)),oe?ir(e,oe,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,We(e.first,0))}function $a(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,We(t.line-1)):null:i>0&&t.ch==(n||ct(e,t.line)).text.length?t.line<e.first+e.size-1?We(t.line+1,0):null:new We(t.line,t.ch+i)}function Ja(e){e.setSelection(We(e.firstLine(),0),We(e.lastLine()),me)}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)}),Re(e,"beforeChange",e,n),e.cm&&Re(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function rr(e,t,i){if(e.cm){if(!e.cm.curOp)return cn(e.cm,rr)(e,t,i);if(e.cm.state.suppressEdits)return}if((Y(e,"beforeChange")||e.cm&&Y(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var n=Xi&&!i&&Ri(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Qa(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Qa(e,t)}function Qa(e,t){if(t.text.length==1&&t.text[0]==""&&St(t.from,t.to)==0)return;var i=Po(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),Tr(e,t,i,Pn(e,t));var n=[];Ai(e,function(r,s){!s&&Q(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,g=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,g),i&&!s.equals(e.sel)){wn(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var I=[];Zr(l,g),g.push({changes:I,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var G=Y(e,"beforeChange")||e.cm&&Y(e.cm,"beforeChange"),he=function(He){var Ye=s.changes[He];if(Ye.origin=t,G&&!Za(e,Ye,!1))return f.length=0,{};I.push(jo(e,Ye));var Je=He?Po(e,Ye):b(f);Tr(e,Ye,Je,za(e,Ye)),!He&&e.cm&&e.cm.scrollIntoView({from:Ye.from,to:Ti(Ye)});var nt=[];Ai(e,function(Ze,ut){!ut&&Q(nt,Ze.history)==-1&&(ns(Ze.history,Ye),nt.push(Ze.history)),Tr(Ze,Ye,null,za(Ze,Ye))})},oe=s.changes.length-1;oe>=0;--oe){var Me=he(oe);if(Me)return Me.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Gn(V(e.sel.ranges,function(r){return new Ht(We(r.anchor.line+t,r.anchor.ch),We(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){_n(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Si(e.cm,n,"gutter")}}function Tr(e,t,i,n){if(e.cm&&!e.cm.curOp)return cn(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:We(e.first,0),to:We(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:We(s,ct(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Un(e,t.from,t.to),i||(i=Po(e,t)),e.cm?xl(e.cm,t,n):Io(e,t,n),qr(e,i,me),e.cantEdit&&eo(e,We(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,g=s.line;e.options.lineWrapping||(g=Pt(sn(ct(n,s.line))),n.iter(g,l.line+1,function(oe){if(oe==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ee(e),Io(n,t,i,ma(e)),e.options.lineWrapping||(n.iter(g,s.line+t.text.length,function(oe){var Me=$i(oe);Me>r.maxLineLength&&(r.maxLine=oe,r.maxLineLength=Me,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Yn(n,s.line),Sr(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?_n(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?Si(e,s.line,"text"):_n(e,s.line,l.line+1,v);var I=Y(e,"changes"),G=Y(e,"change");if(G||I){var he={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};G&&Xt(e,"change",e,he),I&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(he)}e.display.selForContextMenu=null}function or(e,t,i,n,r){var s;n||(n=i),St(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 g=0;g<s.changes.length;++g){var v=s.changes[g];if(i<v.from.line)v.from=We(v.from.line+n,v.from.ch),v.to=We(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 Ar(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=ct(e,c(e,t)):r=Pt(t),r==null?null:(n(s,r)&&e.cm&&Si(e.cm,r,i),s)}function Lr(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Lr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,ho(r),Xt(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function _r(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}_r.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Lr))){var f=[];this.collapse(f),this.children=[new Lr(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 g=new Lr(r.lines.slice(f,f+=25));r.height-=g.height,this.children.splice(++n,0,g),g.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 _r(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=Q(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new _r(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=Pt(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=mr(this);Tn(i,Math.max(0,i.height-s)),e&&(jn(e,function(){is(e,i,-s),Si(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=mr(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,Pt(n))})},Z(Mr);function is(e,t,i){In(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Lo(e,i)}function wl(e,t,i,n){var r=new Mr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Ar(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 g=In(l)<e.scrollTop;Tn(l,l.height+mr(r)),g&&Lo(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Xt(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Pt(t)),r}var rs=0,Li=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};Li.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&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?Si(e,Pt(l),"text"):e&&(f.to!=null&&(r=Pt(l)),f.from!=null&&(n=Pt(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 g=0;g<this.lines.length;++g){var v=sn(this.lines[g]),I=$i(v);I>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=I,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&_n(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()},Li.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=Jn(s.markedSpans,this);if(l.from!=null&&(i=We(t?s:Pt(s),l.from),e==-1))return i;if(l.to!=null&&(n=We(t?s:Pt(s),l.to),e==1))return n}return i&&{from:i,to:n}},Li.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;jn(n,function(){var r=t.line,s=Pt(t.line),l=mo(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 g=mr(i)-f;g&&Tn(r,r.height+g)}Xt(n,"markerChanged",n,e)})},Li.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Q(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Li.prototype.detachLine=function(e){if(this.lines.splice(Q(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Z(Li);function ar(e,t,i,n,r){if(n&&n.shared)return Cl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return cn(e.cm,ar)(e,t,i,n,r);var s=new Li(e,r),l=St(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=ce("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(an(e,t.line,t,i,s)||t.line!=i.line&&an(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");ni()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,g=e.cm,v;if(e.iter(f,i.line+1,function(G){g&&s.collapsed&&!g.options.lineWrapping&&sn(G)==g.display.maxLine&&(v=!0),s.collapsed&&f!=t.line&&Tn(G,0),zn(G,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(G){Zn(e,G)&&Tn(G,0)}),s.clearOnEnter&&_e(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Ln(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),g){if(v&&(g.curOp.updateMaxLine=!0),s.collapsed)_n(g,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var I=t.line;I<=i.line;I++)Si(g,I,"text");s.atomic&&Ka(g.doc),Xt(g,"markerAdded",g,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Or.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Xt(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},Z(Or);function Cl(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 Ai(e,function(g){f&&(n.widgetNode=f.cloneNode(!0)),s.push(ar(g,o(g,t),o(g,i),n,r));for(var v=0;v<g.linked.length;++v)if(g.linked[v].isParent)return;l=b(s)}),new Or(s,l)}function os(e){return e.findMarks(We(e.first,0),e.clipPos(We(e.lastLine())),function(t){return t.parent})}function Sl(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(St(s,l)){var f=ar(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function El(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Ai(r.primary.doc,function(g){return s.push(g)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];Q(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),_r.call(this,[new Lr([new Ci("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=We(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}),wn(this,ki(s),me)};Mn.prototype=Ee(_r.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:dn(function(e){var t=We(this.first,0),i=this.first+this.size-1;rr(this,{from:t,to:We(i,ct(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),wn(this,ki(t),me)}),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=Un(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 Pt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),sn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:dn(function(e,t,i){Ga(this,o(this,typeof e=="number"?We(e,t||0):e),null,i)}),setSelection:dn(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:dn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:dn(function(e,t){Wa(this,u(this,e),t)}),extendSelectionsBy:dn(function(e,t){var i=V(this.sel.ranges,e);Wa(this,u(this,i),t)}),setSelections:dn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Ht(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),wn(this,qn(this.cm,n,t),i)}),addSelection:dn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Ht(o(this,e),o(this,t||e))),wn(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=Un(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=Un(this,i[n].from(),i[n].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:dn(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var f=t&&t!="end"&&dl(this,n,t),g=n.length-1;g>=0;g--)rr(this,n[g]);f?Va(this,f):this.cm&&er(this.cm)}),undo:dn(function(){to(this,"undo")}),redo:dn(function(){to(this,"redo")}),undoSelection:dn(function(){to(this,"undo",!0)}),redoSelection:dn(function(){to(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),Ai(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:nr(this.history.done),undone:nr(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=nr(e.done.slice(0),null,!0),t.undone=nr(e.undone.slice(0),null,!0)},setGutterMarker:dn(function(e,t,i){return Ar(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Ke(r)&&(n.gutterMarkers=null),!0})}),clearGutter:dn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Ar(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Ke(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=Pt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:dn(function(e,t,i){return Ar(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(ke(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:dn(function(e,t,i){return Ar(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(ke(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:dn(function(e,t,i){return wl(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 g=l[f];!(g.to!=null&&r==e.line&&e.ch>=g.to||g.from==null&&r!=e.line||g.from!=null&&r==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&n.push(g.marker.parent||g.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,We(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}],Sl(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),El(os(this));break}if(e.history==this.history){var n=[e.id];Ai(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){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):dt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:dn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Mn.prototype.eachLine=Mn.prototype.iter;var as=0;function Tl(e){var t=this;if(ss(t),ze(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&&cn(t,function(){i=o(t.doc,i);var oe={from:i,to:i,text:t.doc.splitLines(s.filter(function(Me){return Me!=null}).join(t.doc.lineSeparator())),origin:"paste"};rr(t.doc,oe),Va(t.doc,ki(o(t.doc,i),o(t.doc,Ti(oe))))})()},g=function(oe,Me){if(t.options.allowDropFileTypes&&Q(t.options.allowDropFileTypes,oe.type)==-1){f();return}var He=new FileReader;He.onerror=function(){return f()},He.onload=function(){var Ye=He.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ye)){f();return}s[Me]=Ye,f()},He.readAsText(oe)},v=0;v<n.length;v++)g(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 I=e.dataTransfer.getData("Text");if(I){var G;if(t.state.draggingText&&!t.state.draggingText.copy&&(G=t.listSelections()),qr(t.doc,ki(i,i)),G)for(var he=0;he<G.length;++he)or(t.doc,"",G[he].anchor,G[he].head,"drag");t.replaceSelection(I,"around","paste"),t.display.input.focus()}}catch(oe){}}}function Al(e,t){if(T&&(!e.state.draggingText||+new Date-as<100)){N(t);return}if(ze(e,t)||pi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!te){var i=O("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",E&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),E&&i.parentNode.removeChild(i)}}function Ll(e,t){var i=Bi(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=O("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),be(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 _l(){if(us)return;Ml(),us=!0}function Ml(){var e;_e(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Ol)},100))}),_e(window,"blur",function(){return ls(qi)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var _i={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Rr=0;Rr<10;Rr++)_i[Rr+48]=_i[Rr+96]=String(Rr);for(var no=65;no<=90;no++)_i[no]=String.fromCharCode(no);for(var Dr=1;Dr<=12;Dr++)_i[Dr+111]=_i[Dr+63235]="F"+Dr;var gi={};gi.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"},gi.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"},gi.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"},gi.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"]},gi.default=de?gi.macDefault:gi.pcDefault;function Rl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var 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=V(i.split(" "),Rl),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 g=t[f];if(!g)t[f]=l;else if(g!=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:_i[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&&e.keyCode==34&&e.char)return!1;var i=_i[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"?gi[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&&St(s.from,b(n).to)<=0;){var l=n.pop();if(St(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 Fo(e,t,i){var n=Xe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Ho(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new We(t.line,n,i<0?"after":"before")}function zo(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=lt(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),g=f?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var I=Ji(t,i);v=r<0?i.text.length-1:0;var G=ai(t,I,v).top;v=mt(function(he){return ai(t,I,he).top==G},r<0==(l.level==1)?l.from:l.to-1,v),g=="before"&&(v=Fo(i,v,1))}else v=r<0?l.to:l.from;return new We(n,v,g)}}return new We(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=lt(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=et(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(Je,nt){return Fo(t,Je instanceof We?Je.ch:Je,nt)},g,v=function(Je){return e.options.lineWrapping?(g=g||Ji(e,t),ga(e,t,g,Je)):{begin:0,end:t.text.length}},I=v(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var G=l.level==1==n<0,he=f(i,G?1:-1);if(he!=null&&(G?he<=l.to&&he<=I.end:he>=l.from&&he>=I.begin)){var oe=G?"before":"after";return new We(i.line,he,oe)}}var Me=function(Je,nt,Ze){for(var ut=function(Yt,fn){return fn?new We(i.line,f(Yt,1),"before"):new We(i.line,Yt,"after")};Je>=0&&Je<r.length;Je+=nt){var wt=r[Je],yt=nt>0==(wt.level!=1),Lt=yt?Ze.begin:f(Ze.end,-1);if(wt.from<=Lt&&Lt<wt.to)return ut(Lt,yt);if(Lt=yt?wt.from:f(wt.to,-1),Ze.begin<=Lt&&Lt<Ze.end)return ut(Lt,yt)}},He=Me(s+n,n,I);if(He)return He;var Ye=n>0?I.end:f(I.begin,-1);return Ye!=null&&!(n>0&&Ye==t.text.length)&&(He=Me(n>0?0:r.length-1,n,v(Ye)),He)?He:null}var Pr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),me)},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:We(t.head.line+1,0)}:{from:t.head,to:We(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return lr(e,function(t){return{from:We(t.from().line,0),to:o(e.doc,We(t.to().line+1,0))}})},delLineLeft:function(e){return lr(e,function(t){return{from:We(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(We(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(We(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")},ge)},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")},ge)},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},ge)},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=C(e.getLine(s.line),s.ch,n);t.push(W(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 We(r.line,r.ch-1)),r.ch>0)r=new We(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),We(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 We(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),We(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ht(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=sn(i);return n!=i&&(t=Pt(n)),zo(!0,e,n,t,1)}function Nl(e,t){var i=ct(e.doc,t),n=ri(i);return n!=i&&(t=Pt(n)),zo(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=ct(e.doc,i.line),r=lt(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 We(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)!=Oe}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 F;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())}),gs(e,r+" "+t,i,n))return!0}return gs(e,t,i,n)}function gs(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 ms(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=B(),ze(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=ms(t,e);E&&(Wo=n?i:null,!n&&i==88&&!_t&&(de?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ie&&!de&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;P(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(Te(t,"CodeMirror-crosshair"),rt(document,"keyup",i),rt(document,"mouseover",i))}_e(document,"keyup",i),_e(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),ze(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pi(t.display,e)||ze(t,e)||e.ctrlKey&&!e.altKey||de&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(E&&i==Wo){Wo=null,y(e);return}if(E&&(!e.which||e.which<10)&&ms(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 Fl=400,Go=function(e,t,i){this.time=e,this.pos=t,this.button=i};Go.prototype.compare=function(e,t,i){return this.time+Fl>e&&St(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(ze(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){j||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Bi(t,e),r=we(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):le(e)==i.scroller&&y(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Ve?t.display.input.onContextMenu(e):wa(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)!=Oe}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=Be?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=de?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(de?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){T?setTimeout(p(xa,e),0):e.curOp.focus=B();var r=Wl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ge&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(St((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(St(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Xl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=cn(e,function(v){j&&(r.scroller.draggable=!1),e.state.draggingText=!1,rt(r.wrapper.ownerDocument,"mouseup",l),rt(r.wrapper.ownerDocument,"mousemove",f),rt(r.scroller,"dragstart",g),rt(r.scroller,"drop",l),s||(y(v),n.addNew||Qr(e.doc,i,null,null,n.extend),j&&!te||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},g=function(){return s=!0};j&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),_e(r.wrapper.ownerDocument,"mouseup",l),_e(r.wrapper.ownerDocument,"mousemove",f),_e(r.scroller,"dragstart",g),_e(r.scroller,"drop",l),wa(e),setTimeout(function(){return r.input.focus()},20)}function ws(e,t,i){if(i=="char")return new Ht(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ht(We(t.line,0),o(e.doc,We(t.line+1,0)));var n=i(e,t);return new Ht(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;y(t);var l,f,g=s.sel,v=g.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=v[f]:l=new Ht(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ht(i,i)),i=Bi(e,t,!0,!0),f=-1;else{var I=ws(e,i,n.unit);n.extend?l=Bo(l,I.anchor,I.head,n.extend):l=I}n.addNew?f==-1?(f=v.length,wn(s,qn(e,v.concat([l]),f),{scroll:!1,origin:"*mouse"})):v.length>1&&v[f].empty()&&n.unit=="char"&&!n.extend?(wn(s,qn(e,v.slice(0,f).concat(v.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),g=s.sel):Uo(s,f,l,ve):(f=0,wn(s,new Gn([l],0),ve),g=s.sel);var G=i;function he(Ze){if(St(G,Ze)==0)return;if(G=Ze,n.unit=="rectangle"){for(var ut=[],wt=e.options.tabSize,yt=C(ct(s,i.line).text,i.ch,wt),Lt=C(ct(s,Ze.line).text,Ze.ch,wt),Yt=Math.min(yt,Lt),fn=Math.max(yt,Lt),Zt=Math.min(i.line,Ze.line),Bn=Math.min(e.lastLine(),Math.max(i.line,Ze.line));Zt<=Bn;Zt++){var On=ct(s,Zt).text,nn=ue(On,Yt,wt);Yt==fn?ut.push(new Ht(We(Zt,nn),We(Zt,nn))):On.length>nn&&ut.push(new Ht(We(Zt,nn),We(Zt,ue(On,fn,wt))))}ut.length||ut.push(new Ht(i,i)),wn(s,qn(e,g.ranges.slice(0,f).concat(ut),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Ze)}else{var Rn=l,bn=ws(e,Ze,n.unit),ln=Rn.anchor,rn;St(bn.anchor,ln)>0?(rn=bn.head,ln=Oi(Rn.from(),bn.anchor)):(rn=bn.anchor,ln=di(Rn.to(),bn.head));var Qt=g.ranges.slice(0);Qt[f]=Kl(e,new Ht(o(s,ln),rn)),wn(s,qn(e,Qt,f),ve)}}var oe=r.wrapper.getBoundingClientRect(),Me=0;function He(Ze){var ut=++Me,wt=Bi(e,Ze,!0,n.unit=="rectangle");if(!wt)return;if(St(wt,G)!=0){e.curOp.focus=B(),he(wt);var yt=Xr(r,s);(wt.line>=yt.to||wt.line<yt.from)&&setTimeout(cn(e,function(){Me==ut&&He(Ze)}),150)}else{var Lt=Ze.clientY<oe.top?-20:Ze.clientY>oe.bottom?20:0;Lt&&setTimeout(cn(e,function(){if(Me!=ut)return;r.scroller.scrollTop+=Lt,He(Ze)}),50)}}function Ye(Ze){e.state.selectingText=!1,Me=Infinity,Ze&&(y(Ze),r.input.focus()),rt(r.wrapper.ownerDocument,"mousemove",Je),rt(r.wrapper.ownerDocument,"mouseup",nt),s.history.lastSelOrigin=null}var Je=cn(e,function(Ze){Ze.buttons===0||!we(Ze)?Ye(Ze):He(Ze)}),nt=cn(e,Ye);e.state.selectingText=nt,_e(r.wrapper.ownerDocument,"mousemove",Je),_e(r.wrapper.ownerDocument,"mouseup",nt)}function Kl(e,t){var i=t.anchor,n=t.head,r=ct(e.doc,i.line);if(St(i,n)==0&&i.sticky==n.sticky)return t;var s=lt(r);if(!s)return t;var l=et(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var g=l+(f.from==i.ch==(f.level!=1)?0:1);if(g==0||g==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 I=et(s,n.ch,n.sticky),G=I-l||(n.ch-i.ch)*(f.level==1?-1:1);I==g-1||I==g?v=G<0:v=G>0}var he=s[g+(v?-1:0)],oe=v==(he.level==1),Me=oe?he.from:he.to,He=oe?"after":"before";return i.ch==Me&&i.sticky==He?t:new Ht(new We(i.line,Me,He),n)}function Cs(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(he){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 A(t);s-=f.top-l.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var v=l.gutters.childNodes[g];if(v&&v.getBoundingClientRect().right>=r){var I=Kn(e.doc,s),G=e.display.gutterSpecs[g];return Re(e,i,e,I,G.className,t),A(t)}}}function Vo(e,t){return Cs(e,t,"gutterClick",!0)}function Ss(e,t){if(pi(e.display,t)||Yl(e,t))return;if(ze(e,t,"contextmenu"))return;Ve||e.display.input.onContextMenu(t)}function Yl(e,t){return Y(e,"gutterContextMenu")?Cs(e,t,"gutterContextMenu",!1):!1}function Es(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,g,v){v!=ur&&s(f,g,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),_n(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(g){for(var v=0;;){var I=g.text.indexOf(r,v);if(I==-1)break;v=I+r.length,s.push(We(l,I))}l++});for(var f=s.length-1;f>=0;f--)or(n.doc,r,s[f],We(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",ft,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",ae?"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",!$e),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Es(n),Er(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),Er(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?So(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return tr(n)},!0),i("scrollbarStyle","native",function(n){Aa(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),Er(n)},!0),i("firstLineNumber",1,Er,!0),i("lineNumberFormatter",function(n){return n},Er,!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?_e:rt;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?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Te(e.display.wrapper,"CodeMirror-wrap"),fi(e)),Eo(e),_n(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,Es(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Aa(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 F,keySeq:null,specialChars:null},t.autofocus&&!ae&&s.input.focus(),T&&M<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),_l(),zi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!ae||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),j&&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;_e(t.scroller,"mousedown",cn(e,xs)),T&&M<11?_e(t.scroller,"dblclick",cn(e,function(g){if(ze(e,g))return;var v=Bi(e,g);if(!v||Vo(e,g)||pi(e.display,g))return;y(g);var I=e.findWordAt(v);Qr(e.doc,I.anchor,I.head)})):_e(t.scroller,"dblclick",function(g){return ze(e,g)||y(g)}),_e(t.scroller,"contextmenu",function(g){return Ss(e,g)}),_e(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||Ss(e,g)});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(g){if(g.touches.length!=1)return!1;var v=g.touches[0];return v.radiusX<=1&&v.radiusY<=1}function l(g,v){if(v.left==null)return!0;var I=v.left-g.left,G=v.top-g.top;return I*I+G*G>20*20}_e(t.scroller,"touchstart",function(g){if(!ze(e,g)&&!s(g)&&!Vo(e,g)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),_e(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),_e(t.scroller,"touchend",function(g){var v=t.activeTouch;if(v&&!pi(t,g)&&v.left!=null&&!v.moved&&new Date-v.start<300){var I=e.coordsChar(t.activeTouch,"page"),G;!v.prev||l(v,v.prev)?G=new Ht(I,I):!v.prev.prev||l(v,v.prev.prev)?G=e.findWordAt(I):G=new Ht(We(I.line,0),o(e.doc,We(I.line+1,0))),e.setSelection(G.anchor,G.head),e.focus(),y(g)}r()}),_e(t.scroller,"touchcancel",r),_e(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Fi(e,t.scroller.scrollLeft,!0),Re(e,"scroll",e))}),_e(t.scroller,"mousewheel",function(g){return Da(e,g)}),_e(t.scroller,"DOMMouseScroll",function(g){return Da(e,g)}),_e(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){ze(e,g)||N(g)},over:function(g){ze(e,g)||(Ll(e,g),N(g))},start:function(g){return Al(e,g)},drop:cn(e,Tl),leave:function(g){ze(e,g)||ss(e)}};var f=t.input.getField();_e(f,"keyup",function(g){return ys.call(e,g)}),_e(f,"keydown",cn(e,vs)),_e(f,"keypress",cn(e,bs)),_e(f,"focus",function(g){return To(e,g)}),_e(f,"blur",function(g){return qi(e,g)})}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=pe(e,t).state:i="prev");var l=e.options.tabSize,f=ct(r,t),g=C(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var v=f.text.match(/^\s*/)[0],I;if(!n&&!/\S/.test(f.text))I=0,i="not";else if(i=="smart"&&(I=r.mode.indent(s,f.text.slice(v.length),f.text),I==Oe||I>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?I=C(ct(r,t-1).text,null,l):I=0:i=="add"?I=g+e.options.indentUnit:i=="subtract"?I=g-e.options.indentUnit:typeof i=="number"&&(I=g+i),I=Math.max(0,I);var G="",he=0;if(e.options.indentWithTabs)for(var oe=Math.floor(I/l);oe;--oe)he+=l,G+=" ";if(he<I&&(G+=W(I-he)),G!=v)return or(r,G,We(t,0),We(t,v.length),"+input"),f.stateAfter=null,!0;for(var Me=0;Me<r.sel.ranges.length;Me++){var He=r.sel.ranges[Me];if(He.head.line==t&&He.head.ch<v.length){var Ye=We(t,v.length);Uo(r,Me,new Ht(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,g=dt(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 I=0;I<ei.text.length;I++)v.push(s.splitLines(ei.text[I]))}}else g.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(v=V(g,function(Je){return[Je]}));for(var G=e.curOp.updateInput,he=n.ranges.length-1;he>=0;he--){var oe=n.ranges[he],Me=oe.from(),He=oe.to();oe.empty()&&(i&&i>0?Me=We(Me.line,Me.ch-i):e.state.overwrite&&!f?He=We(He.line,Math.min(ct(s,He.line).text.length,He.ch+b(g).length)):f&&ei&&ei.lineWise&&ei.text.join(`
`)==g.join(`
`)&&(Me=He=We(Me.line,0)));var Ye={from:Me,to:He,text:v?v[he%v.length]:g,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};rr(e.doc,Ye),Xt(e,"inputRead",e,Ye)}t&&!f&&As(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=G),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 As(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 Ls(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:We(r,0),head:We(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function _s(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ms(){var e=O("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=O("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return j?e.style.width="1000px":e.setAttribute("wrap","off"),X&&(e.style.border="1px solid black"),_s(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&cn(this,t[n])(this,r,l),Re(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](io(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:Sn(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");R(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,_n(this)}),removeOverlay:Sn(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,_n(this);return}}}),indentLine:Sn(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),hi(this.doc,n)&&Br(this,n,r,s)}),indentSelection:Sn(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 g=f.from(),v=f.to(),I=Math.max(s,g.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var G=I;G<s;++G)Br(this,G,n);var he=this.doc.sel.ranges;g.ch==0&&r.length==he.length&&he[l].from().ch>0&&Uo(this.doc,l,new Ht(g,he[l].to()),me)}}}),getTokenAt:function(n,r){return zt(this,n,r)},getLineTokens:function(n,r){return zt(this,We(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Pe(this,ct(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,g;if(f==0)g=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{g=r[v*2+2];break}}var I=g?g.indexOf("overlay "):-1;return I<0?g:I==0?null:g.slice(0,I-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 g=0;g<f[r].length;g++){var v=l[f[r][g]];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 I=0;I<l._global.length;I++){var G=l._global[I];G.pred(f,this)&&Q(s,G.val)==-1&&s.push(G.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=c(s,n==null?s.first+s.size-1:n),pe(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 g=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>g&&(n=g,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 g=this.display;n=Qn(this,o(this.doc,n));var v=n.bottom,I=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),g.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var G=Math.max(g.wrapper.clientHeight,this.doc.height),he=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>G)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=G&&(v=n.bottom),I+r.offsetWidth>he&&(I=he-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",f=="right"?(I=g.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?I=0:f=="middle"&&(I=(g.sizer.clientWidth-r.offsetWidth)/2),r.style.left=I+"px"),s&&Js(this,{left:I,top:v,right:I+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:Sn(vs),triggerOnKeyPress:Sn(bs),triggerOnKeyUp:ys,triggerOnMouseDown:Sn(xs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:Sn(function(n){As(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var g=o(this.doc,n),v=0;v<r&&!(g=Yo(this.doc,g,f,s,l),g.hitSide);++v);return g},moveH:Sn(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Yo(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},ge)}),deleteH:Sn(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):lr(this,function(f){var g=Yo(l,f.head,n,r,!1);return n<0?{from:g,to:f.head}:{from:f.head,to:g}})}),findPosV:function(n,r,s,l){var f=1,g=l;r<0&&(f=-1,r=-r);for(var v=o(this.doc,n),I=0;I<r;++I){var G=Qn(this,v,"div");if(g==null?g=G.left:G.left=g,v=Os(this,G,f,s),v.hitSide)break}return v},moveV:Sn(function(n,r){var s=this,l=this.doc,f=[],g=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(I){if(g)return n<0?I.from():I.to();var G=Qn(s,I.head,"div");I.goalColumn!=null&&(G.left=I.goalColumn),f.push(G.left);var he=Os(s,G,n,r);return r=="page"&&I==l.sel.primary()&&Lo(s,yo(s,he,"div").top-G.top),he},ge),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 g=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var v=s.charAt(l),I=Ue(v,g)?function(G){return Ue(G,g)}:/\s/.test(v)?function(G){return/\s/.test(G)}:function(G){return!/\s/.test(G)&&!Ue(G)};l>0&&I(s.charAt(l-1));)--l;for(;f<s.length&&I(s.charAt(f));)++f}return new Ht(We(n.line,l),We(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):Te(this.display.cursorDiv,"CodeMirror-overwrite"),Re(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Sn(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-oi(this)-this.display.barHeight,width:n.scrollWidth-oi(this)-this.display.barWidth,clientHeight:go(this),clientWidth:Ii(this)}},scrollIntoView:Sn(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:We(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):Sa(this,n.from,n.to,n.margin)}),setSize:Sn(function(n,r){var s=this,l=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};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(g){if(g.widgets){for(var v=0;v<g.widgets.length;v++)if(g.widgets[v].noHScroll){Si(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Re(this,"refresh",this)}),operation:function(n){return jn(this,n)},startOperation:function(){return zi(this)},endOperation:function(){return Wi(this)},refresh:Sn(function(){var n=this.display.cachedTextHeight;_n(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Oo(this.display),(n==null||Math.abs(n-Zi(this.display))>.5||this.options.lineWrapping)&&Eo(this),Re(this,"refresh",this)}),swapDoc:Sn(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}},Z(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),g=r&&e.direction=="rtl"?-i:i;function v(){var nt=t.line+g;return nt<e.first||nt>=e.first+e.size?!1:(t=new We(nt,t.ch,t.sticky),f=ct(e,nt))}function I(nt){var Ze;if(n=="codepoint"){var ut=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ut)?Ze=null:Ze=new We(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(ut>=55296&&ut<56320?2:1))),-i)}else r?Ze=Pl(e.cm,f,t,i):Ze=Ho(f,t,i);if(Ze==null)if(!nt&&v())t=zo(r,e.cm,f,t.line,g);else return!1;else t=Ze;return!0}if(n=="char"||n=="codepoint")I();else if(n=="column")I(!0);else if(n=="word"||n=="group")for(var G=null,he=n=="group",oe=e.cm&&e.cm.getHelper(t,"wordChars"),Me=!0;!(i<0&&!I(!Me));Me=!1){var He=f.text.charAt(t.ch)||`
`,Ye=Ue(He,oe)?"w":he&&He==`
`?"n":!he||/\s/.test(He)?null:"p";if(he&&!Me&&!Ye&&(Ye="s"),G&&G!=Ye){i<0&&(i=1,I(),t.sticky="after");break}if(Ye&&(G=Ye),i>0&&!I(!Me))break}var Je=eo(e,t,s,l,!0);return ti(s,Je)&&(Je.hitSide=!0),Je}function Os(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),g=Math.max(f-.5*Zi(e.display),3);l=(i>0?t.bottom:t.top)+i*g}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 Vt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Vt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;_s(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var g=f.target;g;g=g.parentNode){if(g==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}_e(r,"paste",function(f){if(!s(f)||ze(n,f)||Ts(f,n))return;M<=11&&setTimeout(cn(n,function(){return t.updateFromDOM()}),20)}),_e(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),_e(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),_e(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),_e(r,"touchstart",function(){return i.forceCompositionEnd()}),_e(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||ze(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 g=Ls(n);ao({lineWise:!0,text:g.text}),f.type=="cut"&&n.operation(function(){n.setSelections(g.ranges,0,me),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 I=Ms(),G=I.firstChild;n.display.lineSpace.insertBefore(I,n.display.lineSpace.firstChild),G.value=ei.text.join(`
`);var he=document.activeElement;D(G),setTimeout(function(){n.display.lineSpace.removeChild(I),he.focus(),he==r&&i.showPrimarySelection()},50)}_e(r,"copy",l),_e(r,"cut",l)},Vt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Vt.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},Vt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Vt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Vt.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&&St(Oi(s,l),n)==0&&St(di(s,l),r)==0)return;var f=t.display.view,g=n.line>=t.display.viewFrom&&Rs(t,n)||{node:f[0].measure.map[2],offset:0},v=r.line<t.display.viewTo&&Rs(t,r);if(!v){var I=f[f.length-1].measure,G=I.maps?I.maps[I.maps.length-1]:I.map;v={node:G[G.length-1],offset:G[G.length-2]-G[G.length-3]}}if(!g||!v){e.removeAllRanges();return}var he=e.rangeCount&&e.getRangeAt(0),oe;try{oe=ne(g.node,g.offset,v.offset,v.node)}catch(Me){}oe&&(!ie&&t.state.focused?(e.collapse(g.node,g.offset),oe.collapsed||(e.removeAllRanges(),e.addRange(oe))):(e.removeAllRanges(),e.addRange(oe)),he&&e.anchorNode==null?e.addRange(he):ie&&this.startGracePeriod()),this.rememberSelection()},Vt.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)},Vt.prototype.showMultipleSelections=function(e){be(this.cm.display.cursorDiv,e.cursors),be(this.cm.display.selectionDiv,e.selection)},Vt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Vt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return w(this.div,t)},Vt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Vt.prototype.blur=function(){this.div.blur()},Vt.prototype.getField=function(){return this.div},Vt.prototype.supportsTouch=function(){return!0},Vt.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)},Vt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Vt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(J&&_&&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(){wn(t.doc,ki(i,n),me),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Vt.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=We(n.line-1,ct(e.doc,n.line-1).length)),r.ch==ct(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=We(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ui(e,n.line))==0?(l=Pt(t.view[0].line),f=t.view[0].node):(l=Pt(t.view[s].line),f=t.view[s-1].node.nextSibling);var g=Ui(e,r.line),v,I;if(g==t.view.length-1?(v=t.viewTo-1,I=t.lineDiv.lastChild):(v=Pt(t.view[g+1].line)-1,I=t.view[g+1].node.previousSibling),!f)return!1;for(var G=e.doc.splitLines(tu(e,f,I,l,v)),he=Un(e.doc,We(l,0),We(v,ct(e.doc,v).text.length));G.length>1&&he.length>1;)if(b(G)==b(he))G.pop(),he.pop(),v--;else if(G[0]==he[0])G.shift(),he.shift(),l++;else break;for(var oe=0,Me=0,He=G[0],Ye=he[0],Je=Math.min(He.length,Ye.length);oe<Je&&He.charCodeAt(oe)==Ye.charCodeAt(oe);)++oe;for(var nt=b(G),Ze=b(he),ut=Math.min(nt.length-(G.length==1?oe:0),Ze.length-(he.length==1?oe:0));Me<ut&&nt.charCodeAt(nt.length-Me-1)==Ze.charCodeAt(Ze.length-Me-1);)++Me;if(G.length==1&&he.length==1&&l==n.line)for(;oe&&oe>n.ch&&nt.charCodeAt(nt.length-Me-1)==Ze.charCodeAt(Ze.length-Me-1);)oe--,Me++;G[G.length-1]=nt.slice(0,nt.length-Me).replace(/^\u200b+/,""),G[0]=G[0].slice(oe).replace(/\u200b+$/,"");var wt=We(l,oe),yt=We(v,he.length?b(he).length-Me:0);if(G.length>1||G[0]||St(wt,yt))return or(e.doc,G,wt,yt,"+input"),!0},Vt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Vt.prototype.reset=function(){this.forceCompositionEnd()},Vt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Vt.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)},Vt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&jn(this.cm,function(){return _n(e.cm)})},Vt.prototype.setUneditable=function(e){e.contentEditable="false"},Vt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||cn(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Vt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Vt.prototype.onContextMenu=function(){},Vt.prototype.resetPosition=function(){},Vt.prototype.needsContentAttribute=!0;function Rs(e,t){var i=mo(e,t.line);if(!i||i.hidden)return null;var n=ct(e.doc,t.line),r=ra(i,n,t.line),s=lt(n,e.doc.direction),l="left";if(s){var f=et(s,t.ch);l=f%2?"right":"left"}var g=sa(r.map,t.ch,l);return g.offset=g.collapse=="right"?g.end:g.start,g}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(),g=!1;function v(oe){return function(Me){return Me.id==oe}}function I(){l&&(s+=f,g&&(s+=f),l=g=!1)}function G(oe){oe&&(I(),s+=oe)}function he(oe){if(oe.nodeType==1){var Me=oe.getAttribute("cm-text");if(Me){G(Me);return}var He=oe.getAttribute("cm-marker"),Ye;if(He){var Je=e.findMarks(We(n,0),We(r+1,0),v(+He));Je.length&&(Ye=Je[0].find(0))&&G(Un(e.doc,Ye.from,Ye.to).join(f));return}if(oe.getAttribute("contenteditable")=="false")return;var nt=/^(pre|div|p|li|table|br)$/i.test(oe.nodeName);if(!/^br$/i.test(oe.nodeName)&&oe.textContent.length==0)return;nt&&I();for(var Ze=0;Ze<oe.childNodes.length;Ze++)he(oe.childNodes[Ze]);/^(pre|p)$/i.test(oe.nodeName)&&(g=!0),nt&&(l=!0)}else oe.nodeType==3&&G(oe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(he(t),t==i);)t=t.nextSibling,g=!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(We(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||!w(n,t))return hr(We(Pt(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(We(Pt(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 g=e.measure,v=g.maps;function I(Ye,Je,nt){for(var Ze=-1;Ze<(v?v.length:0);Ze++)for(var ut=Ze<0?g.map:v[Ze],wt=0;wt<ut.length;wt+=3){var yt=ut[wt+2];if(yt==Ye||yt==Je){var Lt=Pt(Ze<0?e.line:e.rest[Ze]),Yt=ut[wt]+nt;return(nt<0||yt!=Ye)&&(Yt=ut[wt+(nt?1:0)]),We(Lt,Yt)}}}var G=I(l,f,i);if(G)return hr(G,r);for(var he=f.nextSibling,oe=l?l.nodeValue.length-i:0;he;he=he.nextSibling){if(G=I(he,he.firstChild,0),G)return hr(We(G.line,G.ch-oe),r);oe+=he.textContent.length}for(var Me=f.previousSibling,He=i;Me;Me=Me.previousSibling){if(G=I(Me,Me.firstChild,-1),G)return hr(We(G.line,G.ch+He),r);He+=Me.textContent.length}}var en=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,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"),_e(r,"input",function(){T&&M>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),_e(r,"paste",function(l){if(ze(n,l)||Ts(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(ze(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=Ls(n);ao({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,me):(i.prevInput="",r.value=f.text.join(`
`),D(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}_e(r,"cut",s),_e(r,"copy",s),_e(e.scroller,"paste",function(l){if(pi(e,l)||ze(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)}),_e(e.lineSpace,"selectstart",function(l){pi(e,l)||y(l)}),_e(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"})}}),_e(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;be(i.cursorDiv,e.cursors),be(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&&D(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"&&(!ae||B()!=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||qe(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||de&&/[\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||E)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&cn(i,wn)(i.doc,ki(s),me);var g=r.style.cssText,v=t.wrapper.style.cssText,I=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-I.top-5)+"px; left: "+(e.clientX-I.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 G;j&&(G=window.scrollY),n.input.focus(),j&&window.scrollTo(null,G),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=oe,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function he(){if(r.selectionStart!=null){var He=i.somethingSelected(),Ye="\u200B"+(He?r.value:"");r.value="\u21DA",r.value=Ye,t.prevInput=He?"":"\u200B",r.selectionStart=1,r.selectionEnd=Ye.length,n.selForContextMenu=i.doc.sel}}function oe(){if(t.contextMenuPending!=oe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=g,T&&M<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!T||T&&M<9)&&he();var He=0,Ye=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?cn(i,Ja)(i):He++<10?n.detectingSelectAll=setTimeout(Ye,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ye,200)}}if(T&&M>=9&&he(),Ve){N(e);var Me=function(){rt(window,"mouseup",Me),setTimeout(oe,20)};_e(window,"mouseup",Me)}else setTimeout(oe,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=B();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(_e(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(g){}}t.finishInit=function(g){g.save=n,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,n(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(rt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=$t(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return f}function ru(e){e.off=rt,e.on=_e,e.wheelEventPixels=cl,e.Doc=Mn,e.splitLines=dt,e.countColumn=C,e.findColumn=ue,e.isWordChar=Le,e.Pass=Oe,e.signal=Re,e.Line=Ci,e.changeEnd=Ti,e.scrollbarModel=Ta,e.Pos=We,e.cmpPos=St,e.modes=Mt,e.mimeModes=Tt,e.resolveMode=pt,e.getMode=Vn,e.modeExtensions=xn,e.extendMode=gn,e.copyState=kn,e.startState=Xn,e.innerMode=li,e.commands=Pr,e.keyMap=gi,e.keyName=ds,e.isModifierKey=hs,e.lookupKey=sr,e.normalizeKeyMap=Dl,e.StringStream=jt,e.SharedTextMarker=Or,e.TextMarker=Li,e.LineWidget=Mr,e.e_preventDefault=y,e.e_stopPropagation=x,e.e_stop=N,e.addClass=P,e.contains=w,e.rmClass=Te,e.keyNames=_i}$l($t),ql($t);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in Mn.prototype)Mn.prototype.hasOwnProperty(lo)&&Q(ou,lo)<0&&($t.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mn.prototype[lo]));return Z(Mn),$t.inputStyles={textarea:en,contenteditable:Vt},$t.defineMode=function(e){!$t.defaults.mode&&e!="null"&&($t.defaults.mode=e),tn.apply(this,arguments)},$t.defineMIME=on,$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})},Y1PL:function(ot,Qe,k){"use strict";k.r(Qe),k.d(Qe,"ResizableTextArea",function(){return Q});var U=k("wx14"),se=k("1OyB"),ie=k("vuIU"),xe=k("Ji7U"),fe=k("LK+K"),z=k("q1tI"),T=k("VTBJ"),M=k("rePB"),j=k("Zm9Q"),L=k("Kwbf"),_=k("c+Xe"),E=k("m+aA"),te=k("bdgK"),$=new Map;function H(me){me.forEach(function(ve){var ge,ue=ve.target;(ge=$.get(ue))===null||ge===void 0||ge.forEach(function(q){return q(ue)})})}var X=new te.default(H),J=null,ae=null;function de(me,ve){$.has(me)||($.set(me,new Set),X.observe(me)),$.get(me).add(ve)}function Be(me,ve){$.has(me)&&($.get(me).delete(ve),$.get(me).size||(X.unobserve(me),$.delete(me)))}var $e=function(me){Object(xe.a)(ge,me);var ve=Object(fe.a)(ge);function ge(){return Object(se.a)(this,ge),ve.apply(this,arguments)}return Object(ie.a)(ge,[{key:"render",value:function(){return this.props.children}}]),ge}(z.Component),Se=z.createContext(null);function De(me){var ve=me.children,ge=me.onBatchResize,ue=z.useRef(0),q=z.useRef([]),W=z.useContext(Se),b=z.useCallback(function(V,R,ye){ue.current+=1;var Ee=ue.current;q.current.push({size:V,element:R,data:ye}),Promise.resolve().then(function(){Ee===ue.current&&(ge==null||ge(q.current),q.current=[])}),W==null||W(V,R,ye)},[ge,W]);return z.createElement(Se.Provider,{value:b},ve)}function Ve(me){var ve=me.children,ge=me.disabled,ue=z.useRef(null),q=z.useRef(null),W=z.useContext(Se),b=z.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),V=z.isValidElement(ve)&&Object(_.c)(ve),R=V?ve.ref:null,ye=z.useMemo(function(){return Object(_.a)(R,ue)},[R,ue]),Ee=z.useRef(me);Ee.current=me;var re=z.useCallback(function(Le){var Ue=Ee.current,Ke=Ue.onResize,Fe=Ue.data,Ie=Le.getBoundingClientRect(),Xe=Ie.width,mt=Ie.height,tt=Le.offsetWidth,it=Le.offsetHeight,et=Math.floor(Xe),gt=Math.floor(mt);if(b.current.width!==et||b.current.height!==gt||b.current.offsetWidth!==tt||b.current.offsetHeight!==it){var lt={width:et,height:gt,offsetWidth:tt,offsetHeight:it};b.current=lt;var at=tt===Math.round(Xe)?Xe:tt,_e=it===Math.round(mt)?mt:it,vt=Object(T.a)(Object(T.a)({},lt),{},{offsetWidth:at,offsetHeight:_e});W==null||W(vt,Le,Fe),Ke&&Promise.resolve().then(function(){Ke(vt,Le)})}},[]);return z.useEffect(function(){var Le=Object(E.a)(ue.current)||Object(E.a)(q.current);return Le&&!ge&&de(Le,re),function(){return Be(Le,re)}},[ue.current,ge]),z.createElement($e,{ref:q},V?z.cloneElement(ve,{ref:ye}):ve)}var ke="rc-observer-key";function Te(me){var ve=me.children,ge=Object(j.a)(ve);return ge.map(function(ue,q){var W=(ue==null?void 0:ue.key)||"".concat(ke,"-").concat(q);return z.createElement(Ve,Object(U.a)({},me,{key:W}),ue)})}Te.Collection=De;var Ne=Te,be=k("bT9E"),O=k("TSYQ"),ce=k.n(O),ne=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,w=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],B={},P;function S(me){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=me.getAttribute("id")||me.getAttribute("data-reactid")||me.getAttribute("name");if(ve&&B[ge])return B[ge];var ue=window.getComputedStyle(me),q=ue.getPropertyValue("box-sizing")||ue.getPropertyValue("-moz-box-sizing")||ue.getPropertyValue("-webkit-box-sizing"),W=parseFloat(ue.getPropertyValue("padding-bottom"))+parseFloat(ue.getPropertyValue("padding-top")),b=parseFloat(ue.getPropertyValue("border-bottom-width"))+parseFloat(ue.getPropertyValue("border-top-width")),V=w.map(function(ye){return"".concat(ye,":").concat(ue.getPropertyValue(ye))}).join(";"),R={sizingStyle:V,paddingSize:W,borderSize:b,boxSizing:q};return ve&&ge&&(B[ge]=R),R}function D(me){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ue=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;P||(P=document.createElement("textarea"),P.setAttribute("tab-index","-1"),P.setAttribute("aria-hidden","true"),document.body.appendChild(P)),me.getAttribute("wrap")?P.setAttribute("wrap",me.getAttribute("wrap")):P.removeAttribute("wrap");var q=S(me,ve),W=q.paddingSize,b=q.borderSize,V=q.boxSizing,R=q.sizingStyle;P.setAttribute("style","".concat(R,";").concat(ne)),P.value=me.value||me.placeholder||"";var ye=Number.MIN_SAFE_INTEGER,Ee=Number.MAX_SAFE_INTEGER,re=P.scrollHeight,Le;if(V==="border-box"?re+=b:V==="content-box"&&(re-=W),ge!==null||ue!==null){P.value=" ";var Ue=P.scrollHeight-W;ge!==null&&(ye=Ue*ge,V==="border-box"&&(ye=ye+W+b),re=Math.max(ye,re)),ue!==null&&(Ee=Ue*ue,V==="border-box"&&(Ee=Ee+W+b),Le=re>Ee?"":"hidden",re=Math.min(Ee,re))}return{height:re,minHeight:ye,maxHeight:Ee,overflowY:Le,resize:"none"}}var p=k("Gytx"),d=k.n(p),C;(function(me){me[me.NONE=0]="NONE",me[me.RESIZING=1]="RESIZING",me[me.RESIZED=2]="RESIZED"})(C||(C={}));var F=function(me){Object(xe.a)(ge,me);var ve=Object(fe.a)(ge);function ge(ue){var q;return Object(se.a)(this,ge),q=ve.call(this,ue),q.nextFrameActionId=void 0,q.resizeFrameId=void 0,q.textArea=void 0,q.saveTextArea=function(W){q.textArea=W},q.handleResize=function(W){var b=q.state.resizeStatus,V=q.props,R=V.autoSize,ye=V.onResize;if(b!==C.NONE)return;typeof ye=="function"&&ye(W),R&&q.resizeOnNextFrame()},q.resizeOnNextFrame=function(){cancelAnimationFrame(q.nextFrameActionId),q.nextFrameActionId=requestAnimationFrame(q.resizeTextarea)},q.resizeTextarea=function(){var W=q.props.autoSize;if(!W||!q.textArea)return;var b=W.minRows,V=W.maxRows,R=D(q.textArea,!1,b,V);q.setState({textareaStyles:R,resizeStatus:C.RESIZING},function(){cancelAnimationFrame(q.resizeFrameId),q.resizeFrameId=requestAnimationFrame(function(){q.setState({resizeStatus:C.RESIZED},function(){q.resizeFrameId=requestAnimationFrame(function(){q.setState({resizeStatus:C.NONE}),q.fixFirefoxAutoScroll()})})})})},q.renderTextArea=function(){var W=q.props,b=W.prefixCls,V=b===void 0?"rc-textarea":b,R=W.autoSize,ye=W.onResize,Ee=W.className,re=W.disabled,Le=q.state,Ue=Le.textareaStyles,Ke=Le.resizeStatus,Fe=Object(be.a)(q.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ie=ce()(V,Ee,Object(M.a)({},"".concat(V,"-disabled"),re));"value"in Fe&&(Fe.value=Fe.value||"");var Xe=Object(T.a)(Object(T.a)(Object(T.a)({},q.props.style),Ue),Ke===C.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return z.createElement(Ne,{onResize:q.handleResize,disabled:!(R||ye)},z.createElement("textarea",Object(U.a)({},Fe,{className:Ie,style:Xe,ref:q.saveTextArea})))},q.state={textareaStyles:{},resizeStatus:C.NONE},q}return Object(ie.a)(ge,[{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,W=this.textArea.selectionEnd;this.textArea.setSelectionRange(q,W)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ge}(z.Component),Q=F,Ce=function(me){Object(xe.a)(ge,me);var ve=Object(fe.a)(ge);function ge(ue){var q;Object(se.a)(this,ge),q=ve.call(this,ue),q.resizableTextArea=void 0,q.focus=function(){q.resizableTextArea.textArea.focus()},q.saveTextArea=function(b){q.resizableTextArea=b},q.handleChange=function(b){var V=q.props.onChange;q.setValue(b.target.value,function(){q.resizableTextArea.resizeTextarea()}),V&&V(b)},q.handleKeyDown=function(b){var V=q.props,R=V.onPressEnter,ye=V.onKeyDown;b.keyCode===13&&R&&R(b),ye&&ye(b)};var W=typeof ue.value=="undefined"||ue.value===null?ue.defaultValue:ue.value;return q.state={value:W},q}return Object(ie.a)(ge,[{key:"setValue",value:function(q,W){"value"in this.props||this.setState({value:q},W)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return z.createElement(Q,Object(U.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}}]),ge}(z.Component),Oe=Qe.default=Ce},ZW9T:function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return $e});var U=k("k1fw"),se=k("miYZ"),ie=k("tsqr"),xe=k("rAM+"),fe=k("tJVT"),z=k("PpiC"),T=k("q1tI"),M=k.n(T),j=k("bdgK");function L(Se,De,Ve,ke,Te){var Ne=De.getWordUntilPosition(Ve),be={startLineNumber:Ve.lineNumber,endLineNumber:Ve.lineNumber,startColumn:Ne.startColumn,endColumn:Ne.endColumn},O=ke.map(function(ce){return{label:ce,kind:Se.languages.CompletionItemKind.Keyword,insertText:ce,insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:be}});return Te.map(function(ce){O.push(Object(U.a)(Object(U.a)({},ce),{},{range:be}))}),O}var _=function(Se){var De={label:"ifelse",kind:Se.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet},Ve=["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(be,O){var ce=L(Se,be,O,Ve,[De]);return{suggestions:ce}}});var ke=["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(be,O){var ce=[{label:"print",kind:Se.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:Se.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ne=L(Se,be,O,ke,ce);return{suggestions:ne}}});var Te=["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(be,O){var ce=[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}],ne=L(Se,be,O,Te,ce);return{suggestions:ne}}})},E="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",te=k("LvDl");function $(Se){return/^\d+$/.test(Se)?"".concat(Se,"px"):Se}function H(){}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 ae(){var Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],De=Se;if(Array.isArray(Se)){for(var Ve=0;Ve<Se.length;Ve++){var ke=J[Se[Ve]];if(ke)return ke}return De[0]}return J[De]||De}var de=null,Be=Qe.b=function(Se){var De=Se.width,Ve=De===void 0?"100%":De,ke=Se.height,Te=ke===void 0?"100%":ke,Ne=Se.value,be=Se.language,O=be===void 0?"javascript":be,ce=Se.style,ne=ce===void 0?{}:ce,w=Se.options,B=w===void 0?{}:w,P=Se.overrideServices,S=P===void 0?{}:P,D=Se.theme,p=D===void 0?"vs-dark":D,d=Se.onEditBlur,C=Se.onSave,F=Se.autoHeight,Q=F===void 0?!1:F,Ce=Se.forbidCopy,Oe=Ce===void 0?!1:Ce,me=Se.onChange,ve=me===void 0?H:me,ge=Se.editorDidMount,ue=ge===void 0?H:ge,q=Se.onFocus,W=q===void 0?H:q,b=Se.filename,V=b===void 0?"educoder.txt":b,R=Object(z.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)(),Le=Object(T.useRef)(!1),Ue=Object(T.useRef)(),Ke=Object(T.useState)(!1),Fe=Object(fe.a)(Ke,2),Ie=Fe[0],Xe=Fe[1];function mt(){var A;return ye.current&&(A=new j.default(function(N){var le=Object(xe.a)(N),we;try{for(le.s();!(we=le.n()).done;){var Ge=we.value;(Ge.target.offsetHeight>0||Ge.target.offsetWidth>0)&&Ee.current.instance.layout()}}catch(st){le.e(st)}finally{le.f()}}),A.observe(ye.current)),A}function tt(){ie.b.warn(decodeURIComponent(E))}var it=function(){var N=Ee.current.instance;if(Ne!=null&&N&&Ie){var le=N.getModel();le&&Ne!==le.getValue()&&(X=!0,le.setValue(Ne),N.layout(),X=!1)}};Object(T.useEffect)(function(){re.current&&clearTimeout(re.current),re.current=setTimeout(function(){it()},500)},[Ne,Ie,Ee.current]);function et(){var A=Ee.current.instance;if(A){var N=A.getSelection(),le=Ee.current.pastePos||{},we=new de.Range(le.startLineNumber||N.endLineNumber,le.startColumn||N.endColumn,le.endLineNumber||N.endLineNumber,le.endColumn||N.endColumn);setTimeout(function(){A.executeEdits("",[{range:we,text:""}])},300)}}function gt(A){(window.navigator.platform.match("Mac")?A.metaKey:A.ctrlKey)&&A.keyCode==83&&(A.preventDefault(),C())}var lt=function(){if(Q&&Ee.current.instance){var N=Ee.current.instance.getContentHeight();y(N<Te?Te:N)}else y(Te)};function at(A){var N=document.createEvent("MouseEvents");N.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),A.dispatchEvent(N)}function _e(A,N){var le=window.URL||window.webkitURL||window,we=new Blob([N]),Ge=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ge.href=le.createObjectURL(we),Ge.download=A,at(Ge)}Object(T.useEffect)(function(){lt()},[lt]),Object(T.useEffect)(function(){ye.current&&!Ie&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(A){try{de=A,Ee.current.instance=de.editor.create(ye.current,{value:Ne,language:ae(O),theme:p,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},S);var N=Ee.current.instance;if(ue(N,de),setTimeout(function(){lt(),Ee.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){_e(V||"educoder.txt",N.getValue())}})},500),Ee.current.subscription=N.onDidChangeModelContent(function(we){Le.current?clearTimeout(Ue.current):(lt(),ve(N.getValue(),we)),Ue.current=setTimeout(function(){Le.current=!1},500)}),window.Monaco||_(de),Oe&&(N.addCommand(de.KeyMod.CtrlCmd|de.KeyMod.Shift|de.KeyCode.KEY_V,function(){return tt(),null}),N.addCommand(de.KeyMod.CtrlCmd|de.KeyCode.KEY_C,function(){return tt(),null})),window.Monaco=de,d&&N.onDidBlurEditorWidget(function(){d(N.getValue())}),W&&N.onDidFocusEditorText(function(){W(N.getValue())}),Oe){N.addCommand(de.KeyMod.CtrlCmd|de.KeyCode.KEY_V,function(){return tt(),null}),N.onDidPaste(function(we){Ee.current.pastePos=we});try{window.addEventListener("paste",et)}catch(we){}}var le=mt();return Xe(!0),function(){var we=Ee.current.instance;we.dispose();var Ge=we.getModel();Ge&&Ge.dispose(),Ee.current.subscription&&Ee.current.subscription.dispose(),Oe&&window.removeEventListener("paste",et),le.unobserve(ye.current)}}catch(we){}})},[]),Object(T.useEffect)(function(){var A=Ee.current.instance;if(A&&Ie)return document.addEventListener("keydown",gt,!1),function(){document.removeEventListener("keydown",gt)}},[C,Ie]),Object(T.useEffect)(function(){var A=Ee.current.instance;if(A&&Ie){var N=ae(O);de.editor.setModelLanguage(A.getModel(),N),console.log("language:",O,A.getModel(),N)}},[O,Ie]),Object(T.useEffect)(function(){var A=Ee.current.instance;A&&Ie&&de.editor.setTheme(p)},[p,Ie]),Object(T.useEffect)(function(){var A=Ee.current.instance;A&&Ie&&(A.updateOptions(Object(U.a)({},B)),setTimeout(function(){A.getModel().updateOptions(Object(U.a)({},B))},200))},[JSON.stringify(B),Ie]),Object(T.useEffect)(function(){var A=Ee.current.instance;A&&Ie&&A.layout()},[Ve,Te,Ie]);var vt=Object(T.useState)($(Ve)),rt=Object(fe.a)(vt,2),Re=rt[0],ze=rt[1],ee=Object(T.useState)($(Te)),Y=Object(fe.a)(ee,2),Z=Y[0],y=Y[1],x=Object(U.a)(Object(U.a)({},ne),{},{width:Re,height:Z});return M.a.createElement("div",{className:"my-monaco-editor",ref:ye,style:x})};function $e(Se){var De=Se.width,Ve=De===void 0?"100%":De,ke=Se.height,Te=ke===void 0?"100%":ke,Ne=Se.original,be=Se.modified,O=Se.language,ce=Se.options,ne=ce===void 0?{}:ce,w=Object(T.useRef)(),B=Object(T.useState)(null),P=Object(fe.a)(B,2),S=P[0],D=P[1];function p(Q){var Ce;return w.current&&(Ce=new j.default(function(Oe){var me=Object(xe.a)(Oe),ve;try{for(me.s();!(ve=me.n()).done;){var ge=ve.value;(ge.target.offsetHeight>0||ge.target.offsetWidth>0)&&Q.layout()}}catch(ue){me.e(ue)}finally{me.f()}}),Ce.observe(w.current)),Ce}Object(T.useEffect)(function(){w.current&&k.e(27).then(k.t.bind(null,"M/lh",7)).then(function(Q){de=Q;var Ce=de.editor.createDiffEditor(w.current,Object(U.a)(Object(U.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},ne),{},{wordWrap:!0}));D(Ce);var Oe=p(Ce);return function(){Ce.dispose();var me=Ce.getModel();me&&me.dispose(),Oe.unobserve(w.current)}})},[]),Object(T.useEffect)(function(){S&&S.setModel({original:de.editor.createModel(Ne,O),modified:de.editor.createModel(be,O)})},[Ne,be,O,S]);var d=$(Ve),C=$(Te),F={width:d,height:C};return M.a.createElement("div",{className:"my-diff-editor",ref:w,style:F})}},ZpRC:function(ot,Qe,k){"use strict";function U(_){return typeof _=="object"&&_!=null&&_.nodeType===1}function se(_,E){return(!E||_!=="hidden")&&_!=="visible"&&_!=="clip"}function ie(_,E){if(_.clientHeight<_.scrollHeight||_.clientWidth<_.scrollWidth){var te=getComputedStyle(_,null);return se(te.overflowY,E)||se(te.overflowX,E)||function($){var H=function(X){if(!X.ownerDocument||!X.ownerDocument.defaultView)return null;try{return X.ownerDocument.defaultView.frameElement}catch(J){return null}}($);return!!H&&(H.clientHeight<$.scrollHeight||H.clientWidth<$.scrollWidth)}(_)}return!1}function xe(_,E,te,$,H,X,J,ae){return X<_&&J>E||X>_&&J<E?0:X<=_&&ae<=te||J>=E&&ae>=te?X-_-$:J>E&&ae<te||X<_&&ae>te?J-E+H:0}var fe=function(_,E){var te=window,$=E.scrollMode,H=E.block,X=E.inline,J=E.boundary,ae=E.skipOverflowHiddenElements,de=typeof J=="function"?J:function(Ue){return Ue!==J};if(!U(_))throw new TypeError("Invalid target");for(var Be=document.scrollingElement||document.documentElement,$e=[],Se=_;U(Se)&&de(Se);){if((Se=Se.parentElement)===Be){$e.push(Se);break}Se!=null&&Se===document.body&&ie(Se)&&!ie(document.documentElement)||Se!=null&&ie(Se,ae)&&$e.push(Se)}for(var De=te.visualViewport?te.visualViewport.width:innerWidth,Ve=te.visualViewport?te.visualViewport.height:innerHeight,ke=window.scrollX||pageXOffset,Te=window.scrollY||pageYOffset,Ne=_.getBoundingClientRect(),be=Ne.height,O=Ne.width,ce=Ne.top,ne=Ne.right,w=Ne.bottom,B=Ne.left,P=H==="start"||H==="nearest"?ce:H==="end"?w:ce+be/2,S=X==="center"?B+O/2:X==="end"?ne:B,D=[],p=0;p<$e.length;p++){var d=$e[p],C=d.getBoundingClientRect(),F=C.height,Q=C.width,Ce=C.top,Oe=C.right,me=C.bottom,ve=C.left;if($==="if-needed"&&ce>=0&&B>=0&&w<=Ve&&ne<=De&&ce>=Ce&&w<=me&&B>=ve&&ne<=Oe)return D;var ge=getComputedStyle(d),ue=parseInt(ge.borderLeftWidth,10),q=parseInt(ge.borderTopWidth,10),W=parseInt(ge.borderRightWidth,10),b=parseInt(ge.borderBottomWidth,10),V=0,R=0,ye="offsetWidth"in d?d.offsetWidth-d.clientWidth-ue-W:0,Ee="offsetHeight"in d?d.offsetHeight-d.clientHeight-q-b:0;if(Be===d)V=H==="start"?P:H==="end"?P-Ve:H==="nearest"?xe(Te,Te+Ve,Ve,q,b,Te+P,Te+P+be,be):P-Ve/2,R=X==="start"?S:X==="center"?S-De/2:X==="end"?S-De:xe(ke,ke+De,De,ue,W,ke+S,ke+S+O,O),V=Math.max(0,V+Te),R=Math.max(0,R+ke);else{V=H==="start"?P-Ce-q:H==="end"?P-me+b+Ee:H==="nearest"?xe(Ce,me,F,q,b+Ee,P,P+be,be):P-(Ce+F/2)+Ee/2,R=X==="start"?S-ve-ue:X==="center"?S-(ve+Q/2)+ye/2:X==="end"?S-Oe+W+ye:xe(ve,Oe,Q,ue,W+ye,S,S+O,O);var re=d.scrollLeft,Le=d.scrollTop;P+=Le-(V=Math.max(0,Math.min(Le+V,d.scrollHeight-F+Ee))),S+=re-(R=Math.max(0,Math.min(re+R,d.scrollWidth-Q+ye)))}D.push({el:d,top:V,left:R})}return D};function z(_){return _===Object(_)&&Object.keys(_).length!==0}function T(_,E){E===void 0&&(E="auto");var te="scrollBehavior"in document.body.style;_.forEach(function($){var H=$.el,X=$.top,J=$.left;H.scroll&&te?H.scroll({top:X,left:J,behavior:E}):(H.scrollTop=X,H.scrollLeft=J)})}function M(_){return _===!1?{block:"end",inline:"nearest"}:z(_)?_:{block:"start",inline:"nearest"}}function j(_,E){var te=!_.ownerDocument.documentElement.contains(_);if(z(E)&&typeof E.behavior=="function")return E.behavior(te?[]:fe(_,E));if(te)return;var $=M(E);return T(fe(_,$),$.behavior)}var L=Qe.a=j},Zss7:function(ot,Qe,k){var U;(function(se){var ie=/^\s+/,xe=/\s+$/,fe=0,z=se.round,T=se.min,M=se.max,j=se.random;function L(b,V){if(b=b||"",V=V||{},b instanceof L)return b;if(!(this instanceof L))return new L(b,V);var R=_(b);this._originalInput=b,this._r=R.r,this._g=R.g,this._b=R.b,this._a=R.a,this._roundA=z(100*this._a)/100,this._format=V.format||R.format,this._gradientType=V.gradientType,this._r<1&&(this._r=z(this._r)),this._g<1&&(this._g=z(this._g)),this._b<1&&(this._b=z(this._b)),this._ok=R.ok,this._tc_id=fe++}L.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(),V,R,ye,Ee,re,Le;return V=b.r/255,R=b.g/255,ye=b.b/255,V<=.03928?Ee=V/12.92:Ee=se.pow((V+.055)/1.055,2.4),R<=.03928?re=R/12.92:re=se.pow((R+.055)/1.055,2.4),ye<=.03928?Le=ye/12.92:Le=se.pow((ye+.055)/1.055,2.4),.2126*Ee+.7152*re+.0722*Le},setAlpha:function(b){return this._a=D(b),this._roundA=z(100*this._a)/100,this},toHsv:function(){var b=H(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=H(this._r,this._g,this._b),V=z(b.h*360),R=z(b.s*100),ye=z(b.v*100);return this._a==1?"hsv("+V+", "+R+"%, "+ye+"%)":"hsva("+V+", "+R+"%, "+ye+"%, "+this._roundA+")"},toHsl:function(){var b=te(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=te(this._r,this._g,this._b),V=z(b.h*360),R=z(b.s*100),ye=z(b.l*100);return this._a==1?"hsl("+V+", "+R+"%, "+ye+"%)":"hsla("+V+", "+R+"%, "+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 ae(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:z(this._r),g:z(this._g),b:z(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+z(this._r)+", "+z(this._g)+", "+z(this._b)+")":"rgba("+z(this._r)+", "+z(this._g)+", "+z(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:z(p(this._r,255)*100)+"%",g:z(p(this._g,255)*100)+"%",b:z(p(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+z(p(this._r,255)*100)+"%, "+z(p(this._g,255)*100)+"%, "+z(p(this._b,255)*100)+"%)":"rgba("+z(p(this._r,255)*100)+"%, "+z(p(this._g,255)*100)+"%, "+z(p(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:P[J(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var V="#"+de(this._r,this._g,this._b,this._a),R=V,ye=this._gradientType?"GradientType = 1, ":"";if(b){var Ee=L(b);R="#"+de(Ee._r,Ee._g,Ee._b,Ee._a)}return"progid:DXImageTransform.Microsoft.gradient("+ye+"startColorstr="+V+",endColorstr="+R+")"},toString:function(b){var V=!!b;b=b||this._format;var R=!1,ye=this._a<1&&this._a>=0,Ee=!V&&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"&&(R=this.toRgbString()),b==="prgb"&&(R=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(R=this.toHexString()),b==="hex3"&&(R=this.toHexString(!0)),b==="hex4"&&(R=this.toHex8String(!0)),b==="hex8"&&(R=this.toHex8String()),b==="name"&&(R=this.toName()),b==="hsl"&&(R=this.toHslString()),b==="hsv"&&(R=this.toHsvString()),R||this.toHexString())},clone:function(){return L(this.toString())},_applyModification:function(b,V){var R=b.apply(null,[this].concat([].slice.call(V)));return this._r=R._r,this._g=R._g,this._b=R._b,this.setAlpha(R._a),this},lighten:function(){return this._applyModification(De,arguments)},brighten:function(){return this._applyModification(Ve,arguments)},darken:function(){return this._applyModification(ke,arguments)},desaturate:function(){return this._applyModification(Be,arguments)},saturate:function(){return this._applyModification($e,arguments)},greyscale:function(){return this._applyModification(Se,arguments)},spin:function(){return this._applyModification(Te,arguments)},_applyCombination:function(b,V){return b.apply(null,[this].concat([].slice.call(V)))},analogous:function(){return this._applyCombination(ne,arguments)},complement:function(){return this._applyCombination(Ne,arguments)},monochromatic:function(){return this._applyCombination(w,arguments)},splitcomplement:function(){return this._applyCombination(ce,arguments)},triad:function(){return this._applyCombination(be,arguments)},tetrad:function(){return this._applyCombination(O,arguments)}},L.fromRatio=function(b,V){if(typeof b=="object"){var R={};for(var ye in b)b.hasOwnProperty(ye)&&(ye==="a"?R[ye]=b[ye]:R[ye]=Oe(b[ye]));b=R}return L(b,V)};function _(b){var V={r:0,g:0,b:0},R=1,ye=null,Ee=null,re=null,Le=!1,Ue=!1;return typeof b=="string"&&(b=q(b)),typeof b=="object"&&(ue(b.r)&&ue(b.g)&&ue(b.b)?(V=E(b.r,b.g,b.b),Le=!0,Ue=String(b.r).substr(-1)==="%"?"prgb":"rgb"):ue(b.h)&&ue(b.s)&&ue(b.v)?(ye=Oe(b.s),Ee=Oe(b.v),V=X(b.h,ye,Ee),Le=!0,Ue="hsv"):ue(b.h)&&ue(b.s)&&ue(b.l)&&(ye=Oe(b.s),re=Oe(b.l),V=$(b.h,ye,re),Le=!0,Ue="hsl"),b.hasOwnProperty("a")&&(R=b.a)),R=D(R),{ok:Le,format:b.format||Ue,r:T(255,M(V.r,0)),g:T(255,M(V.g,0)),b:T(255,M(V.b,0)),a:R}}function E(b,V,R){return{r:p(b,255)*255,g:p(V,255)*255,b:p(R,255)*255}}function te(b,V,R){b=p(b,255),V=p(V,255),R=p(R,255);var ye=M(b,V,R),Ee=T(b,V,R),re,Le,Ue=(ye+Ee)/2;if(ye==Ee)re=Le=0;else{var Ke=ye-Ee;Le=Ue>.5?Ke/(2-ye-Ee):Ke/(ye+Ee);switch(ye){case b:re=(V-R)/Ke+(V<R?6:0);break;case V:re=(R-b)/Ke+2;break;case R:re=(b-V)/Ke+4;break}re/=6}return{h:re,s:Le,l:Ue}}function $(b,V,R){var ye,Ee,re;b=p(b,360),V=p(V,100),R=p(R,100);function Le(Fe,Ie,Xe){return Xe<0&&(Xe+=1),Xe>1&&(Xe-=1),Xe<1/6?Fe+(Ie-Fe)*6*Xe:Xe<1/2?Ie:Xe<2/3?Fe+(Ie-Fe)*(2/3-Xe)*6:Fe}if(V===0)ye=Ee=re=R;else{var Ue=R<.5?R*(1+V):R+V-R*V,Ke=2*R-Ue;ye=Le(Ke,Ue,b+1/3),Ee=Le(Ke,Ue,b),re=Le(Ke,Ue,b-1/3)}return{r:ye*255,g:Ee*255,b:re*255}}function H(b,V,R){b=p(b,255),V=p(V,255),R=p(R,255);var ye=M(b,V,R),Ee=T(b,V,R),re,Le,Ue=ye,Ke=ye-Ee;if(Le=ye===0?0:Ke/ye,ye==Ee)re=0;else{switch(ye){case b:re=(V-R)/Ke+(V<R?6:0);break;case V:re=(R-b)/Ke+2;break;case R:re=(b-V)/Ke+4;break}re/=6}return{h:re,s:Le,v:Ue}}function X(b,V,R){b=p(b,360)*6,V=p(V,100),R=p(R,100);var ye=se.floor(b),Ee=b-ye,re=R*(1-V),Le=R*(1-Ee*V),Ue=R*(1-(1-Ee)*V),Ke=ye%6,Fe=[R,Le,re,re,Ue,R][Ke],Ie=[Ue,R,R,Le,re,re][Ke],Xe=[re,re,Ue,R,R,Le][Ke];return{r:Fe*255,g:Ie*255,b:Xe*255}}function J(b,V,R,ye){var Ee=[Ce(z(b).toString(16)),Ce(z(V).toString(16)),Ce(z(R).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 ae(b,V,R,ye,Ee){var re=[Ce(z(b).toString(16)),Ce(z(V).toString(16)),Ce(z(R).toString(16)),Ce(me(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 de(b,V,R,ye){var Ee=[Ce(me(ye)),Ce(z(b).toString(16)),Ce(z(V).toString(16)),Ce(z(R).toString(16))];return Ee.join("")}L.equals=function(b,V){return!b||!V?!1:L(b).toRgbString()==L(V).toRgbString()},L.random=function(){return L.fromRatio({r:j(),g:j(),b:j()})};function Be(b,V){V=V===0?0:V||10;var R=L(b).toHsl();return R.s-=V/100,R.s=d(R.s),L(R)}function $e(b,V){V=V===0?0:V||10;var R=L(b).toHsl();return R.s+=V/100,R.s=d(R.s),L(R)}function Se(b){return L(b).desaturate(100)}function De(b,V){V=V===0?0:V||10;var R=L(b).toHsl();return R.l+=V/100,R.l=d(R.l),L(R)}function Ve(b,V){V=V===0?0:V||10;var R=L(b).toRgb();return R.r=M(0,T(255,R.r-z(255*-(V/100)))),R.g=M(0,T(255,R.g-z(255*-(V/100)))),R.b=M(0,T(255,R.b-z(255*-(V/100)))),L(R)}function ke(b,V){V=V===0?0:V||10;var R=L(b).toHsl();return R.l-=V/100,R.l=d(R.l),L(R)}function Te(b,V){var R=L(b).toHsl(),ye=(R.h+V)%360;return R.h=ye<0?360+ye:ye,L(R)}function Ne(b){var V=L(b).toHsl();return V.h=(V.h+180)%360,L(V)}function be(b){var V=L(b).toHsl(),R=V.h;return[L(b),L({h:(R+120)%360,s:V.s,l:V.l}),L({h:(R+240)%360,s:V.s,l:V.l})]}function O(b){var V=L(b).toHsl(),R=V.h;return[L(b),L({h:(R+90)%360,s:V.s,l:V.l}),L({h:(R+180)%360,s:V.s,l:V.l}),L({h:(R+270)%360,s:V.s,l:V.l})]}function ce(b){var V=L(b).toHsl(),R=V.h;return[L(b),L({h:(R+72)%360,s:V.s,l:V.l}),L({h:(R+216)%360,s:V.s,l:V.l})]}function ne(b,V,R){V=V||6,R=R||30;var ye=L(b).toHsl(),Ee=360/R,re=[L(b)];for(ye.h=(ye.h-(Ee*V>>1)+720)%360;--V;)ye.h=(ye.h+Ee)%360,re.push(L(ye));return re}function w(b,V){V=V||6;for(var R=L(b).toHsv(),ye=R.h,Ee=R.s,re=R.v,Le=[],Ue=1/V;V--;)Le.push(L({h:ye,s:Ee,v:re})),re=(re+Ue)%1;return Le}L.mix=function(b,V,R){R=R===0?0:R||50;var ye=L(b).toRgb(),Ee=L(V).toRgb(),re=R/100,Le={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 L(Le)},L.readability=function(b,V){var R=L(b),ye=L(V);return(se.max(R.getLuminance(),ye.getLuminance())+.05)/(se.min(R.getLuminance(),ye.getLuminance())+.05)},L.isReadable=function(b,V,R){var ye=L.readability(b,V),Ee,re;re=!1,Ee=W(R);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},L.mostReadable=function(b,V,R){var ye=null,Ee=0,re,Le,Ue,Ke;R=R||{},Le=R.includeFallbackColors,Ue=R.level,Ke=R.size;for(var Fe=0;Fe<V.length;Fe++)re=L.readability(b,V[Fe]),re>Ee&&(Ee=re,ye=L(V[Fe]));return L.isReadable(b,ye,{level:Ue,size:Ke})||!Le?ye:(R.includeFallbackColors=!1,L.mostReadable(b,["#fff","#000"],R))};var B=L.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"},P=L.hexNames=S(B);function S(b){var V={};for(var R in b)b.hasOwnProperty(R)&&(V[b[R]]=R);return V}function D(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function p(b,V){F(b)&&(b="100%");var R=Q(b);return b=T(V,M(0,parseFloat(b))),R&&(b=parseInt(b*V,10)/100),se.abs(b-V)<1e-6?1:b%V/parseFloat(V)}function d(b){return T(1,M(0,b))}function C(b){return parseInt(b,16)}function F(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function Q(b){return typeof b=="string"&&b.indexOf("%")!=-1}function Ce(b){return b.length==1?"0"+b:""+b}function Oe(b){return b<=1&&(b=b*100+"%"),b}function me(b){return se.round(parseFloat(b)*255).toString(16)}function ve(b){return C(b)/255}var ge=function(){var b="[-\\+]?\\d+%?",V="[-\\+]?\\d*\\.\\d+%?",R="(?:"+V+")|(?:"+b+")",ye="[\\s|\\(]+("+R+")[,|\\s]+("+R+")[,|\\s]+("+R+")\\s*\\)?",Ee="[\\s|\\(]+("+R+")[,|\\s]+("+R+")[,|\\s]+("+R+")[,|\\s]+("+R+")\\s*\\)?";return{CSS_UNIT:new RegExp(R),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 ue(b){return!!ge.CSS_UNIT.exec(b)}function q(b){b=b.replace(ie,"").replace(xe,"").toLowerCase();var V=!1;if(B[b])b=B[b],V=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var R;return(R=ge.rgb.exec(b))?{r:R[1],g:R[2],b:R[3]}:(R=ge.rgba.exec(b))?{r:R[1],g:R[2],b:R[3],a:R[4]}:(R=ge.hsl.exec(b))?{h:R[1],s:R[2],l:R[3]}:(R=ge.hsla.exec(b))?{h:R[1],s:R[2],l:R[3],a:R[4]}:(R=ge.hsv.exec(b))?{h:R[1],s:R[2],v:R[3]}:(R=ge.hsva.exec(b))?{h:R[1],s:R[2],v:R[3],a:R[4]}:(R=ge.hex8.exec(b))?{r:C(R[1]),g:C(R[2]),b:C(R[3]),a:ve(R[4]),format:V?"name":"hex8"}:(R=ge.hex6.exec(b))?{r:C(R[1]),g:C(R[2]),b:C(R[3]),format:V?"name":"hex"}:(R=ge.hex4.exec(b))?{r:C(R[1]+""+R[1]),g:C(R[2]+""+R[2]),b:C(R[3]+""+R[3]),a:ve(R[4]+""+R[4]),format:V?"name":"hex8"}:(R=ge.hex3.exec(b))?{r:C(R[1]+""+R[1]),g:C(R[2]+""+R[2]),b:C(R[3]+""+R[3]),format:V?"name":"hex"}:!1}function W(b){var V,R;return b=b||{level:"AA",size:"small"},V=(b.level||"AA").toUpperCase(),R=(b.size||"small").toLowerCase(),V!=="AA"&&V!=="AAA"&&(V="AA"),R!=="small"&&R!=="large"&&(R="small"),{level:V,size:R}}ot.exports?ot.exports=L:!(U=function(){return L}.call(Qe,k,Qe,ot),U!==void 0&&(ot.exports=U))})(Math)},aRTE:function(ot,Qe){ot.exports={L:1,M:0,Q:3,H:2}},bT9E:function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return se});var U=k("VTBJ");function se(ie,xe){var fe=Object(U.a)({},ie);return Array.isArray(xe)&&xe.forEach(function(z){delete fe[z]}),fe}},c5Ni:function(ot,Qe,k){},dQei:function(ot,Qe){for(var k={glog:function(se){if(se<1)throw new Error("glog("+se+")");return k.LOG_TABLE[se]},gexp:function(se){for(;se<0;)se+=255;for(;se>=256;)se-=255;return k.EXP_TABLE[se]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},U=0;U<8;U++)k.EXP_TABLE[U]=1<<U;for(var U=8;U<256;U++)k.EXP_TABLE[U]=k.EXP_TABLE[U-4]^k.EXP_TABLE[U-5]^k.EXP_TABLE[U-6]^k.EXP_TABLE[U-8];for(var U=0;U<255;U++)k.LOG_TABLE[k.EXP_TABLE[U]]=U;ot.exports=k},dWSS:function(ot,Qe,k){var U=k("dQei");function se(ie,xe){if(ie.length==null)throw new Error(ie.length+"/"+xe);for(var fe=0;fe<ie.length&&ie[fe]==0;)fe++;this.num=new Array(ie.length-fe+xe);for(var z=0;z<ie.length-fe;z++)this.num[z]=ie[z+fe]}se.prototype={get:function(ie){return this.num[ie]},getLength:function(){return this.num.length},multiply:function(ie){for(var xe=new Array(this.getLength()+ie.getLength()-1),fe=0;fe<this.getLength();fe++)for(var z=0;z<ie.getLength();z++)xe[fe+z]^=U.gexp(U.glog(this.get(fe))+U.glog(ie.get(z)));return new se(xe,0)},mod:function(ie){if(this.getLength()-ie.getLength()<0)return this;for(var xe=U.glog(this.get(0))-U.glog(ie.get(0)),fe=new Array(this.getLength()),z=0;z<this.getLength();z++)fe[z]=this.get(z);for(var z=0;z<ie.getLength();z++)fe[z]^=U.gexp(U.glog(ie.get(z))+xe);return new se(fe,0).mod(ie)}},ot.exports=se},dejd:function(ot,Qe,k){},dmUQ:function(ot,Qe,k){"use strict";var U=k("Ff2n"),se=k("rePB"),ie=k("1OyB"),xe=k("vuIU"),fe=k("Ji7U"),z=k("md7G"),T=k("foSv"),M=k("q1tI"),j=k.n(M),L=k("TSYQ"),_=k.n(L),E=k("4IlW");function te(be,O){var ce=Object.keys(be);if(Object.getOwnPropertySymbols){var ne=Object.getOwnPropertySymbols(be);O&&(ne=ne.filter(function(w){return Object.getOwnPropertyDescriptor(be,w).enumerable})),ce.push.apply(ce,ne)}return ce}function $(be){for(var O=1;O<arguments.length;O++){var ce=arguments[O]!=null?arguments[O]:{};O%2?te(Object(ce),!0).forEach(function(ne){Object(se.a)(be,ne,ce[ne])}):Object.getOwnPropertyDescriptors?Object.defineProperties(be,Object.getOwnPropertyDescriptors(ce)):te(Object(ce)).forEach(function(ne){Object.defineProperty(be,ne,Object.getOwnPropertyDescriptor(ce,ne))})}return be}function H(be){var O=X();return function(){var ne=Object(T.a)(be),w;if(O){var B=Object(T.a)(this).constructor;w=Reflect.construct(ne,arguments,B)}else w=ne.apply(this,arguments);return Object(z.a)(this,w)}}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(be){return!1}}function J(){}function ae(be){be.preventDefault()}var de=function(O){return O.replace(/[^\w.-]+/g,"")},Be=200,$e=600,Se=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,De=function(O){return O!=null},Ve=function(O,ce){return ce===O||typeof ce=="number"&&typeof O=="number"&&isNaN(ce)&&isNaN(O)},ke=function(be){Object(fe.a)(ce,be);var O=H(ce);function ce(ne){var w;Object(ie.a)(this,ce),w=O.call(this,ne),w.onKeyDown=function(S){var D=w.props,p=D.onKeyDown,d=D.onPressEnter;if(S.keyCode===E.a.UP){var C=w.getRatio(S);w.up(S,C,null),w.stop()}else if(S.keyCode===E.a.DOWN){var F=w.getRatio(S);w.down(S,F,null),w.stop()}else S.keyCode===E.a.ENTER&&d&&d(S);if(w.recordCursorPosition(),w.lastKeyCode=S.keyCode,p){for(var Q=arguments.length,Ce=new Array(Q>1?Q-1:0),Oe=1;Oe<Q;Oe++)Ce[Oe-1]=arguments[Oe];p.apply(void 0,[S].concat(Ce))}},w.onKeyUp=function(S){var D=w.props.onKeyUp;if(w.stop(),w.recordCursorPosition(),D){for(var p=arguments.length,d=new Array(p>1?p-1:0),C=1;C<p;C++)d[C-1]=arguments[C];D.apply(void 0,[S].concat(d))}},w.onChange=function(S){var D=w.props.onChange;w.state.focused&&(w.inputting=!0),w.rawInput=w.props.parser(w.getValueFromEvent(S)),w.setState({inputValue:w.rawInput}),D(w.toNumber(w.rawInput))},w.onMouseUp=function(){var S=w.props.onMouseUp;w.recordCursorPosition(),S&&S.apply(void 0,arguments)},w.onFocus=function(){var S;w.setState({focused:!0}),(S=w.props).onFocus.apply(S,arguments)},w.onBlur=function(){var S=w.props.onBlur;w.inputting=!1,w.setState({focused:!1});var D=w.getCurrentValidValue(w.state.inputValue),p=w.setValue(D,J);if(S){var d=w.input.value,C=w.getInputDisplayValue({focus:!1,value:p});w.input.value=C&&Number(C),S.apply(void 0,arguments),w.input.value=d}},w.getRatio=function(S){var D=1;return S.metaKey||S.ctrlKey?D=.1:S.shiftKey&&(D=10),D},w.getFullNum=function(S){return isNaN(S)?S:/e/i.test(String(S))?Number(S).toFixed(18).replace(/\.?0+$/,""):S},w.getPrecision=function(S){if(De(w.props.precision))return w.props.precision;var D=String(S);if(D.indexOf("e-")>=0)return parseInt(D.slice(D.indexOf("e-")+2),10);var p=0;return D.indexOf(".")>=0&&(p=D.length-D.indexOf(".")-1),p},w.getInputDisplayValue=function(S){var D=S||w.state,p=D.focused,d=D.inputValue,C=D.value,F;p?F=d:F=w.toPrecisionAsStep(C),F==null&&(F="");var Q=w.formatWrapper(F);return De(w.props.decimalSeparator)&&(Q=Q.toString().replace(".",w.props.decimalSeparator)),Q},w.recordCursorPosition=function(){try{w.cursorStart=w.input.selectionStart,w.cursorEnd=w.input.selectionEnd,w.currentValue=w.input.value,w.cursorBefore=w.input.value.substring(0,w.cursorStart),w.cursorAfter=w.input.value.substring(w.cursorEnd)}catch(S){}},w.restoreByAfter=function(S){if(S===void 0)return!1;var D=w.input.value,p=D.lastIndexOf(S);if(p===-1)return!1;var d=w.cursorBefore.length;return w.lastKeyCode===E.a.DELETE&&w.cursorBefore.charAt(d-1)===S[0]?(w.fixCaret(d,d),!0):p+S.length===D.length?(w.fixCaret(p,p),!0):!1},w.partRestoreByAfter=function(S){return S===void 0?!1:Array.prototype.some.call(S,function(D,p){var d=S.substring(p);return w.restoreByAfter(d)})},w.isNotCompleteNumber=function(S){return isNaN(S)||S===""||S===null||S&&S.toString().indexOf(".")===S.toString().length-1},w.stop=function(){w.autoStepTimer&&clearTimeout(w.autoStepTimer)},w.down=function(S,D,p){w.pressingUpOrDown=!0,w.step("down",S,D,p)},w.up=function(S,D,p){w.pressingUpOrDown=!0,w.step("up",S,D,p)},w.saveInput=function(S){w.input=S};var B=ne.value;B===void 0&&(B=ne.defaultValue),w.state={focused:ne.autoFocus};var P=w.getValidValue(w.toNumber(B));return w.state=$($({},w.state),{},{inputValue:w.toPrecisionAsStep(P),value:P}),w}return Object(xe.a)(ce,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(w){var B=this.props,P=B.value,S=B.onChange,D=B.max,p=B.min,d=this.state.focused;if(w){if(!Ve(w.value,P)||!Ve(w.max,D)||!Ve(w.min,p)){var C=d?P:this.getValidValue(P),F;this.pressingUpOrDown?F=C:this.inputting?F=this.rawInput:F=this.toPrecisionAsStep(C),this.setState({value:C,inputValue:F})}var Q="value"in this.props?P:this.state.value;"max"in this.props&&w.max!==D&&typeof Q=="number"&&Q>D&&S&&S(D),"min"in this.props&&w.min!==p&&typeof Q=="number"&&Q<p&&S&&S(p)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ce=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===E.a.BACKSPACE?Ce=this.cursorStart-1:this.lastKeyCode===E.a.DELETE&&(Ce=this.cursorStart):Ce=this.input.value.length,this.fixCaret(Ce,Ce)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case E.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case E.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Oe){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(w){var B=w;return B===""?B="":this.isNotCompleteNumber(parseFloat(B))?B=this.state.value:B=this.getValidValue(B),this.toNumber(B)}},{key:"getValueFromEvent",value:function(w){var B=w.target.value.trim().replace(/。/g,".");return De(this.props.decimalSeparator)&&(B=B.replace(this.props.decimalSeparator,".")),B}},{key:"getValidValue",value:function(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,S=parseFloat(w);return isNaN(S)?w:(S<B&&(S=B),S>P&&(S=P),S)}},{key:"setValue",value:function(w,B){var P=this.props.precision,S=this.isNotCompleteNumber(parseFloat(w))?null:parseFloat(w),D=this.state.value,p=D===void 0?null:D,d=this.state.inputValue,C=d===void 0?null:d,F=typeof S=="number"?S.toFixed(P):"".concat(S),Q=S!==p||F!=="".concat(C);return"value"in this.props?(C=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:C},B)):this.setState({value:S,inputValue:this.toPrecisionAsStep(w)},B),Q&&this.props.onChange(S),S}},{key:"getMaxPrecision",value:function(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=this.props,S=P.precision,D=P.step;if(De(S))return S;var p=this.getPrecision(B),d=this.getPrecision(D),C=this.getPrecision(w);return w?Math.max(C,p+d):p+d}},{key:"getPrecisionFactor",value:function(w){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,P=this.getMaxPrecision(w,B);return Math.pow(10,P)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(w){return this.props.formatter?this.props.formatter(w):w}},{key:"toPrecisionAsStep",value:function(w){if(this.isNotCompleteNumber(w)||w==="")return w;var B=Math.abs(this.getMaxPrecision(w));return isNaN(B)?w.toString():Number(w).toFixed(B)}},{key:"toNumber",value:function(w){var B=this.props.precision,P=this.state.focused,S=w&&w.length>16&&P;return this.isNotCompleteNumber(w)||S?w:De(B)?Math.round(w*Math.pow(10,B))/Math.pow(10,B):Number(w)}},{key:"upStep",value:function(w,B){var P=this.props.step,S=this.getPrecisionFactor(w,B),D=Math.abs(this.getMaxPrecision(w,B)),p=((S*w+S*P*B)/S).toFixed(D);return this.toNumber(p)}},{key:"downStep",value:function(w,B){var P=this.props.step,S=this.getPrecisionFactor(w,B),D=Math.abs(this.getMaxPrecision(w,B)),p=((S*w-S*P*B)/S).toFixed(D);return this.toNumber(p)}},{key:"step",value:function(w,B){var P=this,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,D=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var p=this.props;if(p.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var C=this["".concat(w,"Step")](d,S),F=C>p.max||C<p.min;if(C>p.max?C=p.max:C<p.min&&(C=p.min),this.setValue(C,null),this.setState({focused:!0},function(){P.pressingUpOrDown=!1}),F)return;this.autoStepTimer=setTimeout(function(){P[w](B,S,!0)},D?Be:$e)}},{key:"fixCaret",value:function(w,B){if(w===void 0||B===void 0||!this.input||!this.input.value)return;try{var P=this.input.selectionStart,S=this.input.selectionEnd;(w!==P||B!==S)&&this.input.setSelectionRange(w,B)}catch(D){}}},{key:"render",value:function(){var w,B=this.props,P=B.prefixCls,S=B.disabled,D=B.readOnly,p=B.useTouch,d=B.autoComplete,C=B.upHandler,F=B.downHandler,Q=B.className,Ce=B.max,Oe=B.min,me=B.style,ve=B.title,ge=B.onMouseEnter,ue=B.onMouseLeave,q=B.onMouseOver,W=B.onMouseOut,b=B.required,V=B.onClick,R=B.tabIndex,ye=B.type,Ee=B.placeholder,re=B.id,Le=B.inputMode,Ue=B.pattern,Ke=B.step,Fe=B.maxLength,Ie=B.autoFocus,Xe=B.name,mt=B.onPaste,tt=B.onInput,it=Object(U.a)(B,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),et=this.state,gt=et.value,lt=et.focused,at=_()(P,(w={},Object(se.a)(w,Q,!!Q),Object(se.a)(w,"".concat(P,"-disabled"),S),Object(se.a)(w,"".concat(P,"-focused"),lt),w)),_e={};Object.keys(it).forEach(function(N){(N.substr(0,5)==="data-"||N.substr(0,5)==="aria-"||N==="role")&&(_e[N]=it[N])});var vt=!D&&!S,rt=this.getInputDisplayValue(null),Re=(gt||gt===0)&&(isNaN(gt)||Number(gt)>=Ce),ze=(gt||gt===0)&&(isNaN(gt)||Number(gt)<=Oe),ee=Re||S||D,Y=ze||S||D,Z=_()("".concat(P,"-handler"),"".concat(P,"-handler-up"),Object(se.a)({},"".concat(P,"-handler-up-disabled"),ee)),y=_()("".concat(P,"-handler"),"".concat(P,"-handler-down"),Object(se.a)({},"".concat(P,"-handler-down-disabled"),Y)),x=p?{onTouchStart:ee?J:this.up,onTouchEnd:this.stop}:{onMouseDown:ee?J:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},A=p?{onTouchStart:Y?J:this.down,onTouchEnd:this.stop}:{onMouseDown:Y?J:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return j.a.createElement("div",{className:at,style:me,title:ve,onMouseEnter:ge,onMouseLeave:ue,onMouseOver:q,onMouseOut:W,onFocus:function(){return null},onBlur:function(){return null}},j.a.createElement("div",{className:"".concat(P,"-handler-wrap")},j.a.createElement("span",Object.assign({unselectable:"on"},x,{role:"button","aria-label":"Increase Value","aria-disabled":ee,className:Z}),C||j.a.createElement("span",{unselectable:"on",className:"".concat(P,"-handler-up-inner"),onClick:ae})),j.a.createElement("span",Object.assign({unselectable:"on"},A,{role:"button","aria-label":"Decrease Value","aria-disabled":Y,className:y}),F||j.a.createElement("span",{unselectable:"on",className:"".concat(P,"-handler-down-inner"),onClick:ae}))),j.a.createElement("div",{className:"".concat(P,"-input-wrap")},j.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":Ce,"aria-valuenow":gt,required:b,type:ye,placeholder:Ee,onPaste:mt,onClick:V,onMouseUp:this.onMouseUp,className:"".concat(P,"-input"),tabIndex:R,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:J,onKeyUp:vt?this.onKeyUp:J,autoFocus:Ie,maxLength:Fe,readOnly:D,disabled:S,max:Ce,min:Oe,step:Ke,name:Xe,title:ve,id:re,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(rt),pattern:Ue,inputMode:Le,onInput:tt},_e))))}}]),ce}(j.a.Component);ke.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:de,required:!1,autoComplete:"off"};var Te=ke,Ne=Qe.a=Te},f4xo:function(ot,Qe,k){var U=k("nVVt");function se(ie){this.mode=U.MODE_8BIT_BYTE,this.data=ie}se.prototype={getLength:function(ie){return this.data.length},write:function(ie){for(var xe=0;xe<this.data.length;xe++)ie.put(this.data.charCodeAt(xe),8)}},ot.exports=se},gkVt:function(ot,Qe,k){"use strict";k.r(Qe);var U=k("DZo9"),se=k("8z0m"),ie=k("+L6B"),xe=k("2/Rp"),fe=k("miYZ"),z=k("tsqr"),T=k("9og8"),M=k("tJVT"),j=k("WmNS"),L=k.n(j),_=k("q1tI"),E=k.n(_),te=k("5NDa"),$=k("5rEg"),H=k("Ot1p"),X=k("ErOA");function J(be){var O=be.setIscreate,ce=be.init,ne=be.UpdateItem,w=Object(_.useState)(""),B=Object(M.a)(w,2),P=B[0],S=B[1],D=Object(_.useState)(""),p=Object(M.a)(D,2),d=p[0],C=p[1];Object(_.useEffect)(function(){if(!ne)return;S(ne&&ne.name),C(ne&&ne.description)},[ne]);function F(){return Q.apply(this,arguments)}function Q(){return Q=Object(T.a)(L.a.mark(function me(){var ve;return L.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:if(P){ue.next=3;break}return z.b.info("\u6807\u9898\u4E0D\u80FD\u4E3A\u7A7A"),ue.abrupt("return");case 3:if(d){ue.next=6;break}return z.b.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A"),ue.abrupt("return");case 6:if(!ne){ue.next=9;break}return Ce(),ue.abrupt("return");case 9:return ue.next=11,Object(X.a)("/api/hpc_courses.json",{method:"post",body:{name:P,description:d,container_type:window.location.pathname.split("/")[1]}});case 11:ve=ue.sent,ve&&(z.b.info("\u521B\u5EFA\u6210\u529F"),O(!1),ce("add"));case 13:case"end":return ue.stop()}},me)})),Q.apply(this,arguments)}function Ce(){return Oe.apply(this,arguments)}function Oe(){return Oe=Object(T.a)(L.a.mark(function me(){var ve;return L.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:return ue.next=2,Object(X.a)("/api/hpc_courses/".concat(ne.id,".json"),{method:"put",body:{name:P,description:d,container_type:window.location.pathname.split("/")[1]}});case 2:ve=ue.sent,ve&&(z.b.info("\u7F16\u8F91\u6210\u529F"),O(!1),ce(""));case 4:case"end":return ue.stop()}},me)})),Oe.apply(this,arguments)}return E.a.createElement("div",null,E.a.createElement($.a,{style:{marginBottom:"20px"},placeholder:"\u8BF7\u8F93\u5165\u6807\u9898",value:P,maxLength:60,addonAfter:String(P.length)+"/60",onChange:function(ve){return S(ve.target.value)}}),E.a.createElement(H.a,{id:"courseContentMD",defaultValue:d,onChange:function(ve){return C(ve)}}),E.a.createElement("div",{className:"clearfix mt30 mb30"},E.a.createElement(xe.a,{type:"primary",onClick:function(){return F()},className:"defalutSubmitbtn fl mr20"},"\u63D0\u4EA4"),E.a.createElement("a",{className:"defalutCancelbtn fl",onClick:function(){return O(!1)}},"\u53D6\u6D88")))}var ae=J,de=k("9Bee");function Be(be){var O=be.CourseItem,ce=be.userId,ne=be.init,w=be.ItemUpdate,B=be.setSee,P=be.UserInfo;function S(){return D.apply(this,arguments)}function D(){return D=Object(T.a)(L.a.mark(function d(){var C;return L.a.wrap(function(Q){for(;;)switch(Q.prev=Q.next){case 0:return Q.next=2,Object(X.a)("/api/hpc_courses/".concat(O.id,".json"),{method:"delete"});case 2:C=Q.sent,C&&(z.b.info("\u5220\u9664\u6210\u529F"),ne("delete"),B(!1));case 4:case"end":return Q.stop()}},d)})),D.apply(this,arguments)}function p(){w(O)}return E.a.createElement("div",null,ce===299635||ce===301458||P!=null&&P.admin||P!=null&&P.business?E.a.createElement("div",{style:{textAlign:"right"}},E.a.createElement(xe.a,{onClick:function(){return p()}},"\u7F16\u8F91"),E.a.createElement(xe.a,{onClick:function(){return S()},style:{marginLeft:"30px"}},"\u5220\u9664")):null,E.a.createElement("h1",null,O==null?void 0:O.name),E.a.createElement(de.a,{value:O==null?void 0:O.description}))}var $e=Be,Se=k("9ivq"),De=k("m3rI"),Ve=k("Ty5D"),ke=k("9kvl");function Te(be){var O,ce,ne,w,B,P,S,D,p,d=be.user,C=be.dispatch,F=Object(_.useState)(1),Q=Object(M.a)(F,2),Ce=Q[0],Oe=Q[1],me=Object(_.useState)(100),ve=Object(M.a)(me,2),ge=ve[0],ue=ve[1],q=Object(_.useState)([]),W=Object(M.a)(q,2),b=W[0],V=W[1],R=Object(_.useState)(!1),ye=Object(M.a)(R,2),Ee=ye[0],re=ye[1],Le=Object(_.useState)(!1),Ue=Object(M.a)(Le,2),Ke=Ue[0],Fe=Ue[1],Ie=Object(_.useState)(""),Xe=Object(M.a)(Ie,2),mt=Xe[0],tt=Xe[1],it=Object(_.useState)(""),et=Object(M.a)(it,2),gt=et[0],lt=et[1],at=Object(_.useState)(""),_e=Object(M.a)(at,2),vt=_e[0],rt=_e[1],Re=Object(Ve.i)(),ze=Re.itemname,ee=Object(_.useState)(""),Y=Object(M.a)(ee,2),Z=Y[0],y=Y[1];Object(_.useEffect)(function(){C({type:"globalSetting/headerToggle",payload:!1}),Ce&&x("")},[Ce]);function x(st){return A.apply(this,arguments)}function A(){return A=Object(T.a)(L.a.mark(function st(Ct){var Ae,bt,dt,qe,_t;return L.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return At.next=2,Object(X.a)("/api/hpc_courses.json",{method:"get",params:{page:Ce,per_page:ge,container_type:window.location.pathname.split("/")[1]}});case 2:if(Ae=At.sent,!Ae){At.next=24;break}if(bt=Ae.data.hpc_courses.length,V(Ae.data.hpc_courses),rt(Ae.data.file_url),lt(""),bt){At.next=10;break}return At.abrupt("return");case 10:if(Z){At.next=14;break}ze?(_t=0,Ae==null||((dt=Ae.data)===null||dt===void 0||((qe=dt.hpc_courses)===null||qe===void 0))||qe.map(function(Mt,Tt){var tn;(ze==null?void 0:ze.toLocaleLowerCase())===(Mt==null||((tn=Mt.name)===null||tn===void 0)?void 0:tn.toLocaleLowerCase())&&(_t=Tt)}),tt(Ae.data.hpc_courses[_t]),Fe(!0),y(Ae.data.hpc_courses[_t].id),(ze==null?void 0:ze.toLocaleLowerCase())==="resources"&&(tt(Ae.data.hpc_courses.filter(function(Mt){return Mt.id===15})[0]),Fe(!0),y(15))):(tt(Ae.data.hpc_courses[0]),Fe(!0),y(Ae.data.hpc_courses[0].id)),At.next=24;break;case 14:if(!(Ct==="delete")){At.next=23;break}if(!(bt===0)){At.next=18;break}return Fe(!1),At.abrupt("return");case 18:tt(Ae.data.hpc_courses[0]),Fe(!0),y(Ae.data.hpc_courses[0].id),At.next=24;break;case 23:Ct==="add"?(tt(Ae.data.hpc_courses[bt-1]),Fe(!0),y(Ae.data.hpc_courses[bt-1].id)):(tt(Ae.data.hpc_courses.filter(function(Mt){return Mt.id===Z})[0]),Fe(!0),y(Z));case 24:case"end":return At.stop()}},st)})),A.apply(this,arguments)}function N(st){re(!1),Fe(!0),tt(st),y(st.id)}function le(st){lt(st),re(!0),Fe(!1)}function we(){lt(""),re(!0),Fe(!1)}var Ge={name:"file",multiple:!0,action:"https://www.educoder.net/api/hpc_courses/upload_file.json",data:{container_type:window.location.pathname.split("/")[1]},onChange:function(Ct){var Ae=Ct.file.status;Ae!=="uploading",Ae==="done"?(z.b.success("".concat(Ct.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F")),x("")):Ae==="error"&&z.b.error("".concat(Ct.file.name," \u6587\u4EF6\u4E0A\u4F20\u5931\u8D25"))},beforeUpload:function(Ct){var Ae=Ct.size/1024/1024<150;return Ae||z.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E150MB"),Ae}};return E.a.createElement("div",{style:{marginBottom:"40px"}},E.a.createElement("div",{className:"bannterdiv",style:{background:"url(".concat(De.a.IMG_SERVER+"/".concat(vt),")")}}),E.a.createElement("img",{style:{width:"100%"},src:De.a.IMG_SERVER+"/".concat(vt)}),E.a.createElement("div",{className:"edu-container minH500",style:{display:"flex",width:"1200px"}},E.a.createElement("div",{style:{flex:"1",marginTop:"17px"}},b&&b.map(function(st,Ct){return E.a.createElement("p",{key:Ct,onClick:function(){return N(st)},className:Z===st.id?"menuitemselect":"menuitem task-hide"},st.name)}),(d==null||((O=d.userInfo)===null||O===void 0)?void 0:O.user_id)===299635||(d==null||((ce=d.userInfo)===null||ce===void 0)?void 0:ce.user_id)===301458||d!=null&&(ne=d.userInfo)!==null&&ne!==void 0&&ne.admin||d!=null&&(w=d.userInfo)!==null&&w!==void 0&&w.business?E.a.createElement("p",{onClick:function(){return we()},className:"menuadd",style:{fontSize:"24px",paddingLeft:"10px"}},E.a.createElement("span",{style:{fontSize:"16px",marginLeft:"5px"}},"Last updated")):null),E.a.createElement("div",{className:"rightcount",style:{flex:"6",background:"#ffffff",padding:"20px",marginLeft:"30px",marginTop:"24px"}},Ee?E.a.createElement(ae,{UpdateItem:gt,setIscreate:re,init:x}):null,Ke?E.a.createElement($e,{UserInfo:d==null?void 0:d.userInfo,setSee:Fe,userId:d==null||((B=d.userInfo)===null||B===void 0)?void 0:B.user_id,ItemUpdate:le,CourseItem:mt,init:x}):null)),(d==null||((P=d.userInfo)===null||P===void 0)?void 0:P.user_id)===299635||(d==null||((S=d.userInfo)===null||S===void 0)?void 0:S.user_id)===301458||d!=null&&(D=d.userInfo)!==null&&D!==void 0&&D.admin||d!=null&&(p=d.userInfo)!==null&&p!==void 0&&p.business?E.a.createElement(se.a,Ge,E.a.createElement(xe.a,{className:"menuadd",style:{paddingLeft:"10px",marginLeft:"20px"}},"\u4E0A\u4F20\u9996\u9875\u56FE\u7247")):null)}var Ne=Qe.default=Object(ke.a)(function(be){var O=be.user;return{user:O}})(Te)},h78n:function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return w});var U=k("q1tI"),se=k.n(U),ie=k("TSYQ"),xe=k.n(ie),fe={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},z=function(S){var D=S.map(function(){return Object(U.useRef)()}),p=Object(U.useRef)();return Object(U.useEffect)(function(){var d=Date.now(),C=!1;Object.keys(D).forEach(function(F){var Q=D[F].current;if(!Q)return;C=!0;var Ce=Q.style;Ce.transitionDuration=".3s, .3s, .3s, .06s",p.current&&d-p.current<100&&(Ce.transitionDuration="0s, 0s")}),C&&(p.current=Date.now())}),[D]};function T(){return T=Object.assign||function(P){for(var S=1;S<arguments.length;S++){var D=arguments[S];for(var p in D)Object.prototype.hasOwnProperty.call(D,p)&&(P[p]=D[p])}return P},T.apply(this,arguments)}function M(P,S){return te(P)||E(P,S)||L(P,S)||j()}function j(){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 L(P,S){if(!P)return;if(typeof P=="string")return _(P,S);var D=Object.prototype.toString.call(P).slice(8,-1);if(D==="Object"&&P.constructor&&(D=P.constructor.name),D==="Map"||D==="Set")return Array.from(P);if(D==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D))return _(P,S)}function _(P,S){(S==null||S>P.length)&&(S=P.length);for(var D=0,p=new Array(S);D<S;D++)p[D]=P[D];return p}function E(P,S){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(P)))return;var D=[],p=!0,d=!1,C=void 0;try{for(var F=P[Symbol.iterator](),Q;!(p=(Q=F.next()).done)&&!(D.push(Q.value),S&&D.length===S);p=!0);}catch(Ce){d=!0,C=Ce}finally{try{!p&&F.return!=null&&F.return()}finally{if(d)throw C}}return D}function te(P){if(Array.isArray(P))return P}function $(P,S){if(P==null)return{};var D=H(P,S),p,d;if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(P);for(d=0;d<C.length;d++){if(p=C[d],S.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(P,p))continue;D[p]=P[p]}}return D}function H(P,S){if(P==null)return{};var D={},p=Object.keys(P),d,C;for(C=0;C<p.length;C++){if(d=p[C],S.indexOf(d)>=0)continue;D[d]=P[d]}return D}var X=function(S){var D=S.className,p=S.percent,d=S.prefixCls,C=S.strokeColor,F=S.strokeLinecap,Q=S.strokeWidth,Ce=S.style,Oe=S.trailColor,me=S.trailWidth,ve=S.transition,ge=$(S,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ge.gapPosition;var ue=Array.isArray(p)?p:[p],q=Array.isArray(C)?C:[C],W=z(ue),b=M(W,1),V=b[0],R=Q/2,ye=100-Q/2,Ee="M ".concat(F==="round"?R:0,",").concat(R,`
L `).concat(F==="round"?ye:100,",").concat(R),re="0 0 100 ".concat(Q),Le=0;return se.a.createElement("svg",T({className:xe()("".concat(d,"-line"),D),viewBox:re,preserveAspectRatio:"none",style:Ce},ge),se.a.createElement("path",{className:"".concat(d,"-line-trail"),d:Ee,strokeLinecap:F,stroke:Oe,strokeWidth:me||Q,fillOpacity:"0"}),ue.map(function(Ue,Ke){var Fe={strokeDasharray:"".concat(Ue,"px, 100px"),strokeDashoffset:"-".concat(Le,"px"),transition:ve||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ie=q[Ke]||q[q.length-1];return Le+=Ue,se.a.createElement("path",{key:Ke,className:"".concat(d,"-line-path"),d:Ee,strokeLinecap:F,stroke:Ie,strokeWidth:Q,fillOpacity:"0",ref:V[Ke],style:Fe})}))};X.defaultProps=fe;var J=X;function ae(){return ae=Object.assign||function(P){for(var S=1;S<arguments.length;S++){var D=arguments[S];for(var p in D)Object.prototype.hasOwnProperty.call(D,p)&&(P[p]=D[p])}return P},ae.apply(this,arguments)}function de(P,S){return Ve(P)||De(P,S)||$e(P,S)||Be()}function Be(){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 $e(P,S){if(!P)return;if(typeof P=="string")return Se(P,S);var D=Object.prototype.toString.call(P).slice(8,-1);if(D==="Object"&&P.constructor&&(D=P.constructor.name),D==="Map"||D==="Set")return Array.from(P);if(D==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(D))return Se(P,S)}function Se(P,S){(S==null||S>P.length)&&(S=P.length);for(var D=0,p=new Array(S);D<S;D++)p[D]=P[D];return p}function De(P,S){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(P)))return;var D=[],p=!0,d=!1,C=void 0;try{for(var F=P[Symbol.iterator](),Q;!(p=(Q=F.next()).done)&&!(D.push(Q.value),S&&D.length===S);p=!0);}catch(Ce){d=!0,C=Ce}finally{try{!p&&F.return!=null&&F.return()}finally{if(d)throw C}}return D}function Ve(P){if(Array.isArray(P))return P}function ke(P,S){if(P==null)return{};var D=Te(P,S),p,d;if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(P);for(d=0;d<C.length;d++){if(p=C[d],S.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(P,p))continue;D[p]=P[p]}}return D}function Te(P,S){if(P==null)return{};var D={},p=Object.keys(P),d,C;for(C=0;C<p.length;C++){if(d=p[C],S.indexOf(d)>=0)continue;D[d]=P[d]}return D}var Ne=0;function be(P){return+P.replace("%","")}function O(P){return Array.isArray(P)?P:[P]}function ce(P,S,D,p){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,C=arguments.length>5?arguments[5]:void 0,F=50-p/2,Q=0,Ce=-F,Oe=0,me=-2*F;switch(C){case"left":Q=-F,Ce=0,Oe=2*F,me=0;break;case"right":Q=F,Ce=0,Oe=-2*F,me=0;break;case"bottom":Ce=F,me=2*F;break;default:}var ve="M 50,50 m ".concat(Q,",").concat(Ce,`
a `).concat(F,",").concat(F," 0 1 1 ").concat(Oe,",").concat(-me,`
a `).concat(F,",").concat(F," 0 1 1 ").concat(-Oe,",").concat(me),ge=Math.PI*2*F,ue={stroke:D,strokeDasharray:"".concat(S/100*(ge-d),"px ").concat(ge,"px"),strokeDashoffset:"-".concat(d/2+P/100*(ge-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ve,pathStyle:ue}}var ne=function(S){var D=S.prefixCls,p=S.strokeWidth,d=S.trailWidth,C=S.gapDegree,F=S.gapPosition,Q=S.trailColor,Ce=S.strokeLinecap,Oe=S.style,me=S.className,ve=S.strokeColor,ge=S.percent,ue=ke(S,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),q=Object(U.useMemo)(function(){return Ne+=1,Ne},[]),W=ce(0,100,Q,p,C,F),b=W.pathString,V=W.pathStyle,R=O(ge),ye=O(ve),Ee=ye.find(function(Fe){return Object.prototype.toString.call(Fe)==="[object Object]"}),re=z(R),Le=de(re,1),Ue=Le[0],Ke=function(){var Ie=0;return R.map(function(Xe,mt){var tt=ye[mt]||ye[ye.length-1],it=Object.prototype.toString.call(tt)==="[object Object]"?"url(#".concat(D,"-gradient-").concat(q,")"):"",et=ce(Ie,Xe,tt,p,C,F);return Ie+=Xe,se.a.createElement("path",{key:mt,className:"".concat(D,"-circle-path"),d:et.pathString,stroke:it,strokeLinecap:Ce,strokeWidth:p,opacity:Xe===0?0:1,fillOpacity:"0",style:et.pathStyle,ref:Ue[mt]})})};return se.a.createElement("svg",ae({className:xe()("".concat(D,"-circle"),me),viewBox:"0 0 100 100",style:Oe},ue),Ee&&se.a.createElement("defs",null,se.a.createElement("linearGradient",{id:"".concat(D,"-gradient-").concat(q),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ee).sort(function(Fe,Ie){return be(Fe)-be(Ie)}).map(function(Fe,Ie){return se.a.createElement("stop",{key:Ie,offset:Fe,stopColor:Ee[Fe]})}))),se.a.createElement("path",{className:"".concat(D,"-circle-trail"),d:b,stroke:Q,strokeLinecap:Ce,strokeWidth:d||p,fillOpacity:"0",style:V}),Ke().reverse())};ne.defaultProps=fe;var w=ne,B={Line:J,Circle:w}},kSUc:function(ot,Qe,k){},lZu9:function(ot,Qe,k){(function(U){U(k("VrN/"),k("1eCo"),k("8EBN"))})(function(U){"use strict";U.defineMode("markdown",function(se,ie){var xe=U.getMode(se,"text/html"),fe=xe.name=="null";function z(p){if(U.findModeByName){var d=U.findModeByName(p);d&&(p=d.mime||d.mimes[0])}var C=U.getMode(se,p);return C.name=="null"?null:C}ie.highlightFormatting===void 0&&(ie.highlightFormatting=!1),ie.maxBlockquoteDepth===void 0&&(ie.maxBlockquoteDepth=0),ie.taskLists===void 0&&(ie.taskLists=!1),ie.strikethrough===void 0&&(ie.strikethrough=!1),ie.emoji===void 0&&(ie.emoji=!1),ie.fencedCodeBlockHighlighting===void 0&&(ie.fencedCodeBlockHighlighting=!0),ie.fencedCodeBlockDefaultMode===void 0&&(ie.fencedCodeBlockDefaultMode="text/plain"),ie.xml===void 0&&(ie.xml=!0),ie.tokenTypeOverrides===void 0&&(ie.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)&&ie.tokenTypeOverrides[M]&&(T[M]=ie.tokenTypeOverrides[M]);var j=/^([*\-_])(?:\s*\1){2,}\s*$/,L=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,_=/^\[(x| )\](?=\s)/i,E=ie.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,te=/^ {0,3}(?:\={1,}|-{2,})\s*$/,$=/^[^#!\[\]*_\\<>` "'(~:]+/,H=/^(~~~+|```+)[ \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]/,ae=" ";function de(p,d,C){return d.f=d.inline=C,C(p,d)}function Be(p,d,C){return d.f=d.block=C,C(p,d)}function $e(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==Ve){var d=fe;if(!d){var C=U.innerMode(xe,p.htmlState);d=C.mode.name=="xml"&&C.state.tagStart===null&&!C.state.context&&C.state.tokenize.isInText}d&&(p.f=be,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 C=p.column()===d.indentation,F=$e(d.prevLine.stream),Q=d.indentedCode,Ce=d.prevLine.hr,Oe=d.list!==!1,me=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var ve=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Oe)){for(d.list=null;ve<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=ve-d.listStack[d.listStack.length-1])}var ge=!F&&!Ce&&!d.prevLine.header&&(!Oe||!Q)&&!d.prevLine.fencedCodeEnd,ue=(d.list===!1||Ce||F)&&d.indentation<=me&&p.match(j),q=null;if(d.indentationDiff>=4&&(Q||d.prevLine.fencedCodeEnd||d.prevLine.header||F))return p.skipToEnd(),d.indentedCode=!0,T.code;if(p.eatSpace())return null;if(C&&d.indentation<=me&&(q=p.match(E))&&q[1].length<=6)return d.quote=0,d.header=q[1].length,d.thisLine.header=!0,ie.highlightFormatting&&(d.formatting="header"),d.f=d.inline,Te(d);if(d.indentation<=me&&p.eat(">"))return d.quote=C?1:d.quote+1,ie.highlightFormatting&&(d.formatting="quote"),p.eatSpace(),Te(d);if(!ue&&!d.setext&&C&&d.indentation<=me&&(q=p.match(L))){var W=q[1]?"ol":"ul";return d.indentation=ve+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,ie.taskLists&&p.match(_,!1)&&(d.taskList=!0),d.f=d.inline,ie.highlightFormatting&&(d.formatting=["list","list-"+W]),Te(d)}else{if(C&&d.indentation<=me&&(q=p.match(H,!0)))return d.quote=0,d.fencedEndRE=new RegExp(q[1]+"+ *$"),d.localMode=ie.fencedCodeBlockHighlighting&&z(q[2]||ie.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=U.startState(d.localMode)),d.f=d.block=ke,ie.highlightFormatting&&(d.formatting="code-block"),d.code=-1,Te(d);if(d.setext||(!ge||!Oe)&&!d.quote&&d.list===!1&&!d.code&&!ue&&!X.test(p.string)&&(q=p.lookAhead(1))&&(q=q.match(te)))return d.setext?(d.header=d.setext,d.setext=0,p.skipToEnd(),ie.highlightFormatting&&(d.formatting="header")):(d.header=q[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,Te(d);if(ue)return p.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,T.hr;if(p.peek()==="[")return de(p,d,B)}return de(p,d,d.inline)}function Ve(p,d){var C=xe.token(p,d.htmlState);if(!fe){var F=U.innerMode(xe,d.htmlState);(F.mode.name=="xml"&&F.state.tagStart===null&&!F.state.context&&F.state.tokenize.isInText||d.md_inside&&p.current().indexOf(">")>-1)&&(d.f=be,d.block=De,d.htmlState=null)}return C}function ke(p,d){var C=d.listStack[d.listStack.length-1]||0,F=d.indentation<C,Q=C+3;if(d.fencedEndRE&&d.indentation<=Q&&(F||p.match(d.fencedEndRE))){ie.highlightFormatting&&(d.formatting="code-block");var Ce;return F||(Ce=Te(d)),d.localMode=d.localState=null,d.block=De,d.f=be,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,F?Be(p,d,d.block):Ce}else return d.localMode?d.localMode.token(p,d.localState):(p.skipToEnd(),T.code)}function Te(p){var d=[];if(p.formatting){d.push(T.formatting),typeof p.formatting=="string"&&(p.formatting=[p.formatting]);for(var C=0;C<p.formatting.length;C++)d.push(T.formatting+"-"+p.formatting[C]),p.formatting[C]==="header"&&d.push(T.formatting+"-"+p.formatting[C]+"-"+p.header),p.formatting[C]==="quote"&&(!ie.maxBlockquoteDepth||ie.maxBlockquoteDepth>=p.quote?d.push(T.formatting+"-"+p.formatting[C]+"-"+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),!ie.maxBlockquoteDepth||ie.maxBlockquoteDepth>=p.quote?d.push(T.quote+"-"+p.quote):d.push(T.quote+"-"+ie.maxBlockquoteDepth)),p.list!==!1){var F=(p.listStack.length-1)%3;F?F===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 Ne(p,d){return p.match($,!0)?Te(d):void 0}function be(p,d){var C=d.text(p,d);if(typeof C!="undefined")return C;if(d.list)return d.list=null,Te(d);if(d.taskList){var F=p.match(_,!0)[1]===" ";return F?d.taskOpen=!0:d.taskClosed=!0,ie.highlightFormatting&&(d.formatting="task"),d.taskList=!1,Te(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&p.match(/^#+$/,!0))return ie.highlightFormatting&&(d.formatting="header"),Te(d);var Q=p.next();if(d.linkTitle){d.linkTitle=!1;var Ce=Q;Q==="("&&(Ce=")"),Ce=(Ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+Ce+"\\\\]+|\\\\\\\\|\\\\.)"+Ce;if(p.match(new RegExp(Oe),!0))return T.linkHref}if(Q==="`"){var me=d.formatting;ie.highlightFormatting&&(d.formatting="code"),p.eatWhile("`");var ve=p.current().length;if(d.code==0&&(!d.quote||ve==1))return d.code=ve,Te(d);if(ve==d.code){var ge=Te(d);return d.code=0,ge}else return d.formatting=me,Te(d)}else if(d.code)return Te(d);if(Q==="\\"&&(p.next(),ie.highlightFormatting)){var ue=Te(d),q=T.formatting+"-escape";return ue?ue+" "+q:q}if(Q==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,ie.highlightFormatting&&(d.formatting="image"),Te(d);if(Q==="["&&d.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,ie.highlightFormatting&&(d.formatting="image"),Te(d);if(Q==="]"&&d.imageAltText){ie.highlightFormatting&&(d.formatting="image");var ue=Te(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=ce,ue}if(Q==="["&&!d.image)return d.linkText&&p.match(/^.*?\]/)||(d.linkText=!0,ie.highlightFormatting&&(d.formatting="link")),Te(d);if(Q==="]"&&d.linkText){ie.highlightFormatting&&(d.formatting="link");var ue=Te(d);return d.linkText=!1,d.inline=d.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?ce:be,ue}if(Q==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=O,ie.highlightFormatting&&(d.formatting="link");var ue=Te(d);return ue?ue+=" ":ue="",ue+T.linkInline}if(Q==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=O,ie.highlightFormatting&&(d.formatting="link");var ue=Te(d);return ue?ue+=" ":ue="",ue+T.linkEmail}if(ie.xml&&Q==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var W=p.string.indexOf(">",p.pos);if(W!=-1){var b=p.string.substring(p.start,W);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(d.md_inside=!0)}return p.backUp(1),d.htmlState=U.startState(xe),Be(p,d,Ve)}if(ie.xml&&Q==="<"&&p.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(Q==="*"||Q==="_"){for(var V=1,R=p.pos==1?" ":p.string.charAt(p.pos-2);V<3&&p.eat(Q);)V++;var ye=p.peek()||" ",Ee=!/\s/.test(ye)&&(!J.test(ye)||/\s/.test(R)||J.test(R)),re=!/\s/.test(R)&&(!J.test(R)||/\s/.test(ye)||J.test(ye)),Le=null,Ue=null;if(V%2&&(!d.em&&Ee&&(Q==="*"||!re||J.test(R))?Le=!0:d.em==Q&&re&&(Q==="*"||!Ee||J.test(ye))&&(Le=!1)),V>1&&(!d.strong&&Ee&&(Q==="*"||!re||J.test(R))?Ue=!0:d.strong==Q&&re&&(Q==="*"||!Ee||J.test(ye))&&(Ue=!1)),Ue!=null||Le!=null){ie.highlightFormatting&&(d.formatting=Le==null?"strong":Ue==null?"em":"strong em"),Le===!0&&(d.em=Q),Ue===!0&&(d.strong=Q);var ge=Te(d);return Le===!1&&(d.em=!1),Ue===!1&&(d.strong=!1),ge}}else if(Q===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return Te(d);p.backUp(1)}if(ie.strikethrough){if(Q==="~"&&p.eatWhile(Q)){if(d.strikethrough){ie.highlightFormatting&&(d.formatting="strikethrough");var ge=Te(d);return d.strikethrough=!1,ge}else if(p.match(/^[^\s]/,!1))return d.strikethrough=!0,ie.highlightFormatting&&(d.formatting="strikethrough"),Te(d)}else if(Q===" "&&p.match(/^~~/,!0)){if(p.peek()===" ")return Te(d);p.backUp(2)}}if(ie.emoji&&Q===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,ie.highlightFormatting&&(d.formatting="emoji");var Ke=Te(d);return d.emoji=!1,Ke}return Q===" "&&(p.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),Te(d)}function O(p,d){var C=p.next();if(C===">"){d.f=d.inline=be,ie.highlightFormatting&&(d.formatting="link");var F=Te(d);return F?F+=" ":F="",F+T.linkInline}return p.match(/^[^>]+/,!0),T.linkInline}function ce(p,d){if(p.eatSpace())return null;var C=p.next();return C==="("||C==="["?(d.f=d.inline=w(C==="("?")":"]"),ie.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,Te(d)):"error"}var ne={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function w(p){return function(d,C){var F=d.next();if(F===p){C.f=C.inline=be,ie.highlightFormatting&&(C.formatting="link-string");var Q=Te(C);return C.linkHref=!1,Q}return d.match(ne[p]),C.linkHref=!0,Te(C)}}function B(p,d){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=P,p.next(),ie.highlightFormatting&&(d.formatting="link"),d.linkText=!0,Te(d)):de(p,d,be)}function P(p,d){if(p.match(/^\]:/,!0)){d.f=d.inline=S,ie.highlightFormatting&&(d.formatting="link");var C=Te(d);return d.linkText=!1,C}return p.match(/^([^\]\\]|\\.)+/,!0),T.linkText}function S(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=be,T.linkHref+" url")}var D={startState:function(){return{f:De,prevLine:{stream:null},thisLine:{stream:null},block:De,htmlState:null,indentation:0,inline:be,text:Ne,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&&U.copyState(xe,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?U.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!=Ve)){var C=p.match(/^\s*/,!0)[0].replace(/\t/g,ae).length;if(d.indentation=C,d.indentationDiff=null,C>0)return null}}return d.f(p,d)},innerMode:function(p){return p.block==Ve?{state:p.htmlState,mode:xe}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:D}},indent:function(p,d,C){return p.block==Ve&&xe.indent?xe.indent(p.htmlState,d,C):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,d,C):U.Pass},blankLine:Se,getType:Te,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return D},"xml"),U.defineMIME("text/markdown","markdown"),U.defineMIME("text/x-markdown","markdown")})},nVVt:function(ot,Qe){ot.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(ot,Qe,k){(function(U){U(k("VrN/"))})(function(U){"use strict";var se=U.Pos;function ie(J,ae){return J.line-ae.line||J.ch-ae.ch}var xe="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",fe=xe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",z=new RegExp("<(/?)(["+xe+"]["+fe+"]*)","g");function T(J,ae,de,Be){this.line=ae,this.ch=de,this.cm=J,this.text=J.getLine(ae),this.min=Be?Math.max(Be.from,J.firstLine()):J.firstLine(),this.max=Be?Math.min(Be.to-1,J.lastLine()):J.lastLine()}function M(J,ae){var de=J.cm.getTokenTypeAt(se(J.line,ae));return de&&/\btag\b/.test(de)}function j(J){return J.line>=J.max?void 0:(J.ch=0,J.text=J.cm.getLine(++J.line),!0)}function L(J){return J.line<=J.min?void 0:(J.text=J.cm.getLine(--J.line),J.ch=J.text.length,!0)}function _(J){for(;;){var ae=J.text.indexOf(">",J.ch);if(ae==-1){if(j(J))continue;return}if(!M(J,ae+1)){J.ch=ae+1;continue}var de=J.text.lastIndexOf("/",ae),Be=de>-1&&!/\S/.test(J.text.slice(de+1,ae));return J.ch=ae+1,Be?"selfClose":"regular"}}function E(J){for(;;){var ae=J.ch?J.text.lastIndexOf("<",J.ch-1):-1;if(ae==-1){if(L(J))continue;return}if(!M(J,ae+1)){J.ch=ae;continue}z.lastIndex=ae,J.ch=ae;var de=z.exec(J.text);if(de&&de.index==ae)return de}}function te(J){for(;;){z.lastIndex=J.ch;var ae=z.exec(J.text);if(!ae){if(j(J))continue;return}if(!M(J,ae.index+1)){J.ch=ae.index+1;continue}return J.ch=ae.index+ae[0].length,ae}}function $(J){for(;;){var ae=J.ch?J.text.lastIndexOf(">",J.ch-1):-1;if(ae==-1){if(L(J))continue;return}if(!M(J,ae+1)){J.ch=ae;continue}var de=J.text.lastIndexOf("/",ae),Be=de>-1&&!/\S/.test(J.text.slice(de+1,ae));return J.ch=ae+1,Be?"selfClose":"regular"}}function H(J,ae){for(var de=[];;){var Be=te(J),$e,Se=J.line,De=J.ch-(Be?Be[0].length:0);if(!Be||!($e=_(J)))return;if($e=="selfClose")continue;if(Be[1]){for(var Ve=de.length-1;Ve>=0;--Ve)if(de[Ve]==Be[2]){de.length=Ve;break}if(Ve<0&&(!ae||ae==Be[2]))return{tag:Be[2],from:se(Se,De),to:se(J.line,J.ch)}}else de.push(Be[2])}}function X(J,ae){for(var de=[];;){var Be=$(J);if(!Be)return;if(Be=="selfClose"){E(J);continue}var $e=J.line,Se=J.ch,De=E(J);if(!De)return;if(De[1])de.push(De[2]);else{for(var Ve=de.length-1;Ve>=0;--Ve)if(de[Ve]==De[2]){de.length=Ve;break}if(Ve<0&&(!ae||ae==De[2]))return{tag:De[2],from:se(J.line,J.ch),to:se($e,Se)}}}}U.registerHelper("fold","xml",function(J,ae){for(var de=new T(J,ae.line,0);;){var Be=te(de);if(!Be||de.line!=ae.line)return;var $e=_(de);if(!$e)return;if(!Be[1]&&$e!="selfClose"){var Se=se(de.line,de.ch),De=H(de,Be[2]);return De&&ie(De.from,Se)>0?{from:Se,to:De.from}:null}}}),U.findMatchingTag=function(J,ae,de){var Be=new T(J,ae.line,ae.ch,de);if(Be.text.indexOf(">")==-1&&Be.text.indexOf("<")==-1)return;var $e=_(Be),Se=$e&&se(Be.line,Be.ch),De=$e&&E(Be);if(!$e||!De||ie(Be,ae)>0)return;var Ve={from:se(Be.line,Be.ch),to:Se,tag:De[2]};return $e=="selfClose"?{open:Ve,close:null,at:"open"}:De[1]?{open:X(Be,De[2]),close:Ve,at:"close"}:(Be=new T(J,Se.line,Se.ch,de),{open:Ve,close:H(Be,De[2]),at:"open"})},U.findEnclosingTag=function(J,ae,de,Be){for(var $e=new T(J,ae.line,ae.ch,de);;){var Se=X($e,Be);if(!Se)break;var De=new T(J,ae.line,ae.ch,de),Ve=H(De,Se.tag);if(Ve)return{open:Se,close:Ve}}},U.scanForClosingTag=function(J,ae,de,Be){var $e=new T(J,ae.line,ae.ch,Be?{from:0,to:Be}:null);return H($e,de)}})},p5ED:function(ot,Qe,k){"use strict";var U=k("+L6B"),se=k("2/Rp"),ie=k("5Dmo"),xe=k("3S7+"),fe=k("k1fw"),z=k("tJVT"),T=k("q1tI"),M=k.n(T),j=k("vHTk"),L=k.n(j),_=k("yEEn"),E=k("ZW9T"),te=k("1vsH");Qe.a=function($){var H=$.name,X=$.data,J=$.theme,ae=$.type,de=$.filename,Be=$.monacoEditor,$e=$.className,Se=$.style,De=$.close,Ve=$.onClose,ke=$.hasMask,Te=Object(T.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Ne=Object(z.a)(Te,2),be=Ne[0],O=Ne[1],ce=Object(T.useState)(""),ne=Object(z.a)(ce,2),w=ne[0],B=ne[1],P=Object(T.useRef)();de&&(Be.filename=de),Object(T.useEffect)(function(){var p,d,C=(p=document.cookie)===null||p===void 0||((d=p.replace(/\s/g,""))===null||d===void 0)?void 0:d.split(";");C==null||C.map(function(F){var Q=F.split("=");Q[0]==="_educoder_session"&&B(Q[1])})},[]);var S=function(){if(X.startsWith("http")||X.startsWith("/")){D();return}Object(te.x)(de||"educoder",X,de)},D=function(){Object(te.v)(de||H,X)};return console.log("data:",X,"fileanme:",de," name:",H),M.a.createElement("div",{style:Object(fe.a)({},Se||{}),className:"".concat(ke&&L.a.bgBlack," ").concat(ae?L.a.wrp:"hide")},De&&M.a.createElement("div",{className:L.a.close,ref:P},M.a.createElement(xe.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return P.current}},M.a.createElement("span",{onClick:D},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(xe.a,{title:"\u5173\u95ED",getPopupContainer:function(){return P.current}},M.a.createElement("span",{className:"",onClick:Ve},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(L.a[$e]," ").concat($e," ").concat(L.a.monaco," ").concat(ae==="txt"?"show":"hide")},ae==="txt"&&M.a.createElement(E.b,Be)),ae==="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}),ae==="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})),ae==="html"&&M.a.createElement("iframe",{src:X+"&disposition=inline"}),ae==="pdf"&&M.a.createElement("embed",{className:L.a.embed,src:X}),ae==="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)})),ae==="other"&&M.a.createElement("div",null,M.a.createElement(se.a,{type:"primary",size:"large",onClick:S},M.a.createElement(_.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(ae==="download"||ae==="office")&&M.a.createElement(se.a,{type:"primary",size:"large",onClick:S},M.a.createElement(_.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ot,Qe,k){},"rAM+":function(ot,Qe,k){"use strict";k.d(Qe,"a",function(){return se});var U=k("Qw5x");function se(ie,xe){var fe;if(typeof Symbol=="undefined"||ie[Symbol.iterator]==null){if(Array.isArray(ie)||(fe=Object(U.a)(ie))||xe&&ie&&typeof ie.length=="number"){fe&&(ie=fe);var z=0,T=function(){};return{s:T,n:function(){return z>=ie.length?{done:!0}:{done:!1,value:ie[z++]}},e:function(E){throw E},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,j=!1,L;return{s:function(){fe=ie[Symbol.iterator]()},n:function(){var E=fe.next();return M=E.done,E},e:function(E){j=!0,L=E},f:function(){try{!M&&fe.return!=null&&fe.return()}finally{if(j)throw L}}}}},rUJ1:function(ot,Qe){const k=/[&<>"']/,U=/[&<>"']/g,se=/[<>"']|&(?!#?\w+;)/,ie=/[<>"']|&(?!#?\w+;)/g,xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fe=ke=>xe[ke];function z(ke,Te){if(Te){if(k.test(ke))return ke.replace(U,fe)}else if(se.test(ke))return ke.replace(ie,fe);return ke}const T=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function M(ke){return ke.replace(T,(Te,Ne)=>(Ne=Ne.toLowerCase(),Ne==="colon"?":":Ne.charAt(0)==="#"?Ne.charAt(1)==="x"?String.fromCharCode(parseInt(Ne.substring(2),16)):String.fromCharCode(+Ne.substring(1)):""))}const j=/(^|[^\[])\^/g;function L(ke,Te){ke=ke.source||ke,Te=Te||"";const Ne={replace:(be,O)=>(O=O.source||O,O=O.replace(j,"$1"),ke=ke.replace(be,O),Ne),getRegex:()=>new RegExp(ke,Te)};return Ne}const _=/[^\w:]/g,E=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function te(ke,Te,Ne){if(ke){let be;try{be=decodeURIComponent(M(Ne)).replace(_,"").toLowerCase()}catch(O){return null}if(be.indexOf("javascript:")===0||be.indexOf("vbscript:")===0||be.indexOf("data:")===0)return null}Te&&!E.test(Ne)&&(Ne=ae(Te,Ne));try{Ne=encodeURI(Ne).replace(/%25/g,"%")}catch(be){return null}return Ne}const $={},H=/^[^:]+:\/*[^/]*$/,X=/^([^:]+:)[\s\S]*$/,J=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ae(ke,Te){$[" "+ke]||(H.test(ke)?$[" "+ke]=ke+"/":$[" "+ke]=Se(ke,"/",!0)),ke=$[" "+ke];const Ne=ke.indexOf(":")===-1;return Te.substring(0,2)==="//"?Ne?Te:ke.replace(X,"$1")+Te:Te.charAt(0)==="/"?Ne?Te:ke.replace(J,"$1")+Te:ke+Te}const de={exec:function(){}};function Be(ke){let Te=1,Ne,be;for(;Te<arguments.length;Te++){Ne=arguments[Te];for(be in Ne)Object.prototype.hasOwnProperty.call(Ne,be)&&(ke[be]=Ne[be])}return ke}function $e(ke,Te){const Ne=ke.replace(/\|/g,(ce,ne,w)=>{let B=!1,P=ne;for(;--P>=0&&w[P]==="\\";)B=!B;return B?"|":" |"}),be=Ne.split(/ \|/);let O=0;if(be.length>Te)be.splice(Te);else for(;be.length<Te;)be.push("");for(;O<be.length;O++)be[O]=be[O].trim().replace(/\\\|/g,"|");return be}function Se(ke,Te,Ne){const be=ke.length;if(be===0)return"";let O=0;for(;O<be;){const ce=ke.charAt(be-O-1);if(ce===Te&&!Ne)O++;else if(ce!==Te&&Ne)O++;else break}return ke.substr(0,be-O)}function De(ke,Te){if(ke.indexOf(Te[1])===-1)return-1;const Ne=ke.length;let be=0,O=0;for(;O<Ne;O++)if(ke[O]==="\\")O++;else if(ke[O]===Te[0])be++;else if(ke[O]===Te[1]&&(be--,be<0))return O;return-1}function Ve(ke){ke&&ke.sanitize&&!ke.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:z,unescape:M,edit:L,cleanUrl:te,resolveUrl:ae,noopTest:de,merge:Be,splitCells:$e,rtrim:Se,findClosingBracket:De,checkSanitizeDeprecation:Ve}},rcnY:function(ot,Qe,k){var U=k("aRTE");function se(ie,xe){this.totalCount=ie,this.dataCount=xe}se.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]],se.getRSBlocks=function(ie,xe){var fe=se.getRsBlockTable(ie,xe);if(fe==null)throw new Error("bad rs block @ typeNumber:"+ie+"/errorCorrectLevel:"+xe);for(var z=fe.length/3,T=new Array,M=0;M<z;M++)for(var j=fe[M*3+0],L=fe[M*3+1],_=fe[M*3+2],E=0;E<j;E++)T.push(new se(L,_));return T},se.getRsBlockTable=function(ie,xe){switch(xe){case U.L:return se.RS_BLOCK_TABLE[(ie-1)*4+0];case U.M:return se.RS_BLOCK_TABLE[(ie-1)*4+1];case U.Q:return se.RS_BLOCK_TABLE[(ie-1)*4+2];case U.H:return se.RS_BLOCK_TABLE[(ie-1)*4+3];default:return}},ot.exports=se},vHTk:function(ot,Qe,k){ot.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(ot,Qe){function k(){this.buffer=new Array,this.length=0}k.prototype={get:function(U){var se=Math.floor(U/8);return(this.buffer[se]>>>7-U%8&1)==1},put:function(U,se){for(var ie=0;ie<se;ie++)this.putBit((U>>>se-ie-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(U){var se=Math.floor(this.length/8);this.buffer.length<=se&&this.buffer.push(0),U&&(this.buffer[se]|=128>>>this.length%8),this.length++}},ot.exports=k}}]);