(window.webpackJsonp=window.webpackJsonp||[]).push([[163,5,6,7],{"+NIl":function(gt,Ye,ne){(function(ue){ue(ne("VrN/"))})(function(ue){"use strict";ue.defineMode("stex",function(Z,P){"use strict";function Q(d,s){d.cmdState.push(s)}function B(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function F(d){var s=d.cmdState.pop();s&&s.closeBracket()}function K(d){for(var s=d.cmdState,c=s.length-1;c>=0;c--){var l=s[c];if(l.name=="DEFAULT")continue;return l}return{styleIdentifier:function(){return null}}}function G(d,s,c){return function(){this.name=d,this.bracketNo=0,this.style=s,this.styles=c,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var M={};M.importmodule=G("importmodule","tag",["string","builtin"]),M.documentclass=G("documentclass","tag",["","atom"]),M.usepackage=G("usepackage","tag",["atom"]),M.begin=G("begin","tag",["atom"]),M.end=G("end","tag",["atom"]),M.label=G("label","tag",["atom"]),M.ref=G("ref","tag",["atom"]),M.eqref=G("eqref","tag",["atom"]),M.cite=G("cite","tag",["atom"]),M.bibitem=G("bibitem","tag",["atom"]),M.Bibitem=G("Bibitem","tag",["atom"]),M.RBibitem=G("RBibitem","tag",["atom"]),M.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function R(d,s){d.f=s}function g(d,s){var c;if(d.match(/^\\[a-zA-Z@]+/)){var l=d.current().slice(1);return c=M.hasOwnProperty(l)?M[l]:M.DEFAULT,c=new c,Q(s,c),R(s,f),c.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return R(s,function(o,h){return p(o,h,"\\]")}),"keyword";if(d.match("\\("))return R(s,function(o,h){return p(o,h,"\\)")}),"keyword";if(d.match("$$"))return R(s,function(o,h){return p(o,h,"$$")}),"keyword";if(d.match("$"))return R(s,function(o,h){return p(o,h,"$")}),"keyword";var n=d.next();if(n=="%")return d.skipToEnd(),"comment";if(n=="}"||n=="]"){if(c=B(s),c)c.closeBracket(n),R(s,f);else return"error";return"bracket"}else return n=="{"||n=="["?(c=M.DEFAULT,c=new c,Q(s,c),"bracket"):/\d/.test(n)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),c=K(s),c.name=="begin"&&(c.argument=d.current()),c.styleIdentifier())}function p(d,s,c){if(d.eatSpace())return null;if(c&&d.match(c))return R(s,g),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var l=d.next();return l=="{"||l=="}"||l=="["||l=="]"||l=="("||l==")"?"bracket":l=="%"?(d.skipToEnd(),"comment"):"error"}function f(d,s){var c=d.peek(),l;return c=="{"||c=="["?(l=B(s),l.openBracket(c),d.eat(c),R(s,g),"bracket"):/[ \t\r]/.test(c)?(d.eat(c),null):(R(s,g),F(s),g(d,s))}return{startState:function(){var d=P.inMathMode?function(s,c){return p(s,c)}:g;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,s){return s.f(d,s)},blankLine:function(d){d.f=g,d.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},"+ua5":function(gt,Ye,ne){},"19Vz":function(gt,Ye,ne){(function(ue){ue(ne("VrN/"))})(function(ue){ue.defineOption("placeholder","",function(G,M,R){var g=R&&R!=ue.Init;if(M&&!g)G.on("blur",B),G.on("change",F),G.on("swapDoc",F),ue.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){Q(G)}),F(G);else if(!M&&g){G.off("blur",B),G.off("change",F),G.off("swapDoc",F),ue.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),Z(G);var p=G.getWrapperElement();p.className=p.className.replace(" CodeMirror-empty","")}M&&!G.hasFocus()&&B(G)});function Z(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function P(G){Z(G);var M=G.state.placeholder=document.createElement("pre");M.style.cssText="height: 0; overflow: visible",M.style.direction=G.getOption("direction"),M.className="CodeMirror-placeholder CodeMirror-line-like";var R=G.getOption("placeholder");typeof R=="string"&&(R=document.createTextNode(R)),M.appendChild(R),G.display.lineSpace.insertBefore(M,G.display.lineSpace.firstChild)}function Q(G){setTimeout(function(){var M=!1,R=G.getInputField();R.nodeName=="TEXTAREA"?M=!R.value:G.lineCount()==1&&(M=!/[^\u200b]/.test(R.querySelector(".CodeMirror-line").textContent)),M?P(G):Z(G)},20)}function B(G){K(G)&&P(G)}function F(G){var M=G.getWrapperElement(),R=K(G);M.className=M.className.replace(" CodeMirror-empty","")+(R?" CodeMirror-empty":""),R?P(G):Z(G)}function K(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1eCo":function(gt,Ye,ne){(function(ue){ue(ne("VrN/"))})(function(ue){"use strict";var Z={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ue.defineMode("xml",function(Q,B){var F=Q.indentUnit,K={},G=B.htmlMode?Z:P;for(var M in G)K[M]=G[M];for(var M in B)K[M]=B[M];var R,g;function p(u,E){function m(D){return E.tokenize=D,D(u,E)}var b=u.next();if(b=="<")return u.eat("!")?u.eat("[")?u.match("CDATA[")?m(s("atom","]]>")):null:u.match("--")?m(s("comment","-->")):u.match("DOCTYPE",!0,!0)?(u.eatWhile(/[\w\._\-]/),m(c(1))):null:u.eat("?")?(u.eatWhile(/[\w\._\-]/),E.tokenize=s("meta","?>"),"meta"):(R=u.eat("/")?"closeTag":"openTag",E.tokenize=f,"tag bracket");if(b=="&"){var N;return u.eat("#")?u.eat("x")?N=u.eatWhile(/[a-fA-F\d]/)&&u.eat(";"):N=u.eatWhile(/[\d]/)&&u.eat(";"):N=u.eatWhile(/[\w\.\-:]/)&&u.eat(";"),N?"atom":"error"}else return u.eatWhile(/[^&<]/),null}p.isInText=!0;function f(u,E){var m=u.next();if(m==">"||m=="/"&&u.eat(">"))return E.tokenize=p,R=m==">"?"endTag":"selfcloseTag","tag bracket";if(m=="=")return R="equals",null;if(m=="<"){E.tokenize=p,E.state=h,E.tagName=E.tagStart=null;var b=E.tokenize(u,E);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(m)?(E.tokenize=d(m),E.stringStartCol=u.column(),E.tokenize(u,E)):(u.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(u){var E=function(m,b){for(;!m.eol();)if(m.next()==u){b.tokenize=f;break}return"string"};return E.isInAttribute=!0,E}function s(u,E){return function(m,b){for(;!m.eol();){if(m.match(E)){b.tokenize=p;break}m.next()}return u}}function c(u){return function(E,m){for(var b;(b=E.next())!=null;){if(b=="<")return m.tokenize=c(u+1),m.tokenize(E,m);if(b==">")if(u==1){m.tokenize=p;break}else return m.tokenize=c(u-1),m.tokenize(E,m)}return"meta"}}function l(u,E,m){this.prev=u.context,this.tagName=E,this.indent=u.indented,this.startOfLine=m,(K.doNotIndent.hasOwnProperty(E)||u.context&&u.context.noIndent)&&(this.noIndent=!0)}function n(u){u.context&&(u.context=u.context.prev)}function o(u,E){for(var m;;){if(!u.context)return;if(m=u.context.tagName,!K.contextGrabbers.hasOwnProperty(m)||!K.contextGrabbers[m].hasOwnProperty(E))return;n(u)}}function h(u,E,m){return u=="openTag"?(m.tagStart=E.column(),L):u=="closeTag"?S:h}function L(u,E,m){return u=="word"?(m.tagName=E.current(),g="tag",C):K.allowMissingTagName&&u=="endTag"?(g="tag bracket",C(u,E,m)):(g="error",L)}function S(u,E,m){if(u=="word"){var b=E.current();return m.context&&m.context.tagName!=b&&K.implicitlyClosed.hasOwnProperty(m.context.tagName)&&n(m),m.context&&m.context.tagName==b||K.matchClosing===!1?(g="tag",x):(g="tag error",O)}else return K.allowMissingTagName&&u=="endTag"?(g="tag bracket",x(u,E,m)):(g="error",O)}function x(u,E,m){return u!="endTag"?(g="error",x):(n(m),h)}function O(u,E,m){return g="error",x(u,E,m)}function C(u,E,m){if(u=="word")return g="attribute",w;if(u=="endTag"||u=="selfcloseTag"){var b=m.tagName,N=m.tagStart;return m.tagName=m.tagStart=null,u=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(b)?o(m,b):(o(m,b),m.context=new l(m,b,N==m.indented)),h}return g="error",C}function w(u,E,m){return u=="equals"?T:(K.allowMissing||(g="error"),C(u,E,m))}function T(u,E,m){return u=="string"?_:u=="word"&&K.allowUnquoted?(g="string",C):(g="error",C(u,E,m))}function _(u,E,m){return u=="string"?_:C(u,E,m)}return{startState:function(u){var E={tokenize:p,state:h,indented:u||0,tagName:null,tagStart:null,context:null};return u!=null&&(E.baseIndent=u),E},token:function(u,E){if(!E.tagName&&u.sol()&&(E.indented=u.indentation()),u.eatSpace())return null;R=null;var m=E.tokenize(u,E);return(m||R)&&m!="comment"&&(g=null,E.state=E.state(R||m,u,E),g&&(m=g=="error"?m+" error":g)),m},indent:function(u,E,m){var b=u.context;if(u.tokenize.isInAttribute)return u.tagStart==u.indented?u.stringStartCol+1:u.indented+F;if(b&&b.noIndent)return ue.Pass;if(u.tokenize!=f&&u.tokenize!=p)return m?m.match(/^(\s*)/)[0].length:0;if(u.tagName)return K.multilineTagIndentPastTag!==!1?u.tagStart+u.tagName.length+2:u.tagStart+F*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/$/,blockCommentStart:"",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(u){u.state==T&&(u.state=C)},xmlCurrentTag:function(u){return u.tagName?{name:u.tagName,close:u.type=="closeTag"}:null},xmlCurrentContext:function(u){for(var E=[],m=u.context;m;m=m.prev)m.tagName&&E.push(m.tagName);return E.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"500L":function(gt,Ye,ne){"use strict";ne.d(Ye,"a",function(){return S});var ue=ne("+L6B"),Z=ne("2/Rp"),P=ne("2qtc"),Q=ne("kLXV"),B=ne("9og8"),F=ne("k1fw"),K=ne("miYZ"),G=ne("tsqr"),M=ne("oBTY"),R=ne("tJVT"),g=ne("DZo9"),p=ne("8z0m"),f=ne("WmNS"),d=ne.n(f),s=ne("q1tI"),c=ne.n(s),l=ne("m3rI"),n=ne("wzkS"),o=ne("y5JW"),h=ne("LtfV"),L=p.a.Dragger;function S(x){var O=[];return x&&x.length>0&&(O=x.map(function(C){return{uid:C.id,id:C.id,name:C.title+o.c+C.filesize,url:C.url,filesize:C.filesize,status:"done",response:{id:C.id}}})),O}Ye.b=function(x){var O=x.value,C=x.onChange,w=x.action,T=x.className,_=x.maxSize,u=_===void 0?150:_,E=x.title,m=E===void 0?"\u4E0A\u4F20\u9644\u4EF6":E,b=x.showRemoveModal,N=b===void 0?!1:b,D=x.accept,H=D===void 0?"":D,j=x.additionalText,I=x.isDragger,y=x.number,W=y===void 0?1e3:y,Y=x.aloneClear,ie=Y===void 0?!1:Y,oe=Object(s.useState)(!1),we=Object(R.a)(oe,2),me=we[0],Se=we[1],Ce=Object(s.useState)(O||[]),xe=Object(R.a)(Ce,2),pe=xe[0],le=xe[1];Object(s.useEffect)(function(){O&&(le(Object(M.a)(O)),W===(O==null?void 0:O.length)&&Se(!0))},[O]);var te=function(){setTimeout(function(){pe.pop(),le(Object(M.a)(pe))},500)},de={multiple:!0,disabled:me,accept:H,withCredentials:!0,fileList:pe,beforeUpload:function(ke,Te){var Le=ke.size/1024/1024;return pe.concat(Te).length>W?(pe.pop(),le(Object(M.a)(pe)),G.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(W,"\u4E2A\u6587\u4EF6")),ie?Promise.reject():(te(),!1)):!0},action:w||"".concat(l.a.API_SERVER,"/api/attachments.json"),onChange:function(ke){var Te,Le,Me=Object(M.a)(ke.fileList);if(ke.file.status==="done"&&((Te=ke.file)===null||Te===void 0||((Le=Te.response)===null||Le===void 0)?void 0:Le.status)===-1){var je,Fe;G.b.error((je=ke.file)===null||je===void 0||((Fe=je.response)===null||Fe===void 0)?void 0:Fe.message);return}Me.length>=W?Se(!0):Se(!1),le(Object(M.a)(Me)),Me=Me.map(function(Ne){var Ue;if(Ne!=null&&(Ue=Ne.response)!==null&&Ue!==void 0&&Ue.id){var Je;Ne.url="/api/attachments/".concat(Ne==null||((Je=Ne.response)===null||Je===void 0)?void 0:Je.id)}return Ne.name.indexOf(o.c)===-1&&(Ne.name="".concat(Ne.name).concat(o.c).concat(Object(o.a)(Ne.size))),Object(F.a)({},Ne)}),console.log("info:",ke),C(Me)},onRemove:function(){var Oe=Object(B.a)(d.a.mark(function Te(Le){var Me;return d.a.wrap(function(Fe){for(;;)switch(Fe.prev=Fe.next){case 0:if(Me=function(){var Ne=Object(B.a)(d.a.mark(function Ue(){var Je,tt;return d.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(Je=Le.response?Le.response.id:Le.id,!Je){Ze.next=8;break}return Ze.next=4,Object(n.d)(Le.response?Le.response.id:Le.uid);case 4:return tt=Ze.sent,Ze.abrupt("return",tt);case 8:return Ze.abrupt("return",!0);case 9:case"end":return Ze.stop()}},Ue)}));return function(){return Ne.apply(this,arguments)}}(),!N){Fe.next=5;break}return Fe.abrupt("return",new Promise(function(Ne,Ue){Q.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:c.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Je=Object(B.a)(d.a.mark(function et(){var Ze;return d.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return it.next=2,Me();case 2:Ze=it.sent,G.b.success("\u5220\u9664\u6210\u529F"),Ne(!0);case 5:case"end":return it.stop()}},et)}));function tt(){return Je.apply(this,arguments)}return tt}(),onCancel:function(){return Ne(!1)}})}));case 5:return Fe.next=7,Me();case 7:return Fe.abrupt("return",Fe.sent);case 8:case"end":return Fe.stop()}},Te)}));function ke(Te){return Oe.apply(this,arguments)}return ke}()};function se(Oe){Oe.preventDefault(),Oe.stopPropagation()}return c.a.createElement("div",{className:"multi-upload ".concat(T||"")},I&&c.a.createElement(L,de,c.a.createElement("p",{className:"ant-upload-drag-icon"},c.a.createElement(h.a,null)),c.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",c.a.createElement("br",null),"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",u,"MB)"," "),j),!I&&c.a.createElement(p.a,de,c.a.createElement(Z.a,{disabled:me},m),c.a.createElement("span",{onClick:se,style:{marginLeft:10,color:"#FA6400"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",u,"MB)"," ")))}},"55Ip":function(gt,Ye,ne){"use strict";ne.d(Ye,"a",function(){return o});var ue=ne("Ty5D"),Z=ne("dI71"),P=ne("q1tI"),Q=ne.n(P),B=ne("YS25"),F=ne("17x9"),K=ne.n(F),G=ne("wx14"),M=ne("zLVn"),R=ne("9R94"),g=function(T){Object(Z.a)(_,T);function _(){for(var E,m=arguments.length,b=new Array(m),N=0;NY&&(Y=y.line_indent_level));var ie={mode:W,parent:y,last_token:y?y.last_token:new f(o.START_BLOCK,""),last_word:y?y.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Y,alignment:0,line_indent_level:y?y.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},j.prototype._reset=function(y){var W=y.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,W),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(u.BlockStatement);var Y=new c(y,this._options);return this._tokens=Y.tokenize(),y},j.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var y,W=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
`,W&&d.lineBreak.test(W||"")&&(Y=W.match(d.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return y=this._output.get_code(Y),y},j.prototype.handle_token=function(y,W){y.type===o.START_EXPR?this.handle_start_expr(y):y.type===o.END_EXPR?this.handle_end_expr(y):y.type===o.START_BLOCK?this.handle_start_block(y):y.type===o.END_BLOCK?this.handle_end_block(y):y.type===o.WORD?this.handle_word(y):y.type===o.RESERVED?this.handle_word(y):y.type===o.SEMICOLON?this.handle_semicolon(y):y.type===o.STRING?this.handle_string(y):y.type===o.EQUALS?this.handle_equals(y):y.type===o.OPERATOR?this.handle_operator(y):y.type===o.COMMA?this.handle_comma(y):y.type===o.BLOCK_COMMENT?this.handle_block_comment(y,W):y.type===o.COMMENT?this.handle_comment(y,W):y.type===o.DOT?this.handle_dot(y):y.type===o.EOF?this.handle_eof(y):y.type===o.UNKNOWN?this.handle_unknown(y,W):this.handle_unknown(y,W)},j.prototype.handle_whitespace_and_comments=function(y,W){var Y=y.newlines,ie=this._options.keep_array_indentation&&b(this._flags.mode);if(y.comments_before)for(var oe=y.comments_before.next();oe;)this.handle_whitespace_and_comments(oe,W),this.handle_token(oe,W),oe=y.comments_before.next();if(ie)for(var we=0;we0,W);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,W);for(var me=1;me0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.set_mode=function(y){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,y),this._flags=this.create_flags(this._previous_flags,y),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},j.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===u.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},j.prototype.start_of_object_property=function(){return this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},j.prototype.start_of_statement=function(y){var W=!1;return W=W||O(this._flags.last_token,["var","let","const"])&&y.type===o.WORD,W=W||x(this._flags.last_token,"do"),W=W||!(this._flags.parent.mode===u.ObjectLiteral&&this._flags.mode===u.Statement)&&O(this._flags.last_token,I)&&!y.newlines,W=W||x(this._flags.last_token,"else")&&!(x(y,"if")&&!y.comments_before),W=W||this._flags.last_token.type===o.END_EXPR&&(this._previous_flags.mode===u.ForInitializer||this._previous_flags.mode===u.Conditional),W=W||this._flags.last_token.type===o.WORD&&this._flags.mode===u.BlockStatement&&!this._flags.in_case&&!(y.text==="--"||y.text==="++")&&this._last_last_text!=="function"&&y.type!==o.WORD&&y.type!==o.RESERVED,W=W||this._flags.mode===u.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),W?(this.set_mode(u.Statement),this.indent(),this.handle_whitespace_and_comments(y,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y,O(y,["do","for","if","while"])),!0):!1},j.prototype.handle_start_expr=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y);var W=u.Expression;if(y.text==="["){if(this._flags.last_token.type===o.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,l)&&(this._output.space_before_token=!0),this.print_token(y),this.set_mode(W),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}W=u.ArrayLiteral,b(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),h(this._flags.last_token.type,[o.START_EXPR,o.END_EXPR,o.WORD,o.OPERATOR,o.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===o.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,W=u.ForInitializer):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,W=u.Conditional):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&y.whitespace_before===""?this._output.space_before_token=!1:(h(this._flags.last_token.text,l)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y);else if(this._flags.last_token.type===o.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var ie=this._tokens.peek(-4);O(Y,["async","function"])||Y.text==="*"&&O(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===u.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(ie.text==="{"||ie.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(y);(this._flags.last_token.type===o.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&h(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===o.START_BLOCK?this.print_newline():(this._flags.last_token.type===o.END_EXPR||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===o.COMMA)&&this.allow_wrap_or_preserved_newline(y,y.newlines),this.print_token(y),this.set_mode(W),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},j.prototype.handle_end_expr=function(y){for(;this._flags.mode===u.Statement;)this.restore_mode();this.handle_whitespace_and_comments(y),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(y,y.text==="]"&&b(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===o.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(y),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===u.Conditional&&(this._previous_flags.mode=u.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},j.prototype.handle_start_block=function(y){this.handle_whitespace_and_comments(y);var W=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===o.END_EXPR?(this.set_mode(u.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(u.BlockStatement):Y&&(h(Y.text,[":",","])&&h(W.type,[o.STRING,o.WORD,o.RESERVED])||h(W.text,["get","set","..."])&&h(Y.type,[o.WORD,o.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h(Y.text,[":",","])?this.set_mode(u.BlockStatement):this.set_mode(u.ObjectLiteral):this._flags.last_token.type===o.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(u.BlockStatement):h(this._flags.last_token.type,[o.EQUALS,o.START_EXPR,o.COMMA,o.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(u.ObjectLiteral):this.set_mode(u.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!W.comments_before&&W.text==="}",oe=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===o.END_EXPR;if(this._options.brace_preserve_inline){var we=0,me=null;this._flags.inline_frame=!0;do if(we+=1,me=this._tokens.peek(we-1),me.newlines){this._flags.inline_frame=!1;break}while(me.type!==o.EOF&&!(me.type===o.END_BLOCK&&me.opened===y))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==o.OPERATOR&&(oe||this._flags.last_token.type===o.EQUALS||O(this._flags.last_token,C)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(b(this._previous_flags.mode)&&(this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.COMMA)&&((this._flags.last_token.type===o.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(y),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==o.OPERATOR&&this._flags.last_token.type!==o.START_EXPR&&(this._flags.last_token.type===o.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(y),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},j.prototype.handle_end_block=function(y){for(this.handle_whitespace_and_comments(y);this._flags.mode===u.Statement;)this.restore_mode();var W=this._flags.last_token.type===o.START_BLOCK;this._flags.inline_frame&&!W?this._output.space_before_token=!0:this._options.brace_style==="expand"?W||this.print_newline():W||(b(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(y)},j.prototype.handle_word=function(y){if(y.type===o.RESERVED){if(h(y.text,["set","get"])&&this._flags.mode!==u.ObjectLiteral)y.type=o.WORD;else if(y.text==="import"&&h(this._tokens.peek().text,["(","."]))y.type=o.WORD;else if(h(y.text,["as","from"])&&!this._flags.import_block)y.type=o.WORD;else if(this._flags.mode===u.ObjectLiteral){var W=this._tokens.peek();W.text===":"&&(y.type=o.WORD)}}if(this.start_of_statement(y)?O(this._flags.last_token,["var","let","const"])&&y.type===o.WORD&&(this._flags.declaration_statement=!0):y.newlines&&!N(this._flags.mode)&&(this._flags.last_token.type!==o.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==o.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(y),this.print_newline()):this.handle_whitespace_and_comments(y),this._flags.do_block&&!this._flags.do_while)if(x(y,"while")){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(y,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===u.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(y,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(y),this._flags.in_case=!0;return}if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y)),x(y,"function")){(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(h(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===o.OPERATOR))&&(!this._output.just_added_blankline()&&!y.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,I)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===o.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(N(this._flags.mode)||b(this._flags.mode))||this.print_newline(),this.print_token(y),this._flags.last_word=y.text;return}var Y="NONE";if(this._flags.last_token.type===o.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":O(y,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&this._flags.mode===u.BlockStatement?Y="NEWLINE":this._flags.last_token.type===o.SEMICOLON&&N(this._flags.mode)?Y="SPACE":this._flags.last_token.type===o.STRING?Y="NEWLINE":this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===u.ObjectLiteral&&h(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===o.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===o.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),O(y,l)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),O(y,["else","catch","finally"]))if((!(this._flags.last_token.type===o.END_BLOCK&&this._previous_flags.mode===u.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&y.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?O(this._flags.last_token,C)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(y,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==o.END_EXPR?(this._flags.last_token.type!==o.START_EXPR||!O(y,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(y,"if")&&x(y.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(y,l)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&b(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);y.previous&&(y.previous.type===o.WORD||y.previous.type===o.RESERVED)&&(this._output.space_before_token=!0),this.print_token(y),this._flags.last_word=y.text,y.type===o.RESERVED&&(y.text==="do"?this._flags.do_block=!0:y.text==="if"?this._flags.if_block=!0:y.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(y,"from")&&(this._flags.import_block=!1))},j.prototype.handle_semicolon=function(y){this.start_of_statement(y)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(y);for(var W=this._tokens.peek();this._flags.mode===u.Statement&&!(this._flags.if_block&&x(W,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(y)},j.prototype.handle_string=function(y){y.text.startsWith("`")&&y.newlines===0&&y.whitespace_before===""&&(y.previous.text===")"||this._flags.last_token.type===o.WORD)||(this.start_of_statement(y)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(y),this._flags.last_token.type===o.RESERVED||this._flags.last_token.type===o.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR||this._flags.last_token.type===o.EQUALS||this._flags.last_token.type===o.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(y):y.text.startsWith("`")&&this._flags.last_token.type===o.END_EXPR&&(y.previous.text==="]"||y.previous.text===")")&&y.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(y)},j.prototype.handle_equals=function(y){this.start_of_statement(y)||this.handle_whitespace_and_comments(y),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0},j.prototype.handle_comma=function(y){this.handle_whitespace_and_comments(y,!0),this.print_token(y),this._output.space_before_token=!0,this._flags.declaration_statement?(N(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)):this._flags.mode===u.ObjectLiteral||this._flags.mode===u.Statement&&this._flags.parent.mode===u.ObjectLiteral?(this._flags.mode===u.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(y)},j.prototype.handle_operator=function(y){var W=y.text==="*"&&(O(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[o.START_BLOCK,o.COMMA,o.END_BLOCK,o.SEMICOLON])),Y=h(y.text,["-","+"])&&(h(this._flags.last_token.type,[o.START_BLOCK,o.START_EXPR,o.EQUALS,o.OPERATOR])||h(this._flags.last_token.text,l)||this._flags.last_token.text===",");if(!this.start_of_statement(y)){var ie=!W;this.handle_whitespace_and_comments(y,ie)}if(y.text==="*"&&this._flags.last_token.type===o.DOT){this.print_token(y);return}if(y.text==="::"){this.print_token(y);return}if(this._flags.last_token.type===o.OPERATOR&&h(this._options.operator_position,_)&&this.allow_wrap_or_preserved_newline(y),y.text===":"&&this._flags.in_case){this.print_token(y),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==o.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var oe=!0,we=!0,me=!1;if(y.text===":"?this._flags.ternary_depth===0?oe=!1:(this._flags.ternary_depth-=1,me=!0):y.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!W&&this._options.preserve_newlines&&h(y.text,n)){var Se=y.text===":",Ce=Se&&me,xe=Se&&!me;switch(this._options.operator_position){case T.before_newline:this._output.space_before_token=!xe,this.print_token(y),(!Se||Ce)&&this.allow_wrap_or_preserved_newline(y),this._output.space_before_token=!0;return;case T.after_newline:this._output.space_before_token=!0,!Se||Ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(y):this._output.space_before_token=!1,this.print_token(y),this._output.space_before_token=!0;return;case T.preserve_newline:xe||this.allow_wrap_or_preserved_newline(y),oe=!(this._output.just_added_newline()||xe),this._output.space_before_token=oe,this.print_token(y),this._output.space_before_token=!0;return}}if(W){this.allow_wrap_or_preserved_newline(y),oe=!1;var pe=this._tokens.peek();we=pe&&h(pe.type,[o.WORD,o.RESERVED])}else if(y.text==="...")this.allow_wrap_or_preserved_newline(y),oe=this._flags.last_token.type===o.START_BLOCK,we=!1;else if(h(y.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===o.COMMA||this._flags.last_token.type===o.START_EXPR)&&this.allow_wrap_or_preserved_newline(y),oe=!1,we=!1,y.newlines&&(y.text==="--"||y.text==="++"||y.text==="~")){var le=O(this._flags.last_token,C)&&y.newlines;le&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(le,!0)}this._flags.last_token.text===";"&&N(this._flags.mode)&&(oe=!0),this._flags.last_token.type===o.RESERVED?oe=!0:this._flags.last_token.type===o.END_EXPR?oe=!(this._flags.last_token.text==="]"&&(y.text==="--"||y.text==="++")):this._flags.last_token.type===o.OPERATOR&&(oe=h(y.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(y.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(we=!0)),(this._flags.mode===u.BlockStatement&&!this._flags.inline_frame||this._flags.mode===u.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||oe,this.print_token(y),this._output.space_before_token=we},j.prototype.handle_block_comment=function(y,W){if(this._output.raw){this._output.add_raw_token(y),y.directives&&y.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(y.directives){this.print_newline(!1,W),this.print_token(y),y.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(y.text)&&!y.newlines){this._output.space_before_token=!0,this.print_token(y),this._output.space_before_token=!0;return}else this.print_block_commment(y,W)},j.prototype.print_block_commment=function(y,W){var Y=m(y.text),ie,oe=!1,we=!1,me=y.whitespace_before,Se=me.length;if(this.print_newline(!1,W),this.print_token_line_indentation(y),this._output.add_token(Y[0]),this.print_newline(!1,W),Y.length>1){for(Y=Y.slice(1),oe=D(Y,"*"),we=H(Y,me),oe&&(this._flags.alignment=1),ie=0;ie=0;d--)if(this.__items[d].match(f))return!0;return!1},R.prototype.set_indent=function(f,d){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},R.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},R.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},R.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},R.prototype.is_empty=function(){return this.__items.length===0},R.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},R.prototype.push=function(f){this.__items.push(f);var d=f.lastIndexOf(`
`);d!==-1?this.__character_count=f.length-d:this.__character_count+=f.length},R.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},R.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},R.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},R.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},R.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function g(f,d){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),d=d||"",f.indent_level>0&&(d=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}g.prototype.get_indent_size=function(f,d){var s=this.__base_string_length;return d=d||0,f<0&&(s=0),s+=f*this.__indent_size,s+=d,s},g.prototype.get_indent_string=function(f,d){var s=this.__base_string;return d=d||0,f<0&&(f=0,s=""),d+=f*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},g.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var f=this.__cache.length,d=0,s="";this.__indent_size&&f>=this.__indent_size&&(d=Math.floor(f/this.__indent_size),f-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),f&&(s+=new Array(f+1).join(" ")),this.__cache.push(s)};function p(f,d){this.__indent_cache=new g(f,d),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new R(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(f,d){return this.__indent_cache.get_indent_string(f,d)},p.prototype.get_indent_size=function(f,d){return this.__indent_cache.get_indent_size(f,d)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(f){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return f!==`
`&&(s=s.replace(/[\n]/g,f)),s},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(f,d){return f=f||0,d=d||0,this.next_line.set_indent(f,d),this.__lines.length>1?(this.current_line.set_indent(f,d),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(f){for(var d=0;d1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(f,d){for(var s=this.__lines.length-2;s>=0;){var c=this.__lines[s];if(c.is_empty())break;if(c.item(0).indexOf(f)!==0&&c.item(-1)!==d){this.__lines.splice(s+1,0,new R(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},M.exports.Output=p},function(M){function R(g,p,f,d){this.type=g,this.text=p,this.comments_before=null,this.newlines=f||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}M.exports.Token=R},function(M,R){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",d="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",s="(?:\\\\u[0-9a-fA-F]{4}|["+g+f+"])",c="(?:\\\\u[0-9a-fA-F]{4}|["+p+f+d+"])*";R.identifier=new RegExp(s+c,"g"),R.identifierStart=new RegExp(s),R.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+f+d+"])+");var l=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;R.newline=/[\n\r\u2028\u2029]/,R.lineBreak=new RegExp(`\r
|`+R.newline.source),R.allLineBreaks=new RegExp(R.lineBreak.source,"g")},function(M,R,g){var p=g(6).Options,f=["before-newline","after-newline","preserve-newline"];function d(s){p.call(this,s,"js");var c=this.raw_options.brace_style||null;c==="expand-strict"?this.raw_options.brace_style="expand":c==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var n=0;n>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),w=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";w=w.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),w="\\?\\.(?!\\d) "+w,w=w.replace(/ /g,"|");var T=new RegExp(w),_="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),u=_.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+u.join("|")+")$"),m,b=function(D,H){f.call(this,D,H),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var j=new l(this._input),I=new n(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(c.identifier).matching(c.identifierMatch),number:j.matching(S),punct:j.matching(T),comment:j.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:j.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:j.matching(//),include:j.starting_with(/#include/).until_after(c.lineBreak),shebang:j.starting_with(/#!/).until_after(c.lineBreak),xml:j.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};b.prototype=new f,b.prototype._is_comment=function(D){return D.type===h.COMMENT||D.type===h.BLOCK_COMMENT||D.type===h.UNKNOWN},b.prototype._is_opening=function(D){return D.type===h.START_BLOCK||D.type===h.START_EXPR},b.prototype._is_closing=function(D,H){return(D.type===h.END_BLOCK||D.type===h.END_EXPR)&&H&&(D.text==="]"&&H.text==="["||D.text===")"&&H.text==="("||D.text==="}"&&H.text==="{")},b.prototype._reset=function(){m=!1},b.prototype._get_next_token=function(D,H){var j=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(h.EOF,""):(j=j||this._read_non_javascript(I),j=j||this._read_string(I),j=j||this._read_word(D),j=j||this._read_singles(I),j=j||this._read_comment(I),j=j||this._read_regexp(I,D),j=j||this._read_xml(I,D),j=j||this._read_punctuation(),j=j||this._create_token(h.UNKNOWN,this._input.next()),j)},b.prototype._read_word=function(D){var H;if(H=this.__patterns.identifier.read(),H!=="")return H=H.replace(c.allLineBreaks,`
`),!(D.type===h.DOT||D.type===h.RESERVED&&(D.text==="set"||D.text==="get"))&&E.test(H)?(H==="in"||H==="of")&&(D.type===h.WORD||D.type===h.STRING)?this._create_token(h.OPERATOR,H):this._create_token(h.RESERVED,H):this._create_token(h.WORD,H);if(H=this.__patterns.number.read(),H!=="")return this._create_token(h.WORD,H)},b.prototype._read_singles=function(D){var H=null;return D==="("||D==="["?H=this._create_token(h.START_EXPR,D):D===")"||D==="]"?H=this._create_token(h.END_EXPR,D):D==="{"?H=this._create_token(h.START_BLOCK,D):D==="}"?H=this._create_token(h.END_BLOCK,D):D===";"?H=this._create_token(h.SEMICOLON,D):D==="."&&O.test(this._input.peek(1))?H=this._create_token(h.DOT,D):D===","&&(H=this._create_token(h.COMMA,D)),H&&this._input.next(),H},b.prototype._read_punctuation=function(){var D=this.__patterns.punct.read();if(D!=="")return D==="="?this._create_token(h.EQUALS,D):D==="?."?this._create_token(h.DOT,D):this._create_token(h.OPERATOR,D)},b.prototype._read_non_javascript=function(D){var H="";if(D==="#"){if(this._is_first_token()&&(H=this.__patterns.shebang.read(),H))return this._create_token(h.UNKNOWN,H.trim()+`
`);if(H=this.__patterns.include.read(),H)return this._create_token(h.UNKNOWN,H.trim()+`
`);D=this._input.next();var j="#";if(this._input.hasNext()&&this._input.testChar(x)){do D=this._input.next(),j+=D;while(this._input.hasNext()&&D!=="#"&&D!=="=");return D==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(j+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(j+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,j)}this._input.back()}else if(D==="<"&&this._is_first_token()){if(H=this.__patterns.html_comment_start.read(),H){for(;this._input.hasNext()&&!this._input.testChar(c.newline);)H+=this._input.next();return m=!0,this._create_token(h.COMMENT,H)}}else if(m&&D==="-"&&(H=this.__patterns.html_comment_end.read(),H))return m=!1,this._create_token(h.COMMENT,H);return null},b.prototype._read_comment=function(D){var H=null;if(D==="/"){var j="";if(this._input.peek(1)==="*"){j=this.__patterns.block_comment.read();var I=L.get_directives(j);I&&I.ignore==="start"&&(j+=L.readIgnored(this._input)),j=j.replace(c.allLineBreaks,`
`),H=this._create_token(h.BLOCK_COMMENT,j),H.directives=I}else this._input.peek(1)==="/"&&(j=this.__patterns.comment.read(),H=this._create_token(h.COMMENT,j))}return H},b.prototype._read_string=function(D){if(D==="`"||D==="'"||D==='"'){var H=this._input.next();return this.has_char_escapes=!1,D==="`"?H+=this._read_string_recursive("`",!0,"${"):H+=this._read_string_recursive(D),this.has_char_escapes&&this._options.unescape_strings&&(H=N(H)),this._input.peek()===D&&(H+=this._input.next()),H=H.replace(c.allLineBreaks,`
`),this._create_token(h.STRING,H)}return null},b.prototype._allow_regexp_or_xml=function(D){return D.type===h.RESERVED&&o(D.text,["return","case","throw","else","do","typeof","yield"])||D.type===h.END_EXPR&&D.text===")"&&D.opened.previous.type===h.RESERVED&&o(D.opened.previous.text,["if","while","for"])||o(D.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},b.prototype._read_regexp=function(D,H){if(D==="/"&&this._allow_regexp_or_xml(H)){for(var j=this._input.next(),I=!1,y=!1;this._input.hasNext()&&(I||y||this._input.peek()!==D)&&!this._input.testChar(c.newline);)j+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?y=!0:this._input.peek()==="]"&&(y=!1)),this._input.next();return this._input.peek()===D&&(j+=this._input.next(),j+=this._input.read(c.identifier)),this._create_token(h.STRING,j)}return null},b.prototype._read_xml=function(D,H){if(this._options.e4x&&D==="<"&&this._allow_regexp_or_xml(H)){var j="",I=this.__patterns.xml.read_match();if(I){for(var y=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),W=y.indexOf("{")===0,Y=0;I;){var ie=!!I[1],oe=I[2],we=!!I[I.length-1]||oe.slice(0,8)==="![CDATA[";if(!we&&(oe===y||W&&oe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--Y:++Y),j+=I[0],Y<=0)break;I=this.__patterns.xml.read_match()}return I||(j+=this._input.match(/[\s\S]*/g)[0]),j=j.replace(c.allLineBreaks,`
`),this._create_token(h.STRING,j)}}return null};function N(D){for(var H="",j=0,I=new p(D),y=null;I.hasNext();)if(y=I.match(/([\s]|[^\\]|\\\\)+/g),y&&(H+=y[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")y=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")y=I.match(/u([0-9A-Fa-f]{4})/g);else{H+="\\",I.hasNext()&&(H+=I.next());continue}if(!y)return D;if(j=parseInt(y[1],16),j>126&&j<=255&&y[0].indexOf("x")===0)return D;if(j>=0&&j<32){H+="\\"+y[0];continue}else j===34||j===39||j===92?H+="\\"+String.fromCharCode(j):H+=String.fromCharCode(j)}return H}b.prototype._read_string_recursive=function(D,H,j){var I,y;D==="'"?y=this.__patterns.single_quote:D==='"'?y=this.__patterns.double_quote:D==="`"?y=this.__patterns.template_text:D==="}"&&(y=this.__patterns.template_expression);for(var W=y.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===D||!H&&c.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Y+=this._input.next()):j&&(j==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),j===Y&&(D==="`"?Y+=this._read_string_recursive("}",H,"`"):Y+=this._read_string_recursive("`",H,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=y.read(),W+=Y}return W},M.exports.Tokenizer=b,M.exports.TOKEN=h,M.exports.positionable_operators=C.slice(),M.exports.line_starters=_.slice()},function(M){var R=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&p=0&&f=p.length&&this.__input.substring(f-p.length,f).toLowerCase()===p},M.exports.InputScanner=g},function(M,R,g){var p=g(8).InputScanner,f=g(3).Token,d=g(10).TokenStream,s=g(11).WhitespacePattern,c={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(n,o){this._input=new p(n),this._options=o||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var n,o=new f(c.START,""),h=null,L=[],S=new d;o.type!==c.EOF;){for(n=this._get_next_token(o,h);this._is_comment(n);)S.add(n),n=this._get_next_token(o,h);S.isEmpty()||(n.comments_before=S,S=new d),n.parent=h,this._is_opening(n)?(L.push(h),h=n):h&&this._is_closing(n,h)&&(n.opened=h,h.closed=n,h=L.pop(),n.parent=h),n.previous=o,o.next=n,this.__tokens.add(n),o=n}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(n,o){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(c.RAW,h):this._create_token(c.EOF,"")},l.prototype._is_comment=function(n){return!1},l.prototype._is_opening=function(n){return!1},l.prototype._is_closing=function(n,o){return!1},l.prototype._create_token=function(n,o){var h=new f(n,o,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},M.exports.Tokenizer=l,M.exports.TOKEN=c},function(M){function R(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}R.prototype.restart=function(){this.__position=0},R.prototype.isEmpty=function(){return this.__tokens_length===0},R.prototype.hasNext=function(){return this.__position=0&&g/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new p,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(s){var c=this._create();return c._disabled[s]=!0,c._update(),c},d.prototype.read_options=function(s){var c=this._create();for(var l in f)c._disabled[l]=s.templating.indexOf(l)===-1;return c._update(),c},d.prototype.exclude=function(s){var c=this._create();return c._excluded[s]=!0,c._update(),c},d.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var c=this._read_template();c;)this._match_pattern?c+=this._input.read(this._match_pattern):c+=this._input.readUntil(this.__template_pattern),s+=c,c=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},d.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},d.prototype._read_template=function(){var s="",c=this._input.peek();if(c==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(s=s||this.__patterns.erb.read())}else c==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},M.exports.TemplatablePattern=d}],F={};function K(M){var R=F[M];if(R!==void 0)return R.exports;var g=F[M]={exports:{}};return B[M](g,g.exports,K),g.exports}var G=K(0);P=G})();var Q=P;!(ue=[],Z=function(){return{js_beautify:Q}}.apply(Ye,ue),Z!==void 0&&(gt.exports=Z))})()},"7/Dv":function(gt,Ye,ne){gt.exports={bg:"bg___2rJyo",flexRow:"flexRow___2xuIa",flexJustifyCenter:"flexJustifyCenter___Z3bJt",flexAlignEnd:"flexAlignEnd___v7Ww-",flexAlignCenter:"flexAlignCenter___223DA",flexColumn:"flexColumn___3CNqR",formWrap:"formWrap___2b6uL",titleWrap:"titleWrap___1CMQA",fieldWrap:"fieldWrap___2BRrD",mdWrap:"mdWrap___3UYzt",backgroundFa:"backgroundFa___32wpj",button:"button___MHDAn"}},"7Cbv":function(gt,Ye,ne){"use strict";var ue=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Z=new Uint8Array(16);function P(){if(!ue)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ue(Z)}var Q=/^(?:[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 B(f){return typeof f=="string"&&Q.test(f)}for(var F=B,K=[],G=0;G<256;++G)K.push((G+256).toString(16).substr(1));function M(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(K[f[d+0]]+K[f[d+1]]+K[f[d+2]]+K[f[d+3]]+"-"+K[f[d+4]]+K[f[d+5]]+"-"+K[f[d+6]]+K[f[d+7]]+"-"+K[f[d+8]]+K[f[d+9]]+"-"+K[f[d+10]]+K[f[d+11]]+K[f[d+12]]+K[f[d+13]]+K[f[d+14]]+K[f[d+15]]).toLowerCase();if(!F(s))throw TypeError("Stringified UUID is invalid");return s}var R=M;function g(f,d,s){f=f||{};var c=f.random||(f.rng||P)();if(c[6]=c[6]&15|64,c[8]=c[8]&63|128,d){s=s||0;for(var l=0;l<16;++l)d[s+l]=c[l];return d}return R(c)}var p=Ye.a=g},"7ahc":function(gt,Ye,ne){"use strict";ne.d(Ye,"a",function(){return L});var ue=ne("k1fw"),Z=ne("0Owb"),P=ne("+L6B"),Q=ne("2/Rp"),B=ne("y8nQ"),F=ne("Vl3Y"),K=ne("tJVT"),G=ne("OaEy"),M=ne("2fM7"),R=ne("q1tI"),g=ne.n(R),p=ne("VrN/"),f=ne.n(p),d=ne("p77/"),s=ne.n(d),c=ne("c5Ni"),l=ne.n(c),n=M.a.Option,o={labelCol:{span:4},wrapperCol:{span:20}},h={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ye.b=function(S){var x=S.callback,O=S.onCancel,C=Object(R.useState)("python"),w=Object(K.a)(C,2),T=w[0],_=w[1];function u(m){_(h[m][1])}function E(m){x(m)}return g.a.createElement(F.a,Object(Z.a)({},o,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),g.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(M.a,{onChange:u},Object.keys(h).map(function(m){return g.a.createElement(n,{key:m,value:m},h[m][0])}))),g.a.createElement(F.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(L,{mode:T})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(Q.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function L(S){var x=S.value,O=S.onChange,C=S.mode,w=S.options,T=w===void 0?{}:w,_=Object(R.useRef)(),u=Object(R.useState)(),E=Object(K.a)(u,2),m=E[0],b=E[1];return Object(R.useEffect)(function(){if(m){function N(D){var H=D.getValue();O&&O(H)}return m.on("change",N),function(){m.off("change",N)}}},[m,O]),Object(R.useEffect)(function(){m&&m.setOption("mode",C)},[m,C]),Object(R.useEffect)(function(){m&&((x!==m.getValue()||x==="")&&setTimeout(function(){m.setValue(x||" ")},300))},[m,x]),Object(R.useEffect)(function(){if(_.current&&!m){var N=f.a.fromTextArea(_.current,Object(ue.a)({mode:C,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},T));b(N)}},[_.current,m]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:_}))}},"8EBN":function(gt,Ye,ne){(function(ue){ue(ne("VrN/"))})(function(ue){"use strict";ue.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 Z=0;Z-1&&Q.substring(K+1,Q.length);if(G)return ue.findModeByExtension(G)},ue.findModeByName=function(Q){Q=Q.toLowerCase();for(var B=0;B=U.length?q.slice(U.length):q}).join(`
`)}var l=[],n=[""],o=new d.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function L(){l.length=0,n=[""]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(X,v,A,U){if(v>=X.length||X[v].level<=A)return v;var q=X[v];U.push("- "+q.text+""),v++;var V=[];return v=x(X,v,q.level,V),V.length>0&&(U.push("
"),V.forEach(function(ye){U.push(ye)}),U.push("
")),U.push(" "),v=x(X,v,A,U),v}function O(){return x(l,0,0,n),n.push("
"),n.join("")}var C={heading:function(v){var A=h.exec(v);if(A)return{type:"heading",raw:A[0],depth:A[1].length,text:A[2]}},fences:function(v){var A=this.rules.block.fences.exec(v);if(A){var U=A[0],q=c(U,A[3]||""),V=A[2]?A[2].trim():A[2];if(["latex","katex","math"].indexOf(V)>=0){var ye=_(),We=q;q=ye,u[ye]={type:"block",expression:We}}return{type:"code",raw:U,lang:V,text:q}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,T=0,_=function(){return"__special_katext_id_".concat(T++,"__")},u={};function E(){return u}function m(){T=0,u={}}function b(X){return X=X.replace(w,function(v,A){var U=_();return u[U]={type:"inline",expression:A},U}),X}var N=o.listitem;o.listitem=function(X){return N(b(X))};var D=o.paragraph;o.paragraph=function(X){return D(b(X))};var H=o.tablecell;o.tablecell=function(X,v){return H(b(X),v)},o.code=function(X,v,A){var U=(v||"").match(/\S*/)[0];return U?["latex","katex","math"].indexOf(U)>=0?"".concat(X,"
"):'
').concat(A?X:Object(s.escape)(X,!0),`
`):''+(A?X:Object(s.escape)(X,!0))+"
"},o.heading=function(X,v,A){var U=this.options.headerPrefix+A.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return l.push({anchor:U,level:v,text:X}),"'+X+""},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:C,renderer:o});var j=d.a,I=ne("SJMd"),y=ne("ulZh"),W=ne.n(y),Y=ne("m3rI"),ie=ne("Oy/b"),oe=ne("p5ED"),we=ne("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(X,v){return(me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,U){A.__proto__=U}||function(A,U){for(var q in U)Object.prototype.hasOwnProperty.call(U,q)&&(A[q]=U[q])})(X,v)};function Se(X,v){function A(){this.constructor=X}me(X,v),X.prototype=v===null?Object.create(v):(A.prototype=v.prototype,new A)}function Ce(X,v,A,U){return new(A||(A=Promise))(function(q,V){function ye(mt){try{qe(U.next(mt))}catch(ze){V(ze)}}function We(mt){try{qe(U.throw(mt))}catch(ze){V(ze)}}function qe(mt){var ze;mt.done?q(mt.value):(ze=mt.value,ze instanceof A?ze:new A(function(_t){_t(ze)})).then(ye,We)}qe((U=U.apply(X,v||[])).next())})}function xe(X,v){var A,U,q,V,ye={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return V={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function We(qe){return function(mt){return function(ze){if(A)throw new TypeError("Generator is already executing.");for(;ye;)try{if(A=1,U&&(q=2&ze[0]?U.return:ze[0]?U.throw||((q=U.return)&&q.call(U),0):U.next)&&!(q=q.call(U,ze[1])).done)return q;switch(U=0,q&&(ze=[2&ze[0],q.value]),ze[0]){case 0:case 1:q=ze;break;case 4:return ye.label++,{value:ze[1],done:!1};case 5:ye.label++,U=ze[1],ze=[0];continue;case 7:ze=ye.ops.pop(),ye.trys.pop();continue;default:if(!(q=ye.trys,(q=q.length>0&&q[q.length-1])||ze[0]!==6&&ze[0]!==2)){ye=0;continue}if(ze[0]===3&&(!q||ze[1]>q[0]&&ze[1]',"select"),this.addActionButton(U,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(U,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(U,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(U,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(U,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(U,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(U,'',"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(V){var ye=document.createElement("div");ye.className=""+A.toolbarButtonStyleClass.name,ye.setAttribute("data-type-name",V.typeName),ye.innerHTML=V.icon,ye.addEventListener("click",function(){A.markerToolbarButtonClicked(ye,V)}),A.buttons.push(ye),A.markerButtons.push(ye)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var q=document.createElement("div");q.className=this.toolbarBlockStyleClass.name,q.style.whiteSpace="nowrap",q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(q),this.addActionButton(q,'',"render"),this.addActionButton(q,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},X.prototype.addButtonClickListener=function(v){this.buttonClickListeners.push(v)},X.prototype.removeButtonClickListener=function(v){this.buttonClickListeners.indexOf(v)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(v),1)},X.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},X.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var v=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var A=0;A0&&this.buttonClickListeners.forEach(function(U){return U("marker",A)}),this.markerButtonOverflowBlock.style.display="none"},X.prototype.actionToolbarButtonClicked=function(v,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])},X.prototype.setActiveButton=function(v){this.resetButtonStyles(),v.className=v.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),v.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},X.prototype.setActiveMarkerButton=function(v){var A=this.markerButtons.find(function(U){return U.getAttribute("data-type-name")===v});A&&this.setActiveButton(A)},X.prototype.setCurrentMarker=function(v){var A=this;this.currentMarker=v,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")})},X}(),Me=function(){function X(v,A,U,q){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=A,this.uiStyleSettings=U,this.styles=q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return X.prototype.addStyles=function(){var v;this.toolboxStyleClass=this.styles.addClass(new Te("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Te("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var A=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Te("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Te("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Te("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Te("toolbox-panel-row_colors",`
background-color: `+((v=this.uiStyleSettings.toolboxBackgroundColor)!==null&&v!==void 0?v:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Te("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
padding: `+A+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Te("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new ke("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new ke("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},X.prototype.show=function(v){var A;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((A=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&A!==void 0?A:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},X.prototype.setPanelButtons=function(v){var A,U,q=this;this.panels=v,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(V){var ye;V.uiStyleSettings=q.uiStyleSettings;var We=document.createElement("div");We.className=q.toolboxButtonStyleClass.name+" "+((ye=q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:q.toolboxButtonStyleColorsClass.name),We.innerHTML=V.icon,We.title=V.title,We.addEventListener("click",function(){q.panelButtonClick(V)}),q.panelButtons.push(We),q.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},X.prototype.panelButtonClick=function(v){var A=this,U=-1;if(v!==this.activePanel){U=this.panels.indexOf(v),this.panelRow.innerHTML="";var q=v.getUi();q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(q),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=v}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(V,ye){var We,qe;V.className=A.toolboxButtonStyleClass.name+" "+(ye===U?""+((We=A.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:A.toolboxActiveButtonStyleColorsClass.name):""+((qe=A.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&qe!==void 0?qe:A.toolboxButtonStyleColorsClass.name))})},X}(),je=function(X,v){this.title=X,this.icon=v},Fe=function(X){function v(A,U,q,V){var ye=X.call(this,A,V||'')||this;return ye.colors=[],ye.addTransparent=!1,ye.colorBoxes=[],ye.colors=U,ye.currentColor=q,ye.setCurrentColor=ye.setCurrentColor.bind(ye),ye.getColorBox=ye.getColorBox.bind(ye),ye}return Se(v,X),v.prototype.getUi=function(){var A=this,U=document.createElement("div");return U.style.overflow="hidden",U.style.whiteSpace="nowrap",this.colors.forEach(function(q){var V=A.getColorBox(q);U.appendChild(V),A.colorBoxes.push(V)}),U},v.prototype.getColorBox=function(A){var U=this,q=this.uiStyleSettings.toolbarHeight/4,V=this.uiStyleSettings.toolbarHeight-q,ye=document.createElement("div");ye.style.display="inline-block",ye.style.boxSizing="content-box",ye.style.width=V-2+"px",ye.style.height=V-2+"px",ye.style.padding="1px",ye.style.marginRight="2px",ye.style.marginBottom="2px",ye.style.borderWidth="2px",ye.style.borderStyle="solid",ye.style.borderRadius=(V+2)/2+"px",ye.style.borderColor=A===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ye.addEventListener("click",function(){U.setCurrentColor(A,ye)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=V-2+"px",We.style.height=V-2+"px",We.style.backgroundColor=A,We.style.borderRadius=V/2+"px",A==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.innerHTML=``),ye.appendChild(We),ye},v.prototype.setCurrentColor=function(A,U){var q=this;this.currentColor=A,this.colorBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(A)},v}(je),Ne=function(){function X(v,A,U){this._state="new",this._isSelected=!1,this._container=v,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(X.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),X.prototype.ownsTarget=function(v){return!1},Object.defineProperty(X.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),X.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},X.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},X.prototype.pointerDown=function(v,A){},X.prototype.dblClick=function(v,A){},X.prototype.manipulate=function(v){},X.prototype.pointerUp=function(v){this.stateChanged()},X.prototype.dispose=function(){},X.prototype.addMarkerVisualToContainer=function(v){this.container.childNodes.length>0?this.container.insertBefore(v,this.container.childNodes[0]):this.container.appendChild(v)},X.prototype.getState=function(){return{typeName:X.typeName,state:this.state,notes:this.notes}},X.prototype.restoreState=function(v){this._state=v.state,this.notes=v.notes},X.prototype.scale=function(v,A){},X.prototype.colorChanged=function(v){this.onColorChanged&&this.onColorChanged(v),this.stateChanged()},X.prototype.fillColorChanged=function(v){this.onFillColorChanged&&this.onFillColorChanged(v),this.stateChanged()},X.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var v=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),v.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(v)&&this.onStateChanged(this)}},X.typeName="MarkerBase",X}(),Ue=function(){function X(){this.findGripByVisual=this.findGripByVisual.bind(this)}return X.prototype.findGripByVisual=function(v){return this.topLeft.ownsTarget(v)?this.topLeft:this.topCenter.ownsTarget(v)?this.topCenter:this.topRight.ownsTarget(v)?this.topRight:this.centerLeft.ownsTarget(v)?this.centerLeft:this.centerRight.ownsTarget(v)?this.centerRight:this.bottomLeft.ownsTarget(v)?this.bottomLeft:this.bottomCenter.ownsTarget(v)?this.bottomCenter:this.bottomRight.ownsTarget(v)?this.bottomRight:void 0},X}(),Je=function(){function X(){this.GRIP_SIZE=10,this.visual=le.createGroup(),this.visual.appendChild(le.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(le.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},X}(),tt=function(){function X(){}return X.toITransformMatrix=function(v){return{a:v.a,b:v.b,c:v.c,d:v.d,e:v.e,f:v.f}},X.toSVGMatrix=function(v,A){return v.a=A.a,v.b=A.b,v.c=A.c,v.d=A.d,v.e=A.e,v.f=A.f,v},X}(),et=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.left=0,V.top=0,V.width=0,V.height=0,V.defaultSize={x:50,y:20},V.offsetX=0,V.offsetY=0,V.rotationAngle=0,V.CB_DISTANCE=10,V._suppressMarkerCreateEvent=!1,V.container.transform.baseVal.appendItem(le.createTransform()),V.setupControlBox(),V}return Se(v,X),Object.defineProperty(v.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"visual",{get:function(){return this._visual},set:function(A){this._visual=A;var U=le.createTransform();this._visual.transform.baseVal.appendItem(U)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(A){return!!X.prototype.ownsTarget.call(this,A)||!!(this.controlGrips.findGripByVisual(A)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(A))},v.prototype.pointerDown=function(A,U){X.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 q=this.unrotatePoint(A);if(this.manipulationStartX=q.x,this.manipulationStartY=q.y,this.offsetX=q.x-this.left,this.offsetY=q.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 V=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=V.x-this.width/2,this.top=V.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ye=this.container.transform.baseVal.getItem(0);ye.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ye,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(A){var U=this.state;X.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)},v.prototype.moveVisual=function(A){this.visual.style.transform="translate("+A.x+"px, "+A.y+"px)"},v.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)},v.prototype.resize=function(A){var U=this.manipulationStartLeft,q=this.manipulationStartWidth,V=this.manipulationStartTop,ye=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:U=this.manipulationStartLeft+A.x-this.manipulationStartX,q=this.manipulationStartWidth+this.manipulationStartLeft-U;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:q=this.manipulationStartWidth+A.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:V=this.manipulationStartTop+A.y-this.manipulationStartY,ye=this.manipulationStartHeight+this.manipulationStartTop-V;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ye=this.manipulationStartHeight+A.y-this.manipulationStartY}q>=0?(this.left=U,this.width=q):(this.left=U+q,this.width=-q),ye>=0?(this.top=V,this.height=ye):(this.top=V+ye,this.height=-ye),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.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()}},v.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)},v.prototype.rotatePoint=function(A){if(this.rotationAngle===0)return A;var U=this.container.getCTM(),q=le.createPoint(A.x,A.y);return{x:(q=q.matrixTransform(U)).x,y:q.y}},v.prototype.unrotatePoint=function(A){if(this.rotationAngle===0)return A;var U=this.container.getCTM();U=U.inverse();var q=le.createPoint(A.x,A.y);return{x:(q=q.matrixTransform(U)).x,y:q.y}},v.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=le.createGroup();var A=le.createTransform();A.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(A),this.container.appendChild(this.controlBox),this.controlRect=le.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=le.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 Ue,this.addControlGrips(),this.controlBox.style.display="none"},v.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()},v.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()},v.prototype.createGrip=function(){var A=new Je;return A.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(A.visual),A},v.prototype.positionGrips=function(){var A=this.controlGrips.topLeft.GRIP_SIZE,U=-A/2,q=U,V=(this.width+this.CB_DISTANCE)/2-A/2,ye=(this.height+this.CB_DISTANCE)/2-A/2,We=this.height+this.CB_DISTANCE-A/2,qe=this.width+this.CB_DISTANCE-A/2;this.positionGrip(this.controlGrips.topLeft.visual,U,q),this.positionGrip(this.controlGrips.topCenter.visual,V,q),this.positionGrip(this.controlGrips.topRight.visual,qe,q),this.positionGrip(this.controlGrips.centerLeft.visual,U,ye),this.positionGrip(this.controlGrips.centerRight.visual,qe,ye),this.positionGrip(this.controlGrips.bottomLeft.visual,U,We),this.positionGrip(this.controlGrips.bottomCenter.visual,V,We),this.positionGrip(this.controlGrips.bottomRight.visual,qe,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,V,q-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(A,U,q){var V=A.transform.baseVal.getItem(0);V.setTranslate(U,q),A.transform.baseVal.replaceItem(V,0)},v.prototype.hideControlBox=function(){this.controlBox.style.display="none"},v.prototype.showControlBox=function(){this.controlBox.style.display=""},v.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)},X.prototype.getState.call(this))},v.prototype.restoreState=function(A){X.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))},v.prototype.scale=function(A,U){X.prototype.scale.call(this,A,U);var q=this.rotatePoint({x:this.left,y:this.top}),V=this.unrotatePoint({x:q.x*A,y:q.y*U});this.left=V.x,this.top=V.y,this.width=this.width*A,this.height=this.height*U,this.adjustControlBox()},v}(Ne),Ze=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.createVisual=V.createVisual.bind(V),V}return Se(v,X),v.prototype.ownsTarget=function(A){return!(!X.prototype.ownsTarget.call(this,A)&&A!==this.visual)},v.prototype.createVisual=function(){this.visual=le.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)},v.prototype.pointerDown=function(A,U){X.prototype.pointerDown.call(this,A,U),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},v.prototype.manipulate=function(A){X.prototype.manipulate.call(this,A)},v.prototype.resize=function(A){X.prototype.resize.call(this,A),this.setSize()},v.prototype.setSize=function(){X.prototype.setSize.call(this),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(A){X.prototype.pointerUp.call(this,A),this.setSize()},v.prototype.setStrokeColor=function(A){this.strokeColor=A,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(A),this.stateChanged()},v.prototype.setFillColor=function(A){this.fillColor=A,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this))},v.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(),X.prototype.restoreState.call(this,A),this.setSize()},v.prototype.scale=function(A,U){X.prototype.scale.call(this,A,U),this.setSize()},v.title="Rectangle marker",v}(et),dt=function(X){function v(A,U,q,V){var ye=X.call(this,A,V||'')||this;return ye.widths=[],ye.widthBoxes=[],ye.widths=U,ye.currentWidth=q,ye.setCurrentWidth=ye.setCurrentWidth.bind(ye),ye}return Se(v,X),v.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(q){var V=document.createElement("div");V.style.display="flex",V.style.flexGrow="2",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=q===A.currentWidth?A.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){A.setCurrentWidth(q,V)}),U.appendChild(V);var ye=document.createElement("div");ye.innerText=q.toString(),ye.style.marginRight="5px",V.appendChild(ye);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var qe=document.createElement("hr");qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop=q+"px solid "+A.uiStyleSettings.toolboxColor,qe.style.flexGrow="2",We.appendChild(qe),V.appendChild(We),A.widthBoxes.push(V)}),U},v.prototype.setCurrentWidth=function(A,U){var q=this;this.currentWidth=A,this.widthBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(je),it=function(X){function v(A,U,q,V){var ye=X.call(this,A,V||'')||this;return ye.styles=[],ye.styleBoxes=[],ye.styles=U,ye.currentStyle=q,ye.setCurrentStyle=ye.setCurrentStyle.bind(ye),ye}return Se(v,X),v.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(q){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/A.styles.length-5+"%",V.style.borderColor=q===A.currentStyle?A.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){A.setCurrentStyle(q,V)}),U.appendChild(V);var ye=document.createElement("div");ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.overflow="hidden";var We=``;ye.innerHTML=We,V.appendChild(ye),A.styleBoxes.push(V)}),U},v.prototype.setCurrentStyle=function(A,U){var q=this;this.currentStyle=A,this.styleBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(je),at=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.strokeColor=q.defaultColor,V.strokeWidth=q.defaultStrokeWidth,V.strokeDasharray=q.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",q.defaultColorSet,q.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new dt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new it("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(v,X),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=X.prototype.getState.call(this);return A.typeName=v.typeName,A},v.typeName="FrameMarker",v.title="Frame marker",v.icon='',v}(Ze),Ie=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},st=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.x1=0,V.y1=0,V.x2=0,V.y2=0,V.defaultLength=50,V.manipulationStartX=0,V.manipulationStartY=0,V.manipulationStartX1=0,V.manipulationStartY1=0,V.manipulationStartX2=0,V.manipulationStartY2=0,V.setupControlBox(),V}return Se(v,X),v.prototype.ownsTarget=function(A){return!!X.prototype.ownsTarget.call(this,A)||!(!this.grip1.ownsTarget(A)&&!this.grip2.ownsTarget(A))},v.prototype.pointerDown=function(A,U){X.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")},v.prototype.pointerUp=function(A){var U=this.state;X.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)},v.prototype.adjustVisual=function(){},v.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)},v.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()},v.prototype.select=function(){X.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){X.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=le.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){this.positionGrips()},v.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},v.prototype.createGrip=function(){var A=new Je;return A.visual.transform.baseVal.appendItem(le.createTransform()),this.controlBox.appendChild(A.visual),A},v.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)},v.prototype.positionGrip=function(A,U,q){var V=A.transform.baseVal.getItem(0);V.setTranslate(U,q),A.transform.baseVal.replaceItem(V,0)},v.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},X.prototype.getState.call(this))},v.prototype.restoreState=function(A){X.prototype.restoreState.call(this,A);var U=A;this.x1=U.x1,this.y1=U.y1,this.x2=U.x2,this.y2=U.y2},v.prototype.scale=function(A,U){X.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()},v}(Ne),$e=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.strokeColor=q.defaultColor,V.strokeWidth=q.defaultStrokeWidth,V.strokeDasharray=q.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",q.defaultColorSet,q.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new dt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new it("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(v,X),v.prototype.ownsTarget=function(A){return!(!X.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.selectorLine&&A!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorLine=le.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=le.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)},v.prototype.pointerDown=function(A,U){X.prototype.pointerDown.call(this,A,U),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},v.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()),le.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(A){this.strokeColor=A,this.adjustVisual(),this.colorChanged(A)},v.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.adjustVisual()},v.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},X.prototype.getState.call(this));return A.typeName=v.typeName,A},v.prototype.restoreState=function(A){X.prototype.restoreState.call(this,A);var U=A;this.strokeColor=U.strokeColor,this.strokeWidth=U.strokeWidth,this.strokeDasharray=U.strokeDasharray,this.createVisual(),this.adjustVisual()},v.typeName="LineMarker",v.title="Line marker",v.icon='',v}(st),De=function(X){function v(A,U,q,V){var ye=X.call(this,A,V||'')||this;return ye.fonts=[],ye.fontBoxes=[],ye.fonts=U,ye.currentFont=q,ye.setCurrentFont=ye.setCurrentFont.bind(ye),ye}return Se(v,X),v.prototype.getUi=function(){var A=this,U=document.createElement("div");return U.style.overflow="hidden",U.style.flexGrow="2",this.fonts.forEach(function(q){var V=document.createElement("div");V.style.display="inline-block",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.overflow="hidden",V.style.maxWidth=100/A.fonts.length-5+"%",V.style.borderColor=q===A.currentFont?A.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){A.setCurrentFont(q,V)}),U.appendChild(V);var ye=document.createElement("div");ye.style.display="flex",ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.fontFamily=q,ye.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",ye.appendChild(We),V.appendChild(ye),A.fontBoxes.push(V)}),U},v.prototype.setCurrentFont=function(A,U){var q=this;this.currentFont=A,this.fontBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(je),He=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.color="transparent",V.padding=5,V.DEFAULT_TEXT="your text here",V.text=V.DEFAULT_TEXT,V.isMoved=!1,V.color=q.defaultColor,V.fontFamily=q.defaultFontFamily,V.defaultSize={x:100,y:30},V.setColor=V.setColor.bind(V),V.setFont=V.setFont.bind(V),V.renderText=V.renderText.bind(V),V.sizeText=V.sizeText.bind(V),V.textEditDivClicked=V.textEditDivClicked.bind(V),V.showTextEditor=V.showTextEditor.bind(V),V.setSize=V.setSize.bind(V),V.positionTextEditor=V.positionTextEditor.bind(V),V.colorPanel=new Fe("Color",q.defaultColorSet,q.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.fontFamilyPanel=new De("Font",q.defaultFontFamilies,q.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V}return Se(v,X),v.prototype.ownsTarget=function(A){if(X.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(q){q===A&&(U=!0)}),U},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.bgRectangle=le.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=le.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.textElement.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(A,U){X.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")},v.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(le.createTSpan(U.trim()===""?" ":U.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var A=this.textElement.getBBox(),U=1;if(A.width>0&&A.height>0){var q=(1*this.width-this.width*this.padding*2/100)/A.width,V=(1*this.height-this.height*this.padding*2/100)/A.height;U=Math.min(q,V)}return U},v.prototype.getTextPosition=function(A){var U=this.textElement.getBBox(),q=0,V=0;return U.width>0&&U.height>0&&(q=(this.width-U.width*A)/2,V=this.height/2-U.height*A/2),{x:q,y:V}},v.prototype.sizeText=function(){var A=this.textElement.getBBox(),U=this.getTextScale(),q=this.getTextPosition(U);q.y-=A.y*U,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+q.x+"px, "+q.y+"px) scale("+U+", "+U+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(q.x,q.y),this.textElement.transform.baseVal.getItem(1).setScale(U,U))},v.prototype.manipulate=function(A){X.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)},v.prototype.resize=function(A){X.prototype.resize.call(this,A),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){X.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(A){var U=this.state;U==="creating"&&(this._suppressMarkerCreateEvent=!0),X.prototype.pointerUp.call(this,A),this.setSize(),(U==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.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 q=U.clipboardData.getData("text"),V=window.getSelection();if(!V.rangeCount)return!1;V.deleteFromDocument(),V.getRangeAt(0).insertNode(document.createTextNode(q)),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")},v.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}),q=this.textElement.getBBox(),V={x:q.width*A,y:q.height*A};U.x-=V.x/2,U.y-=V.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"}},v.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()},v.prototype.select=function(){X.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},v.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),X.prototype.deselect.call(this)},v.prototype.dblClick=function(A,U){X.prototype.dblClick.call(this,A,U),this.showTextEditor()},v.prototype.setColor=function(A){this.textElement&&le.setAttributes(this.textElement,[["fill",A]]),this.color=A,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(A)},v.prototype.setFont=function(A){this.textElement&&le.setAttributes(this.textElement,[["font-family",A]]),this.fontFamily=A,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},v.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},v.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},X.prototype.getState.call(this));return A.typeName=v.typeName,A},v.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(),X.prototype.restoreState.call(this,A),this.setSize()},v.prototype.scale=function(A,U){X.prototype.scale.call(this,A,U),this.setSize(),this.sizeText(),this.positionTextEditor()},v.typeName="TextMarker",v.title="Text marker",v.icon='',v}(et),Ee=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.color="transparent",V.lineWidth=3,V.drawing=!1,V.pixelRatio=1,V.color=q.defaultColor,V.lineWidth=q.defaultStrokeWidth,V.pixelRatio=q.freehandPixelRatio,V.setColor=V.setColor.bind(V),V.addCanvas=V.addCanvas.bind(V),V.finishCreation=V.finishCreation.bind(V),V.setLineWidth=V.setLineWidth.bind(V),V.colorPanel=new Fe("Color",q.defaultColorSet,q.defaultColor),V.colorPanel.onColorChanged=V.setColor,V.lineWidthPanel=new dt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.lineWidthPanel.onWidthChanged=V.setLineWidth,V}return Se(v,X),v.prototype.ownsTarget=function(A){return!(!X.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.drawingImage=le.createImage(),this.visual.appendChild(this.drawingImage);var A=le.createTransform();this.visual.transform.baseVal.appendItem(A),this.addMarkerVisualToContainer(this.visual)},v.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):X.prototype.pointerDown.call(this,A,U)},v.prototype.manipulate=function(A){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(A.x,A.y),this.canvasContext.stroke()):X.prototype.manipulate.call(this,A)},v.prototype.resize=function(A){X.prototype.resize.call(this,A),le.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(A){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):X.prototype.pointerUp.call(this,A)},v.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)},v.prototype.select=function(){this.state==="creating"&&this.finishCreation(),X.prototype.select.call(this)},v.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),X.prototype.deselect.call(this)},v.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],q=U[0],V=U[1],ye=U[2],We=U[3],qe=!1,mt=0;mt0&&(qe=!0,mtWe&&(We=mt),ze>ye&&(ye=ze));if(qe){this.left=q/this.pixelRatio,this.top=V/this.pixelRatio,this.width=(ye-q)/this.pixelRatio,this.height=(We-V)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=ye-q,_t.height=We-V,_t.getContext("2d").putImageData(this.canvasContext.getImageData(q,V,ye-q,We-V),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){le.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),le.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(A){this.color=A,this.colorChanged(A)},v.prototype.setLineWidth=function(A){this.lineWidth=A},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=Object.assign({drawingImgUrl:this.drawingImgUrl},X.prototype.getState.call(this));return A.typeName=v.typeName,A},v.prototype.restoreState=function(A){this.createVisual(),X.prototype.restoreState.call(this,A),this.drawingImgUrl=A.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(A,U){X.prototype.scale.call(this,A,U),this.setDrawingImage()},v.typeName="FreehandMarker",v.title="Freehand marker",v.icon='',v}(et),fe=function(X){function v(A,U,q){var V=X.call(this,A,q||'')||this;return V.typeBoxes=[],V.currentType=U,V.setCurrentType=V.setCurrentType.bind(V),V}return Se(v,X),v.prototype.getUi=function(){var A=this,U=document.createElement("div");U.style.display="flex",U.style.overflow="hidden",U.style.flexGrow="2";for(var q=function(We){var qe="both";switch(We){case 0:qe="both";break;case 1:qe="start";break;case 2:qe="end";break;case 3:qe="none"}var mt=document.createElement("div");if(mt.style.display="flex",mt.style.flexGrow="2",mt.style.alignItems="center",mt.style.justifyContent="space-between",mt.style.padding="5px",mt.style.borderWidth="2px",mt.style.borderStyle="solid",mt.style.borderColor=qe===V.currentType?V.uiStyleSettings.toolboxAccentColor:"transparent",mt.addEventListener("click",function(){A.setCurrentType(qe,mt)}),U.appendChild(mt),qe==="both"||qe==="start"){var ze=document.createElement("div");ze.style.display="flex",ze.style.alignItems="center",ze.style.minHeight="20px",ze.innerHTML=``,ze.style.marginLeft="5px",mt.appendChild(ze)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(V.uiStyleSettings!==void 0?V.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",_t.appendChild(jt),mt.appendChild(_t),qe==="both"||qe==="end"){var $t=document.createElement("div");$t.style.display="flex",$t.style.alignItems="center",$t.style.minHeight="20px",$t.innerHTML=``,$t.style.marginRight="5px",mt.appendChild($t)}V.typeBoxes.push(mt)},V=this,ye=0;ye<4;ye++)q(ye);return U},v.prototype.setCurrentType=function(A,U){var q=this;this.currentType=A,this.typeBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings!==void 0?q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(je),_e=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.arrowType="end",V.arrowBaseHeight=10,V.arrowBaseWidth=10,V.getArrowPoints=V.getArrowPoints.bind(V),V.setArrowType=V.setArrowType.bind(V),V.arrowTypePanel=new fe("Arrow type","end"),V.arrowTypePanel.onArrowTypeChanged=V.setArrowType,V}return Se(v,X),v.prototype.ownsTarget=function(A){return!(!X.prototype.ownsTarget.call(this,A)&&A!==this.arrow1&&A!==this.arrow2)},v.prototype.getArrowPoints=function(A,U){var q=this.arrowBaseWidth+2*this.strokeWidth,V=this.arrowBaseHeight+2*this.strokeWidth;return A-q/2+","+(U+V/2)+" "+A+","+(U-V/2)+" "+(A+q/2)+","+(U+V/2)},v.prototype.createTips=function(){this.arrow1=le.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=le.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(le.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(A,U){X.prototype.pointerDown.call(this,A,U),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(X.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",le.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),le.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 q=this.arrow2.transform.baseVal.getItem(0);q.setRotate(A+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(q,0)}},v.prototype.setArrowType=function(A){this.arrowType=A,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=Object.assign({arrowType:this.arrowType},X.prototype.getState.call(this));return A.typeName=v.typeName,A},v.prototype.restoreState=function(A){X.prototype.restoreState.call(this,A);var U=A;this.arrowType=U.arrowType,this.createTips(),this.adjustVisual()},v.typeName="ArrowMarker",v.title="Arrow marker",v.icon='',v}($e),re=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.fillColor=q.defaultFillColor,V.strokeWidth=0,V.fillPanel=new Fe("Color",q.defaultColorSet,q.defaultFillColor),V.fillPanel.onColorChanged=V.setFillColor,V}return Se(v,X),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=X.prototype.getState.call(this);return A.typeName=v.typeName,A},v.typeName="CoverMarker",v.title="Cover marker",v.icon='',v}(Ze),ae=function(X){function v(A,U,q,V){var ye=X.call(this,A,V||'')||this;return ye.opacities=[],ye.opacityBoxes=[],ye.opacities=U,ye.currentOpacity=q,ye.setCurrentOpacity=ye.setCurrentOpacity.bind(ye),ye}return Se(v,X),v.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(q){var V=document.createElement("div");V.style.display="flex",V.style.alignItems="center",V.style.justifyContent="center",V.style.padding="5px",V.style.borderWidth="2px",V.style.borderStyle="solid",V.style.borderColor=q===A.currentOpacity?A.uiStyleSettings.toolboxAccentColor:"transparent",V.addEventListener("click",function(){A.setCurrentOpacity(q,V)}),U.appendChild(V);var ye=document.createElement("div");ye.innerText=100*q+"%",V.appendChild(ye),A.opacityBoxes.push(V)}),U},v.prototype.setCurrentOpacity=function(A,U){var q=this;this.currentOpacity=A,this.opacityBoxes.forEach(function(V){V.style.borderColor=V===U?q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(je),he=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.setOpacity=V.setOpacity.bind(V),V.fillColor=q.defaultHighlightColor,V.strokeWidth=0,V.opacity=q.defaultHighlightOpacity,V.fillPanel=new Fe("Color",q.defaultColorSet,V.fillColor),V.fillPanel.onColorChanged=V.setFillColor,V.opacityPanel=new ae("Opacity",q.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(v,X),v.prototype.setOpacity=function(A){this.opacity=A,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=X.prototype.getState.call(this);return A.typeName=v.typeName,A},v.typeName="HighlightMarker",v.title="Highlight marker",v.icon='',v}(re),ve='',be=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.bgColor="transparent",V.tipPosition={x:0,y:0},V.tipBase1Position={x:0,y:0},V.tipBase2Position={x:0,y:0},V.tipMoving=!1,V.color=q.defaultStrokeColor,V.bgColor=q.defaultFillColor,V.fontFamily=q.defaultFontFamily,V.defaultSize={x:100,y:30},V.setBgColor=V.setBgColor.bind(V),V.getTipPoints=V.getTipPoints.bind(V),V.positionTip=V.positionTip.bind(V),V.setTipPoints=V.setTipPoints.bind(V),V.colorPanel=new Fe("Text color",q.defaultColorSet,V.color,''),V.colorPanel.onColorChanged=V.setColor,V.bgColorPanel=new Fe("Fill color",q.defaultColorSet,V.bgColor,ve),V.bgColorPanel.onColorChanged=V.setBgColor,V.fontFamilyPanel=new De("Font",q.defaultFontFamilies,q.defaultFontFamily),V.fontFamilyPanel.onFontChanged=V.setFont,V.tipGrip=new Je,V.tipGrip.visual.transform.baseVal.appendItem(le.createTransform()),V.controlBox.appendChild(V.tipGrip.visual),V}return Se(v,X),v.prototype.ownsTarget=function(A){return X.prototype.ownsTarget.call(this,A)||this.tipGrip.ownsTarget(A)||this.tip===A},v.prototype.createTip=function(){le.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=le.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(A,U){this.state==="new"&&X.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):X.prototype.pointerDown.call(this,A,U)},v.prototype.pointerUp=function(A){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,X.prototype.pointerUp.call(this,A);else{var U=this.state==="creating";X.prototype.pointerUp.call(this,A),this.setTipPoints(U),this.positionTip()}},v.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 X.prototype.manipulate.call(this,A)},v.prototype.setBgColor=function(A){this.bgRectangle&&this.tip&&(le.setAttributes(this.bgRectangle,[["fill",A]]),le.setAttributes(this.tip,[["fill",A]])),this.bgColor=A,this.fillColorChanged(A)},v.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},v.prototype.setTipPoints=function(A){A===void 0&&(A=!1);var U=Math.min(this.height/2,15),q=this.height/5;A&&(this.tipPosition={x:U+q/2,y:this.height+20});var V=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?V',v}(He),Pe=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.fillColor="transparent",V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.opacity=1,V.strokeColor=q.defaultColor,V.strokeWidth=q.defaultStrokeWidth,V.strokeDasharray=q.defaultStrokeDasharray,V.fillColor=q.defaultFillColor,V.setStrokeColor=V.setStrokeColor.bind(V),V.setFillColor=V.setFillColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.setOpacity=V.setOpacity.bind(V),V.createVisual=V.createVisual.bind(V),V.strokePanel=new Fe("Line color",pe(q.defaultColorSet,["transparent"]),q.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.fillPanel=new Fe("Fill color",pe(q.defaultColorSet,["transparent"]),V.fillColor,ve),V.fillPanel.onColorChanged=V.setFillColor,V.strokeWidthPanel=new dt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new it("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V.opacityPanel=new ae("Opacity",q.defaultOpacitySteps,V.opacity),V.opacityPanel.onOpacityChanged=V.setOpacity,V}return Se(v,X),v.prototype.ownsTarget=function(A){return!(!X.prototype.ownsTarget.call(this,A)&&A!==this.visual)},v.prototype.createVisual=function(){this.visual=le.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)},v.prototype.pointerDown=function(A,U){X.prototype.pointerDown.call(this,A,U),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},v.prototype.manipulate=function(A){X.prototype.manipulate.call(this,A)},v.prototype.resize=function(A){X.prototype.resize.call(this,A),this.setSize()},v.prototype.setSize=function(){X.prototype.setSize.call(this),le.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},v.prototype.pointerUp=function(A){X.prototype.pointerUp.call(this,A),this.setSize()},v.prototype.setStrokeColor=function(A){this.strokeColor=A,this.visual&&le.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(A),this.stateChanged()},v.prototype.setFillColor=function(A){this.fillColor=A,this.visual&&le.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(A),this.stateChanged()},v.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.visual&&le.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.visual&&le.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(A){this.opacity=A,this.visual&&le.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},X.prototype.getState.call(this));return A.typeName=v.typeName,A},v.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(),X.prototype.restoreState.call(this,A),this.setSize()},v.prototype.scale=function(A,U){X.prototype.scale.call(this,A,U),this.setSize()},v.typeName="EllipseMarker",v.title="Ellipse marker",v.icon='',v}(et),Ge=function(X){function v(A,U,q){return X.call(this,A,U,q)||this}return Se(v,X),Object.defineProperty(v.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(A){return!(!X.prototype.ownsTarget.call(this,A)&&A!==this.tip1&&A!==this.tip2)},v.prototype.createTips=function(){this.tip1=le.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(le.createTransform()),this.visual.appendChild(this.tip1),this.tip2=le.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(le.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(A,U){X.prototype.pointerDown.call(this,A,U),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(X.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(le.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()]]),le.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 q=this.tip2.transform.baseVal.getItem(0);q.setRotate(A+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(q,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=X.prototype.getState.call(this);return A.typeName=v.typeName,A},v.prototype.restoreState=function(A){X.prototype.restoreState.call(this,A),this.createTips(),this.adjustVisual()},v.typeName="MeasurementMarker",v.title="Measurement marker",v.icon='',v}($e),ot=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.strokePanel.colors=q.defaultColorSet,V.fillColor="transparent",V}return Se(v,X),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=X.prototype.getState.call(this);return A.typeName=v.typeName,A},v.typeName="EllipseFrameMarker",v.title="Ellipse frame marker",v.icon='',v}(Pe),ct=function(){function X(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),X.prototype.addUndoStep=function(v){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(v)||(this.undoStack.push(v),JSON.stringify(this.lastRedoStep)!==JSON.stringify(v)&&this.redoStack.splice(0,this.redoStack.length))},X.prototype.replaceLastUndoStep=function(v){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=v)},X.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},X.prototype.undo=function(){if(this.undoStack.length>1){var v=this.undoStack.pop();return v!==void 0&&this.redoStack.push(v),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},X.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},X}(),ft=function(X){function v(A,U,q){var V=X.call(this,A,U,q)||this;return V.strokeColor="transparent",V.strokeWidth=0,V.strokeDasharray="",V.curveX=0,V.curveY=0,V.manipulationStartCurveX=0,V.manipulationStartCurveY=0,V.setStrokeColor=V.setStrokeColor.bind(V),V.setStrokeWidth=V.setStrokeWidth.bind(V),V.setStrokeDasharray=V.setStrokeDasharray.bind(V),V.positionGrips=V.positionGrips.bind(V),V.addControlGrips=V.addControlGrips.bind(V),V.adjustVisual=V.adjustVisual.bind(V),V.setupControlBox=V.setupControlBox.bind(V),V.resize=V.resize.bind(V),V.strokeColor=q.defaultColor,V.strokeWidth=q.defaultStrokeWidth,V.strokeDasharray=q.defaultStrokeDasharray,V.strokePanel=new Fe("Line color",q.defaultColorSet,q.defaultColor),V.strokePanel.onColorChanged=V.setStrokeColor,V.strokeWidthPanel=new dt("Line width",q.defaultStrokeWidths,q.defaultStrokeWidth),V.strokeWidthPanel.onWidthChanged=V.setStrokeWidth,V.strokeStylePanel=new it("Line style",q.defaultStrokeDasharrays,q.defaultStrokeDasharray),V.strokeStylePanel.onStyleChanged=V.setStrokeDasharray,V}return Se(v,X),v.prototype.ownsTarget=function(A){return!(!X.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.selectorCurve&&A!==this.visibleCurve&&!this.curveGrip.ownsTarget(A))},v.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},v.prototype.createVisual=function(){this.visual=le.createGroup(),this.selectorCurve=le.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=le.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)},v.prototype.pointerDown=function(A,U){X.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")},v.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),le.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),le.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),le.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){X.prototype.setupControlBox.call(this),this.curveControlLine1=le.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=le.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)},v.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,X.prototype.addControlGrips.call(this)},v.prototype.positionGrips=function(){X.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()))},v.prototype.manipulate=function(A){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+A.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+A.y-this.manipulationStartY),X.prototype.manipulate.call(this,A)},v.prototype.resize=function(A){this.activeGrip===this.curveGrip&&(this.curveX=A.x,this.curveY=A.y),X.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)},v.prototype.setStrokeColor=function(A){this.strokeColor=A,this.adjustVisual(),this.colorChanged(A)},v.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.adjustVisual()},v.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.adjustVisual()},v.prototype.scale=function(A,U){this.curveX=this.curveX*A,this.curveY=this.curveY*U,X.prototype.scale.call(this,A,U)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var A=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},X.prototype.getState.call(this));return A.typeName=v.typeName,A},v.prototype.restoreState=function(A){X.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()},v.typeName="CurveMarker",v.title="Curve marker",v.icon='',v}(st),Ct=function(){function X(v,A){A===void 0&&(A=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=A}return Object.defineProperty(X.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),X.prototype.preventDefault=function(){this._defaultPrevented=!0},X}(),xt=function(X){function v(A,U,q){var V=X.call(this,A,!1)||this;return V.dataUrl=U,V.state=q,V}return Se(v,X),v}(Ct),ut=function(X){function v(A,U,q){q===void 0&&(q=!1);var V=X.call(this,A,q)||this;return V.marker=U,V}return Se(v,X),v}(Ct),Ut=function(){function X(){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 X.prototype.addEventListener=function(v,A){this[v].push(A)},X.prototype.removeEventListener=function(v,A){var U=this[v].indexOf(A);U>-1&&this[v].splice(U,1)},X}(),Mt=function(){function X(v){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ie,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 Ut,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=X.instanceCounter++,this.styles=new Oe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=v,this.targetRoot=document.body,this.width=v.clientWidth,this.height=v.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(X.prototype,"ALL_MARKER_TYPES",{get:function(){return[at,Ee,_e,He,ot,Pe,he,be,Ge,re,$e,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[at,Ee,_e,He,Pe,he,be]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"BASIC_MARKER_TYPES",{get:function(){return[at,Ee,_e,He,he]},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var A=this;this._availableMarkerTypes.splice(0),v.forEach(function(U){if(typeof U=="string"){var q=A.ALL_MARKER_TYPES.find(function(V){return V.typeName===U});q!==void 0&&A._availableMarkerTypes.push(q)}else A._availableMarkerTypes.push(U)})},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(v){this._zoomLevel=v,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),X.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},X.prototype.show=function(){var v=this;this.styles.styleSheetRoot===void 0&&se.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=se.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(A){return A(new Ct(v))})},X.prototype.render=function(){return Ce(this,void 0,void 0,function(){var v;return xe(this,function(A){switch(A.label){case 0:return this.setCurrentMarker(),(v=new de).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.markersOnly=this.renderMarkersOnly,v.width=this.renderWidth,v.height=this.renderHeight,[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return A.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,A.sent()]}})})},X.prototype.close=function(v){var A=this;if(v===void 0&&(v=!1),this.isOpen){var U=!1;v||this.eventListeners.beforeclose.forEach(function(q){var V=new Ct(A,!0);q(V),V.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(q){return q(new Ct(A))}),this.detachEvents(),this._isOpen=!1)}},X.prototype.addMarkersToToolbar=function(){for(var v,A=[],U=0;Uthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,U=A',v.title="Powered by marker.js",v.style.display="grid",v.style.alignItems="center",v.style.justifyItems="center",v.style.padding="3px",v.style.width="20px",v.style.height="20px",this.logoUI.appendChild(v),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},X.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")},X.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"},X.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},X.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 v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"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-1&&this.markers.splice(this.markers.indexOf(v),1),v.dispose()},X.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())},X.prototype.toolbarButtonClicked=function(v,A){if(v==="marker"&&A!==void 0)this.createNewMarker(A);else if(v==="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()}},X.prototype.deleteSelectedMarker=function(){var v=this;if(this._currentMarker!==void 0){var A=!1;if(this.eventListeners.markerbeforedelete.forEach(function(q){var V=new ut(v,v._currentMarker,!0);q(V),V.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(q){return q(new ut(v,U))})}}},X.prototype.clear=function(){var v=this,A=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ye){var We=new ut(v,void 0,!0);ye(We),We.defaultPrevented&&(A=!0)}),!A)){this.setCurrentMarker();for(var U=function(ye){var We=q.markers[ye];q.setCurrentMarker(q.markers[ye]),q._currentMarker.dispose(),q.markerImage.removeChild(q._currentMarker.container),q.markers.splice(q.markers.indexOf(q._currentMarker),1),q.eventListeners.markerdelete.forEach(function(qe){return qe(new ut(v,We))})},q=this,V=this.markers.length-1;V>=0;V--)U(V);this.addUndoStep()}},Object.defineProperty(X.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),X.prototype.showNotesEditor=function(){var v;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=(v=this._currentMarker.notes)!==null&&v!==void 0?v:"",this.overlayContainer.appendChild(this.notesArea))},X.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)},X.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},X.prototype.addUndoStep=function(){var v=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 q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(A),q1&&this.panTo({x:v.clientX,y:v.clientY}))},X.prototype.onPointerUp=function(v){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(v.clientX,v.clientY)),this.isDragging=!1,this.addUndoStep()},X.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},X.prototype.onKeyUp=function(v){this._currentMarker===void 0||this.notesArea!==void 0||v.key!=="Delete"&&v.key!=="Backspace"||this.deleteSelectedMarker()},X.prototype.clientToLocalCoordinates=function(v,A){var U=this.markerImage.getBoundingClientRect();return{x:(v-U.left)/this.zoomLevel,y:(A-U.top)/this.zoomLevel}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"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()},X.prototype.addLicenseKey=function(v){te.addKey(v)},X.prototype.addEventListener=function(v,A){this.eventListeners.addEventListener(v,A)},X.prototype.removeEventListener=function(v,A){this.eventListeners.removeEventListener(v,A)},X.prototype.renderState=function(v){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(v),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(X.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),X.prototype.focus=function(){var v=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 Ct(v))}))},X.prototype.blur=function(){var v=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(A){return A(new Ct(v))}))},X.instanceCounter=0,X}();/* **********************************
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 Zt=function(X,v){return(Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,U){A.__proto__=U}||function(A,U){for(var q in U)Object.prototype.hasOwnProperty.call(U,q)&&(A[q]=U[q])})(X,v)};function Yt(X,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function A(){this.constructor=X}Zt(X,v),X.prototype=v===null?Object.create(v):(A.prototype=v.prototype,new A)}function Rt(X,v,A,U){return new(A||(A=Promise))(function(q,V){function ye(mt){try{qe(U.next(mt))}catch(ze){V(ze)}}function We(mt){try{qe(U.throw(mt))}catch(ze){V(ze)}}function qe(mt){var ze;mt.done?q(mt.value):(ze=mt.value,ze instanceof A?ze:new A(function(_t){_t(ze)})).then(ye,We)}qe((U=U.apply(X,v||[])).next())})}function Ti(X,v){var A,U,q,V,ye={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return V={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(V[Symbol.iterator]=function(){return this}),V;function We(qe){return function(mt){return function(ze){if(A)throw new TypeError("Generator is already executing.");for(;ye;)try{if(A=1,U&&(q=2&ze[0]?U.return:ze[0]?U.throw||((q=U.return)&&q.call(U),0):U.next)&&!(q=q.call(U,ze[1])).done)return q;switch(U=0,q&&(ze=[2&ze[0],q.value]),ze[0]){case 0:case 1:q=ze;break;case 4:return ye.label++,{value:ze[1],done:!1};case 5:ye.label++,U=ze[1],ze=[0];continue;case 7:ze=ye.ops.pop(),ye.trys.pop();continue;default:if(!(q=ye.trys,(q=q.length>0&&q[q.length-1])||ze[0]!==6&&ze[0]!==2)){ye=0;continue}if(ze[0]===3&&(!q||ze[1]>q[0]&&ze[1]0&&A>0){var U=new Gi(v,A),q=U.ratio>=1?20:U.getHorizontalLength(20),V=U.ratio<1?20:U.getVerticalLength(20),ye=document.createElementNS("http://www.w3.org/2000/svg","svg");ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),ye.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ye);var We=Qe.createDefs();ye.appendChild(We);var qe=Qe.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(qe);var mt=Qe.createPath(Qe.getHollowRectanglePath((24-q)/2,(24-V)/2,q,V,(24-q)/2+2,(24-V)/2+2,q-4,V-4));ye.appendChild(mt);var ze=Qe.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ze.appendChild(Qe.createTSpan(v+":"+A)),ye.appendChild(ze);var _t=ze.getBBox();Qe.setAttributes(ze,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var jt=Qe.createPath(Qe.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return qe.appendChild(jt),Qe.setAttributes(mt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ye),ye.outerHTML}return''},X}(),vi=function(X){function v(A,U,q){var V=X.call(this,A,U)||this;return V.isDropdownOpen=!1,V.onClick=V.dropdownButtonClicked,V.dropdownButtons=q,V}return Yt(v,X),v.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)},v.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},v.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},v.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},v.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},v.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},v}(Bt),kt=function(){function X(v,A){this.GRIP_SIZE=10,this.color=v,this.fillColor=A,this.visual=Qe.createGroup(),this.visual.appendChild(Qe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Qe.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return X.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},X.prototype.setCenter=function(v,A){this.visual.childNodes.forEach(function(U){return Qe.setAttributes(U,[["cx",v.toString()],["cy",A.toString()]])})},X}(),Bi=function(){function X(v,A,U,q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=v,this.canvasHeight=A,this.margin=U,this.container=q,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(X.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(v){this._aspectRatio=v,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.gridContainer&&Qe.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(v){this._zoomFactor=v,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),X.prototype.open=function(){var v=this;this.cropShadeElement=Qe.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Qe.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var A=0;Athis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-A.height/2),Qe.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(V,ye){var We=A.y+U*(ye+1);Qe.setAttributes(V,[["x1",""+A.x],["y1",""+We],["x2",""+(A.x+A.width)],["y2",""+We]])});var q=A.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(V,ye){var We=A.x+q*(ye+1);Qe.setAttributes(V,[["x1",""+We],["y1",""+A.y],["x2",""+We],["y2",""+(A.y+A.height)]])}),Qe.setAttributes(this.cropShadeElement,[["d",Qe.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},X.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)},X.prototype.clientToLocalCoordinates=function(v,A){var U=this.container.getBoundingClientRect();return{x:v-U.left+this.margin,y:A-U.top+this.margin}},X.prototype.onPointerDown=function(v){this.container.setPointerCapture(v.pointerId),this.previousPoint=this.clientToLocalCoordinates(v.clientX,v.clientY),this.cropRectElement===v.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(v.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(v.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(v.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(v.target)&&(this.activeGrip=this.bottomRightGrip)},X.prototype.onPointerMove=function(v){if(this.isMoving)this.move(this.clientToLocalCoordinates(v.clientX,v.clientY));else if(this.activeGrip){var A=this.clientToLocalCoordinates(v.clientX,v.clientY);this.resize(A)}v.preventDefault()},X.prototype.onPointerUp=function(v){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(v.pointerId)},X.prototype.move=function(v){var A=v.x-this.previousPoint.x,U=v.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=v},X.prototype.resize=function(v){var A=Object.assign({},this.cropRect),U=v.x-this.previousPoint.x,q=v.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:A.x+Uthis.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+=q,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+=q}A.width<10&&(A.x=this.cropRect.x,A.width=10),A.height<10&&(A.y=this.cropRect.y,A.height=10),this.previousPoint=v,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))},X.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var v=this.cropRect.x+this.cropRect.width/2,A=this.cropRect.y+this.cropRect.height/2,U=this.aspectRatio.getHorizontalLength(this.cropRect.height),q=this.aspectRatio.getVerticalLength(this.cropRect.width);U/this.canvasWidththis.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=v-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)}},X.prototype.getRescaledRect=function(v,A,U,q,V,ye){var We=U/v,qe=q/A;return{x:(V.x-ye)*We+ye,y:(V.y-ye)*qe+ye,width:V.width*We,height:V.height*qe}},X.prototype.scaleCanvas=function(v,A){var U=this.getRescaledRect(this.canvasWidth,this.canvasHeight,v,A,this.cropRect,this.margin);this.canvasWidth=v,this.canvasHeight=A,this.onCropChange&&this.onCropChange(U),this.setCropRectangle(U)},X}(),Vi=function(){function X(v){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=v,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(X.prototype,"angle",{get:function(){return this._angle},set:function(v){this._angle=v,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),X.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},X.prototype.onPointerDown=function(v){this.controlContainer.setPointerCapture(v.pointerId),this.isDragging=!0,this.previousPoint={x:v.clientX,y:v.clientY}},X.prototype.onPointerMove=function(v){this.isDragging&&(this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.previousPoint.x=v.clientX)},X.prototype.onPointerUp=function(v){this.isDragging&&this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(v.pointerId)},X.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var v=this.angleLabelText.getBBox();Qe.setAttributes(this.angleLabelElement,[["x",((this.width-v.width)/2).toString()],["y",(this.height/2).toString()]])}},X.prototype.positionScaleShape=function(){if(this.scaleShape){var v=this.scaleShape.transform.baseVal.getItem(0);v.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(v,0)}},X.prototype.getVisual=function(){var v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("xmlns","http://www.w3.org/2000/svg"),v.setAttribute("width",this.width+"px"),v.setAttribute("height",this.height+"px"),v.setAttribute("viewBox","0 0 "+this.width+" "+this.height),v.style.flexShrink="0",document.body.appendChild(v);for(var A="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,U=1;U<=this.width/5+10;U++){var q=U%5==0?this.height/3:this.height/6;A+="h4v"+-q+"h1v"+q}A+="v1H0Z",this.scaleShape=Qe.createPath(A);var V=Qe.createTransform();this.scaleShape.transform.baseVal.appendItem(V),v.appendChild(this.scaleShape),this.angleLabelElement=Qe.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Qe.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ye=Qe.createTSpan("");return ye.innerHTML="°",this.angleLabelElement.appendChild(ye),v.appendChild(this.angleLabelElement),document.body.removeChild(v),v},X}(),fr=function(){function X(){this.naturalSize=!1,this.imageType="image/png"}return X.prototype.rasterize=function(v,A,U,q,V,ye,We){var qe=this;return new Promise(function(mt){var ze=document.createElement("canvas");ze.width=v.width.baseVal.value-2*q,ze.height=v.height.baseVal.value-2*q;var _t=1,jt=1;qe.naturalSize===!0?(_t=A.naturalWidth/(v.width.baseVal.value-2*q)/ye,jt=A.naturalHeight/(v.height.baseVal.value-2*q)/We,ze.width=A.naturalWidth/ye,ze.height=A.naturalHeight/We):qe.width!==void 0&&qe.height!==void 0&&(_t=qe.width/U.width,jt=qe.height/U.height,ze.width*=_t,ze.height*=jt);var $t=ze.getContext("2d");$t.translate(ze.width/2,ze.height/2),$t.rotate(V*Math.PI/180),$t.scale(ye,We),$t.translate(-ze.width/2,-ze.height/2),$t.drawImage(A,0,0,ze.width,ze.height);var Pi=document.createElement("canvas");Pi.width=U.width*_t,Pi.height=U.height*jt,Pi.getContext("2d").putImageData($t.getImageData((U.x-q)*_t,(U.y-q)*jt,U.width*_t,U.height*jt),0,0),mt(Pi.toDataURL(qe.imageType,qe.imageQuality))})},X}(),Ve=function(){function X(v){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=X.instanceCounter++,this.styles=new wt(this.instanceNo),this.target=v,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(X.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(v){this._zoomToCropEnabled=v,v?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"gridLines",{get:function(){return this._gridLines},set:function(v){this._gridLines=v,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(v){this._rotationAngle=v,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(X.prototype,"aspectRatio",{get:function(){var v;return(v=this._aspectRatio)!==null&&v!==void 0?v:this.aspectRatios[0]},set:function(v){this._aspectRatio=v},enumerable:!1,configurable:!0}),X.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},X.prototype.show=function(){this.showUI(),this.open()},X.prototype.close=function(v){v===void 0&&(v=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),v||this.closeEventListeners.forEach(function(A){return A()}),this._isOpen=!1)},X.prototype.addRenderEventListener=function(v){this.renderEventListeners.push(v)},X.prototype.removeRenderEventListener=function(v){this.renderEventListeners.indexOf(v)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(v),1)},X.prototype.addCloseEventListener=function(v){this.closeEventListeners.push(v)},X.prototype.removeCloseEventListener=function(v){this.closeEventListeners.indexOf(v)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(v),1)},X.prototype.setupResizeObserver=function(){var v=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.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))},X.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var v=1*this.target.clientWidth/this.target.clientHeight,A=this.contentDiv.clientWidth/v>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*v:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,U=A+2*this.CANVAS_MARGINv+this.CANVAS_MARGIN?this.target.offsetTop-(v+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},X.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},X.prototype.addTopToolbar=function(){var v=this;this.topToolbar=new qt,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 er;A.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(A);var U=[];this.aspectRatios.forEach(function(jt){var $t=new Bt(tr.getIcon(jt.horizontal,jt.vertical),jt.horizontal===0&&jt.vertical===0?"FREE":jt.horizontal+":"+jt.vertical);$t.onClick=function(){return v.ratioButtonClicked(jt)},U.push($t)}),this.aspectRatioButton=new vi(tr.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 q=new Bt('',"Toggle grid");q.isActive=this.isGridVisible,q.onClick=function(){v.isGridVisible=!v.isGridVisible,q.isActive=v.isGridVisible},A.addButton(q);var V=new Bt('',"Zoom to selection");if(V.isActive=this.zoomToCropEnabled,V.onClick=function(){v.zoomToCropEnabled=!v.zoomToCropEnabled,V.isActive=v.zoomToCropEnabled},A.addButton(V),!Ui.isLicensed){var ye=new pt;this.topToolbar.addElementBlock(ye);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var qe=document.createElement("a");qe.style.color="currentColor",qe.href="https://markerjs.com/products/cropro",qe.target="_blank",qe.innerHTML='',We.appendChild(qe),ye.addElement(We)}var mt=new er;mt.minWidth=3*this.toolbarHeight+"px",mt.contentAlign="end",this.topToolbar.addButtonBlock(mt);var ze=new Bt('',"OK");ze.onClick=this.startRenderAndClose,mt.addButton(ze),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ze.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Bt('',"Close");_t.onClick=this.close,mt.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},X.prototype.addBottomToolbar=function(){var v=this;this.bottomToolbar=new qt,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 er;A.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(A);var U=new Bt('',"Rotate left");U.onClick=this.rotateLeftButtonClicked,A.addButton(U);var q=new Bt('',"Rotate right");q.onClick=this.rotateRightButtonClicked,A.addButton(q);var V=new pt;V.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(V),this.straightener=new Vi("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(mt){v.rotateBy(mt),v.straightener.angle=v.rotationAngle},V.addElement(this.straightener.getUI());var ye=new er;ye.minWidth=2*this.toolbarHeight+"px",ye.contentAlign="end",this.bottomToolbar.addButtonBlock(ye);var We=new Bt('',"Flip horizontal");We.onClick=this.flipHorizontallyButtonClicked,ye.addButton(We);var qe=new Bt('',"Flip vertical");qe.onClick=this.flipVerticallyButtonClicked,ye.addButton(qe)},X.prototype.ratioButtonClicked=function(v){this.aspectRatio=v,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},X.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=tr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},X.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Gi(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},X.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},X.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},X.prototype.restoreState=function(v){if(v){var A=this.cropLayer.getRescaledRect(v.width,v.height,this.imageWidth,this.imageHeight,v.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(A),this.cropRectChanged(A),this.flippedHorizontally=v.flippedHorizontally,this.flippedVertically=v.flippedVertically,this.applyFlip(),this.rotationAngle=v.rotationAngle,this.applyRotation()}},X.prototype.clientToLocalCoordinates=function(v,A){var U=this.cropImage.getBoundingClientRect();return{x:v-U.left,y:A-U.top}},X.prototype.onWindowResize=function(){this.positionUI()},X.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var v=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=v+"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()},X.prototype.rotateLeftButtonClicked=function(){var v=this.rotationAngle-90;this.rotationAngle%90!=0&&(v+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(v)},X.prototype.rotateRightButtonClicked=function(){var v=this.rotationAngle+90;this.rotationAngle%90!=0&&(v-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(v)},X.prototype.rotateTo=function(v){v=(v=v>180?v-360:v)<=-180?v+360:v,this.rotationAngle=v,this.applyRotation()},X.prototype.rotateBy=function(v){this.rotateTo((this.rotationAngle+v)%360)},X.prototype.applyRotation=function(){var v=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=v},X.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},X.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},X.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},X.prototype.startRenderAndClose=function(){return Rt(this,void 0,void 0,function(){var v,A;return Ti(this,function(U){switch(U.label){case 0:return[4,this.render()];case 1:return v=U.sent(),A=this.getState(),this.renderEventListeners.forEach(function(q){return q(v,A)}),this.close(!0),[2]}})})},X.prototype.render=function(){return Rt(this,void 0,void 0,function(){var v;return Ti(this,function(A){switch(A.label){case 0:return(v=new fr).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.width=this.renderWidth,v.height=this.renderHeight,this.unzoomFromCrop(),Qe.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,v.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,v.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()]}})})},X.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Lt("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 Lt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Lt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var v=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Lt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*v)+`px;
height: `+(this.toolbarHeight-2*v)+`px;
padding: `+v+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Lt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Lt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Ot("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ot("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Lt("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 Lt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Lt("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 Lt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*v)+`px;
padding: `+v+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Lt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},X.instanceCounter=0,X}(),Tt=ne("8hTe"),pr=ne.n(Tt),mr=/]*>/g;function gr(X){var v=document.createElement("div");return v.innerHTML=X,v.childNodes.length===0?"":v.childNodes[0].nodeValue}var vr=Ye.a=function(X){var v=X.value,A=v===void 0?"":v,U=X.edit,q=U===void 0?!1:U,V=X.className,ye=X.showTextOnly,We=X.showLines,qe=X.replaces,mt=X.zoomImg,ze=X.hasMask,_t=X.style,jt=_t===void 0?{}:_t,$t=X.stylesPrev,Pi=$t===void 0?{}:$t,yi=String(A),_i=Object(R.useRef)(),Xi=Object(R.useRef)(),Ir=Object(R.useState)(""),li=Object(K.a)(Ir,2),ji=li[0],or=li[1],lr=Object(R.useState)("office"),Mi=Object(K.a)(lr,2),kr=Mi[0],yr=Mi[1],zr=function(){var Ht=new Ve(Xi.current);Ht.displayMode="popup",Ht.addRenderEventListener(function(){var pi=Object(F.a)(M.a.mark(function Dt(ri){var zt;return M.a.wrap(function(ui){for(;;)switch(ui.prev=ui.next){case 0:return _i.current.style.display="none",ui.next=3,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ri}});case 3:zt=ui.sent,zt!=null&&zt.id&&qe(Xi.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 5:case"end":return ui.stop()}},Dt)}));return function(Dt){return pi.apply(this,arguments)}}()),Ht.show()},Kr=function(){var Ht=new Mt(Xi.current);Ht.settings.displayMode="popup",Ht.addEventListener("render",function(){var pi=Object(F.a)(M.a.mark(function Dt(ri){var zt;return M.a.wrap(function(ui){for(;;)switch(ui.prev=ui.next){case 0:if(_i.current.style.display="none",!Xi.current){ui.next=6;break}return ui.next=4,Object(we.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:ri.dataUrl}});case 4:zt=ui.sent,zt!=null&&zt.id&&qe(Xi.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(zt==null?void 0:zt.id,"?type=").concat(zt.content_type));case 6:case"end":return ui.stop()}},Dt)}));return function(Dt){return pi.apply(this,arguments)}}()),Ht.show(),window.markerArea=Ht},Yi=Object(R.useMemo)(function(){_i.current&&(_i.current.style.zIndex=-1);try{var ti=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ht=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pi=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;yi=yi.replace(ti,"("+Y.a.API_SERVER+"/api/attachments/").replace(Ht,'"'+Y.a.API_SERVER+"/api/attachments/").replace(pi,'"'+Y.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(ir){}var Dt=j(yi),ri=E();if(yi.match(/\[TOC\]/)&&(Dt=Dt.replace("[TOC]
",O()),L()),Dt=Dt.replace(/(__special_katext_id_\d+__)/g,function(ir,ui){var wi=ri[ui],Vr=wi.type,Er=wi.expression;return Object(ie.renderToString)(gr(Er)||"",{displayMode:Vr==="block",throwOnError:!1,output:"html"})}),Dt=Dt.replace(/▁/g,"\u2581\u2581\u2581"),m(),ye){var zt=document.createElement("div");return zt.innerHTML=Dt,zt.innerText}return setTimeout(function(){return dn()},500),Dt},[yi]),zi=Object(R.useRef)();S.WebkitLineClamp=We,We&&(jt=Object(B.a)(Object(B.a)({},jt),S));function _r(ti){var Ht=ti.target;if(Ht.tagName.toUpperCase()==="IMG"){if(mt){var pi=Ht.getAttribute("src");or(pi),yr("image")}}else if(Ht.tagName.toUpperCase()==="A"){var Dt=Ht.getAttribute("href");if(Dt.indexOf("office")>-1)ti.preventDefault(),or(Dt),yr("office");else if(Dt.indexOf("application/pdf")>-1)ti.preventDefault(),or(Dt),yr("pdf");else if(Dt.indexOf("text/html")>-1)ti.preventDefault(),or(Dt),yr("html");else if(Dt.startsWith("#")){ti.preventDefault();var ri=document.getElementById(Dt.replace("#",""));ri&&ri.scrollIntoView(!0)}}}var dn=function(){var Ht,pi=(Ht=zi.current)===null||Ht===void 0?void 0:Ht.querySelectorAll("video");pi==null||pi.forEach(function(Dt){if(Dt.oncontextmenu=function(){return!1},Dt.src.indexOf(".m3u8")>-1&&!Dt.canPlayType("application/vnd.apple.mpegurl")){if(W.a.isSupported()){var ri=new W.a;ri.loadSource(Dt.src),ri.attachMedia(Dt)}}})};Object(R.useEffect)(function(){if(zi.current&&Yi&&(Yi.match(mr)&&window.PR.prettyPrint()),zi.current)return zi.current.addEventListener("click",_r),function(){zi.current.removeEventListener("click",_r),m(),L()}},[Yi,zi.current,_r]);var br=function(Ht){if(!q)return;Ht.target.nodeName==="IMG"?(_i.current.style.zIndex=1,_i.current.style.display="flex",_i.current.style.width=Ht.target.clientWidth+"px",_i.current.style.height=Ht.target.clientHeight+"px",_i.current.style.top=Ht.target.offsetTop+"px",_i.current.style.left=Ht.target.offsetLeft+"px",Xi.current.src=Ht.target.getAttribute("src")):_i.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:zi,style:Object(B.a)({},jt),className:"".concat(V||""," markdown-body ").concat(pr.a.mdBody),onMouseOver:br,dangerouslySetInnerHTML:{__html:Yi}}),g.a.createElement("div",{ref:_i,className:pr.a.button},g.a.createElement(Z.a,null,g.a.createElement(Q.a,{onClick:function(){return zr()}},"\u88C1\u526A"),g.a.createElement(Q.a,{onClick:function(){return Kr()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Xi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(oe.a,{close:!0,data:ji,type:ji!=null&&ji.length?kr:"",style:Object(B.a)({},Pi),onClose:function(){return or("")}}))}},"9VGf":function(gt,Ye,ne){"use strict";ne.d(Ye,"a",function(){return P});var ue=ne("q1tI"),Z=ne.n(ue);function P(Q,B){var F=Object(ue.useRef)();Object(ue.useEffect)(function(){F.current=Q}),Object(ue.useEffect)(function(){function K(){F.current()}if(B!==null){var G=setInterval(K,B);return function(){return clearInterval(G)}}},[B])}},BU3w:function(gt,Ye,ne){"use strict";ne.d(Ye,"a",function(){return F});var ue=ne("MNnm"),Z="rc-util-key";function P(K){if(K.attachTo)return K.attachTo;var G=document.querySelector("head");return G||document.body}function Q(K){var G,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ue.a)())return null;var R=document.createElement("style");if((G=M.csp)===null||G===void 0?void 0:G.nonce){var g;R.nonce=(g=M.csp)===null||g===void 0?void 0:g.nonce}R.innerHTML=K;var p=P(M),f=p.firstChild;return M.prepend&&p.prepend?p.prepend(R):M.prepend&&f?p.insertBefore(R,f):p.appendChild(R),R}var B=new Map;function F(K,G){var M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},R=P(M);if(!B.has(R)){var g=Q("",M),p=g.parentNode;B.set(R,p),p.removeChild(g)}var f=Array.from(B.get(R).children).find(function(n){return n.tagName==="STYLE"&&n[Z]===G});if(f){var d,s;if(((d=M.csp)===null||d===void 0?void 0:d.nonce)&&f.nonce!==((s=M.csp)===null||s===void 0?void 0:s.nonce)){var c;f.nonce=(c=M.csp)===null||c===void 0?void 0:c.nonce}return f.innerHTML!==K&&(f.innerHTML=K),f}var l=Q(K,M);return l[Z]=G,l}},Bd2K:function(gt,Ye,ne){(function(ue){ue(ne("VrN/"),ne("osHv"))})(function(ue){ue.defineOption("autoCloseTags",!1,function(M,R,g){if(g!=ue.Init&&g&&M.removeKeyMap("autoCloseTags"),!R)return;var p={name:"autoCloseTags"};(typeof R!="object"||R.whenClosing!==!1)&&(p["'/'"]=function(f){return F(f)}),(typeof R!="object"||R.whenOpening!==!1)&&(p["'>'"]=function(f){return Q(f)}),M.addKeyMap(p)});var Z=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 Q(M){if(M.getOption("disableInput"))return ue.Pass;for(var R=M.listSelections(),g=[],p=M.getOption("autoCloseTags"),f=0;fd.ch&&(o=o.slice(0,o.length-s.end+d.ch));var x=o.toLowerCase();if(!o||s.type=="string"&&(s.end!=d.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&n.close||s.string.indexOf("/")==d.ch-s.start-1||L&&K(L,x)>-1||G(M,c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(l)||[],o,d,!0))return ue.Pass;var O=typeof p=="object"&&p.emptyTags;if(O&&K(O,o)>-1){g[f]={text:"/>",newPos:ue.Pos(d.line,d.ch+2)};continue}var C=S&&K(S,x)>-1;g[f]={indent:C,text:">"+(C?`
`:"")+""+o+">",newPos:C?ue.Pos(d.line+1,0):ue.Pos(d.line,d.ch+1)}}for(var w=typeof p=="object"&&p.dontIndentOnAutoClose,f=R.length-1;f>=0;f--){var T=g[f];M.replaceRange(T.text,R[f].head,R[f].anchor,"+insert");var _=M.listSelections().slice(0);_[f]={head:T.newPos,anchor:T.newPos},M.setSelections(_),!w&&T.indent&&(M.indentLine(T.newPos.line,null,!0),M.indentLine(T.newPos.line+1,null,!0))}}function B(M,R){for(var g=M.listSelections(),p=[],f=R?"/":"",d=M.getOption("autoCloseTags"),s=typeof d=="object"&&d.dontIndentOnSlash,c=0;c"&&(L+=">"),p[c]=L}if(M.replaceSelections(p),g=M.listSelections(),!s)for(var c=0;c=0&&R[l]==g;l--)++c;p=s.to;for(var l=1;l0){for(var R=0;R1&&arguments[1]!==void 0?arguments[1]:"",R=[],g=0;gEe.length)&&(fe=Ee.length);for(var _e=0,re=new Array(fe);_e=Ee.length?{done:!0}:{done:!1,value:Ee[re++]}}}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 _e=Ee[Symbol.iterator](),_e.next.bind(_e)}function F(Ee,fe){return fe={exports:{}},Ee(fe,fe.exports),fe.exports}var K=F(function(Ee){function fe(){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 _e(re){Ee.exports.defaults=re}Ee.exports={defaults:fe(),getDefaults:fe,changeDefaults:_e}}),G=K.defaults,M=K.getDefaults,R=K.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(fe){return s[fe]};function l(Ee,fe){if(fe){if(g.test(Ee))return Ee.replace(p,c)}else if(f.test(Ee))return Ee.replace(d,c);return Ee}var n=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(Ee){return Ee.replace(n,function(fe,_e){return _e=_e.toLowerCase(),_e==="colon"?":":_e.charAt(0)==="#"?_e.charAt(1)==="x"?String.fromCharCode(parseInt(_e.substring(2),16)):String.fromCharCode(+_e.substring(1)):""})}var h=/(^|[^\[])\^/g;function L(Ee,fe){Ee=Ee.source||Ee,fe=fe||"";var _e={replace:function(ae,he){return he=he.source||he,he=he.replace(h,"$1"),Ee=Ee.replace(ae,he),_e},getRegex:function(){return new RegExp(Ee,fe)}};return _e}var S=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Ee,fe,_e){if(Ee){var re;try{re=decodeURIComponent(o(_e)).replace(S,"").toLowerCase()}catch(ae){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}fe&&!x.test(_e)&&(_e=u(fe,_e));try{_e=encodeURI(_e).replace(/%25/g,"%")}catch(ae){return null}return _e}var C={},w=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,_=/^([^:]+:\/*[^/]*)[\s\S]*$/;function u(Ee,fe){C[" "+Ee]||(w.test(Ee)?C[" "+Ee]=Ee+"/":C[" "+Ee]=N(Ee,"/",!0)),Ee=C[" "+Ee];var _e=Ee.indexOf(":")===-1;return fe.substring(0,2)==="//"?_e?fe:Ee.replace(T,"$1")+fe:fe.charAt(0)==="/"?_e?fe:Ee.replace(_,"$1")+fe:Ee+fe}var E={exec:function(){}};function m(Ee){for(var fe=1,_e,re;fe=0&&be[Ge]==="\\";)Pe=!Pe;return Pe?"|":" |"}),re=_e.split(/ \|/),ae=0;if(re.length>fe)re.splice(fe);else for(;re.length=re.length?ae.slice(re.length):ae}).join(`
`)}var me=function(){function Ee(_e){this.options=_e||I}var fe=Ee.prototype;return fe.space=function(re){var ae=this.rules.block.newline.exec(re);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
`}},fe.code=function(re,ae){var he=this.rules.block.code.exec(re);if(he){var ve=ae[ae.length-1];if(ve&&ve.type==="paragraph")return{raw:he[0],text:he[0].trimRight()};var be=he[0].replace(/^ {4}/gm,"");return{type:"code",raw:he[0],codeBlockStyle:"indented",text:this.options.pedantic?be:y(be,`
`)}}},fe.fences=function(re){var ae=this.rules.block.fences.exec(re);if(ae){var he=ae[0],ve=we(he,ae[3]||"");return{type:"code",raw:he,lang:ae[2]?ae[2].trim():ae[2],text:ve}}},fe.heading=function(re){var ae=this.rules.block.heading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},fe.nptable=function(re){var ae=this.rules.block.nptable.exec(re);if(ae){var he={type:"table",header:W(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[],raw:ae[0]};if(he.header.length===he.align.length){var ve=he.align.length,be;for(be=0;be ?/gm,"");return{type:"blockquote",raw:ae[0],text:he}}},fe.list=function(re){var ae=this.rules.block.list.exec(re);if(ae){for(var he=ae[0],ve=ae[2],be=ve.length>1,Pe=ve[ve.length-1]===")",Ge={type:"list",raw:he,ordered:be,start:be?+ve.slice(0,-1):"",loose:!1,items:[]},ot=ae[0].match(this.rules.block.item),ct=!1,ft,Ct,xt,ut,Ut,Mt,Zt,Yt=ot.length,Rt=0;Rt1||this.options.smartLists&&xt!==ve)&&(ut=ot.slice(Rt+1).join(`
`),Ge.raw=Ge.raw.substring(0,Ge.raw.length-ut.length),Rt=Yt-1)),Ut=ct||/\n\n(?!\s*$)/.test(ft),Rt!==Yt-1&&(ct=ft.charAt(ft.length-1)===`
`,Ut||(Ut=ct)),Ut&&(Ge.loose=!0),Mt=/^\[[ xX]\] /.test(ft),Zt=void 0,Mt&&(Zt=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Ge.items.push({type:"list_item",raw:he,task:Mt,checked:Zt,loose:Ut,text:ft});return Ge}},fe.html=function(re){var ae=this.rules.block.html.exec(re);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):Y(ae[0]):ae[0]}},fe.def=function(re){var ae=this.rules.block.def.exec(re);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var he=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:he,raw:ae[0],href:ae[2],title:ae[3]}}},fe.table=function(re){var ae=this.rules.block.table.exec(re);if(ae){var he={type:"table",header:W(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[]};if(he.header.length===he.align.length){he.raw=ae[0];var ve=he.align.length,be;for(be=0;be/i.test(ve[0])&&(ae=!1),!he&&/^<(pre|code|kbd|script)(\s|>)/i.test(ve[0])?he=!0:he&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ve[0])&&(he=!1),{type:this.options.sanitize?"text":"html",raw:ve[0],inLink:ae,inRawBlock:he,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):Y(ve[0]):ve[0]}},fe.link=function(re){var ae=this.rules.inline.link.exec(re);if(ae){var he=ie(ae[2],"()");if(he>-1){var ve=ae[0].indexOf("!")===0?5:4,be=ve+ae[1].length+he;ae[2]=ae[2].substring(0,he),ae[0]=ae[0].substring(0,be).trim(),ae[3]=""}var Pe=ae[2],Ge="";if(this.options.pedantic){var ot=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Pe);ot?(Pe=ot[1],Ge=ot[3]):Ge=""}else Ge=ae[3]?ae[3].slice(1,-1):"";Pe=Pe.trim().replace(/^<([\s\S]*)>$/,"$1");var ct=oe(ae,{href:Pe&&Pe.replace(this.rules.inline._escapes,"$1"),title:Ge&&Ge.replace(this.rules.inline._escapes,"$1")},ae[0]);return ct}},fe.reflink=function(re,ae){var he;if((he=this.rules.inline.reflink.exec(re))||(he=this.rules.inline.nolink.exec(re))){var ve=(he[2]||he[1]).replace(/\s+/g," ");if(ve=ae[ve.toLowerCase()],!ve||!ve.href){var be=he[0].charAt(0);return{type:"text",raw:be,text:be}}var Pe=oe(he,ve,he[0]);return Pe}},fe.strong=function(re,ae,he){he===void 0&&(he="");var ve=this.rules.inline.strong.start.exec(re);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ae=ae.slice(-1*re.length);var be=ve[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var Pe;(ve=be.exec(ae))!=null;)if(Pe=this.rules.inline.strong.middle.exec(ae.slice(0,ve.index+3)),Pe)return{type:"strong",raw:re.slice(0,Pe[0].length),text:re.slice(2,Pe[0].length-2)}}},fe.em=function(re,ae,he){he===void 0&&(he="");var ve=this.rules.inline.em.start.exec(re);if(ve&&(!ve[1]||ve[1]&&(he===""||this.rules.inline.punctuation.exec(he)))){ae=ae.slice(-1*re.length);var be=ve[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var Pe;(ve=be.exec(ae))!=null;)if(Pe=this.rules.inline.em.middle.exec(ae.slice(0,ve.index+2)),Pe)return{type:"em",raw:re.slice(0,Pe[0].length),text:re.slice(1,Pe[0].length-1)}}},fe.codespan=function(re){var ae=this.rules.inline.code.exec(re);if(ae){var he=ae[2].replace(/\n/g," "),ve=/[^ ]/.test(he),be=he.startsWith(" ")&&he.endsWith(" ");return ve&&be&&(he=he.substring(1,he.length-1)),he=Y(he,!0),{type:"codespan",raw:ae[0],text:he}}},fe.br=function(re){var ae=this.rules.inline.br.exec(re);if(ae)return{type:"br",raw:ae[0]}},fe.del=function(re){var ae=this.rules.inline.del.exec(re);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},fe.autolink=function(re,ae){var he=this.rules.inline.autolink.exec(re);if(he){var ve,be;return he[2]==="@"?(ve=Y(this.options.mangle?ae(he[1]):he[1]),be="mailto:"+ve):(ve=Y(he[1]),be=ve),{type:"link",raw:he[0],text:ve,href:be,tokens:[{type:"text",raw:ve,text:ve}]}}},fe.url=function(re,ae){var he;if(he=this.rules.inline.url.exec(re)){var ve,be;if(he[2]==="@")ve=Y(this.options.mangle?ae(he[0]):he[0]),be="mailto:"+ve;else{var Pe;do Pe=he[0],he[0]=this.rules.inline._backpedal.exec(he[0])[0];while(Pe!==he[0]);ve=Y(he[0]),he[1]==="www."?be="http://"+ve:be=ve}return{type:"link",raw:he[0],text:ve,href:be,tokens:[{type:"text",raw:ve,text:ve}]}}},fe.inlineText=function(re,ae,he){var ve=this.rules.inline.text.exec(re);if(ve){var be;return ae?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ve[0]):Y(ve[0]):ve[0]:be=Y(this.options.smartypants?he(ve[0]):ve[0]),{type:"text",raw:ve[0],text:be}}},Ee}(),Se=j.noopTest,Ce=j.edit,xe=j.merge,pe={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*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Se,table:Se,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Ce(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Ce(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Ce(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=//,pe.html=Ce(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Ce(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=Ce(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=xe({},pe),pe.gfm=xe({},pe.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*|$)"}),pe.gfm.nptable=Ce(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=Ce(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=xe({},pe.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Se,paragraph:Ce(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var le={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Se,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Se,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",le.punctuation=Ce(le.punctuation).replace(/punctuation/g,le._punctuation).getRegex(),le._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",le._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",le.em.start=Ce(le.em.start).replace(/punctuation/g,le._punctuation).getRegex(),le.em.middle=Ce(le.em.middle).replace(/punctuation/g,le._punctuation).replace(/overlapSkip/g,le._overlapSkip).getRegex(),le.em.endAst=Ce(le.em.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.em.endUnd=Ce(le.em.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.start=Ce(le.strong.start).replace(/punctuation/g,le._punctuation).getRegex(),le.strong.middle=Ce(le.strong.middle).replace(/punctuation/g,le._punctuation).replace(/blockSkip/g,le._blockSkip).getRegex(),le.strong.endAst=Ce(le.strong.endAst,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.strong.endUnd=Ce(le.strong.endUnd,"g").replace(/punctuation/g,le._punctuation).getRegex(),le.blockSkip=Ce(le._blockSkip,"g").getRegex(),le.overlapSkip=Ce(le._overlapSkip,"g").getRegex(),le._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,le._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,le._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])?)+(?![-_])/,le.autolink=Ce(le.autolink).replace("scheme",le._scheme).replace("email",le._email).getRegex(),le._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,le.tag=Ce(le.tag).replace("comment",pe._comment).replace("attribute",le._attribute).getRegex(),le._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,le._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,le._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,le.link=Ce(le.link).replace("label",le._label).replace("href",le._href).replace("title",le._title).getRegex(),le.reflink=Ce(le.reflink).replace("label",le._label).getRegex(),le.reflinkSearch=Ce(le.reflinkSearch,"g").replace("reflink",le.reflink).replace("nolink",le.nolink).getRegex(),le.normal=xe({},le),le.pedantic=xe({},le.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:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",le._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le._label).getRegex()}),le.gfm=xe({},le.normal,{escape:Ce(le.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]*?(?:(?=[\\.5&&(re="x"+re.toString(16)),fe+=""+re+";";return fe}var Le=function(){function Ee(_e){this.tokens=[],this.tokens.links=Object.create(null),this.options=_e||de,this.options.tokenizer=this.options.tokenizer||new me,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:se.normal,inline:Oe.normal};this.options.pedantic?(re.block=se.pedantic,re.inline=Oe.pedantic):this.options.gfm&&(re.block=se.gfm,this.options.breaks?re.inline=Oe.breaks:re.inline=Oe.gfm),this.tokenizer.rules=re}Ee.lex=function(re,ae){var he=new Ee(ae);return he.lex(re)};var fe=Ee.prototype;return fe.lex=function(re){return re=re.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},fe.blockTokens=function(re,ae,he){ae===void 0&&(ae=[]),he===void 0&&(he=!0),re=re.replace(/^ +$/gm,"");for(var ve,be,Pe,Ge;re;){if(ve=this.tokenizer.space(re)){re=re.substring(ve.raw.length),ve.type&&ae.push(ve);continue}if(ve=this.tokenizer.code(re,ae)){re=re.substring(ve.raw.length),ve.type?ae.push(ve):(Ge=ae[ae.length-1],Ge.raw+=`
`+ve.raw,Ge.text+=`
`+ve.text);continue}if(ve=this.tokenizer.fences(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.heading(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.nptable(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.hr(re)){re=re.substring(ve.raw.length),ae.push(ve);continue}if(ve=this.tokenizer.blockquote(re)){re=re.substring(ve.raw.length),ve.tokens=this.blockTokens(ve.text,[],he),ae.push(ve);continue}if(ve=this.tokenizer.list(re)){for(re=re.substring(ve.raw.length),Pe=ve.items.length,be=0;be0)for(;(ot=this.tokenizer.rules.inline.reflinkSearch.exec(Ge))!=null;)ct.includes(ot[0].slice(ot[0].lastIndexOf("[")+1,-1))&&(Ge=Ge.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ot=this.tokenizer.rules.inline.blockSkip.exec(Ge))!=null;)Ge=Ge.slice(0,ot.index)+"["+"a".repeat(ot[0].length-2)+"]"+Ge.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Pe=this.tokenizer.escape(re)){re=re.substring(Pe.raw.length),ae.push(Pe);continue}if(Pe=this.tokenizer.tag(re,he,ve)){re=re.substring(Pe.raw.length),he=Pe.inLink,ve=Pe.inRawBlock,ae.push(Pe);continue}if(Pe=this.tokenizer.link(re)){re=re.substring(Pe.raw.length),Pe.type==="link"&&(Pe.tokens=this.inlineTokens(Pe.text,[],!0,ve)),ae.push(Pe);continue}if(Pe=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Pe.raw.length),Pe.type==="link"&&(Pe.tokens=this.inlineTokens(Pe.text,[],!0,ve)),ae.push(Pe);continue}if(Pe=this.tokenizer.strong(re,Ge,be)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],he,ve),ae.push(Pe);continue}if(Pe=this.tokenizer.em(re,Ge,be)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],he,ve),ae.push(Pe);continue}if(Pe=this.tokenizer.codespan(re)){re=re.substring(Pe.raw.length),ae.push(Pe);continue}if(Pe=this.tokenizer.br(re)){re=re.substring(Pe.raw.length),ae.push(Pe);continue}if(Pe=this.tokenizer.del(re)){re=re.substring(Pe.raw.length),Pe.tokens=this.inlineTokens(Pe.text,[],he,ve),ae.push(Pe);continue}if(Pe=this.tokenizer.autolink(re,Te)){re=re.substring(Pe.raw.length),ae.push(Pe);continue}if(!he&&(Pe=this.tokenizer.url(re,Te))){re=re.substring(Pe.raw.length),ae.push(Pe);continue}if(Pe=this.tokenizer.inlineText(re,ve,ke)){re=re.substring(Pe.raw.length),be=Pe.raw.slice(-1),ae.push(Pe);continue}if(re){var ft="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ae},Z(Ee,null,[{key:"rules",get:function(){return{block:se,inline:Oe}}}]),Ee}(),Me=K.defaults,je=j.cleanUrl,Fe=j.escape,Ne=function(){function Ee(_e){this.options=_e||Me}var fe=Ee.prototype;return fe.code=function(re,ae,he){var ve=(ae||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(re,ve);be!=null&&be!==re&&(he=!0,re=be)}return ve?''+(he?re:Fe(re,!0))+`
`:""+(he?re:Fe(re,!0))+`
`},fe.blockquote=function(re){return`
`+re+`
`},fe.html=function(re){return re},fe.heading=function(re,ae,he,ve){return this.options.headerIds?"
`:""+re+"
`},fe.hr=function(){return this.options.xhtml?`
`:`
`},fe.list=function(re,ae,he){var ve=ae?"ol":"ul",be=ae&&he!==1?' start="'+he+'"':"";return"<"+ve+be+`>
`+re+""+ve+`>
`},fe.listitem=function(re){return""+re+`
`},fe.checkbox=function(re){return" "},fe.paragraph=function(re){return""+re+`
`},fe.table=function(re,ae){return ae&&(ae=""+ae+""),`
`},fe.tablerow=function(re){return`
`+re+`
`},fe.tablecell=function(re,ae){var he=ae.header?"th":"td",ve=ae.align?"<"+he+' align="'+ae.align+'">':"<"+he+">";return ve+re+""+he+`>
`},fe.strong=function(re){return""+re+""},fe.em=function(re){return""+re+""},fe.codespan=function(re){return""+re+""},fe.br=function(){return this.options.xhtml?"
":"
"},fe.del=function(re){return""+re+""},fe.link=function(re,ae,he){if(re=je(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var ve='"+he+"",ve},fe.image=function(re,ae,he){if(re=je(this.options.sanitize,this.options.baseUrl,re),re===null)return he;var ve='
":">",ve},fe.text=function(re){return re},Ee}(),Ue=function(){function Ee(){}var fe=Ee.prototype;return fe.strong=function(re){return re},fe.em=function(re){return re},fe.codespan=function(re){return re},fe.del=function(re){return re},fe.html=function(re){return re},fe.text=function(re){return re},fe.link=function(re,ae,he){return""+he},fe.image=function(re,ae,he){return""+he},fe.br=function(){return""},Ee}(),Je=function(){function Ee(){this.seen={}}var fe=Ee.prototype;return fe.slug=function(re){var ae=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var he=ae;do this.seen[he]++,ae=he+"-"+this.seen[he];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},Ee}(),tt=K.defaults,et=j.unescape,Ze=function(){function Ee(_e){this.options=_e||tt,this.options.renderer=this.options.renderer||new Ne,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new Je}Ee.parse=function(re,ae){var he=new Ee(ae);return he.parse(re)};var fe=Ee.prototype;return fe.parse=function(re,ae){ae===void 0&&(ae=!0);var he="",ve,be,Pe,Ge,ot,ct,ft,Ct,xt,ut,Ut,Mt,Zt,Yt,Rt,Ti,Ui,Qe,wt=re.length;for(ve=0;ve0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=Qe+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=Qe+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:Qe}):Yt+=Qe),Yt+=this.parse(Rt.tokens,Zt),xt+=this.renderer.listitem(Yt,Ui,Ti);he+=this.renderer.list(xt,Ut,Mt);continue}case"html":{he+=this.renderer.html(ut.text);continue}case"paragraph":{he+=this.renderer.paragraph(this.parseInline(ut.tokens));continue}case"text":{for(xt=ut.tokens?this.parseInline(ut.tokens):ut.text;ve+1An error occurred:
"+at(Pe.message+"",!0)+"
";throw Pe}}De.options=De.setOptions=function(Ee){return dt(De.defaults,Ee),st(De.defaults),De},De.getDefaults=Ie,De.defaults=$e,De.use=function(Ee){var fe=dt({},Ee);if(Ee.renderer&&function(){var re=De.defaults.renderer||new Ne,ae=function(be){var Pe=re[be];re[be]=function(){for(var Ge=arguments.length,ot=new Array(Ge),ct=0;ct`,triples:"",explode:"[]{}"},P=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(s,c,l){l&&l!=ue.Init&&(s.removeKeyMap(B),s.state.closeBrackets=null),c&&(F(Q(c,"pairs")),s.state.closeBrackets=c,s.addKeyMap(B))});function Q(s,c){return c=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[c]!=null?s[c]:Z[c]}var B={Backspace:M,Enter:R};function F(s){for(var c=0;c=0;o--){var L=n[o].head;s.replaceRange("",P(L.line,L.ch-1),P(L.line,L.ch+1),"+delete")}}function R(s){var c=G(s),l=c&&Q(c,"explode");if(!l||s.getOption("disableInput"))return ue.Pass;for(var n=s.listSelections(),o=0;o0;return{anchor:new P(s.anchor.line,s.anchor.ch+(c?-1:1)),head:new P(s.head.line,s.head.ch+(c?1:-1))}}function p(s,c){var l=G(s);if(!l||s.getOption("disableInput"))return ue.Pass;var n=Q(l,"pairs"),o=n.indexOf(c);if(o==-1)return ue.Pass;for(var h=Q(l,"closeBefore"),L=Q(l,"triples"),S=n.charAt(o+1)==c,x=s.listSelections(),O=o%2==0,C,w=0;w=0&&s.getRange(_,P(_.line,_.ch+3))==c+c+c?u="skipThree":u="skip";else if(S&&_.ch>1&&L.indexOf(c)>=0&&s.getRange(P(_.line,_.ch-2),_)==c+c){if(_.ch>2&&/\bstring/.test(s.getTokenTypeAt(P(_.line,_.ch-2))))return ue.Pass;u="addFour"}else if(S){var m=_.ch==0?" ":s.getRange(P(_.line,_.ch-1),_);if(!ue.isWordChar(E)&&m!=c&&!ue.isWordChar(m))u="both";else return ue.Pass}else if(O&&(E.length===0||/\s/.test(E)||h.indexOf(E)>-1))u="both";else return ue.Pass;if(!C)C=u;else if(C!=u)return ue.Pass}var b=o%2?n.charAt(o-1):c,N=o%2?c:n.charAt(o+1);s.operation(function(){if(C=="skip")s.execCommand("goCharRight");else if(C=="skipThree")for(var D=0;D<3;D++)s.execCommand("goCharRight");else if(C=="surround"){for(var H=s.getSelections(),D=0;D0&&(ie.percent=ie.loaded/ie.total*100),j.onProgress(ie)});var y=new FormData;j.data&&Object.keys(j.data).forEach(function(Y){var ie=j.data[Y];if(Array.isArray(ie)){ie.forEach(function(oe){y.append(Y+"[]",oe)});return}y.append(Y,j.data[Y])}),j.file instanceof Blob?y.append(j.filename,j.file,j.file.name):y.append(j.filename,j.file),I.onerror=function(ie){j.onError(ie)},I.onload=function(){return I.status<200||I.status>=300?j.onError(B(j,I),F(I)):j.onSuccess(F(I),I)},I.open(j.method,j.action,!0),j.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var W=j.headers||{};return W["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(W).forEach(function(Y){W[Y]!==null&&I.setRequestHeader(Y,W[Y])}),I.send(y),{abort:function(){I.abort()}}}var G=+new Date,M=0;function R(){return"rc-upload-"+G+"-"+ ++M}function g(j,I){return j.indexOf(I,j.length-I.length)!==-1}var p=function(j,I){if(j&&I){var y=Array.isArray(I)?I:I.split(","),W=j.name||"",Y=j.type||"",ie=Y.replace(/\/.*$/,"");return y.some(function(oe){var we=oe.trim();return we.charAt(0)==="."?g(W.toLowerCase(),we.toLowerCase()):/\/\*$/.test(we)?ie===we.replace(/\/.*$/,""):Y===we})}return!0};function f(j,I){var y=j.createReader(),W=[];function Y(){y.readEntries(function(ie){var oe=Array.prototype.slice.apply(ie);W=W.concat(oe);var we=!oe.length;we?I(W):Y()})}Y()}var d=function(I,y,W){var Y=function ie(oe,we){we=we||"",oe.isFile?oe.file(function(me){W(me)&&(oe.fullPath&&!me.webkitRelativePath&&(Object.defineProperties(me,{webkitRelativePath:{writable:!0}}),me.webkitRelativePath=oe.fullPath.replace(/^\//,""),Object.defineProperties(me,{webkitRelativePath:{writable:!1}})),y([me]))}):oe.isDirectory&&f(oe,function(me){me.forEach(function(Se){ie(Se,""+we+oe.name+"/")})})};I.forEach(function(ie){Y(ie.webkitGetAsEntry())})},s=d,c=Object.assign||function(j){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(j,W))continue;y[W]=j[W]}return y}function L(j,I){if(!(j instanceof I))throw new TypeError("Cannot call a class as a function")}function S(j,I){if(!j)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:j}function x(j,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);j.prototype=Object.create(I&&I.prototype,{constructor:{value:j,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(j,I):j.__proto__=I)}var O=function(I){return Object.keys(I).reduce(function(y,W){return(W.substr(0,5)==="data-"||W.substr(0,5)==="aria-"||W==="role")&&(y[W]=I[W]),y},{})},C=function(j){x(I,j);function I(){var y,W,Y,ie;L(this,I);for(var oe=arguments.length,we=Array(oe),me=0;me1&&arguments[1]!==void 0?arguments[1]:1,_e=Ue.length,re=0;re<_e;re+=1){var ae=(Ee+re*fe+_e)%_e,he=Ue[ae],ve=he.group,be=he.data;if(!ve&&!be.disabled)return ae}return-1},dt=B.useState(function(){return Ze(0)}),it=Object(G.a)(dt,2),at=it[0],Ie=it[1],st=function(Ee){Ie(Ee);var fe=Ue[Ee];if(!fe){Me(null,-1);return}Me(fe.data.value,Ee)};B.useEffect(function(){st(pe!==!1?Ze(0):-1)},[Ue.length,Ce]),B.useEffect(function(){var He=setTimeout(function(){if(!xe&&se&&Se.size===1){var Ee=Array.from(Se)[0],fe=Ue.findIndex(function(_e){var re=_e.data;return re.value===Ee});st(fe),et(fe)}});return function(){return clearTimeout(He)}},[se]);var $e=function(Ee){Ee!==void 0&&Te(Ee,{selected:!Se.has(Ee)}),xe||Le(!1)};if(B.useImperativeHandle(Y,function(){return{onKeyDown:function(Ee){var fe=Ee.which;switch(fe){case M.a.UP:case M.a.DOWN:{var _e=0;if(fe===M.a.UP?_e=-1:fe===M.a.DOWN&&(_e=1),_e!==0){var re=Ze(at+_e,_e);et(re),st(re)}break}case M.a.ENTER:{var ae=Ue[at];ae&&!ae.data.disabled?$e(ae.data.value):$e(void 0),se&&Ee.preventDefault();break}case M.a.ESC:Le(!1)}},onKeyUp:function(){},scrollTo:function(Ee){et(Ee)}}}),Ue.length===0)return B.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),className:"".concat(Ne,"-empty"),onMouseDown:tt},de);function De(He){var Ee=Ue[He];if(!Ee)return null;var fe=Ee.data||{},_e=fe.value,re=fe.label,ae=fe.children,he=Object(R.a)(fe,!0),ve=me?ae:re;return Ee?B.createElement("div",Object.assign({"aria-label":typeof ve=="string"?ve:null},he,{key:He,role:"option",id:"".concat(oe,"_list_").concat(He),"aria-selected":Se.has(_e)}),_e):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(oe,"_list"),style:{height:0,width:0,overflow:"hidden"}},De(at-1),De(at),De(at+1)),B.createElement(d.a,{itemKey:"key",ref:Je,data:Ue,height:le,itemHeight:te,fullHeight:!1,onMouseDown:tt,onScroll:je,virtual:ke,onMouseEnter:Fe},function(He,Ee){var fe,_e=He.group,re=He.groupOption,ae=He.data,he=ae.label,ve=ae.key;if(_e)return B.createElement("div",{className:f()(Ne,"".concat(Ne,"-group"))},he!==void 0?he:ve);var be=ae.disabled,Pe=ae.value,Ge=ae.title,ot=ae.children,ct=ae.style,ft=ae.className,Ct=Object(K.a)(ae,["disabled","value","title","children","style","className"]),xt=Se.has(Pe),ut="".concat(Ne,"-option"),Ut=f()(Ne,ut,ft,(fe={},Object(F.a)(fe,"".concat(ut,"-grouped"),re),Object(F.a)(fe,"".concat(ut,"-active"),at===Ee&&!be),Object(F.a)(fe,"".concat(ut,"-disabled"),be),Object(F.a)(fe,"".concat(ut,"-selected"),xt),fe)),Mt=me?ot:he,Zt=!Oe||typeof Oe=="function"||xt;return B.createElement("div",Object.assign({},Ct,{"aria-selected":xt,className:Ut,title:Ge,onMouseMove:function(){if(at===Ee||be)return;st(Ee)},onClick:function(){be||$e(Pe)},style:ct}),B.createElement("div",{className:"".concat(ut,"-content")},Mt||Pe),B.isValidElement(Oe)||xt,Zt&&B.createElement(s.a,{className:"".concat(Ne,"-option-state"),customizeIcon:Oe,customizeIconProps:{isSelected:xt}},xt?"\u2713":null))}))},l=B.forwardRef(c);l.displayName="OptionList";var n=l,o=function(){return null};o.isSelectOption=!0;var h=o,L=function(){return null};L.isSelectOptGroup=!0;var S=L,x=ne("VTBJ"),O=ne("Zm9Q");function C(y){var W=y.key,Y=y.props,ie=Y.children,oe=Y.value,we=Object(K.a)(Y,["children","value"]);return Object(x.a)({key:W,value:oe!==void 0?oe:W,children:ie},we)}function w(y){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(y).map(function(Y,ie){if(!B.isValidElement(Y)||!Y.type)return null;var oe=Y.type.isSelectOptGroup,we=Y.key,me=Y.props,Se=me.children,Ce=Object(K.a)(me,["children"]);return W||!oe?C(Y):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(we===null?ie:we,"__"),label:we},Ce),{},{options:w(Se)})}).filter(function(Y){return Y})}var T=ne("2Qr1"),_=ne("qNPg"),u=ne("U8pU"),E=ne("Kwbf"),m=ne("WKfj");function b(y){var W=y.mode,Y=y.options,ie=y.children,oe=y.backfill,we=y.allowClear,me=y.placeholder,Se=y.getInputElement,Ce=y.showSearch,xe=y.onSearch,pe=y.defaultOpen,le=y.autoFocus,te=y.labelInValue,de=y.value,se=y.inputValue,Oe=y.optionLabelProp,ke=W==="multiple"||W==="tags",Te=Ce!==void 0?Ce:ke||W==="combobox",Le=Y||w(ie);if(Object(E.a)(W!=="tags"||Le.every(function(Ne){return!Ne.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),W==="tags"||W==="combobox"){var Me=Le.some(function(Ne){return Ne.options?Ne.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in Ne?Ne.value:Ne.key)=="number"});Object(E.a)(!Me,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(W!=="combobox"||!Oe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(W==="combobox"||!oe,"`backfill` only works with `combobox` mode."),Object(E.a)(W==="combobox"||!Se,"`getInputElement` only work with `combobox` mode."),Object(E.b)(W!=="combobox"||!Se||!we||!me,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),xe&&!Te&&W!=="combobox"&&W!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!pe||le,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),de!=null){var je=Object(m.d)(de);Object(E.a)(!te||je.every(function(Ne){return Object(u.a)(Ne)==="object"&&("key"in Ne||"value"in Ne)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!ke||Array.isArray(de),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Fe=null;Object(O.a)(ie).some(function(Ne){if(!B.isValidElement(Ne)||!Ne.type)return!1;var Ue=Ne.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var Je=Object(O.a)(Ne.props.children).every(function(tt){return!B.isValidElement(tt)||!Ne.type||tt.type.isSelectOption?!0:(Fe=tt.type,!1)});return!Je}return Fe=Ue,!0}),Fe&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Fe.displayName||Fe.name||Fe,"`.")),Object(E.a)(se===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var N=b,D=Object(_.a)({prefixCls:"rc-select",components:{optionList:n},convertChildrenToData:w,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:N,fillOptionsWithMissingValue:T.a}),H=function(y){Object(P.a)(Y,y);var W=Object(Q.a)(Y);function Y(){var ie;return Object(ue.a)(this,Y),ie=W.apply(this,arguments),ie.selectRef=B.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(Z.a)(Y,[{key:"render",value:function(){return B.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),Y}(B.Component);H.Option=h,H.OptGroup=S;var j=H,I=Ye.c=j},M8RZ:function(gt,Ye,ne){"use strict";ne.d(Ye,"a",function(){return M});var ue=ne("fWQN"),Z=ne("mtLc"),P=ne("yKVA"),Q=ne("879j"),B=ne("q1tI"),F=ne.n(B),K=ne("i8i4"),G=ne.n(K),M=function(R){Object(P.a)(p,R);var g=Object(Q.a)(p);function p(f){var d;Object(ue.a)(this,p),d=g.call(this,f);var s=window.document;return d.node=s.createElement("div"),s.body.appendChild(d.node),d}return Object(Z.a)(p,[{key:"render",value:function(){var d=this.props.children;return Object(K.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(F.a.Component)},Ot1p:function(gt,Ye,ne){"use strict";var ue=ne("2qtc"),Z=ne("kLXV"),P=ne("rAM+"),Q=ne("miYZ"),B=ne("tsqr"),F=ne("9og8"),K=ne("tJVT"),G=ne("jrin"),M=ne("WmNS"),R=ne.n(M),g=ne("q1tI"),p=ne.n(g),f=ne("VrN/"),d=ne.n(f),s=ne("bdgK"),c=ne("p77/"),l=ne("Bd2K"),n=ne("ELLl"),o=ne("19Vz"),h=ne("lZu9"),L=ne("+NIl"),S=ne("kSUc"),x=ne("9Bee"),O=function(be){var Pe=be.value,Ge=Pe===void 0?"":Pe,ot=be.className,ct=be.showTextOnly,ft=be.showLines,Ct=be.style,xt=Ct===void 0?{}:Ct,ut=Object(g.useMemo)(function(){return""},[Ge]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},C=ne("0Owb"),w=ne("dejd"),T=ne("C+DQ"),_=ne("1vsH"),u=ne("m3rI"),E=[{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 m(be){var Pe=be.onActionCallback,Ge=be.title,ot=be.icon,ct=be.actionName,ft=be.className,Ct=ft===void 0?"":ft,xt=be.children;function ut(){Pe(ct)}return p.a.createElement("a",{title:Ge,className:Ct,onClick:ut},p.a.createElement("i",{className:"md-iconfont ".concat(ot)}),xt)}var b=function(be){var Pe=be.watch,Ge=be.showNullButton,ot=be.onActionCallback,ct=be.fullScreen,ft=be.insertTemp,Ct=be.hidetoolBar,xt=be.uuid,ut=be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(_.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(_.F)("_educoder_session"),"&key=").concat(xt,"&api=").concat(encodeURIComponent(u.a.PROXY_SERVER)));var Ut=[].concat(E,[{title:"".concat(Pe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Pe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!Ct&&Ut.map(function(Mt,Zt){return p.a.createElement("li",{key:Zt},Mt.actionName?p.a.createElement(m,Object(C.a)({},Mt,{onActionCallback:ot})):p.a.createElement("span",{className:"v-line"}))}),Ge?p.a.createElement("li",null,p.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&p.a.createElement("li",null,p.a.createElement(m,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:ot},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(m,{icon:"".concat(ct?"icon-shrink":"icon-enlarge"),title:ct?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},N=ne("M8RZ"),D=ne("+L6B"),H=ne("2/Rp"),j=ne("y8nQ"),I=ne("Vl3Y"),y=ne("5NDa"),W=ne("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},ie=function(be){var Pe=be.callback,Ge=be.onCancel;function ot(ct){Pe(ct)}return p.a.createElement(I.a,Object(C.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),p.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(W.a,null)),p.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(W.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(H.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))},oe=ne("7ahc"),we=ne("HmJG"),me=ne("BjJ7"),Se=I.a.useForm,Ce={width:280,marginRight:10},xe={labelCol:{span:5},wrapperCol:{span:19}},pe=function(be){var Pe=be.callback,Ge=be.onCancel,ot=Se(),ct=Object(K.a)(ot,1),ft=ct[0];function Ct(Ut){Pe(Ut)}function xt(Ut,Mt){if(Ut.status===-1){B.b.error(Ut.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Ut.id),type:Mt.type})}function ut(Ut){var Mt=Ut.target.files[0];te(Mt,xt)}return p.a.createElement(I.a,Object(C.a)({form:ft},xe,{className:"upload-image-panel",onFinish:Ct}),p.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(W.a,{style:Ce})),p.a.createElement(le,{onFileChange:ut}))),p.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(W.a,{style:{width:264}})),p.a.createElement(I.a.Item,{style:{textAlign:"right"}},p.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(H.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))};function le(be){var Pe=be.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Pe}))}function te(be,Pe){if(!be)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ge=new FormData;Ge.append("editormd-image-file",be),Ge.append("file_param_name","editormd-image-file"),Ge.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(ct){Pe(JSON.parse(ct.target.responseText),be)},!1),ot.addEventListener("error",function(ct){console.error(ct)},!1),ot.open("POST","".concat(me.a,"/api/attachments.json")),ot.send(Ge)}var de=ne("giR+"),se=ne("fyUT"),Oe=ne("7Kak"),ke=ne("9yH6"),Te=ke.a.Group,Le={margin:"0 8px"},Me=function(be){var Pe=be.callback,Ge=be.onCancel;function ot(ct){Pe(ct)}return p.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:Le},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:Le},"\u884C\u6570"),p.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(se.a,null)),p.a.createElement("span",{style:Le},"\u5217\u6570"),p.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(se.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:Le},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(I.a.Item,{name:"align"},p.a.createElement(Te,null,p.a.createElement(ke.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(ke.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(ke.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(ke.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(H.a,{type:"ghost",onClick:Ge},"\u53D6\u6D88")))},je=ne("ErOA"),Fe=ne("7Cbv"),Ne="link",Ue="upload-image",Je="code-block",tt="add-table",et="------------",Ze={default:et,left:":".concat(et),center:":".concat(et,":"),right:"".concat(et,":")},dt=ne("9VGf"),it,at;function Ie(){}var st=0,$e=1e4,De="\u2581",He=`
**\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 Ee(be){return/^\d+$/.test(be)?"".concat(be,"px"):be}var fe=navigator.platform.toUpperCase().indexOf("MAC")>=0,_e=fe?"Cmd":"Ctrl",re=["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"],ae=(it={},Object(G.a)(it,_e+"-B","bold"),Object(G.a)(it,_e+"-I","italic"),it),he=(at={},Object(G.a)(at,Ne,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(at,Je,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(at,Ue,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(at,tt,"\u6DFB\u52A0\u8868\u683C"),at),ve=Ye.a=function(be){var Pe=be.defaultValue,Ge=Pe===void 0?"":Pe,ot=be.onChange,ct=be.width,ft=ct===void 0?"100%":ct,Ct=be.height,xt=Ct===void 0?400:Ct,ut=be.miniToolbar,Ut=ut===void 0?!1:ut,Mt=be.isFocus,Zt=Mt===void 0?!1:Mt,Yt=be.watch,Rt=be.insertTemp,Ti=be.mode,Ui=Ti===void 0?"markdown":Ti,Qe=be.id,wt=Qe===void 0?"markdown-editor-id":Qe,Ot=be.showResizeBar,Lt=Ot===void 0?!1:Ot,qt=be.noStorage,qi=qt===void 0?!1:qt,er=be.showNullButton,Bt=er===void 0?!1:er,pt=be.hidetoolBar,Gi=pt===void 0?!1:pt,tr=be.fullScreen,vi=tr===void 0?!1:tr,kt=be.onBlur,Bi=be.onCMBeforeChange,Vi=be.onFullScreen,fr=be.className,Ve=fr===void 0?"":fr,Tt=be.disablePaste,pr=Tt===void 0?!1:Tt,mr=be.placeholder,gr=mr===void 0?"":mr,vr=be.values,X=vr===void 0?"":vr,v=Object(g.useState)(null),A=Object(K.a)(v,2),U=A[0],q=A[1],V=Object(g.useState)(Ge),ye=Object(K.a)(V,2),We=ye[0],qe=ye[1],mt=Object(g.useState)(Yt),ze=Object(K.a)(mt,2),_t=ze[0],jt=ze[1],$t=Object(g.useState)(vi),Pi=Object(K.a)($t,2),yi=Pi[0],_i=Pi[1],Xi=Object(g.useState)(""),Ir=Object(K.a)(Xi,2),li=Ir[0],ji=Ir[1],or=Object(g.useState)(0),lr=Object(K.a)(or,2),Mi=lr[0],kr=lr[1],yr=Object(g.useState)(xt),zr=Object(K.a)(yr,2),Kr=zr[0],Yi=zr[1],zi=Object(g.useState)(!1),_r=Object(K.a)(zi,2),dn=_r[0],br=_r[1],ti=Object(g.useRef)(Object(Fe.a)()),Ht=Object(g.useRef)(!1),pi=Object(g.useRef)(),Dt=Object(g.useRef)(),ri=Object(g.useRef)(),zt=Object(g.useRef)(),ir=Object(g.useRef)(),ui=function(){var vt=Object(F.a)(R.a.mark(function St(){var bt,It;return R.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:return Vt.next=2,Object(je.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ti.current}});case 2:It=Vt.sent,It!=null&&(bt=It.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",U,Dt),It.attachments.map(function(Nt){Nt.content_type.indexOf("image")>-1?U.replaceSelection(".concat(Nt.content_type,")")):Nt.content_type.indexOf("video")>-1?U.replaceSelection('')):Nt.content_type.indexOf("pdf")>-1?U.replaceSelection('').concat(Nt.name,"")):U.replaceSelection("[".concat(Nt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Nt.id,"?type=").concat(Nt.content_type,")"))}));case 4:case"end":return Vt.stop()}},St)}));return function(){return vt.apply(this,arguments)}}();Object(g.useEffect)(function(){qe(X),U==null||U.setValue(X)},[X]),Object(g.useEffect)(function(){Vi==null||Vi(yi)},[yi]),Object(g.useEffect)(function(){if(Dt.current){var vt=d.a.fromTextArea(Dt.current,{mode:Ui,lineNumbers:!Ut,lineWrapping:!0,value:Ge,autoCloseTags:!0,autoCloseBrackets:!0});Zt&&vt.focus();function St(bt,It){if(pr){It.preventDefault();return}var Ft=It.clipboardData;if(Ft){var Vt=Ft.types.toString(),Nt=Ft.items;if(Vt==="Files"||Ft.types.indexOf("Files")>-1){if(It.preventDefault(),Ui=="stex")return;try{var si,Ai=Nt[1];((si=Nt[0])===null||si===void 0?void 0:si.kind)==="file"&&(Ai=Nt[0]);var Pt=Ai.getAsFile(),ur=Pt.name.split(".").pop();te(Pt,function(Wt){if(Wt.id){var Oi,bi,Ki;(Pt==null||((Oi=Pt.type)===null||Oi===void 0)?void 0:Oi.indexOf("image"))>-1?vt.replaceSelection(".concat(Wt.content_type,")")):(Pt==null||((bi=Pt.type)===null||bi===void 0)?void 0:bi.indexOf("video"))>-1?vt.replaceSelection('')):(Pt==null||((Ki=Pt.type)===null||Ki===void 0)?void 0:Ki.indexOf("pdf"))>-1?vt.replaceSelection('').concat(Pt.name,"")):re.includes(ur)?vt.replaceSelection('').concat(Pt.name,"")):vt.replaceSelection("[".concat(Pt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})}catch(Wt){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",St),vt.on("dragleave",function(bt,It){ri.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(bt,It){ri.current.classList.add("mouse-hover-md")}),vt.on("drop",function(bt,It){ri.current.classList.add("mouse-hover-md");var Ft;if(Ft=It.dataTransfer.files,Ft.length>0){It.preventDefault(),It.stopPropagation();for(var Vt=function(Ai){var Pt=Ft[Ai],ur=Pt.name.split(".").pop();te(Pt,function(Wt){if(Wt.id){var Oi,bi,Ki;(Pt==null||((Oi=Pt.type)===null||Oi===void 0)?void 0:Oi.indexOf("image"))>-1?vt.replaceSelection(".concat(Wt.content_type,")")):(Pt==null||((bi=Pt.type)===null||bi===void 0)?void 0:bi.indexOf("video"))>-1?vt.replaceSelection('')):(Pt==null||((Ki=Pt.type)===null||Ki===void 0)?void 0:Ki.indexOf("pdf"))>-1?vt.replaceSelection('').concat(Pt.name,"")):re.includes(ur)?vt.replaceSelection('').concat(Pt.name,"")):vt.replaceSelection("[".concat(Pt.name,"](").concat(u.a.API_SERVER,"/api/attachments/").concat(Wt.id,"?type=").concat(Wt.content_type,")"))}else(Wt==null?void 0:Wt.status)===401&&(document.location.href="/user/login")})},Nt=0;Nt0||Nt.target.offsetWidth>0)&&(wi(),U.setSize("100%","100%"),U.refresh())}}catch(si){Ft.e(si)}finally{Ft.f()}});return bt.observe(Dt.current.parentElement),bt}if(U){var St=vt();return function(){St.unobserve(Dt.current.parentElement)}}},[U,wi]),Object(g.useEffect)(function(){if(U){for(var vt=[],St=function(){var Nt=It[bt];Ft=Object(K.a)(Nt,2);var si=Ft[0],Ai=Ft[1],Pt=Object(G.a)({},si,function(){Vr(Ai)});vt.push(Pt),U.addKeyMap(Pt)},bt=0,It=Object.entries(ae);bt0){var vt=new Date().getTime(),St=window.sessionStorage.getItem(wt);vt>=Mi+$e&&(!St||St!==We)&&(window.sessionStorage.setItem(wt,We),br(!0))}},$e),Object(g.useEffect)(function(){jt(Yt)},[U,Yt]),Object(g.useEffect)(function(){U&&(Zt&&U.focus())},[U,Zt]),Object(g.useEffect)(function(){if(_t&&U){var vt=U.getScrollerElement();function St(bt){var It=bt.target;if(ir.current){var Ft=It.scrollTop/It.scrollHeight;ir.current.scrollTop=ir.current.scrollHeight*Ft}}return vt.addEventListener("scroll",St),function(){vt.removeEventListener("scroll",St)}}},[U,_t]),Object(g.useEffect)(function(){if(U&&Bi){function vt(St,bt){Bi(St,bt)}return U.on("beforeChange",vt),function(){U.off("beforeChange",vt)}}},[U,Bi]),Object(g.useEffect)(function(){if(U&&kt){function vt(){kt(U.getValue())}return U.on("blur",vt),function(){U.off("blur",vt)}}},[U,kt]),Object(g.useEffect)(function(){if(U){function vt(St){var bt=St.getValue();qe(bt),kr(new Date().getTime()),St.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(bt)}return U.on("change",vt),function(){U.off("change",vt)}}},[U,ot]),Object(g.useEffect)(function(){U&&(Ge==null?(U.setValue(""),qe("")):Ge!==U.getValue()&&(U.setValue(Ge),qe(Ge),U.setCursor(U.lineCount(),0)))},[U,Ge]);var Vr=Object(g.useCallback)(function(vt){var St=U.getCursor(),bt=U.getSelection(),It=bt.split(`
`);switch(vt){case"bold":return U.replaceSelection("**"+bt+"**"),bt===""&&U.setCursor(St.line,St.ch+2),U.focus();case"italic":return U.replaceSelection("*"+bt+"*"),bt===""&&U.setCursor(St.line,St.ch+1),U.focus();case"code":return U.replaceSelection("`"+bt+"`"),bt===""&&U.setCursor(St.line,St.ch+1),U.focus();case"inline-latex":return U.replaceSelection("`$$"+bt+"$$`"),bt===""&&U.setCursor(St.line,St.ch+3),U.focus();case"latex":return U.replaceSelection("```latex\n"+bt+"\n```"),U.setCursor(St.line+1,bt.length+1),U.focus();case"line-break":return U.replaceSelection(`
`),U.focus();case"list-ul":return bt===""?U.replaceSelection("- "+bt):U.replaceSelection(It.map(function(Ft){return Ft===""?"":"- ".concat(Ft)}).join(`
`)),U.focus();case"list-ol":return bt===""?U.replaceSelection("1. "+bt):U.replaceSelection(It.map(function(Ft,Vt){return Ft===""?"":"".concat(Vt+1,". ").concat(Ft)}).join(`
`)),U.focus();case"add-null-ch":return bt===""&&U.setCursor(St.line,St.ch+1),U.replaceSelection(De),U.focus();case"inster-template-1":return bt===""&&U.setCursor(St.line,St.ch),U.replaceSelection(He),U.focus();case"eraser":return U.setValue(""),U.focus();case"trigger-watch":return jt(!_t),U.focus();case"trigger-full-screen":return _i(!yi),U.focus();case Ne:ji(Ne);return;case Je:ji(Je);return;case Ue:ji(Ue);return;case tt:ji(tt);return;default:throw new Error}},[U,_t,yi]),Er=Object(g.useCallback)(function(vt){ji("");switch(li){case Ne:var St=vt.title,bt=vt.link;return U.replaceSelection("[".concat(St,"](").concat(bt,")")),U.focus();case Je:var It=vt.language,Ft=vt.content;return U.replaceSelection(["```"+It,Ft,"```"].join(`
`)),U.focus();case Ue:var Vt=vt.src,Nt=vt.alt;return Nt?U.replaceSelection(".concat(Vt,' "').concat(Nt,'" )')):U.replaceSelection("")),U.focus();case tt:for(var si=vt.row,Ai=vt.col,Pt=vt.align,ur=`
`,Wt=0;Wt300&&(si=300);var Ai=xt+si+"px";Yi(Ai)}}return vt.addEventListener("mousedown",It),document.addEventListener("mousemove",Vt),document.addEventListener("mouseup",Ft),function(){vt.removeEventListener("mousedown",It),document.removeEventListener("mousemove",Vt),document.removeEventListener("mouseup",Ft)}}},[U,zt]),Object(g.useEffect)(function(){Yi(xt)},[xt]);var rr=Ee(ft),fn=Ee(Kr),$i={width:rr,height:fn},pn=Object(g.useMemo)(function(){if(Mi){var vt=new Date(Mi),St=vt.getHours(),bt=vt.getMinutes(),It=vt.getSeconds();return St=St<10?"0"+St:St,bt=bt<10?"0"+bt:bt,It=It<10?"0"+It:It,"".concat(St,":").concat(bt,":").concat(It)}return 0},[Mi]);function jn(){window.sessionStorage.removeItem(wt),br(!1),kr(0)}function Dr(){br(!1),kr(0),U.setValue(window.sessionStorage.getItem(wt))}function ua(vt,St){var bt=U.getValue();bt=bt.replace(vt,St),qe(bt),U==null||U.setValue(bt)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:ri},p.a.createElement("div",{className:"markdown-editor-container ".concat(Ve," ").concat(_t?"on-preview":""," ").concat(Ut?"mini":""," ").concat(yi?"full-screen":""),style:$i},p.a.createElement(b,{insertTemp:Rt,watch:_t,fullScreen:yi,showNullButton:Bt,onActionCallback:Vr,hidetoolBar:Gi,uuid:ti.current,setOpenPhones:function(){Ht.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Dt,placeholder:gr})),_t?p.a.createElement("div",{ref:ir,className:"preview-container"},Ui==="stex"&&p.a.createElement(O,{value:We}),Ui!=="stex"&&p.a.createElement(x.a,{edit:!0,value:We,replaces:ua})):null))),Lt?p.a.createElement("a",{ref:zt,className:"editor-resize"}):null,p.a.createElement(N.a,null,he[li]?p.a.createElement(Z.a,{centered:!0,title:he[li],visible:!0,onCancel:xr,footer:null,className:"markdown-popup-form"},cn):null))}},SJMd:function(gt,Ye){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var ne,ue,Z,P=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var F,K;(function(){var G=window,M=["break,continue,do,else,for,if,return,while"],R=[M,"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"],g=[R,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[g,"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"],f=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[g,"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"],s="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",c=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="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",n=[M,"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"],o=[M,"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"],h=[M,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],L=[p,d,f,c,l,n,o,h],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",O="kwd",C="com",w="typ",T="lit",_="pun",u="pln",E="tag",m="dec",b="src",N="atn",D="atv",H="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Te){for(var Le=0,Me=!1,je=!1,Fe=0,Ne=Te.length;Fe122||(re<65||_e>90||st.push([Math.max(65,_e)|32,Math.min(re,90)|32]),re<97||_e>122||st.push([Math.max(97,_e)&~32,Math.min(re,122)&~32]))}}st.sort(function(be,Pe){return be[0]-Pe[0]||Pe[1]-be[1]});for(var ae=[],he=[],He=0;Heve[0]&&(ve[1]+1>ve[0]&&De.push("-"),De.push(et(ve[1])))}return De.push("]"),De.join("")}function dt(at){for(var Ie=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")),st=Ie.length,$e=[],De=0,He=0;De=2&&_e==="["?Ie[De]=Ze(Ee):_e!=="\\"&&(Ie[De]=Ee.replace(/[a-zA-Z]/g,function(he){var ve=he.charCodeAt(0);return"["+String.fromCharCode(ve&~32,ve|32)+"]"}))}return Ie.join("")}for(var it=[],Fe=0,Ne=Te.length;Fe=0;)Me[it.charAt(at)]=dt;var Ie=dt[1],st=""+Ie;tt.hasOwnProperty(st)||(Je.push(Ie),tt[st]=null)}Je.push(/[\0-\uffff]/),je=I(Je)})();var Fe=Le.length,Ne=function(Ue){for(var Je=Ue.sourceCode,tt=Ue.basePos,et=Ue.sourceNode,Ze=[tt,u],dt=0,it=Je.match(je)||[],at={},Ie=0,st=it.length;Ie=5&&De.substring(0,5)==="lang-",Ee&&!(He&&typeof He[1]=="string")&&(Ee=!1,De=b),Ee||(at[$e]=De)}var re=dt;if(dt+=$e.length,!Ee)Ze.push(tt+re,De);else{var ae=He[1],he=$e.indexOf(ae),ve=he+ae.length;He[2]&&(ve=$e.length-He[2].length,he=ve-ae.length);var be=De.substring(5);W(et,tt+re,$e.substring(0,he),Ne,Ze),W(et,tt+re+he,ae,le(be,ae),Ze),W(et,tt+re+ve,$e.substring(ve),Ne,Ze)}}Ue.decorations=Ze};return Ne}function we(Te){var Le=[],Me=[];Te.tripleQuotedStrings?Le.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Te.multiLineStrings?Le.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Le.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Te.verbatimStrings&&Me.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var je=Te.hashComments;je&&(Te.cStyleComments?(je>1?Le.push([C,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Le.push([C,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Me.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Le.push([C,/^#[^\r\n]*/,null,"#"])),Te.cStyleComments&&(Me.push([C,/^\/\/[^\r\n]*/,null]),Me.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Fe=Te.regexLiterals;if(Fe){var Ne=Fe>1?"":`
\r`,Ue=Ne?".":"[\\S\\s]",Je="/(?=[^/*"+Ne+"])(?:[^/\\x5B\\x5C"+Ne+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+Ne+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";Me.push(["lang-regex",RegExp("^"+j+"("+Je+")")])}var tt=Te.types;tt&&Me.push([w,tt]);var et=(""+Te.keywords).replace(/^ | $/g,"");et.length&&Me.push([O,new RegExp("^(?:"+et.replace(/[\s,]+/g,"|")+")\\b"),null]),Le.push([u,/^\s+/,null,` \r
\xA0`]);var Ze="^.[^\\s\\w.$@'\"`/\\\\]*";return Te.regexLiterals&&(Ze+="(?!s*/)"),Me.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[w,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[u,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[u,/^\\[\s\S]?/,null],[_,new RegExp(Ze),null]),oe(Le,Me)}var me=we({keywords:L,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Se(Te,Le,Me){for(var je=/(?:^|\s)nocode(?:\s|$)/,Fe=/\r\n?|\n/,Ne=Te.ownerDocument,Ue=Ne.createElement("li");Te.firstChild;)Ue.appendChild(Te.firstChild);var Je=[Ue];function tt(Ie){var st=Ie.nodeType;if(st==1&&!je.test(Ie.className))if(Ie.nodeName==="br")et(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var $e=Ie.firstChild;$e;$e=$e.nextSibling)tt($e);else if((st==3||st==4)&&Me){var De=Ie.nodeValue,He=De.match(Fe);if(He){var Ee=De.substring(0,He.index);Ie.nodeValue=Ee;var fe=De.substring(He.index+He[0].length);if(fe){var _e=Ie.parentNode;_e.insertBefore(Ne.createTextNode(fe),Ie.nextSibling)}et(Ie),Ee||Ie.parentNode.removeChild(Ie)}}}function et(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function st(He,Ee){var fe=Ee?He.cloneNode(!1):He,_e=He.parentNode;if(_e){var re=st(_e,1),ae=He.nextSibling;re.appendChild(fe);for(var he=ae;he;he=ae)ae=he.nextSibling,re.appendChild(he)}return fe}for(var $e=st(Ie.nextSibling,0),De;(De=$e.parentNode)&&De.nodeType===1;)$e=De;Je.push($e)}for(var Ze=0;Ze=_e&&(tt+=2),Ne>=re&&(dt+=2)}}finally{De&&(De.style.display=He)}}var xe={};function pe(Te,Le){for(var Me=Le.length;--Me>=0;){var je=Le[Me];xe.hasOwnProperty(je)?G.console&&console.warn("cannot override language handler %s",je):xe[je]=Te}}function le(Te,Le){return Te&&xe.hasOwnProperty(Te)||(Te=/^\s*]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[_,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^