(window.webpackJsonp=window.webpackJsonp||[]).push([[224,7,9],{"+NIl":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.defineMode("stex",function(Y,L){"use strict";function Q(D,T){D.cmdState.push(T)}function B(D){return D.cmdState.length>0?D.cmdState[D.cmdState.length-1]:null}function _(D){var T=D.cmdState.pop();T&&T.closeBracket()}function H(D){for(var T=D.cmdState,S=T.length-1;S>=0;S--){var h=T[S];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function W(D,T,S){return function(){this.name=D,this.bracketNo=0,this.style=T,this.styles=S,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=W("importmodule","tag",["string","builtin"]),O.documentclass=W("documentclass","tag",["","atom"]),O.usepackage=W("usepackage","tag",["atom"]),O.begin=W("begin","tag",["atom"]),O.end=W("end","tag",["atom"]),O.label=W("label","tag",["atom"]),O.ref=W("ref","tag",["atom"]),O.eqref=W("eqref","tag",["atom"]),O.cite=W("cite","tag",["atom"]),O.bibitem=W("bibitem","tag",["atom"]),O.Bibitem=W("Bibitem","tag",["atom"]),O.RBibitem=W("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function M(D,T){D.f=T}function y(D,T){var S;if(D.match(/^\\[a-zA-Z@]+/)){var h=D.current().slice(1);return S=O.hasOwnProperty(h)?O[h]:O.DEFAULT,S=new S,Q(T,S),M(T,k),S.style}if(D.match(/^\\[$&%#{}_]/))return"tag";if(D.match(/^\\[,;!\/\\]/))return"tag";if(D.match("\\["))return M(T,function(u,d){return w(u,d,"\\]")}),"keyword";if(D.match("\\("))return M(T,function(u,d){return w(u,d,"\\)")}),"keyword";if(D.match("$$"))return M(T,function(u,d){return w(u,d,"$$")}),"keyword";if(D.match("$"))return M(T,function(u,d){return w(u,d,"$")}),"keyword";var o=D.next();if(o=="%")return D.skipToEnd(),"comment";if(o=="}"||o=="]"){if(S=B(T),S)S.closeBracket(o),M(T,k);else return"error";return"bracket"}else return o=="{"||o=="["?(S=O.DEFAULT,S=new S,Q(T,S),"bracket"):/\d/.test(o)?(D.eatWhile(/[\w.%]/),"atom"):(D.eatWhile(/[\w\-_]/),S=H(T),S.name=="begin"&&(S.argument=D.current()),S.styleIdentifier())}function w(D,T,S){if(D.eatSpace())return null;if(S&&D.match(S))return M(T,y),"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 h=D.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(D.skipToEnd(),"comment"):"error"}function k(D,T){var S=D.peek(),h;return S=="{"||S=="["?(h=B(T),h.openBracket(S),D.eat(S),M(T,y),"bracket"):/[ \t\r]/.test(S)?(D.eat(S),null):(M(T,y),_(T),y(D,T))}return{startState:function(){var D=L.inMathMode?function(T,S){return w(T,S)}:y;return{cmdState:[],f:D}},copyState:function(D){return{cmdState:D.cmdState.slice(),f:D.f}},token:function(D,T){return T.f(D,T)},blankLine:function(D){D.f=y,D.cmdState.length=0},lineComment:"%"}}),ie.defineMIME("text/x-stex","stex"),ie.defineMIME("text/x-latex","stex")})},"/GNS":function(Pe,Le,Z){Pe.exports=Z.p+"static/search1.c4136dd4.png"},"19Vz":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){ie.defineOption("placeholder","",function(W,O,M){var y=M&&M!=ie.Init;if(O&&!y)W.on("blur",B),W.on("change",_),W.on("swapDoc",_),ie.on(W.getInputField(),"compositionupdate",W.state.placeholderCompose=function(){Q(W)}),_(W);else if(!O&&y){W.off("blur",B),W.off("change",_),W.off("swapDoc",_),ie.off(W.getInputField(),"compositionupdate",W.state.placeholderCompose),Y(W);var w=W.getWrapperElement();w.className=w.className.replace(" CodeMirror-empty","")}O&&!W.hasFocus()&&B(W)});function Y(W){W.state.placeholder&&(W.state.placeholder.parentNode.removeChild(W.state.placeholder),W.state.placeholder=null)}function L(W){Y(W);var O=W.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=W.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var M=W.getOption("placeholder");typeof M=="string"&&(M=document.createTextNode(M)),O.appendChild(M),W.display.lineSpace.insertBefore(O,W.display.lineSpace.firstChild)}function Q(W){setTimeout(function(){var O=!1,M=W.getInputField();M.nodeName=="TEXTAREA"?O=!M.value:W.lineCount()==1&&(O=!/[^\u200b]/.test(M.querySelector(".CodeMirror-line").textContent)),O?L(W):Y(W)},20)}function B(W){H(W)&&L(W)}function _(W){var O=W.getWrapperElement(),M=H(W);O.className=O.className.replace(" CodeMirror-empty","")+(M?" CodeMirror-empty":""),M?L(W):Y(W)}function H(W){return W.lineCount()===1&&W.getLine(0)===""}})},"1eCo":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";var Y={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},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ie.defineMode("xml",function(Q,B){var _=Q.indentUnit,H={},W=B.htmlMode?Y:L;for(var O in W)H[O]=W[O];for(var O in B)H[O]=B[O];var M,y;function w(a,b){function g(G){return b.tokenize=G,G(a,b)}var E=a.next();if(E=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?g(T("atom","]]>")):null:a.match("--")?g(T("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),g(S(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=T("meta","?>"),"meta"):(M=a.eat("/")?"closeTag":"openTag",b.tokenize=k,"tag bracket");if(E=="&"){var P;return a.eat("#")?a.eat("x")?P=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):P=a.eatWhile(/[\d]/)&&a.eat(";"):P=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),P?"atom":"error"}else return a.eatWhile(/[^&<]/),null}w.isInText=!0;function k(a,b){var g=a.next();if(g==">"||g=="/"&&a.eat(">"))return b.tokenize=w,M=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return M="equals",null;if(g=="<"){b.tokenize=w,b.state=d,b.tagName=b.tagStart=null;var E=b.tokenize(a,b);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(g)?(b.tokenize=D(g),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function D(a){var b=function(g,E){for(;!g.eol();)if(g.next()==a){E.tokenize=k;break}return"string"};return b.isInAttribute=!0,b}function T(a,b){return function(g,E){for(;!g.eol();){if(g.match(b)){E.tokenize=w;break}g.next()}return a}}function S(a){return function(b,g){for(var E;(E=b.next())!=null;){if(E=="<")return g.tokenize=S(a+1),g.tokenize(b,g);if(E==">")if(a==1){g.tokenize=w;break}else return g.tokenize=S(a-1),g.tokenize(b,g)}return"meta"}}function h(a,b,g){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=g,(H.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function u(a,b){for(var g;;){if(!a.context)return;if(g=a.context.tagName,!H.contextGrabbers.hasOwnProperty(g)||!H.contextGrabbers[g].hasOwnProperty(b))return;o(a)}}function d(a,b,g){return a=="openTag"?(g.tagStart=b.column(),A):a=="closeTag"?v:d}function A(a,b,g){return a=="word"?(g.tagName=b.current(),y="tag",x):H.allowMissingTagName&&a=="endTag"?(y="tag bracket",x(a,b,g)):(y="error",A)}function v(a,b,g){if(a=="word"){var E=b.current();return g.context&&g.context.tagName!=E&&H.implicitlyClosed.hasOwnProperty(g.context.tagName)&&o(g),g.context&&g.context.tagName==E||H.matchClosing===!1?(y="tag",m):(y="tag error",R)}else return H.allowMissingTagName&&a=="endTag"?(y="tag bracket",m(a,b,g)):(y="error",R)}function m(a,b,g){return a!="endTag"?(y="error",m):(o(g),d)}function R(a,b,g){return y="error",m(a,b,g)}function x(a,b,g){if(a=="word")return y="attribute",f;if(a=="endTag"||a=="selfcloseTag"){var E=g.tagName,P=g.tagStart;return g.tagName=g.tagStart=null,a=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(E)?u(g,E):(u(g,E),g.context=new h(g,E,P==g.indented)),d}return y="error",x}function f(a,b,g){return a=="equals"?c:(H.allowMissing||(y="error"),x(a,b,g))}function c(a,b,g){return a=="string"?s:a=="word"&&H.allowUnquoted?(y="string",x):(y="error",x(a,b,g))}function s(a,b,g){return a=="string"?s:x(a,b,g)}return{startState:function(a){var b={tokenize:w,state:d,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(b.baseIndent=a),b},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;M=null;var g=b.tokenize(a,b);return(g||M)&&g!="comment"&&(y=null,b.state=b.state(M||g,a,b),y&&(g=y=="error"?g+" error":y)),g},indent:function(a,b,g){var E=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+_;if(E&&E.noIndent)return ie.Pass;if(a.tokenize!=k&&a.tokenize!=w)return g?g.match(/^(\s*)/)[0].length:0;if(a.tagName)return H.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+_*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(a){a.state==c&&(a.state=x)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var b=[],g=a.context;g;g=g.prev)g.tagName&&b.push(g.tagName);return b.reverse()}}}),ie.defineMIME("text/xml","xml"),ie.defineMIME("application/xml","xml"),ie.mimeModes.hasOwnProperty("text/html")||ie.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2RCv":function(Pe,Le,Z){"use strict";var ie=Z("Awhp"),Y=Z("KrTs"),L=Z("+L6B"),Q=Z("2/Rp"),B=Z("5NDa"),_=Z("5rEg"),H=Z("0Owb"),W=Z("oBTY"),O=Z("tJVT"),M=Z("PpiC"),y=Z("q1tI"),w=Z.n(y),k=function(T){var S=T.InputRight,h=T.value,o=h===void 0?[]:h,u=T.onChange,d=u===void 0?function(){}:u,A=Object(M.a)(T,["InputRight","value","onChange"]),v=Object(y.useState)(),m=Object(O.a)(v,2),R=m[0],x=m[1],f=function(a){var b=o.filter(function(g,E){return E!==a});d(b)},c=function(a){if(a.preventDefault(),!R)return;d([].concat(Object(W.a)(o),[R])),x(null)};return w.a.createElement("div",null,w.a.createElement(_.a,Object(H.a)({},A,{value:R,onChange:function(a){return x(a.target.value)},onPressEnter:c,onBlur:c})),S,w.a.createElement("div",{className:"mt20"},o==null?void 0:o.map(function(s,a){return w.a.createElement(Y.a,{className:"ml10 mr10",count:"x",onClick:function(){return f(a)}},w.a.createElement(Q.a,{type:"primary",ghost:!0},s))})))};Le.a=k},"4qgm":function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAAwCAYAAABE1blzAAAIeUlEQVRoQ72aa2wU1xXHf2dm1jYEBClJGgofIFJLU0W04AdQWgJSW0UprZRIpB/aJBTxStIShWchJvbytA2lBCKKeajhQ5s2tGpFK1G1UowqKNjYBkraJCqqiCDEDZSncezdmTnVnd2FxaztmfWaa632w9459/7v75xzz71j4R61ssM6TkrYqMon3qesPjFNLt6LoWWgB5n1ttr/GcMCLKrE5qFgPJf3gRXN5XJgoMcfUIFlR/QxiqgVhyfVA/MxTWKgPuZvL51UtUyTjwdK6IAI/NLbWlQylhctWC0xPuN35Zi+gFUMfpIzoqxsLpffDoTIggssb9KvqLBJYnxD3dvUepq8OIAPquxzfCobJ8v5QgotmMAxDVoyYjAvi81KcRiWk1qPKm/RPIvHqy2T5FeFElkQgeVNWq42m8TmcU0G8ZVXC2ia5vOW47Lq2BQ5m5ehrIf6JbC0WQdbsMSH5ZbNED/R3+mYDHSL5kcqVLZOZB8imq/lvAWWHdWpOGySIqYEwvKk1mtsmtl5/M72WNk4Wf6dj8jIAqce1qGJEparsgSHQVoIar3M3GRadWnDp+rb5eyJi0RaykgCy47q9DS1srDUvLRzme+YFXhg5CY2YD4uf/RdVrROkffCGgk13vQTOrzdZZUKi8SmOCy1pMLUYfCDkfD7T+Cvl1P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vmb/nFrHuX6E4D7/YXWwTurLWJQnnbMGPLnlADu0SP7bK4ozmNQLe6pZn2wwGrbv8PSygpSs9Cw9cAAAAASUVORK5CYII="},"55Ip":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return u});var ie=Z("Ty5D"),Y=Z("dI71"),L=Z("q1tI"),Q=Z.n(L),B=Z("YS25"),_=Z("17x9"),H=Z.n(_),W=Z("wx14"),O=Z("zLVn"),M=Z("9R94"),y=function(c){Object(Y.a)(s,c);function s(){for(var b,g=arguments.length,E=new Array(g),P=0;P1&&arguments[1]!==void 0?arguments[1]:0,T=(H[k[D+0]]+H[k[D+1]]+H[k[D+2]]+H[k[D+3]]+"-"+H[k[D+4]]+H[k[D+5]]+"-"+H[k[D+6]]+H[k[D+7]]+"-"+H[k[D+8]]+H[k[D+9]]+"-"+H[k[D+10]]+H[k[D+11]]+H[k[D+12]]+H[k[D+13]]+H[k[D+14]]+H[k[D+15]]).toLowerCase();if(!_(T))throw TypeError("Stringified UUID is invalid");return T}var M=O;function y(k,D,T){k=k||{};var S=k.random||(k.rng||L)();if(S[6]=S[6]&15|64,S[8]=S[8]&63|128,D){T=T||0;for(var h=0;h<16;++h)D[T+h]=S[h];return D}return M(S)}var w=Le.a=y},"7ZXX":function(Pe,Le,Z){Pe.exports=Z.p+"static/err.6e7c5817.png"},"7ahc":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return A});var ie=Z("k1fw"),Y=Z("0Owb"),L=Z("+L6B"),Q=Z("2/Rp"),B=Z("y8nQ"),_=Z("Vl3Y"),H=Z("tJVT"),W=Z("OaEy"),O=Z("2fM7"),M=Z("q1tI"),y=Z.n(M),w=Z("VrN/"),k=Z.n(w),D=Z("p77/"),T=Z.n(D),S=Z("c5Ni"),h=Z.n(S),o=O.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},d={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"]};Le.b=function(v){var m=v.callback,R=v.onCancel,x=Object(M.useState)("python"),f=Object(H.a)(x,2),c=f[0],s=f[1];function a(g){s(d[g][1])}function b(g){m(g)}return y.a.createElement(_.a,Object(Y.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),y.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},y.a.createElement(O.a,{onChange:a},Object.keys(d).map(function(g){return y.a.createElement(o,{key:g,value:g},d[g][0])}))),y.a.createElement(_.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},y.a.createElement(A,{mode:c})),y.a.createElement("div",{className:"flex-container flex-end"},y.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),y.a.createElement(Q.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function A(v){var m=v.value,R=v.onChange,x=v.mode,f=v.options,c=f===void 0?{}:f,s=Object(M.useRef)(),a=Object(M.useState)(),b=Object(H.a)(a,2),g=b[0],E=b[1];return Object(M.useEffect)(function(){if(g){function P(G){var V=G.getValue();R&&R(V)}return g.on("change",P),function(){g.off("change",P)}}},[g,R]),Object(M.useEffect)(function(){g&&g.setOption("mode",x)},[g,x]),Object(M.useEffect)(function(){g&&((m!==g.getValue()||m==="")&&setTimeout(function(){g.setValue(m||" ")},300))},[g,m]),Object(M.useEffect)(function(){if(s.current&&!g){var P=k.a.fromTextArea(s.current,Object(ie.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},c));E(P)}},[s.current,g]),y.a.createElement("div",{className:"my-codemirror-container"},y.a.createElement("textarea",{ref:s}))}},"7ixt":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return L});var ie={adjustX:1,adjustY:1},Y=[0,0],L={left:{points:["cr","cl"],overflow:ie,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:ie,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:ie,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:ie,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:ie,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:ie,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:ie,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:ie,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:ie,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:ie,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:ie,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:ie,offset:[-4,0],targetOffset:Y}},Q=L},"7v3h":function(Pe,Le,Z){Pe.exports=Z.p+"static/empty2.dd73f390.png"},"8/bI":function(Pe,Le,Z){Pe.exports=Z.p+"static/empty.8918e228.png"},"8EBN":function(Pe,Le,Z){(function(ie){ie(Z("VrN/"))})(function(ie){"use strict";ie.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 Y=0;Y-1&&Q.substring(H+1,Q.length);if(W)return ie.findModeByExtension(W)},ie.findModeByName=function(Q){Q=Q.toLowerCase();for(var B=0;B=I.length?J.slice(I.length):J}).join(`
`)}var h=[],o=[""],u=new D.a.Renderer,d=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){h.length=0,o=[""]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(j,l,p,I){if(l>=j.length||j[l].level<=p)return l;var J=j[l];I.push(""+J.text+" "),l++;var U=[];return l=m(j,l,J.level,U),U.length>0&&(I.push(""),U.forEach(function(he){I.push(he)}),I.push(" ")),I.push(" "),l=m(j,l,p,I),l}function R(){return m(h,0,0,o),o.push(" "),o.join("")}var x={heading:function(l){var p=d.exec(l);if(p)return{type:"heading",raw:p[0],depth:p[1].length,text:p[2]}},fences:function(l){var p=this.rules.block.fences.exec(l);if(p){var I=p[0],J=S(I,p[3]||""),U=p[2]?p[2].trim():p[2];if(["latex","katex","math"].indexOf(U)>=0){var he=s(),_e=J;J=he,a[he]={type:"block",expression:_e}}return{type:"code",raw:I,lang:U,text:J}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,c=0,s=function(){return"__special_katext_id_".concat(c++,"__")},a={};function b(){return a}function g(){c=0,a={}}function E(j){return j=j.replace(f,function(l,p){var I=s();return a[I]={type:"inline",expression:p},I}),j}var P=u.listitem;u.listitem=function(j){return P(E(j))};var G=u.paragraph;u.paragraph=function(j){return G(E(j))};var V=u.tablecell;u.tablecell=function(j,l){return V(E(j),l)},u.code=function(j,l,p){var I=(l||"").match(/\S*/)[0];return I?["latex","katex","math"].indexOf(I)>=0?"".concat(j,"
"):' ').concat(p?j:Object(T.escape)(j,!0),`
`):''+(p?j:Object(T.escape)(j,!0))+" "},u.heading=function(j,l,p){var I=this.options.headerPrefix+p.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:I,level:l,text:j}),"'+j+" "},D.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),D.a.use({tokenizer:x,renderer:u});var $=D.a,z=Z("SJMd"),F=Z("ulZh"),ee=Z.n(F),ae=Z("m3rI"),ce=Z("Oy/b"),ve=Z("p5ED"),Me=Z("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 xe=function(j,l){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,I){p.__proto__=I}||function(p,I){for(var J in I)Object.prototype.hasOwnProperty.call(I,J)&&(p[J]=I[J])})(j,l)};function Ee(j,l){function p(){this.constructor=j}xe(j,l),j.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)}function Te(j,l,p,I){return new(p||(p=Promise))(function(J,U){function he(gt){try{tt(I.next(gt))}catch(je){U(je)}}function _e(gt){try{tt(I.throw(gt))}catch(je){U(je)}}function tt(gt){var je;gt.done?J(gt.value):(je=gt.value,je instanceof p?je:new p(function(Ct){Ct(je)})).then(he,_e)}tt((I=I.apply(j,l||[])).next())})}function Se(j,l){var p,I,J,U,he={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return U={next:_e(0),throw:_e(1),return:_e(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function _e(tt){return function(gt){return function(je){if(p)throw new TypeError("Generator is already executing.");for(;he;)try{if(p=1,I&&(J=2&je[0]?I.return:je[0]?I.throw||((J=I.return)&&J.call(I),0):I.next)&&!(J=J.call(I,je[1])).done)return J;switch(I=0,J&&(je=[2&je[0],J.value]),je[0]){case 0:case 1:J=je;break;case 4:return he.label++,{value:je[1],done:!1};case 5:he.label++,I=je[1],je=[0];continue;case 7:je=he.ops.pop(),he.trys.pop();continue;default:if(!(J=he.trys,(J=J.length>0&&J[J.length-1])||je[0]!==6&&je[0]!==2)){he=0;continue}if(je[0]===3&&(!J||je[1]>J[0]&&je[1] ',"select"),this.addActionButton(I,' ',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(I,' ',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(I,' ',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(I,' ',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(I,' ',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(I,' ',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(I,' ',"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(U){var he=document.createElement("div");he.className=""+p.toolbarButtonStyleClass.name,he.setAttribute("data-type-name",U.typeName),he.innerHTML=U.icon,he.addEventListener("click",function(){p.markerToolbarButtonClicked(he,U)}),p.buttons.push(he),p.markerButtons.push(he)}),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 J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,' ',"render"),this.addActionButton(J,' ',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},j.prototype.addButtonClickListener=function(l){this.buttonClickListeners.push(l)},j.prototype.removeButtonClickListener=function(l){this.buttonClickListeners.indexOf(l)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(l),1)},j.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},j.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var l=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var p=0;p0&&this.buttonClickListeners.forEach(function(I){return I("marker",p)}),this.markerButtonOverflowBlock.style.display="none"},j.prototype.actionToolbarButtonClicked=function(l,p){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(I){return I("action",p)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},j.prototype.setActiveButton=function(l){this.resetButtonStyles(),l.className=l.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),l.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},j.prototype.setActiveMarkerButton=function(l){var p=this.markerButtons.find(function(I){return I.getAttribute("data-type-name")===l});p&&this.setActiveButton(p)},j.prototype.setCurrentMarker=function(l){var p=this;this.currentMarker=l,this.buttons.filter(function(I){return/delete|notes/.test(I.getAttribute("data-action"))}).forEach(function(I){p.currentMarker===void 0?(I.style.fillOpacity="0.4",I.style.pointerEvents="none"):(I.style.fillOpacity="1",I.style.pointerEvents="all")})},j}(),Be=function(){function j(l,p,I,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=l,this.displayMode=p,this.uiStyleSettings=I,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return j.prototype.addStyles=function(){var l;this.toolboxStyleClass=this.styles.addClass(new De("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 De("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var p=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new De("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new De("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new De("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 De("toolbox-panel-row_colors",`
background-color: `+((l=this.uiStyleSettings.toolboxBackgroundColor)!==null&&l!==void 0?l:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new De("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*p)+`px;
padding: `+p+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new De("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new De("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ze("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},j.prototype.show=function(l){var p;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=l,this.uiContainer.className=this.toolboxStyleClass.name+" "+((p=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},j.prototype.setPanelButtons=function(l){var p,I,J=this;this.panels=l,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((p=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&p!==void 0?p:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((I=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&I!==void 0?I:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(U){var he;U.uiStyleSettings=J.uiStyleSettings;var _e=document.createElement("div");_e.className=J.toolboxButtonStyleClass.name+" "+((he=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:J.toolboxButtonStyleColorsClass.name),_e.innerHTML=U.icon,_e.title=U.title,_e.addEventListener("click",function(){J.panelButtonClick(U)}),J.panelButtons.push(_e),J.buttonRow.appendChild(_e)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},j.prototype.panelButtonClick=function(l){var p=this,I=-1;if(l!==this.activePanel){I=this.panels.indexOf(l),this.panelRow.innerHTML="";var J=l.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),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=l}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){p.displayMode==="inline"?p.panelRow.style.display="none":p.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(U,he){var _e,tt;U.className=p.toolboxButtonStyleClass.name+" "+(he===I?""+((_e=p.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&_e!==void 0?_e:p.toolboxActiveButtonStyleColorsClass.name):""+((tt=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:p.toolboxButtonStyleColorsClass.name))})},j}(),qe=function(j,l){this.title=j,this.icon=l},Qe=function(j){function l(p,I,J,U){var he=j.call(this,p,U||' ')||this;return he.colors=[],he.addTransparent=!1,he.colorBoxes=[],he.colors=I,he.currentColor=J,he.setCurrentColor=he.setCurrentColor.bind(he),he.getColorBox=he.getColorBox.bind(he),he}return Ee(l,j),l.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.whiteSpace="nowrap",this.colors.forEach(function(J){var U=p.getColorBox(J);I.appendChild(U),p.colorBoxes.push(U)}),I},l.prototype.getColorBox=function(p){var I=this,J=this.uiStyleSettings.toolbarHeight/4,U=this.uiStyleSettings.toolbarHeight-J,he=document.createElement("div");he.style.display="inline-block",he.style.boxSizing="content-box",he.style.width=U-2+"px",he.style.height=U-2+"px",he.style.padding="1px",he.style.marginRight="2px",he.style.marginBottom="2px",he.style.borderWidth="2px",he.style.borderStyle="solid",he.style.borderRadius=(U+2)/2+"px",he.style.borderColor=p===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",he.addEventListener("click",function(){I.setCurrentColor(p,he)});var _e=document.createElement("div");return _e.style.display="inline-block",_e.style.width=U-2+"px",_e.style.height=U-2+"px",_e.style.backgroundColor=p,_e.style.borderRadius=U/2+"px",p==="transparent"&&(_e.style.fill=this.uiStyleSettings.toolboxAccentColor,_e.innerHTML=`
`),he.appendChild(_e),he},l.prototype.setCurrentColor=function(p,I){var J=this;this.currentColor=p,this.colorBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(p)},l}(qe),Ie=function(){function j(l,p,I){this._state="new",this._isSelected=!1,this._container=l,this._overlayContainer=p,this.globalSettings=I,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(j.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),j.prototype.ownsTarget=function(l){return!1},Object.defineProperty(j.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),j.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},j.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},j.prototype.pointerDown=function(l,p){},j.prototype.dblClick=function(l,p){},j.prototype.manipulate=function(l){},j.prototype.pointerUp=function(l){this.stateChanged()},j.prototype.dispose=function(){},j.prototype.addMarkerVisualToContainer=function(l){this.container.childNodes.length>0?this.container.insertBefore(l,this.container.childNodes[0]):this.container.appendChild(l)},j.prototype.getState=function(){return{typeName:j.typeName,state:this.state,notes:this.notes}},j.prototype.restoreState=function(l){this._state=l.state,this.notes=l.notes},j.prototype.scale=function(l,p){},j.prototype.colorChanged=function(l){this.onColorChanged&&this.onColorChanged(l),this.stateChanged()},j.prototype.fillColorChanged=function(l){this.onFillColorChanged&&this.onFillColorChanged(l),this.stateChanged()},j.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var l=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),l.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(l)&&this.onStateChanged(this)}},j.typeName="MarkerBase",j}(),Ne=function(){function j(){this.findGripByVisual=this.findGripByVisual.bind(this)}return j.prototype.findGripByVisual=function(l){return this.topLeft.ownsTarget(l)?this.topLeft:this.topCenter.ownsTarget(l)?this.topCenter:this.topRight.ownsTarget(l)?this.topRight:this.centerLeft.ownsTarget(l)?this.centerLeft:this.centerRight.ownsTarget(l)?this.centerRight:this.bottomLeft.ownsTarget(l)?this.bottomLeft:this.bottomCenter.ownsTarget(l)?this.bottomCenter:this.bottomRight.ownsTarget(l)?this.bottomRight:void 0},j}(),$e=function(){function j(){this.GRIP_SIZE=10,this.visual=se.createGroup(),this.visual.appendChild(se.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(se.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},j}(),et=function(){function j(){}return j.toITransformMatrix=function(l){return{a:l.a,b:l.b,c:l.c,d:l.d,e:l.e,f:l.f}},j.toSVGMatrix=function(l,p){return l.a=p.a,l.b=p.b,l.c=p.c,l.d=p.d,l.e=p.e,l.f=p.f,l},j}(),Xe=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.left=0,U.top=0,U.width=0,U.height=0,U.defaultSize={x:50,y:20},U.offsetX=0,U.offsetY=0,U.rotationAngle=0,U.CB_DISTANCE=10,U._suppressMarkerCreateEvent=!1,U.container.transform.baseVal.appendItem(se.createTransform()),U.setupControlBox(),U}return Ee(l,j),Object.defineProperty(l.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"visual",{get:function(){return this._visual},set:function(p){this._visual=p;var I=se.createTransform();this._visual.transform.baseVal.appendItem(I)},enumerable:!1,configurable:!0}),l.prototype.ownsTarget=function(p){return!!j.prototype.ownsTarget.call(this,p)||!!(this.controlGrips.findGripByVisual(p)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(p))},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.left=p.x,this.top=p.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(p);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(I),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(I)){this.activeGrip=this.rotatorGrip;var U=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=U.x-this.width/2,this.top=U.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var he=this.container.transform.baseVal.getItem(0);he.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(he,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},l.prototype.pointerUp=function(p){var I=this.state;j.prototype.pointerUp.call(this,p),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(p),this._state="select",I==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},l.prototype.moveVisual=function(p){this.visual.style.transform="translate("+p.x+"px, "+p.y+"px)"},l.prototype.manipulate=function(p){var I=this.unrotatePoint(p);this.state==="creating"?this.resize(p):this.state==="move"?(this.left=this.manipulationStartLeft+(I.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(I.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(I):this.state==="rotate"&&this.rotate(p)},l.prototype.resize=function(p){var I=this.manipulationStartLeft,J=this.manipulationStartWidth,U=this.manipulationStartTop,he=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:I=this.manipulationStartLeft+p.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-I;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+p.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:U=this.manipulationStartTop+p.y-this.manipulationStartY,he=this.manipulationStartHeight+this.manipulationStartTop-U;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:he=this.manipulationStartHeight+p.y-this.manipulationStartY}J>=0?(this.left=I,this.width=J):(this.left=I+J,this.width=-J),he>=0?(this.top=U,this.height=he):(this.top=U+he,this.height=-he),this.setSize()},l.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},l.prototype.rotate=function(p){if(Math.abs(p.x-this.centerX)>.1){var I=Math.sign(p.x-this.centerX);this.rotationAngle=180*Math.atan((p.y-this.centerY)/(p.x-this.centerX))/Math.PI+90*I,this.applyRotation()}},l.prototype.applyRotation=function(){var p=this.container.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(p,0)},l.prototype.rotatePoint=function(p){if(this.rotationAngle===0)return p;var I=this.container.getCTM(),J=se.createPoint(p.x,p.y);return{x:(J=J.matrixTransform(I)).x,y:J.y}},l.prototype.unrotatePoint=function(p){if(this.rotationAngle===0)return p;var I=this.container.getCTM();I=I.inverse();var J=se.createPoint(p.x,p.y);return{x:(J=J.matrixTransform(I)).x,y:J.y}},l.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=se.createGroup();var p=se.createTransform();p.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(p),this.container.appendChild(this.controlBox),this.controlRect=se.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=se.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 Ne,this.addControlGrips(),this.controlBox.style.display="none"},l.prototype.adjustControlBox=function(){var p=this.controlBox.transform.baseVal.getItem(0);p.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(p,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()},l.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()},l.prototype.createGrip=function(){var p=new $e;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},l.prototype.positionGrips=function(){var p=this.controlGrips.topLeft.GRIP_SIZE,I=-p/2,J=I,U=(this.width+this.CB_DISTANCE)/2-p/2,he=(this.height+this.CB_DISTANCE)/2-p/2,_e=this.height+this.CB_DISTANCE-p/2,tt=this.width+this.CB_DISTANCE-p/2;this.positionGrip(this.controlGrips.topLeft.visual,I,J),this.positionGrip(this.controlGrips.topCenter.visual,U,J),this.positionGrip(this.controlGrips.topRight.visual,tt,J),this.positionGrip(this.controlGrips.centerLeft.visual,I,he),this.positionGrip(this.controlGrips.centerRight.visual,tt,he),this.positionGrip(this.controlGrips.bottomLeft.visual,I,_e),this.positionGrip(this.controlGrips.bottomCenter.visual,U,_e),this.positionGrip(this.controlGrips.bottomRight.visual,tt,_e),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,U,J-3*this.CB_DISTANCE)},l.prototype.positionGrip=function(p,I,J){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,J),p.transform.baseVal.replaceItem(U,0)},l.prototype.hideControlBox=function(){this.controlBox.style.display="none"},l.prototype.showControlBox=function(){this.controlBox.style.display=""},l.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:et.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:et.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},j.prototype.getState.call(this))},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.left=I.left,this.top=I.top,this.width=I.width,this.height=I.height,this.rotationAngle=I.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(et.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,I.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(et.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,I.containerTransformMatrix))},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I);var J=this.rotatePoint({x:this.left,y:this.top}),U=this.unrotatePoint({x:J.x*p,y:J.y*I});this.left=U.x,this.top=U.y,this.width=this.width*p,this.height=this.height*I,this.adjustControlBox()},l}(Ie),Ke=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.createVisual=U.createVisual.bind(U),U}return Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual)},l.prototype.createVisual=function(){this.visual=se.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},l.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){j.prototype.resize.call(this,p),this.setSize()},l.prototype.setSize=function(){j.prototype.setSize.call(this),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(p){j.prototype.pointerUp.call(this,p),this.setSize()},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},l.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},l.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this))},l.prototype.restoreState=function(p){var I=p;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize()},l.title="Rectangle marker",l}(Xe),ct=function(j){function l(p,I,J,U){var he=j.call(this,p,U||' ')||this;return he.widths=[],he.widthBoxes=[],he.widths=I,he.currentWidth=J,he.setCurrentWidth=he.setCurrentWidth.bind(he),he}return Ee(l,j),l.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.widths.forEach(function(J){var U=document.createElement("div");U.style.display="flex",U.style.flexGrow="2",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=J===p.currentWidth?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentWidth(J,U)}),I.appendChild(U);var he=document.createElement("div");he.innerText=J.toString(),he.style.marginRight="5px",U.appendChild(he);var _e=document.createElement("div");_e.style.minHeight="20px",_e.style.flexGrow="2",_e.style.display="flex",_e.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=J+"px solid "+p.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",_e.appendChild(tt),U.appendChild(_e),p.widthBoxes.push(U)}),I},l.prototype.setCurrentWidth=function(p,I){var J=this;this.currentWidth=p,this.widthBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},l}(qe),rt=function(j){function l(p,I,J,U){var he=j.call(this,p,U||' ')||this;return he.styles=[],he.styleBoxes=[],he.styles=I,he.currentStyle=J,he.setCurrentStyle=he.setCurrentStyle.bind(he),he}return Ee(l,j),l.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",this.styles.forEach(function(J){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/p.styles.length-5+"%",U.style.borderColor=J===p.currentStyle?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentStyle(J,U)}),I.appendChild(U);var he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.overflow="hidden";var _e=`
`;he.innerHTML=_e,U.appendChild(he),p.styleBoxes.push(U)}),I},l.prototype.setCurrentStyle=function(p,I){var J=this;this.currentStyle=p,this.styleBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},l}(qe),at=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ee(l,j),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="FrameMarker",l.title="Frame marker",l.icon=' ',l}(Ke),Ae=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},dt=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.x1=0,U.y1=0,U.x2=0,U.y2=0,U.defaultLength=50,U.manipulationStartX=0,U.manipulationStartY=0,U.manipulationStartX1=0,U.manipulationStartY1=0,U.manipulationStartX2=0,U.manipulationStartY2=0,U.setupControlBox(),U}return Ee(l,j),l.prototype.ownsTarget=function(p){return!!j.prototype.ownsTarget.call(this,p)||!(!this.grip1.ownsTarget(p)&&!this.grip2.ownsTarget(p))},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.state==="new"&&(this.x1=p.x,this.y1=p.y,this.x2=p.x,this.y2=p.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(I)?this.activeGrip=this.grip1:this.grip2.ownsTarget(I)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},l.prototype.pointerUp=function(p){var I=this.state;j.prototype.pointerUp.call(this,p),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(p),this._state="select",I==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},l.prototype.adjustVisual=function(){},l.prototype.manipulate=function(p){this.state==="creating"?this.resize(p):this.state==="move"?(this.x1=this.manipulationStartX1+p.x-this.manipulationStartX,this.y1=this.manipulationStartY1+p.y-this.manipulationStartY,this.x2=this.manipulationStartX2+p.x-this.manipulationStartX,this.y2=this.manipulationStartY2+p.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(p)},l.prototype.resize=function(p){switch(this.activeGrip){case this.grip1:this.x1=p.x,this.y1=p.y;break;case this.grip2:case void 0:this.x2=p.x,this.y2=p.y}this.adjustVisual(),this.adjustControlBox()},l.prototype.select=function(){j.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},l.prototype.deselect=function(){j.prototype.deselect.call(this),this.controlBox.style.display="none"},l.prototype.setupControlBox=function(){this.controlBox=se.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},l.prototype.adjustControlBox=function(){this.positionGrips()},l.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},l.prototype.createGrip=function(){var p=new $e;return p.visual.transform.baseVal.appendItem(se.createTransform()),this.controlBox.appendChild(p.visual),p},l.prototype.positionGrips=function(){var p=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-p/2,this.y1-p/2),this.positionGrip(this.grip2.visual,this.x2-p/2,this.y2-p/2)},l.prototype.positionGrip=function(p,I,J){var U=p.transform.baseVal.getItem(0);U.setTranslate(I,J),p.transform.baseVal.replaceItem(U,0)},l.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},j.prototype.getState.call(this))},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.x1=I.x1,this.y1=I.y1,this.x2=I.x2,this.y2=I.y2},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.x1=this.x1*p,this.y1=this.y1*I,this.x2=this.x2*p,this.y2=this.y2*I,this.adjustVisual(),this.adjustControlBox()},l}(Ie),ot=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorLine&&p!==this.visibleLine)},l.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorLine=se.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=se.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},l.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()),se.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.createVisual(),this.adjustVisual()},l.typeName="LineMarker",l.title="Line marker",l.icon=' ',l}(dt),we=function(j){function l(p,I,J,U){var he=j.call(this,p,U||' ')||this;return he.fonts=[],he.fontBoxes=[],he.fonts=I,he.currentFont=J,he.setCurrentFont=he.setCurrentFont.bind(he),he}return Ee(l,j),l.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.overflow="hidden",I.style.flexGrow="2",this.fonts.forEach(function(J){var U=document.createElement("div");U.style.display="inline-block",U.style.alignItems="center",U.style.justifyContent="space-between",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.overflow="hidden",U.style.maxWidth=100/p.fonts.length-5+"%",U.style.borderColor=J===p.currentFont?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentFont(J,U)}),I.appendChild(U);var he=document.createElement("div");he.style.display="flex",he.style.minHeight="20px",he.style.flexGrow="2",he.style.fontFamily=J,he.style.overflow="hidden";var _e=document.createElement("div");_e.style.whiteSpace="nowrap",_e.style.overflow="hidden",_e.style.textOverflow="ellipsis",_e.innerHTML="The quick brown fox jumps over the lazy dog",he.appendChild(_e),U.appendChild(he),p.fontBoxes.push(U)}),I},l.prototype.setCurrentFont=function(p,I){var J=this;this.currentFont=p,this.fontBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},l}(qe),Fe=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.color="transparent",U.padding=5,U.DEFAULT_TEXT="your text here",U.text=U.DEFAULT_TEXT,U.isMoved=!1,U.color=J.defaultColor,U.fontFamily=J.defaultFontFamily,U.defaultSize={x:100,y:30},U.setColor=U.setColor.bind(U),U.setFont=U.setFont.bind(U),U.renderText=U.renderText.bind(U),U.sizeText=U.sizeText.bind(U),U.textEditDivClicked=U.textEditDivClicked.bind(U),U.showTextEditor=U.showTextEditor.bind(U),U.setSize=U.setSize.bind(U),U.positionTextEditor=U.positionTextEditor.bind(U),U.colorPanel=new Qe("Color",J.defaultColorSet,J.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.fontFamilyPanel=new we("Font",J.defaultFontFamilies,J.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U}return Ee(l,j),l.prototype.ownsTarget=function(p){if(j.prototype.ownsTarget.call(this,p)||p===this.visual||p===this.textElement||p===this.bgRectangle)return!0;var I=!1;return this.textElement.childNodes.forEach(function(J){J===p&&(I=!0)}),I},l.prototype.createVisual=function(){this.visual=se.createGroup(),this.bgRectangle=se.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=se.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.textElement.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.isMoved=!1,this.pointerDownPoint=p,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},l.prototype.renderText=function(){var p=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(I){p.textElement.appendChild(se.createTSpan(I.trim()===""?" ":I.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},l.prototype.getTextScale=function(){var p=this.textElement.getBBox(),I=1;if(p.width>0&&p.height>0){var J=(1*this.width-this.width*this.padding*2/100)/p.width,U=(1*this.height-this.height*this.padding*2/100)/p.height;I=Math.min(J,U)}return I},l.prototype.getTextPosition=function(p){var I=this.textElement.getBBox(),J=0,U=0;return I.width>0&&I.height>0&&(J=(this.width-I.width*p)/2,U=this.height/2-I.height*p/2),{x:J,y:U}},l.prototype.sizeText=function(){var p=this.textElement.getBBox(),I=this.getTextScale(),J=this.getTextPosition(I);J.y-=p.y*I,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+I+", "+I+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(I,I))},l.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(p.x-this.pointerDownPoint.x)>5||Math.abs(p.y-this.pointerDownPoint.y)>5)},l.prototype.resize=function(p){j.prototype.resize.call(this,p),this.isMoved=!0,this.setSize(),this.sizeText()},l.prototype.setSize=function(){j.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},l.prototype.pointerUp=function(p){var I=this.state;I==="creating"&&(this._suppressMarkerCreateEvent=!0),j.prototype.pointerUp.call(this,p),this.setSize(),(I==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},l.prototype.showTextEditor=function(){var p=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(I){I.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var I=Number.parseFloat(p.textEditor.style.fontSize);p.textEditor.clientWidth>=Number.parseInt(p.textEditor.style.maxWidth)&&I>.9;)I-=.1,p.textEditor.style.fontSize=Math.max(I,.9)+"em"}),this.textEditor.addEventListener("keyup",function(I){I.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(I){if(I.clipboardData){var J=I.clipboardData.getData("text"),U=window.getSelection();if(!U.rangeCount)return!1;U.deleteFromDocument(),U.getRangeAt(0).insertNode(document.createTextNode(J)),I.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){p.textEditDivClicked(p.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},l.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var p=this.getTextScale(),I=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),U={x:J.width*p,y:J.height*p};I.x-=U.x/2,I.y-=U.y/2,this.textEditor.style.top=I.y+"px",this.textEditor.style.left=I.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-I.x+"px",this.textEditor.style.fontSize=Math.max(16*p,12)+"px",this.textElement.style.display="none"}},l.prototype.textEditDivClicked=function(p){this.text=p.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},l.prototype.select=function(){j.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},l.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),j.prototype.deselect.call(this)},l.prototype.dblClick=function(p,I){j.prototype.dblClick.call(this,p,I),this.showTextEditor()},l.prototype.setColor=function(p){this.textElement&&se.setAttributes(this.textElement,[["fill",p]]),this.color=p,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(p)},l.prototype.setFont=function(p){this.textElement&&se.setAttributes(this.textElement,[["font-family",p]]),this.fontFamily=p,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},l.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},l.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){var I=p;this.color=I.color,this.fontFamily=I.fontFamily,this.padding=I.padding,this.text=I.text,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize(),this.sizeText(),this.positionTextEditor()},l.typeName="TextMarker",l.title="Text marker",l.icon=' ',l}(Xe),ge=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.color="transparent",U.lineWidth=3,U.drawing=!1,U.pixelRatio=1,U.color=J.defaultColor,U.lineWidth=J.defaultStrokeWidth,U.pixelRatio=J.freehandPixelRatio,U.setColor=U.setColor.bind(U),U.addCanvas=U.addCanvas.bind(U),U.finishCreation=U.finishCreation.bind(U),U.setLineWidth=U.setLineWidth.bind(U),U.colorPanel=new Qe("Color",J.defaultColorSet,J.defaultColor),U.colorPanel.onColorChanged=U.setColor,U.lineWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.lineWidthPanel.onWidthChanged=U.setLineWidth,U}return Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.drawingImage)},l.prototype.createVisual=function(){this.visual=se.createGroup(),this.drawingImage=se.createImage(),this.visual.appendChild(this.drawingImage);var p=se.createTransform();this.visual.transform.baseVal.appendItem(p),this.addMarkerVisualToContainer(this.visual)},l.prototype.pointerDown=function(p,I){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(p.x,p.y),this.drawing=!0):j.prototype.pointerDown.call(this,p,I)},l.prototype.manipulate=function(p){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(p.x,p.y),this.canvasContext.stroke()):j.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){j.prototype.resize.call(this,p),se.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},l.prototype.pointerUp=function(p){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):j.prototype.pointerUp.call(this,p)},l.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)},l.prototype.select=function(){this.state==="creating"&&this.finishCreation(),j.prototype.select.call(this)},l.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),j.prototype.deselect.call(this)},l.prototype.finishCreation=function(){for(var p=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),I=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=I[0],U=I[1],he=I[2],_e=I[3],tt=!1,gt=0;gt0&&(tt=!0,gt_e&&(_e=gt),je>he&&(he=je));if(tt){this.left=J/this.pixelRatio,this.top=U/this.pixelRatio,this.width=(he-J)/this.pixelRatio,this.height=(_e-U)/this.pixelRatio;var Ct=document.createElement("canvas");Ct.width=he-J,Ct.height=_e-U,Ct.getContext("2d").putImageData(this.canvasContext.getImageData(J,U,he-J,_e-U),0,0),this.drawingImgUrl=Ct.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},l.prototype.setDrawingImage=function(){se.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),se.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},l.prototype.setColor=function(p){this.color=p,this.colorChanged(p)},l.prototype.setLineWidth=function(p){this.lineWidth=p},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({drawingImgUrl:this.drawingImgUrl},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){this.createVisual(),j.prototype.restoreState.call(this,p),this.drawingImgUrl=p.drawingImgUrl,this.setDrawingImage()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setDrawingImage()},l.typeName="FreehandMarker",l.title="Freehand marker",l.icon=' ',l}(Xe),de=function(j){function l(p,I,J){var U=j.call(this,p,J||' ')||this;return U.typeBoxes=[],U.currentType=I,U.setCurrentType=U.setCurrentType.bind(U),U}return Ee(l,j),l.prototype.getUi=function(){var p=this,I=document.createElement("div");I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2";for(var J=function(_e){var tt="both";switch(_e){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var gt=document.createElement("div");if(gt.style.display="flex",gt.style.flexGrow="2",gt.style.alignItems="center",gt.style.justifyContent="space-between",gt.style.padding="5px",gt.style.borderWidth="2px",gt.style.borderStyle="solid",gt.style.borderColor=tt===U.currentType?U.uiStyleSettings.toolboxAccentColor:"transparent",gt.addEventListener("click",function(){p.setCurrentType(tt,gt)}),I.appendChild(gt),tt==="both"||tt==="start"){var je=document.createElement("div");je.style.display="flex",je.style.alignItems="center",je.style.minHeight="20px",je.innerHTML=`
`,je.style.marginLeft="5px",gt.appendChild(je)}var Ct=document.createElement("div");Ct.style.display="flex",Ct.style.alignItems="center",Ct.style.minHeight="20px",Ct.style.flexGrow="2";var Gt=document.createElement("hr");if(Gt.style.minWidth="20px",Gt.style.border="0px",Gt.style.borderTop="3px solid "+(U.uiStyleSettings!==void 0?U.uiStyleSettings.toolboxColor:"#eeeeee"),Gt.style.flexGrow="2",Ct.appendChild(Gt),gt.appendChild(Ct),tt==="both"||tt==="end"){var er=document.createElement("div");er.style.display="flex",er.style.alignItems="center",er.style.minHeight="20px",er.innerHTML=`
`,er.style.marginRight="5px",gt.appendChild(er)}U.typeBoxes.push(gt)},U=this,he=0;he<4;he++)J(he);return I},l.prototype.setCurrentType=function(p,I){var J=this;this.currentType=p,this.typeBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},l}(qe),fe=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.arrowType="end",U.arrowBaseHeight=10,U.arrowBaseWidth=10,U.getArrowPoints=U.getArrowPoints.bind(U),U.setArrowType=U.setArrowType.bind(U),U.arrowTypePanel=new de("Arrow type","end"),U.arrowTypePanel.onArrowTypeChanged=U.setArrowType,U}return Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.arrow1&&p!==this.arrow2)},l.prototype.getArrowPoints=function(p,I){var J=this.arrowBaseWidth+2*this.strokeWidth,U=this.arrowBaseHeight+2*this.strokeWidth;return p-J/2+","+(I+U/2)+" "+p+","+(I-U/2)+" "+(p+J/2)+","+(I+U/2)},l.prototype.createTips=function(){this.arrow1=se.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=se.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(se.createTransform()),this.visual.appendChild(this.arrow2)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(j.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",se.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),se.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.arrow1.transform.baseVal.getItem(0);I.setRotate(p,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(I,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(p+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},l.prototype.setArrowType=function(p){this.arrowType=p,this.adjustVisual(),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({arrowType:this.arrowType},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.arrowType=I.arrowType,this.createTips(),this.adjustVisual()},l.typeName="ArrowMarker",l.title="Arrow marker",l.icon=' ',l}(ot),te=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.fillColor=J.defaultFillColor,U.strokeWidth=0,U.fillPanel=new Qe("Color",J.defaultColorSet,J.defaultFillColor),U.fillPanel.onColorChanged=U.setFillColor,U}return Ee(l,j),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="CoverMarker",l.title="Cover marker",l.icon=' ',l}(Ke),re=function(j){function l(p,I,J,U){var he=j.call(this,p,U||' ')||this;return he.opacities=[],he.opacityBoxes=[],he.opacities=I,he.currentOpacity=J,he.setCurrentOpacity=he.setCurrentOpacity.bind(he),he}return Ee(l,j),l.prototype.getUi=function(){var p=this,I=document.createElement("div");return I.style.display="flex",I.style.overflow="hidden",I.style.flexGrow="2",I.style.justifyContent="space-between",this.opacities.forEach(function(J){var U=document.createElement("div");U.style.display="flex",U.style.alignItems="center",U.style.justifyContent="center",U.style.padding="5px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderColor=J===p.currentOpacity?p.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){p.setCurrentOpacity(J,U)}),I.appendChild(U);var he=document.createElement("div");he.innerText=100*J+"%",U.appendChild(he),p.opacityBoxes.push(U)}),I},l.prototype.setCurrentOpacity=function(p,I){var J=this;this.currentOpacity=p,this.opacityBoxes.forEach(function(U){U.style.borderColor=U===I?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},l}(qe),ne=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.setOpacity=U.setOpacity.bind(U),U.fillColor=J.defaultHighlightColor,U.strokeWidth=0,U.opacity=J.defaultHighlightOpacity,U.fillPanel=new Qe("Color",J.defaultColorSet,U.fillColor),U.fillPanel.onColorChanged=U.setFillColor,U.opacityPanel=new re("Opacity",J.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Ee(l,j),l.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="HighlightMarker",l.title="Highlight marker",l.icon=' ',l}(te),le=' ',pe=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.bgColor="transparent",U.tipPosition={x:0,y:0},U.tipBase1Position={x:0,y:0},U.tipBase2Position={x:0,y:0},U.tipMoving=!1,U.color=J.defaultStrokeColor,U.bgColor=J.defaultFillColor,U.fontFamily=J.defaultFontFamily,U.defaultSize={x:100,y:30},U.setBgColor=U.setBgColor.bind(U),U.getTipPoints=U.getTipPoints.bind(U),U.positionTip=U.positionTip.bind(U),U.setTipPoints=U.setTipPoints.bind(U),U.colorPanel=new Qe("Text color",J.defaultColorSet,U.color,' '),U.colorPanel.onColorChanged=U.setColor,U.bgColorPanel=new Qe("Fill color",J.defaultColorSet,U.bgColor,le),U.bgColorPanel.onColorChanged=U.setBgColor,U.fontFamilyPanel=new we("Font",J.defaultFontFamilies,J.defaultFontFamily),U.fontFamilyPanel.onFontChanged=U.setFont,U.tipGrip=new $e,U.tipGrip.visual.transform.baseVal.appendItem(se.createTransform()),U.controlBox.appendChild(U.tipGrip.visual),U}return Ee(l,j),l.prototype.ownsTarget=function(p){return j.prototype.ownsTarget.call(this,p)||this.tipGrip.ownsTarget(p)||this.tip===p},l.prototype.createTip=function(){se.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=se.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},l.prototype.pointerDown=function(p,I){this.state==="new"&&j.prototype.pointerDown.call(this,p,I),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(I)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):j.prototype.pointerDown.call(this,p,I)},l.prototype.pointerUp=function(p){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,j.prototype.pointerUp.call(this,p);else{var I=this.state==="creating";j.prototype.pointerUp.call(this,p),this.setTipPoints(I),this.positionTip()}},l.prototype.manipulate=function(p){if(this.tipMoving){var I=this.unrotatePoint(p);this.tipPosition={x:I.x-this.manipulationStartLeft,y:I.y-this.manipulationStartTop},this.positionTip()}else j.prototype.manipulate.call(this,p)},l.prototype.setBgColor=function(p){this.bgRectangle&&this.tip&&(se.setAttributes(this.bgRectangle,[["fill",p]]),se.setAttributes(this.tip,[["fill",p]])),this.bgColor=p,this.fillColorChanged(p)},l.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},l.prototype.setTipPoints=function(p){p===void 0&&(p=!1);var I=Math.min(this.height/2,15),J=this.height/5;p&&(this.tipPosition={x:I+J/2,y:this.height+20});var U=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?U ',l}(Fe),Ce=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.fillColor="transparent",U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.opacity=1,U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.fillColor=J.defaultFillColor,U.setStrokeColor=U.setStrokeColor.bind(U),U.setFillColor=U.setFillColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.setOpacity=U.setOpacity.bind(U),U.createVisual=U.createVisual.bind(U),U.strokePanel=new Qe("Line color",me(J.defaultColorSet,["transparent"]),J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.fillPanel=new Qe("Fill color",me(J.defaultColorSet,["transparent"]),U.fillColor,le),U.fillPanel.onColorChanged=U.setFillColor,U.strokeWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U.opacityPanel=new re("Opacity",J.defaultOpacitySteps,U.opacity),U.opacityPanel.onOpacityChanged=U.setOpacity,U}return Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual)},l.prototype.createVisual=function(){this.visual=se.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="new"&&(this.createVisual(),this.moveVisual(p),this._state="creating")},l.prototype.manipulate=function(p){j.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){j.prototype.resize.call(this,p),this.setSize()},l.prototype.setSize=function(){j.prototype.setSize.call(this),se.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},l.prototype.pointerUp=function(p){j.prototype.pointerUp.call(this,p),this.setSize()},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.visual&&se.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(p),this.stateChanged()},l.prototype.setFillColor=function(p){this.fillColor=p,this.visual&&se.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(p),this.stateChanged()},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.visual&&se.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.visual&&se.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},l.prototype.setOpacity=function(p){this.opacity=p,this.visual&&se.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){var I=p;this.fillColor=I.fillColor,this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.opacity=I.opacity,this.createVisual(),j.prototype.restoreState.call(this,p),this.setSize()},l.prototype.scale=function(p,I){j.prototype.scale.call(this,p,I),this.setSize()},l.typeName="EllipseMarker",l.title="Ellipse marker",l.icon=' ',l}(Xe),Oe=function(j){function l(p,I,J){return j.call(this,p,I,J)||this}return Ee(l,j),Object.defineProperty(l.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.tip1&&p!==this.tip2)},l.prototype.createTips=function(){this.tip1=se.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(se.createTransform()),this.visual.appendChild(this.tip1),this.tip2=se.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(se.createTransform()),this.visual.appendChild(this.tip2)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.state==="creating"&&this.createTips()},l.prototype.adjustVisual=function(){if(j.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(se.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()]]),se.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 p=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),I=this.tip1.transform.baseVal.getItem(0);I.setRotate(p,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(I,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(p+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p),this.createTips(),this.adjustVisual()},l.typeName="MeasurementMarker",l.title="Measurement marker",l.icon=' ',l}(ot),st=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.strokePanel.colors=J.defaultColorSet,U.fillColor="transparent",U}return Ee(l,j),Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=j.prototype.getState.call(this);return p.typeName=l.typeName,p},l.typeName="EllipseFrameMarker",l.title="Ellipse frame marker",l.icon=' ',l}(Ce),mt=function(){function j(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),j.prototype.addUndoStep=function(l){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(l)||(this.undoStack.push(l),JSON.stringify(this.lastRedoStep)!==JSON.stringify(l)&&this.redoStack.splice(0,this.redoStack.length))},j.prototype.replaceLastUndoStep=function(l){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=l)},j.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},j.prototype.undo=function(){if(this.undoStack.length>1){var l=this.undoStack.pop();return l!==void 0&&this.redoStack.push(l),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},j.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},j}(),ht=function(j){function l(p,I,J){var U=j.call(this,p,I,J)||this;return U.strokeColor="transparent",U.strokeWidth=0,U.strokeDasharray="",U.curveX=0,U.curveY=0,U.manipulationStartCurveX=0,U.manipulationStartCurveY=0,U.setStrokeColor=U.setStrokeColor.bind(U),U.setStrokeWidth=U.setStrokeWidth.bind(U),U.setStrokeDasharray=U.setStrokeDasharray.bind(U),U.positionGrips=U.positionGrips.bind(U),U.addControlGrips=U.addControlGrips.bind(U),U.adjustVisual=U.adjustVisual.bind(U),U.setupControlBox=U.setupControlBox.bind(U),U.resize=U.resize.bind(U),U.strokeColor=J.defaultColor,U.strokeWidth=J.defaultStrokeWidth,U.strokeDasharray=J.defaultStrokeDasharray,U.strokePanel=new Qe("Line color",J.defaultColorSet,J.defaultColor),U.strokePanel.onColorChanged=U.setStrokeColor,U.strokeWidthPanel=new ct("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),U.strokeWidthPanel.onWidthChanged=U.setStrokeWidth,U.strokeStylePanel=new rt("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),U.strokeStylePanel.onStyleChanged=U.setStrokeDasharray,U}return Ee(l,j),l.prototype.ownsTarget=function(p){return!(!j.prototype.ownsTarget.call(this,p)&&p!==this.visual&&p!==this.selectorCurve&&p!==this.visibleCurve&&!this.curveGrip.ownsTarget(p))},l.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},l.prototype.createVisual=function(){this.visual=se.createGroup(),this.selectorCurve=se.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=se.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)},l.prototype.pointerDown=function(p,I){j.prototype.pointerDown.call(this,p,I),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=p.x,this.curveY=p.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(I)&&(this.activeGrip=this.curveGrip,this._state="resize")},l.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),se.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),se.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),se.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},l.prototype.setupControlBox=function(){j.prototype.setupControlBox.call(this),this.curveControlLine1=se.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=se.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)},l.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,j.prototype.addControlGrips.call(this)},l.prototype.positionGrips=function(){j.prototype.positionGrips.call(this);var p=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-p/2,this.curveY-p/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()))},l.prototype.manipulate=function(p){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+p.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+p.y-this.manipulationStartY),j.prototype.manipulate.call(this,p)},l.prototype.resize=function(p){this.activeGrip===this.curveGrip&&(this.curveX=p.x,this.curveY=p.y),j.prototype.resize.call(this,p),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},l.prototype.setStrokeColor=function(p){this.strokeColor=p,this.adjustVisual(),this.colorChanged(p)},l.prototype.setStrokeWidth=function(p){this.strokeWidth=p,this.adjustVisual()},l.prototype.setStrokeDasharray=function(p){this.strokeDasharray=p,this.adjustVisual()},l.prototype.scale=function(p,I){this.curveX=this.curveX*p,this.curveY=this.curveY*I,j.prototype.scale.call(this,p,I)},Object.defineProperty(l.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),l.prototype.getState=function(){var p=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},j.prototype.getState.call(this));return p.typeName=l.typeName,p},l.prototype.restoreState=function(p){j.prototype.restoreState.call(this,p);var I=p;this.strokeColor=I.strokeColor,this.strokeWidth=I.strokeWidth,this.strokeDasharray=I.strokeDasharray,this.curveX=I.curveX,this.curveY=I.curveY,this.createVisual(),this.adjustVisual()},l.typeName="CurveMarker",l.title="Curve marker",l.icon=' ',l}(dt),Rt=function(){function j(l,p){p===void 0&&(p=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=l,this.cancelable=p}return Object.defineProperty(j.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),j.prototype.preventDefault=function(){this._defaultPrevented=!0},j}(),At=function(j){function l(p,I,J){var U=j.call(this,p,!1)||this;return U.dataUrl=I,U.state=J,U}return Ee(l,j),l}(Rt),ft=function(j){function l(p,I,J){J===void 0&&(J=!1);var U=j.call(this,p,J)||this;return U.marker=I,U}return Ee(l,j),l}(Rt),Ft=function(){function j(){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 j.prototype.addEventListener=function(l,p){this[l].push(p)},j.prototype.removeEventListener=function(l,p){var I=this[l].indexOf(p);I>-1&&this[l].splice(I,1)},j}(),kt=function(){function j(l){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ae,this._isOpen=!1,this.undoRedoManager=new mt,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 Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=j.instanceCounter++,this.styles=new Je(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=l,this.targetRoot=document.body,this.width=l.clientWidth,this.height=l.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(j.prototype,"ALL_MARKER_TYPES",{get:function(){return[at,ge,fe,Fe,st,Ce,ne,pe,Oe,te,ot,ht]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[at,ge,fe,Fe,Ce,ne,pe]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"BASIC_MARKER_TYPES",{get:function(){return[at,ge,fe,Fe,ne]},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(l){var p=this;this._availableMarkerTypes.splice(0),l.forEach(function(I){if(typeof I=="string"){var J=p.ALL_MARKER_TYPES.find(function(U){return U.typeName===I});J!==void 0&&p._availableMarkerTypes.push(J)}else p._availableMarkerTypes.push(I)})},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(l){this._zoomLevel=l,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(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),j.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Re.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},j.prototype.show=function(){var l=this;this.styles.styleSheetRoot===void 0&&We.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=We.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(p){return p(new Rt(l))})},j.prototype.render=function(){return Te(this,void 0,void 0,function(){var l;return Se(this,function(p){switch(p.label){case 0:return this.setCurrentMarker(),(l=new Ve).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.markersOnly=this.renderMarkersOnly,l.width=this.renderWidth,l.height=this.renderHeight,[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return p.sent(),[4,l.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,p.sent()]}})})},j.prototype.close=function(l){var p=this;if(l===void 0&&(l=!1),this.isOpen){var I=!1;l||this.eventListeners.beforeclose.forEach(function(J){var U=new Rt(p,!0);J(U),U.defaultPrevented&&(I=!0)}),I||(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(J){return J(new Rt(p))}),this.detachEvents(),this._isOpen=!1)}},j.prototype.addMarkersToToolbar=function(){for(var l,p=[],I=0;Ithis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*l:this.editorCanvas.clientWidth,I=p ',l.title="Powered by marker.js",l.style.display="grid",l.style.alignItems="center",l.style.justifyItems="center",l.style.padding="3px",l.style.width="20px",l.style.height="20px",this.logoUI.appendChild(l),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},j.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")},j.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"},j.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},j.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 l=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=l+"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 Ue(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(l),1),l.dispose()},j.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())},j.prototype.toolbarButtonClicked=function(l,p){if(l==="marker"&&p!==void 0)this.createNewMarker(p);else if(l==="action")switch(p){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()}},j.prototype.deleteSelectedMarker=function(){var l=this;if(this._currentMarker!==void 0){var p=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var U=new ft(l,l._currentMarker,!0);J(U),U.defaultPrevented&&(p=!0)}),!p){var I=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(J){return J(new ft(l,I))})}}},j.prototype.clear=function(){var l=this,p=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(he){var _e=new ft(l,void 0,!0);he(_e),_e.defaultPrevented&&(p=!0)}),!p)){this.setCurrentMarker();for(var I=function(he){var _e=J.markers[he];J.setCurrentMarker(J.markers[he]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(tt){return tt(new ft(l,_e))})},J=this,U=this.markers.length-1;U>=0;U--)I(U);this.addUndoStep()}},Object.defineProperty(j.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),j.prototype.showNotesEditor=function(){var l;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=(l=this._currentMarker.notes)!==null&&l!==void 0?l:"",this.overlayContainer.appendChild(this.notesArea))},j.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)},j.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},j.prototype.addUndoStep=function(){var l=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var p=this.getState(),I=this.undoRedoManager.getLastUndoStep();if(!I||I.width===p.width&&I.height===p.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(p),J1&&this.panTo({x:l.clientX,y:l.clientY}))},j.prototype.onPointerUp=function(l){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(l.clientX,l.clientY)),this.isDragging=!1,this.addUndoStep()},j.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},j.prototype.onKeyUp=function(l){this._currentMarker===void 0||this.notesArea!==void 0||l.key!=="Delete"&&l.key!=="Backspace"||this.deleteSelectedMarker()},j.prototype.clientToLocalCoordinates=function(l,p){var I=this.markerImage.getBoundingClientRect();return{x:(l-I.left)/this.zoomLevel,y:(p-I.top)/this.zoomLevel}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var l=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=l+"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()},j.prototype.addLicenseKey=function(l){Re.addKey(l)},j.prototype.addEventListener=function(l,p){this.eventListeners.addEventListener(l,p)},j.prototype.removeEventListener=function(l,p){this.eventListeners.removeEventListener(l,p)},j.prototype.renderState=function(l){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(l),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(j.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),j.prototype.focus=function(){var l=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(p){return p(new Rt(l))}))},j.prototype.blur=function(){var l=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(p){return p(new Rt(l))}))},j.instanceCounter=0,j}();/* **********************************
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 Ht=function(j,l){return(Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,I){p.__proto__=I}||function(p,I){for(var J in I)Object.prototype.hasOwnProperty.call(I,J)&&(p[J]=I[J])})(j,l)};function It(j,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");function p(){this.constructor=j}Ht(j,l),j.prototype=l===null?Object.create(l):(p.prototype=l.prototype,new p)}function xt(j,l,p,I){return new(p||(p=Promise))(function(J,U){function he(gt){try{tt(I.next(gt))}catch(je){U(je)}}function _e(gt){try{tt(I.throw(gt))}catch(je){U(je)}}function tt(gt){var je;gt.done?J(gt.value):(je=gt.value,je instanceof p?je:new p(function(Ct){Ct(je)})).then(he,_e)}tt((I=I.apply(j,l||[])).next())})}function Mt(j,l){var p,I,J,U,he={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return U={next:_e(0),throw:_e(1),return:_e(2)},typeof Symbol=="function"&&(U[Symbol.iterator]=function(){return this}),U;function _e(tt){return function(gt){return function(je){if(p)throw new TypeError("Generator is already executing.");for(;he;)try{if(p=1,I&&(J=2&je[0]?I.return:je[0]?I.throw||((J=I.return)&&J.call(I),0):I.next)&&!(J=J.call(I,je[1])).done)return J;switch(I=0,J&&(je=[2&je[0],J.value]),je[0]){case 0:case 1:J=je;break;case 4:return he.label++,{value:je[1],done:!1};case 5:he.label++,I=je[1],je=[0];continue;case 7:je=he.ops.pop(),he.trys.pop();continue;default:if(!(J=he.trys,(J=J.length>0&&J[J.length-1])||je[0]!==6&&je[0]!==2)){he=0;continue}if(je[0]===3&&(!J||je[1]>J[0]&&je[1]0&&p>0){var I=new Kt(l,p),J=I.ratio>=1?20:I.getHorizontalLength(20),U=I.ratio<1?20:I.getVerticalLength(20),he=document.createElementNS("http://www.w3.org/2000/svg","svg");he.setAttribute("xmlns","http://www.w3.org/2000/svg"),he.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(he);var _e=lt.createDefs();he.appendChild(_e);var tt=lt.createElement("clipPath",[["id","text-bg-clip"]]);_e.appendChild(tt);var gt=lt.createPath(lt.getHollowRectanglePath((24-J)/2,(24-U)/2,J,U,(24-J)/2+2,(24-U)/2+2,J-4,U-4));he.appendChild(gt);var je=lt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);je.appendChild(lt.createTSpan(l+":"+p)),he.appendChild(je);var Ct=je.getBBox();lt.setAttributes(je,[["x",((24-Ct.width)/2).toString()],["y",((24-Ct.height)/2-Ct.y).toString()]]);var Gt=lt.createPath(lt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ct.width))/2,(24-Math.ceil(Ct.height))/2,Math.ceil(Ct.width),Math.ceil(Ct.height)));return tt.appendChild(Gt),lt.setAttributes(gt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(he),he.outerHTML}return' '},j}(),tr=function(j){function l(p,I,J){var U=j.call(this,p,I)||this;return U.isDropdownOpen=!1,U.onClick=U.dropdownButtonClicked,U.dropdownButtons=J,U}return It(l,j),l.prototype.setupDropdown=function(){var p=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(I){I.className=p.className,I.colorsClassName=p.colorsClassName,p.dropdownBlock.appendChild(I.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},l.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},l.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},l.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},l.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},l.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},l}(yt),Ot=function(){function j(l,p){this.GRIP_SIZE=10,this.color=l,this.fillColor=p,this.visual=lt.createGroup(),this.visual.appendChild(lt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(lt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return j.prototype.ownsTarget=function(l){return l===this.visual||l===this.visual.childNodes[0]||l===this.visual.childNodes[1]},j.prototype.setCenter=function(l,p){this.visual.childNodes.forEach(function(I){return lt.setAttributes(I,[["cx",l.toString()],["cy",p.toString()]])})},j}(),ur=function(){function j(l,p,I,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=l,this.canvasHeight=p,this.margin=I,this.container=J,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(j.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(l){this._aspectRatio=l,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.gridContainer&<.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(l){this._zoomFactor=l,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),j.prototype.open=function(){var l=this;this.cropShadeElement=lt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=lt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var p=0;pthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-p.height/2),lt.setAttributes(this.cropRectElement,[["x",p.x.toString()],["y",p.y.toString()],["width",p.width.toString()],["height",p.height.toString()]]);var I=p.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(U,he){var _e=p.y+I*(he+1);lt.setAttributes(U,[["x1",""+p.x],["y1",""+_e],["x2",""+(p.x+p.width)],["y2",""+_e]])});var J=p.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(U,he){var _e=p.x+J*(he+1);lt.setAttributes(U,[["x1",""+_e],["y1",""+p.y],["x2",""+_e],["y2",""+(p.y+p.height)]])}),lt.setAttributes(this.cropShadeElement,[["d",lt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,p.x,p.y,p.width,p.height)]]),this.topLeftGrip.setCenter(p.x,p.y),this.topRightGrip.setCenter(p.x+p.width,p.y),this.bottomLeftGrip.setCenter(p.x,p.y+p.height),this.bottomRightGrip.setCenter(p.x+p.width,p.y+p.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},j.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)},j.prototype.clientToLocalCoordinates=function(l,p){var I=this.container.getBoundingClientRect();return{x:l-I.left+this.margin,y:p-I.top+this.margin}},j.prototype.onPointerDown=function(l){this.container.setPointerCapture(l.pointerId),this.previousPoint=this.clientToLocalCoordinates(l.clientX,l.clientY),this.cropRectElement===l.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(l.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(l.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(l.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(l.target)&&(this.activeGrip=this.bottomRightGrip)},j.prototype.onPointerMove=function(l){if(this.isMoving)this.move(this.clientToLocalCoordinates(l.clientX,l.clientY));else if(this.activeGrip){var p=this.clientToLocalCoordinates(l.clientX,l.clientY);this.resize(p)}l.preventDefault()},j.prototype.onPointerUp=function(l){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(l.pointerId)},j.prototype.move=function(l){var p=l.x-this.previousPoint.x,I=l.y-this.previousPoint.y;this.zoomFactor!==1&&(p=-p/this.zoomFactor,I=-I/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+p),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+I),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=l},j.prototype.resize=function(l){var p=Object.assign({},this.cropRect),I=l.x-this.previousPoint.x,J=l.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:p.x+Ithis.canvasWidth*this.zoomFactor&&(I=this.canvasWidth*this.zoomFactor-p.width),p.width+=I}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(p.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(I),p.height=this.aspectRatio.getVerticalLength(p.width)):(p.y+=J,p.height=this.cropRect.y+this.cropRect.height-p.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?p.height=this.aspectRatio.getVerticalLength(p.width):p.height+=J}p.width<10&&(p.x=this.cropRect.x,p.width=10),p.height<10&&(p.y=this.cropRect.y,p.height=10),this.previousPoint=l,p.x>=this.margin&&p.y>=this.margin&&p.x-this.margin+p.width<=this.canvasWidth&&p.y-this.margin+p.height<=this.canvasHeight&&(this.cropRect=p,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},j.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var l=this.cropRect.x+this.cropRect.width/2,p=this.cropRect.y+this.cropRect.height/2,I=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=this.aspectRatio.getVerticalLength(this.cropRect.width);I/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=l-this.cropRect.width/2,this.cropRect.y=p-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)}},j.prototype.getRescaledRect=function(l,p,I,J,U,he){var _e=I/l,tt=J/p;return{x:(U.x-he)*_e+he,y:(U.y-he)*tt+he,width:U.width*_e,height:U.height*tt}},j.prototype.scaleCanvas=function(l,p){var I=this.getRescaledRect(this.canvasWidth,this.canvasHeight,l,p,this.cropRect,this.margin);this.canvasWidth=l,this.canvasHeight=p,this.onCropChange&&this.onCropChange(I),this.setCropRectangle(I)},j}(),bt=function(){function j(l){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=l,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(j.prototype,"angle",{get:function(){return this._angle},set:function(l){this._angle=l,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),j.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},j.prototype.onPointerDown=function(l){this.controlContainer.setPointerCapture(l.pointerId),this.isDragging=!0,this.previousPoint={x:l.clientX,y:l.clientY}},j.prototype.onPointerMove=function(l){this.isDragging&&(this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.previousPoint.x=l.clientX)},j.prototype.onPointerUp=function(l){this.isDragging&&this.onAngleChange&&this.onAngleChange((l.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(l.pointerId)},j.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var l=this.angleLabelText.getBBox();lt.setAttributes(this.angleLabelElement,[["x",((this.width-l.width)/2).toString()],["y",(this.height/2).toString()]])}},j.prototype.positionScaleShape=function(){if(this.scaleShape){var l=this.scaleShape.transform.baseVal.getItem(0);l.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(l,0)}},j.prototype.getVisual=function(){var l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("xmlns","http://www.w3.org/2000/svg"),l.setAttribute("width",this.width+"px"),l.setAttribute("height",this.height+"px"),l.setAttribute("viewBox","0 0 "+this.width+" "+this.height),l.style.flexShrink="0",document.body.appendChild(l);for(var p="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,I=1;I<=this.width/5+10;I++){var J=I%5==0?this.height/3:this.height/6;p+="h4v"+-J+"h1v"+J}p+="v1H0Z",this.scaleShape=lt.createPath(p);var U=lt.createTransform();this.scaleShape.transform.baseVal.appendItem(U),l.appendChild(this.scaleShape),this.angleLabelElement=lt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=lt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var he=lt.createTSpan("");return he.innerHTML="°",this.angleLabelElement.appendChild(he),l.appendChild(this.angleLabelElement),document.body.removeChild(l),l},j}(),ri=function(){function j(){this.naturalSize=!1,this.imageType="image/png"}return j.prototype.rasterize=function(l,p,I,J,U,he,_e){var tt=this;return new Promise(function(gt){var je=document.createElement("canvas");je.width=l.width.baseVal.value-2*J,je.height=l.height.baseVal.value-2*J;var Ct=1,Gt=1;tt.naturalSize===!0?(Ct=p.naturalWidth/(l.width.baseVal.value-2*J)/he,Gt=p.naturalHeight/(l.height.baseVal.value-2*J)/_e,je.width=p.naturalWidth/he,je.height=p.naturalHeight/_e):tt.width!==void 0&&tt.height!==void 0&&(Ct=tt.width/I.width,Gt=tt.height/I.height,je.width*=Ct,je.height*=Gt);var er=je.getContext("2d");er.translate(je.width/2,je.height/2),er.rotate(U*Math.PI/180),er.scale(he,_e),er.translate(-je.width/2,-je.height/2),er.drawImage(p,0,0,je.width,je.height);var jr=document.createElement("canvas");jr.width=I.width*Ct,jr.height=I.height*Gt,jr.getContext("2d").putImageData(er.getImageData((I.x-J)*Ct,(I.y-J)*Gt,I.width*Ct,I.height*Gt),0,0),gt(jr.toDataURL(tt.imageType,tt.imageQuality))})},j}(),Ge=function(){function j(l){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=j.instanceCounter++,this.styles=new $t(this.instanceNo),this.target=l,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(j.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(l){this._zoomToCropEnabled=l,l?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(l){this._isGridVisible=l,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"gridLines",{get:function(){return this._gridLines},set:function(l){this._gridLines=l,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(l){this._rotationAngle=l,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"aspectRatio",{get:function(){var l;return(l=this._aspectRatio)!==null&&l!==void 0?l:this.aspectRatios[0]},set:function(l){this._aspectRatio=l},enumerable:!1,configurable:!0}),j.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},j.prototype.show=function(){this.showUI(),this.open()},j.prototype.close=function(l){l===void 0&&(l=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),l||this.closeEventListeners.forEach(function(p){return p()}),this._isOpen=!1)},j.prototype.addRenderEventListener=function(l){this.renderEventListeners.push(l)},j.prototype.removeRenderEventListener=function(l){this.renderEventListeners.indexOf(l)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(l),1)},j.prototype.addCloseEventListener=function(l){this.closeEventListeners.push(l)},j.prototype.removeCloseEventListener=function(l){this.closeEventListeners.indexOf(l)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(l),1)},j.prototype.setupResizeObserver=function(){var l=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){l.resize(l.target.clientWidth,l.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))},j.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var l=1*this.target.clientWidth/this.target.clientHeight,p=this.contentDiv.clientWidth/l>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*l:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,I=p+2*this.CANVAS_MARGINl+this.CANVAS_MARGIN?this.target.offsetTop-(l+this.CANVAS_MARGIN):0;this.coverDiv.style.top=p+"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},j.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},j.prototype.addTopToolbar=function(){var l=this;this.topToolbar=new Mr,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 p=new Xt;p.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(p);var I=[];this.aspectRatios.forEach(function(Gt){var er=new yt(wt.getIcon(Gt.horizontal,Gt.vertical),Gt.horizontal===0&&Gt.vertical===0?"FREE":Gt.horizontal+":"+Gt.vertical);er.onClick=function(){return l.ratioButtonClicked(Gt)},I.push(er)}),this.aspectRatioButton=new tr(wt.getIcon(0,0),"Aspect ratio",I),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,p.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new yt(' ',"Toggle grid");J.isActive=this.isGridVisible,J.onClick=function(){l.isGridVisible=!l.isGridVisible,J.isActive=l.isGridVisible},p.addButton(J);var U=new yt(' ',"Zoom to selection");if(U.isActive=this.zoomToCropEnabled,U.onClick=function(){l.zoomToCropEnabled=!l.zoomToCropEnabled,U.isActive=l.zoomToCropEnabled},p.addButton(U),!jt.isLicensed){var he=new ze;this.topToolbar.addElementBlock(he);var _e=document.createElement("div");_e.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var tt=document.createElement("a");tt.style.color="currentColor",tt.href="https://markerjs.com/products/cropro",tt.target="_blank",tt.innerHTML=' ',_e.appendChild(tt),he.addElement(_e)}var gt=new Xt;gt.minWidth=3*this.toolbarHeight+"px",gt.contentAlign="end",this.topToolbar.addButtonBlock(gt);var je=new yt(' ',"OK");je.onClick=this.startRenderAndClose,gt.addButton(je),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(je.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ct=new yt(' ',"Close");Ct.onClick=this.close,gt.addButton(Ct),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ct.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},j.prototype.addBottomToolbar=function(){var l=this;this.bottomToolbar=new Mr,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 p=new Xt;p.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(p);var I=new yt(' ',"Rotate left");I.onClick=this.rotateLeftButtonClicked,p.addButton(I);var J=new yt(' ',"Rotate right");J.onClick=this.rotateRightButtonClicked,p.addButton(J);var U=new ze;U.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(U),this.straightener=new bt("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(gt){l.rotateBy(gt),l.straightener.angle=l.rotationAngle},U.addElement(this.straightener.getUI());var he=new Xt;he.minWidth=2*this.toolbarHeight+"px",he.contentAlign="end",this.bottomToolbar.addButtonBlock(he);var _e=new yt(' ',"Flip horizontal");_e.onClick=this.flipHorizontallyButtonClicked,he.addButton(_e);var tt=new yt(' ',"Flip vertical");tt.onClick=this.flipVerticallyButtonClicked,he.addButton(tt)},j.prototype.ratioButtonClicked=function(l){this.aspectRatio=l,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},j.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=wt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},j.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Kt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},j.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},j.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},j.prototype.restoreState=function(l){if(l){var p=this.cropLayer.getRescaledRect(l.width,l.height,this.imageWidth,this.imageHeight,l.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(p),this.cropRectChanged(p),this.flippedHorizontally=l.flippedHorizontally,this.flippedVertically=l.flippedVertically,this.applyFlip(),this.rotationAngle=l.rotationAngle,this.applyRotation()}},j.prototype.clientToLocalCoordinates=function(l,p){var I=this.cropImage.getBoundingClientRect();return{x:l-I.left,y:p-I.top}},j.prototype.onWindowResize=function(){this.positionUI()},j.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var l=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=l+"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()},j.prototype.rotateLeftButtonClicked=function(){var l=this.rotationAngle-90;this.rotationAngle%90!=0&&(l+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(l)},j.prototype.rotateRightButtonClicked=function(){var l=this.rotationAngle+90;this.rotationAngle%90!=0&&(l-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(l)},j.prototype.rotateTo=function(l){l=(l=l>180?l-360:l)<=-180?l+360:l,this.rotationAngle=l,this.applyRotation()},j.prototype.rotateBy=function(l){this.rotateTo((this.rotationAngle+l)%360)},j.prototype.applyRotation=function(){var l=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var p=this.editingTargetRotationContainer.transform.baseVal.getItem(0);p.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(p,0);var I=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/I.width,this.imageHeight/I.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=l},j.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},j.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},j.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},j.prototype.startRenderAndClose=function(){return xt(this,void 0,void 0,function(){var l,p;return Mt(this,function(I){switch(I.label){case 0:return[4,this.render()];case 1:return l=I.sent(),p=this.getState(),this.renderEventListeners.forEach(function(J){return J(l,p)}),this.close(!0),[2]}})})},j.prototype.render=function(){return xt(this,void 0,void 0,function(){var l;return Mt(this,function(p){switch(p.label){case 0:return(l=new ri).naturalSize=this.renderAtNaturalSize,l.imageType=this.renderImageType,l.imageQuality=this.renderImageQuality,l.width=this.renderWidth,l.height=this.renderHeight,this.unzoomFromCrop(),lt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,l.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 p.sent(),[4,l.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,p.sent()]}})})},j.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ir("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 ir("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ir("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var l=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ir("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*l)+`px;
height: `+(this.toolbarHeight-2*l)+`px;
padding: `+l+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ir("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ir("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new ar("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new ar("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ir("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 ir("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ir("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 ir("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*l)+`px;
padding: `+l+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ir("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},j.instanceCounter=0,j}(),Dt=Z("8hTe"),pi=Z.n(Dt),mi=/]*>/g;function gi(j){var l=document.createElement("div");return l.innerHTML=j,l.childNodes.length===0?"":l.childNodes[0].nodeValue}var vi=Le.a=function(j){var l=j.value,p=l===void 0?"":l,I=j.edit,J=I===void 0?!1:I,U=j.className,he=j.showTextOnly,_e=j.showLines,tt=j.replaces,gt=j.zoomImg,je=j.hasMask,Ct=j.style,Gt=Ct===void 0?{}:Ct,er=j.stylesPrev,jr=er===void 0?{}:er,Ar=String(p),Tr=Object(M.useRef)(),Yr=Object(M.useRef)(),Ii=Object(M.useState)(""),mr=Object(H.a)(Ii,2),zr=mr[0],li=mr[1],ui=Object(M.useState)("office"),Wr=Object(H.a)(ui,2),Mi=Wr[0],yi=Wr[1],zi=function(){var zt=new Ge(Yr.current);zt.displayMode="popup",zt.addRenderEventListener(function(){var xr=Object(_.a)(O.a.mark(function Bt(dr){var Yt;return O.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return Tr.current.style.display="none",gr.next=3,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr}});case 3:Yt=gr.sent,Yt!=null&&Yt.id&&tt(Yr.current.getAttribute("src").replace(ae.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 5:case"end":return gr.stop()}},Bt)}));return function(Bt){return xr.apply(this,arguments)}}()),zt.show()},Ki=function(){var zt=new kt(Yr.current);zt.settings.displayMode="popup",zt.addEventListener("render",function(){var xr=Object(_.a)(O.a.mark(function Bt(dr){var Yt;return O.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:if(Tr.current.style.display="none",!Yr.current){gr.next=6;break}return gr.next=4,Object(Me.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:dr.dataUrl}});case 4:Yt=gr.sent,Yt!=null&&Yt.id&&tt(Yr.current.getAttribute("src").replace(ae.a.API_SERVER,""),"/api/attachments/".concat(Yt==null?void 0:Yt.id,"?type=").concat(Yt.content_type));case 6:case"end":return gr.stop()}},Bt)}));return function(Bt){return xr.apply(this,arguments)}}()),zt.show(),window.markerArea=zt},Jr=Object(M.useMemo)(function(){Tr.current&&(Tr.current.style.zIndex=-1);try{var sr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,zt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,xr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ar=Ar.replace(sr,"("+ae.a.API_SERVER+"/api/attachments/").replace(zt,'"'+ae.a.API_SERVER+"/api/attachments/").replace(xr,'"'+ae.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(ii){}var Bt=$(Ar),dr=b();if(Ar.match(/\[TOC\]/)&&(Bt=Bt.replace("[TOC]
",R()),A()),Bt=Bt.replace(/(__special_katext_id_\d+__)/g,function(ii,gr){var Lr=dr[gr],Vi=Lr.type,xi=Lr.expression;return Object(ce.renderToString)(gi(xi)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Bt=Bt.replace(/▁/g,"\u2581\u2581\u2581"),g(),he){var Yt=document.createElement("div");return Yt.innerHTML=Bt,Yt.innerText}return setTimeout(function(){return hn()},500),Bt},[Ar]),Qr=Object(M.useRef)();v.WebkitLineClamp=_e,_e&&(Gt=Object(B.a)(Object(B.a)({},Gt),v));function bi(sr){var zt=sr.target;if(zt.tagName.toUpperCase()==="IMG"){if(gt){var xr=zt.getAttribute("src");li(xr),yi("image")}}else if(zt.tagName.toUpperCase()==="A"){var Bt=zt.getAttribute("href");if(Bt.indexOf("office")>-1)sr.preventDefault(),li(Bt),yi("office");else if(Bt.indexOf("application/pdf")>-1)sr.preventDefault(),li(Bt),yi("pdf");else if(Bt.indexOf("text/html")>-1)sr.preventDefault(),li(Bt),yi("html");else if(Bt.startsWith("#")){sr.preventDefault();var dr=document.getElementById(Bt.replace("#",""));dr&&dr.scrollIntoView(!0)}}}var hn=function(){var zt,xr=(zt=Qr.current)===null||zt===void 0?void 0:zt.querySelectorAll("video");xr==null||xr.forEach(function(Bt){if(Bt.oncontextmenu=function(){return!1},Bt.src.indexOf(".m3u8")>-1&&!Bt.canPlayType("application/vnd.apple.mpegurl")){if(ee.a.isSupported()){var dr=new ee.a;dr.loadSource(Bt.src),dr.attachMedia(Bt)}}})};Object(M.useEffect)(function(){if(Qr.current&&Jr&&(Jr.match(mi)&&window.PR.prettyPrint()),Qr.current)return Qr.current.addEventListener("click",bi),function(){Qr.current.removeEventListener("click",bi),g(),A()}},[Jr,Qr.current,bi]);var Ei=function(zt){if(!J)return;zt.target.nodeName==="IMG"?(Tr.current.style.zIndex=1,Tr.current.style.display="flex",Tr.current.style.width=zt.target.clientWidth+"px",Tr.current.style.height=zt.target.clientHeight+"px",Tr.current.style.top=zt.target.offsetTop+"px",Tr.current.style.left=zt.target.offsetLeft+"px",Yr.current.src=zt.target.getAttribute("src")):Tr.current.style.display="none"};return y.a.createElement("div",{style:{position:"relative"}},y.a.createElement("div",{ref:Qr,style:Object(B.a)({},Gt),className:"".concat(U||""," markdown-body ").concat(pi.a.mdBody),onMouseOver:Ei,dangerouslySetInnerHTML:{__html:Jr}}),y.a.createElement("div",{ref:Tr,className:pi.a.button},y.a.createElement(Y.a,null,y.a.createElement(Q.a,{onClick:function(){return zi()}},"\u88C1\u526A"),y.a.createElement(Q.a,{onClick:function(){return Ki()}},"\u7F16\u8F91"))),y.a.createElement("img",{ref:Yr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),y.a.createElement(ve.a,{close:!0,data:zr,type:zr!=null&&zr.length?Mi:"",style:Object(B.a)({},jr),onClose:function(){return li("")}}))}},"9VGf":function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return L});var ie=Z("q1tI"),Y=Z.n(ie);function L(Q,B){var _=Object(ie.useRef)();Object(ie.useEffect)(function(){_.current=Q}),Object(ie.useEffect)(function(){function H(){_.current()}if(B!==null){var W=setInterval(H,B);return function(){return clearInterval(W)}}},[B])}},"A/g1":function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF92lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDMgNzkuMTY0NTI3LCAyMDIwLzEwLzE1LTE3OjQ4OjMyICA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Qvl9C2OSIqMWvwHasUdWSW6Umojbh/VPNgTlOCCLWElsOB3hO7BL6XLHfCqOaXuYsA466aPR6XnAZQ8qHKB4fWJP4kNV7SrV3ymqwNVAFiTUe85HzLedaKNxfd/h4FvuPdoA9Hvj7ftmhMAkFbZyaxaQH1a3XwurL9tp4kN7fsUQz5fTnxbGH8GFt7DcwpecTuMFmlIaZ+bjOgvF2u7d/gnIWZR+Q1KPowcIIaAhQSarqmH/xE0TpQbb92M9uT7kdz+/HqfDB0EcF/ZRi1ggYFER/cYcMtMOO3jzlmVjXKDrkt5uv9are9ZLJ8L6UcJ+HplVotygVRlYLFwM4GWf2njl/ymq1fqrSgM3J1Sfz5Rnd15ulp/tiGtPV6h0aIwaCDxUPc/F8sfOQdqTKnbrvjMf9fOK7ZLCyv8Jom1s9qvsHANttQw4dhY++6BW+sKFlNJr7E9K6wOZEoT0YU3ogvXm5OSMK5KQ347v7oggZbr3j/+PWwUnoj9jyHCk+OP7p3Kry+6nL33uvazqbD+6+W35RDmrtGOPW8Va7JcjzemtC+frTKWfgJyCQmxI/GZ7x+warfdUKy/rj47UZXdnlHZXHprJWBcFKZsGX1k16t2spI7oqbr3iOTkdzGyz7z8tK5s4eAN4UiHxx5dO94Ka2jLd2Gq95TI/e9tXoqbBytZLJzwAUGdY+273nc6Y294z3p1sRW2ZhSt02Gsg+eDxknyl07FYWRY8I+aZptYx27B0Bw/Bp3faHRcs13EsCWiWpjZ8DEU+Ecxe7IKjVl5GMy8zAJMQSIwbH27rL+7FH2jUzTNfUwgMMAkFiFlf5MrstviA4PU61HIuo1KQRCdkGeJCDJoCQkkkzyOFVF4mOxyv9u8x8opnU6UeBF0wAAAABJRU5ErkJggg=="},Bd2K:function(Pe,Le,Z){(function(ie){ie(Z("VrN/"),Z("osHv"))})(function(ie){ie.defineOption("autoCloseTags",!1,function(O,M,y){if(y!=ie.Init&&y&&O.removeKeyMap("autoCloseTags"),!M)return;var w={name:"autoCloseTags"};(typeof M!="object"||M.whenClosing!==!1)&&(w["'/'"]=function(k){return _(k)}),(typeof M!="object"||M.whenOpening!==!1)&&(w["'>'"]=function(k){return Q(k)}),O.addKeyMap(w)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],L=["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(O){if(O.getOption("disableInput"))return ie.Pass;for(var M=O.listSelections(),y=[],w=O.getOption("autoCloseTags"),k=0;kD.ch&&(u=u.slice(0,u.length-T.end+D.ch));var m=u.toLowerCase();if(!u||T.type=="string"&&(T.end!=D.ch||!/[\"\']/.test(T.string.charAt(T.string.length-1))||T.string.length==1)||T.type=="tag"&&o.close||T.string.indexOf("/")==D.ch-T.start-1||A&&H(A,m)>-1||W(O,S.mode.xmlCurrentContext&&S.mode.xmlCurrentContext(h)||[],u,D,!0))return ie.Pass;var R=typeof w=="object"&&w.emptyTags;if(R&&H(R,u)>-1){y[k]={text:"/>",newPos:ie.Pos(D.line,D.ch+2)};continue}var x=v&&H(v,m)>-1;y[k]={indent:x,text:">"+(x?`
`:"")+""+u+">",newPos:x?ie.Pos(D.line+1,0):ie.Pos(D.line,D.ch+1)}}for(var f=typeof w=="object"&&w.dontIndentOnAutoClose,k=M.length-1;k>=0;k--){var c=y[k];O.replaceRange(c.text,M[k].head,M[k].anchor,"+insert");var s=O.listSelections().slice(0);s[k]={head:c.newPos,anchor:c.newPos},O.setSelections(s),!f&&c.indent&&(O.indentLine(c.newPos.line,null,!0),O.indentLine(c.newPos.line+1,null,!0))}}function B(O,M){for(var y=O.listSelections(),w=[],k=M?"/":"",D=O.getOption("autoCloseTags"),T=typeof D=="object"&&D.dontIndentOnSlash,S=0;S"&&(A+=">"),w[S]=A}if(O.replaceSelections(w),y=O.listSelections(),!T)for(var S=0;S=0&&M[h]==y;h--)++S;w=T.to;for(var h=1;h0){for(var M=0;M1&&arguments[1]!==void 0?arguments[1]:"",M=[],y=0;y4||((d=m.detail)===null||d===void 0?void 0:d.identity)===void 0||((A=m.detail)===null||A===void 0?void 0:A.shixun_status)===2||((v=m.detail)===null||v===void 0?void 0:v.shixun_status)===1);return O.a.createElement("aside",{className:"bg-white mb10 pl20 pr20 ".concat(T.a.wrap)},O.a.createElement(Y.a,{gutter:[20,20],align:"middle"},O.a.createElement(_.a,{flex:1},O.a.createElement("span",{className:T.a.icons},O.a.createElement("img",{src:k.d,width:"14"})),O.a.createElement("span",{className:"font16"},"\u7B2C ",s==null?void 0:s.position," \u5173\uFF1A",a)),O.a.createElement(_.a,null,(s==null?void 0:s.prev_challenge)&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var G,V=s.prev_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(g.id,"/challenges/").concat(s==null||((G=s.prev_challenge)===null||G===void 0)?void 0:G.id).concat(V);y.d.replace($)}},"\u4E0A\u4E00\u5173"),s.next_challenge&&O.a.createElement(Q.a,{type:"primary",ghost:!0,className:"mt10 mr5",onClick:function(){var G,V=s.next_challenge.st===0?"/editcheckpoint":"/editquestion",$="/shixuns/".concat(g.id,"/challenges/").concat(s==null||((G=s.next_challenge)===null||G===void 0)?void 0:G.id).concat(V);y.d.replace($)}},"\u4E0B\u4E00\u5173"),E&&O.a.createElement(Q.a,{type:"primary"},O.a.createElement(w.a,{to:"/shixuns/".concat(g.id,"/challenges/newquestion")},"\u65B0\u589E\u9009\u62E9\u9898\u4EFB\u52A1")),E&&O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(w.a,{to:"/shixuns/".concat(g.id,"/challenges/new")},"\u65B0\u589E\u5B9E\u8DF5\u4EFB\u52A1")),O.a.createElement(Q.a,{type:"primary",className:"ml5"},O.a.createElement(w.a,{to:"/shixuns/".concat(g.id,"/challenges")},"\u8FD4\u56DE")))))};Le.a=Object(y.a)(function(h){var o=h.shixunsDetail,u=h.newCourse,d=h.loading,A=h.globalSetting;return{shixunsDetail:o,newCourse:u,globalSetting:A,loading:d.effects}})(S)},DlQD:function(Pe,Le,Z){(function(ie,Y){Pe.exports=Y()})(this,function(){"use strict";function ie(ge,de){for(var fe=0;fege.length)&&(de=ge.length);for(var fe=0,te=new Array(de);fe=ge.length?{done:!0}:{done:!1,value:ge[te++]}}}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 fe=ge[Symbol.iterator](),fe.next.bind(fe)}function _(ge,de){return de={exports:{}},ge(de,de.exports),de.exports}var H=_(function(ge){function de(){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 fe(te){ge.exports.defaults=te}ge.exports={defaults:de(),getDefaults:de,changeDefaults:fe}}),W=H.defaults,O=H.getDefaults,M=H.changeDefaults,y=/[&<>"']/,w=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,T={"&":"&","<":"<",">":">",'"':""","'":"'"},S=function(de){return T[de]};function h(ge,de){if(de){if(y.test(ge))return ge.replace(w,S)}else if(k.test(ge))return ge.replace(D,S);return ge}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(ge){return ge.replace(o,function(de,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var d=/(^|[^\[])\^/g;function A(ge,de){ge=ge.source||ge,de=de||"";var fe={replace:function(re,ne){return ne=ne.source||ne,ne=ne.replace(d,"$1"),ge=ge.replace(re,ne),fe},getRegex:function(){return new RegExp(ge,de)}};return fe}var v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(ge,de,fe){if(ge){var te;try{te=decodeURIComponent(u(fe)).replace(v,"").toLowerCase()}catch(re){return null}if(te.indexOf("javascript:")===0||te.indexOf("vbscript:")===0||te.indexOf("data:")===0)return null}de&&!m.test(fe)&&(fe=a(de,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(re){return null}return fe}var x={},f=/^[^:]+:\/*[^/]*$/,c=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(ge,de){x[" "+ge]||(f.test(ge)?x[" "+ge]=ge+"/":x[" "+ge]=P(ge,"/",!0)),ge=x[" "+ge];var fe=ge.indexOf(":")===-1;return de.substring(0,2)==="//"?fe?de:ge.replace(c,"$1")+de:de.charAt(0)==="/"?fe?de:ge.replace(s,"$1")+de:ge+de}var b={exec:function(){}};function g(ge){for(var de=1,fe,te;de=0&&pe[Oe]==="\\";)Ce=!Ce;return Ce?"|":" |"}),te=fe.split(/ \|/),re=0;if(te.length>de)te.splice(de);else for(;te.length=te.length?re.slice(te.length):re}).join(`
`)}var xe=function(){function ge(fe){this.options=fe||z}var de=ge.prototype;return de.space=function(te){var re=this.rules.block.newline.exec(te);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
`}},de.code=function(te,re){var ne=this.rules.block.code.exec(te);if(ne){var le=re[re.length-1];if(le&&le.type==="paragraph")return{raw:ne[0],text:ne[0].trimRight()};var pe=ne[0].replace(/^ {4}/gm,"");return{type:"code",raw:ne[0],codeBlockStyle:"indented",text:this.options.pedantic?pe:F(pe,`
`)}}},de.fences=function(te){var re=this.rules.block.fences.exec(te);if(re){var ne=re[0],le=Me(ne,re[3]||"");return{type:"code",raw:ne,lang:re[2]?re[2].trim():re[2],text:le}}},de.heading=function(te){var re=this.rules.block.heading.exec(te);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},de.nptable=function(te){var re=this.rules.block.nptable.exec(te);if(re){var ne={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[],raw:re[0]};if(ne.header.length===ne.align.length){var le=ne.align.length,pe;for(pe=0;pe ?/gm,"");return{type:"blockquote",raw:re[0],text:ne}}},de.list=function(te){var re=this.rules.block.list.exec(te);if(re){for(var ne=re[0],le=re[2],pe=le.length>1,Ce=le[le.length-1]===")",Oe={type:"list",raw:ne,ordered:pe,start:pe?+le.slice(0,-1):"",loose:!1,items:[]},st=re[0].match(this.rules.block.item),mt=!1,ht,Rt,At,ft,Ft,kt,Ht,It=st.length,xt=0;xt1||this.options.smartLists&&At!==le)&&(ft=st.slice(xt+1).join(`
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-ft.length),xt=It-1)),Ft=mt||/\n\n(?!\s*$)/.test(ht),xt!==It-1&&(mt=ht.charAt(ht.length-1)===`
`,Ft||(Ft=mt)),Ft&&(Oe.loose=!0),kt=/^\[[ xX]\] /.test(ht),Ht=void 0,kt&&(Ht=ht[1]!==" ",ht=ht.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:ne,task:kt,checked:Ht,loose:Ft,text:ht});return Oe}},de.html=function(te){var re=this.rules.block.html.exec(te);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):ae(re[0]):re[0]}},de.def=function(te){var re=this.rules.block.def.exec(te);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var ne=re[1].toLowerCase().replace(/\s+/g," ");return{tag:ne,raw:re[0],href:re[2],title:re[3]}}},de.table=function(te){var re=this.rules.block.table.exec(te);if(re){var ne={type:"table",header:ee(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[]};if(ne.header.length===ne.align.length){ne.raw=re[0];var le=ne.align.length,pe;for(pe=0;pe/i.test(le[0])&&(re=!1),!ne&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?ne=!0:ne&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(ne=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:re,inRawBlock:ne,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ae(le[0]):le[0]}},de.link=function(te){var re=this.rules.inline.link.exec(te);if(re){var ne=ce(re[2],"()");if(ne>-1){var le=re[0].indexOf("!")===0?5:4,pe=le+re[1].length+ne;re[2]=re[2].substring(0,ne),re[0]=re[0].substring(0,pe).trim(),re[3]=""}var Ce=re[2],Oe="";if(this.options.pedantic){var st=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ce);st?(Ce=st[1],Oe=st[3]):Oe=""}else Oe=re[3]?re[3].slice(1,-1):"";Ce=Ce.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ve(re,{href:Ce&&Ce.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},re[0]);return mt}},de.reflink=function(te,re){var ne;if((ne=this.rules.inline.reflink.exec(te))||(ne=this.rules.inline.nolink.exec(te))){var le=(ne[2]||ne[1]).replace(/\s+/g," ");if(le=re[le.toLowerCase()],!le||!le.href){var pe=ne[0].charAt(0);return{type:"text",raw:pe,text:pe}}var Ce=ve(ne,le,ne[0]);return Ce}},de.strong=function(te,re,ne){ne===void 0&&(ne="");var le=this.rules.inline.strong.start.exec(te);if(le&&(!le[1]||le[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){re=re.slice(-1*te.length);var pe=le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;pe.lastIndex=0;for(var Ce;(le=pe.exec(re))!=null;)if(Ce=this.rules.inline.strong.middle.exec(re.slice(0,le.index+3)),Ce)return{type:"strong",raw:te.slice(0,Ce[0].length),text:te.slice(2,Ce[0].length-2)}}},de.em=function(te,re,ne){ne===void 0&&(ne="");var le=this.rules.inline.em.start.exec(te);if(le&&(!le[1]||le[1]&&(ne===""||this.rules.inline.punctuation.exec(ne)))){re=re.slice(-1*te.length);var pe=le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;pe.lastIndex=0;for(var Ce;(le=pe.exec(re))!=null;)if(Ce=this.rules.inline.em.middle.exec(re.slice(0,le.index+2)),Ce)return{type:"em",raw:te.slice(0,Ce[0].length),text:te.slice(1,Ce[0].length-1)}}},de.codespan=function(te){var re=this.rules.inline.code.exec(te);if(re){var ne=re[2].replace(/\n/g," "),le=/[^ ]/.test(ne),pe=ne.startsWith(" ")&&ne.endsWith(" ");return le&&pe&&(ne=ne.substring(1,ne.length-1)),ne=ae(ne,!0),{type:"codespan",raw:re[0],text:ne}}},de.br=function(te){var re=this.rules.inline.br.exec(te);if(re)return{type:"br",raw:re[0]}},de.del=function(te){var re=this.rules.inline.del.exec(te);if(re)return{type:"del",raw:re[0],text:re[1]}},de.autolink=function(te,re){var ne=this.rules.inline.autolink.exec(te);if(ne){var le,pe;return ne[2]==="@"?(le=ae(this.options.mangle?re(ne[1]):ne[1]),pe="mailto:"+le):(le=ae(ne[1]),pe=le),{type:"link",raw:ne[0],text:le,href:pe,tokens:[{type:"text",raw:le,text:le}]}}},de.url=function(te,re){var ne;if(ne=this.rules.inline.url.exec(te)){var le,pe;if(ne[2]==="@")le=ae(this.options.mangle?re(ne[0]):ne[0]),pe="mailto:"+le;else{var Ce;do Ce=ne[0],ne[0]=this.rules.inline._backpedal.exec(ne[0])[0];while(Ce!==ne[0]);le=ae(ne[0]),ne[1]==="www."?pe="http://"+le:pe=le}return{type:"link",raw:ne[0],text:le,href:pe,tokens:[{type:"text",raw:le,text:le}]}}},de.inlineText=function(te,re,ne){var le=this.rules.inline.text.exec(te);if(le){var pe;return re?pe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ae(le[0]):le[0]:pe=ae(this.options.smartypants?ne(le[0]):le[0]),{type:"text",raw:le[0],text:pe}}},ge}(),Ee=$.noopTest,Te=$.edit,Se=$.merge,me={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:Ee,table:Ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=Te(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,me.item=Te(me.item,"gm").replace(/bull/g,me.bullet).getRegex(),me.list=Te(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._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",me._comment=//,me.html=Te(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=Te(me._paragraph).replace("hr",me.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",me._tag).getRegex(),me.blockquote=Te(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=Se({},me),me.gfm=Se({},me.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*|$)"}),me.gfm.nptable=Te(me.gfm.nptable).replace("hr",me.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",me._tag).getRegex(),me.gfm.table=Te(me.gfm.table).replace("hr",me.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",me._tag).getRegex(),me.pedantic=Se({},me.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| \\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._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:Ee,paragraph:Te(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ee,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:Ee,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",se.punctuation=Te(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex(),se._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",se._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",se.em.start=Te(se.em.start).replace(/punctuation/g,se._punctuation).getRegex(),se.em.middle=Te(se.em.middle).replace(/punctuation/g,se._punctuation).replace(/overlapSkip/g,se._overlapSkip).getRegex(),se.em.endAst=Te(se.em.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.em.endUnd=Te(se.em.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.start=Te(se.strong.start).replace(/punctuation/g,se._punctuation).getRegex(),se.strong.middle=Te(se.strong.middle).replace(/punctuation/g,se._punctuation).replace(/blockSkip/g,se._blockSkip).getRegex(),se.strong.endAst=Te(se.strong.endAst,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.strong.endUnd=Te(se.strong.endUnd,"g").replace(/punctuation/g,se._punctuation).getRegex(),se.blockSkip=Te(se._blockSkip,"g").getRegex(),se.overlapSkip=Te(se._overlapSkip,"g").getRegex(),se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,se._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])?)+(?![-_])/,se.autolink=Te(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex(),se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,se.tag=Te(se.tag).replace("comment",me._comment).replace("attribute",se._attribute).getRegex(),se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,se._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,se.link=Te(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex(),se.reflink=Te(se.reflink).replace("label",se._label).getRegex(),se.reflinkSearch=Te(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex(),se.normal=Se({},se),se.pedantic=Se({},se.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()}),se.gfm=Se({},se.normal,{escape:Te(se.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&&(te="x"+te.toString(16)),de+=""+te+";";return de}var Ue=function(){function ge(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||Ve,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var te={block:We.normal,inline:Je.normal};this.options.pedantic?(te.block=We.pedantic,te.inline=Je.pedantic):this.options.gfm&&(te.block=We.gfm,this.options.breaks?te.inline=Je.breaks:te.inline=Je.gfm),this.tokenizer.rules=te}ge.lex=function(te,re){var ne=new ge(re);return ne.lex(te)};var de=ge.prototype;return de.lex=function(te){return te=te.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(te,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function(te,re,ne){re===void 0&&(re=[]),ne===void 0&&(ne=!0),te=te.replace(/^ +$/gm,"");for(var le,pe,Ce,Oe;te;){if(le=this.tokenizer.space(te)){te=te.substring(le.raw.length),le.type&&re.push(le);continue}if(le=this.tokenizer.code(te,re)){te=te.substring(le.raw.length),le.type?re.push(le):(Oe=re[re.length-1],Oe.raw+=`
`+le.raw,Oe.text+=`
`+le.text);continue}if(le=this.tokenizer.fences(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.heading(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.nptable(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.hr(te)){te=te.substring(le.raw.length),re.push(le);continue}if(le=this.tokenizer.blockquote(te)){te=te.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],ne),re.push(le);continue}if(le=this.tokenizer.list(te)){for(te=te.substring(le.raw.length),Ce=le.items.length,pe=0;pe0)for(;(st=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)mt.includes(st[0].slice(st[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(st=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,st.index)+"["+"a".repeat(st[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;te;){if(Ce=this.tokenizer.escape(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.tag(te,ne,le)){te=te.substring(Ce.raw.length),ne=Ce.inLink,le=Ce.inRawBlock,re.push(Ce);continue}if(Ce=this.tokenizer.link(te)){te=te.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,le)),re.push(Ce);continue}if(Ce=this.tokenizer.reflink(te,this.tokens.links)){te=te.substring(Ce.raw.length),Ce.type==="link"&&(Ce.tokens=this.inlineTokens(Ce.text,[],!0,le)),re.push(Ce);continue}if(Ce=this.tokenizer.strong(te,Oe,pe)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ne,le),re.push(Ce);continue}if(Ce=this.tokenizer.em(te,Oe,pe)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ne,le),re.push(Ce);continue}if(Ce=this.tokenizer.codespan(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.br(te)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.del(te)){te=te.substring(Ce.raw.length),Ce.tokens=this.inlineTokens(Ce.text,[],ne,le),re.push(Ce);continue}if(Ce=this.tokenizer.autolink(te,De)){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(!ne&&(Ce=this.tokenizer.url(te,De))){te=te.substring(Ce.raw.length),re.push(Ce);continue}if(Ce=this.tokenizer.inlineText(te,le,Ze)){te=te.substring(Ce.raw.length),pe=Ce.raw.slice(-1),re.push(Ce);continue}if(te){var ht="Infinite loop on byte: "+te.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return re},Y(ge,null,[{key:"rules",get:function(){return{block:We,inline:Je}}}]),ge}(),Be=H.defaults,qe=$.cleanUrl,Qe=$.escape,Ie=function(){function ge(fe){this.options=fe||Be}var de=ge.prototype;return de.code=function(te,re,ne){var le=(re||"").match(/\S*/)[0];if(this.options.highlight){var pe=this.options.highlight(te,le);pe!=null&&pe!==te&&(ne=!0,te=pe)}return le?''+(ne?te:Qe(te,!0))+`
`:""+(ne?te:Qe(te,!0))+`
`},de.blockquote=function(te){return`
`+te+`
`},de.html=function(te){return te},de.heading=function(te,re,ne,le){return this.options.headerIds?"
`:""+te+"
`},de.hr=function(){return this.options.xhtml?`
`:`
`},de.list=function(te,re,ne){var le=re?"ol":"ul",pe=re&&ne!==1?' start="'+ne+'"':"";return"<"+le+pe+`>
`+te+""+le+`>
`},de.listitem=function(te){return""+te+`
`},de.checkbox=function(te){return" "},de.paragraph=function(te){return""+te+`
`},de.table=function(te,re){return re&&(re=""+re+" "),`
`},de.tablerow=function(te){return`
`+te+`
`},de.tablecell=function(te,re){var ne=re.header?"th":"td",le=re.align?"<"+ne+' align="'+re.align+'">':"<"+ne+">";return le+te+""+ne+`>
`},de.strong=function(te){return""+te+" "},de.em=function(te){return""+te+" "},de.codespan=function(te){return""+te+""},de.br=function(){return this.options.xhtml?" ":" "},de.del=function(te){return""+te+""},de.link=function(te,re,ne){if(te=qe(this.options.sanitize,this.options.baseUrl,te),te===null)return ne;var le='"+ne+" ",le},de.image=function(te,re,ne){if(te=qe(this.options.sanitize,this.options.baseUrl,te),te===null)return ne;var le=' ":">",le},de.text=function(te){return te},ge}(),Ne=function(){function ge(){}var de=ge.prototype;return de.strong=function(te){return te},de.em=function(te){return te},de.codespan=function(te){return te},de.del=function(te){return te},de.html=function(te){return te},de.text=function(te){return te},de.link=function(te,re,ne){return""+ne},de.image=function(te,re,ne){return""+ne},de.br=function(){return""},ge}(),$e=function(){function ge(){this.seen={}}var de=ge.prototype;return de.slug=function(te){var re=te.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var ne=re;do this.seen[ne]++,re=ne+"-"+this.seen[ne];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},ge}(),et=H.defaults,Xe=$.unescape,Ke=function(){function ge(fe){this.options=fe||et,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ne,this.slugger=new $e}ge.parse=function(te,re){var ne=new ge(re);return ne.parse(te)};var de=ge.prototype;return de.parse=function(te,re){re===void 0&&(re=!0);var ne="",le,pe,Ce,Oe,st,mt,ht,Rt,At,ft,Ft,kt,Ht,It,xt,Mt,jt,lt,$t=te.length;for(le=0;le<$t;le++){ft=te[le];switch(ft.type){case"space":continue;case"hr":{ne+=this.renderer.hr();continue}case"heading":{ne+=this.renderer.heading(this.parseInline(ft.tokens),ft.depth,Xe(this.parseInline(ft.tokens,this.textRenderer)),this.slugger);continue}case"code":{ne+=this.renderer.code(ft.text,ft.lang,ft.escaped);continue}case"table":{for(Rt="",ht="",Oe=ft.header.length,pe=0;pe0&&xt.tokens[0].type==="text"?(xt.tokens[0].text=lt+" "+xt.tokens[0].text,xt.tokens[0].tokens&&xt.tokens[0].tokens.length>0&&xt.tokens[0].tokens[0].type==="text"&&(xt.tokens[0].tokens[0].text=lt+" "+xt.tokens[0].tokens[0].text)):xt.tokens.unshift({type:"text",text:lt}):It+=lt),It+=this.parse(xt.tokens,Ht),At+=this.renderer.listitem(It,jt,Mt);ne+=this.renderer.list(At,Ft,kt);continue}case"html":{ne+=this.renderer.html(ft.text);continue}case"paragraph":{ne+=this.renderer.paragraph(this.parseInline(ft.tokens));continue}case"text":{for(At=ft.tokens?this.parseInline(ft.tokens):ft.text;le+1<$t&&te[le+1].type==="text";)ft=te[++le],At+=`
`+(ft.tokens?this.parseInline(ft.tokens):ft.text);ne+=re?this.renderer.paragraph(At):At;continue}default:{var ar='Token with "'+ft.type+'" type was not found.';if(this.options.silent){console.error(ar);return}else throw new Error(ar)}}}return ne},de.parseInline=function(te,re){re=re||this.renderer;var ne="",le,pe,Ce=te.length;for(le=0;leAn error occurred:
"+at(Ce.message+"",!0)+" ";throw Ce}}we.options=we.setOptions=function(ge){return ct(we.defaults,ge),dt(we.defaults),we},we.getDefaults=Ae,we.defaults=ot,we.use=function(ge){var de=ct({},ge);if(ge.renderer&&function(){var te=we.defaults.renderer||new Ie,re=function(pe){var Ce=te[pe];te[pe]=function(){for(var Oe=arguments.length,st=new Array(Oe),mt=0;mt`,triples:"",explode:"[]{}"},L=ie.Pos;ie.defineOption("autoCloseBrackets",!1,function(T,S,h){h&&h!=ie.Init&&(T.removeKeyMap(B),T.state.closeBrackets=null),S&&(_(Q(S,"pairs")),T.state.closeBrackets=S,T.addKeyMap(B))});function Q(T,S){return S=="pairs"&&typeof T=="string"?T:typeof T=="object"&&T[S]!=null?T[S]:Y[S]}var B={Backspace:O,Enter:M};function _(T){for(var S=0;S=0;u--){var A=o[u].head;T.replaceRange("",L(A.line,A.ch-1),L(A.line,A.ch+1),"+delete")}}function M(T){var S=W(T),h=S&&Q(S,"explode");if(!h||T.getOption("disableInput"))return ie.Pass;for(var o=T.listSelections(),u=0;u0;return{anchor:new L(T.anchor.line,T.anchor.ch+(S?-1:1)),head:new L(T.head.line,T.head.ch+(S?1:-1))}}function w(T,S){var h=W(T);if(!h||T.getOption("disableInput"))return ie.Pass;var o=Q(h,"pairs"),u=o.indexOf(S);if(u==-1)return ie.Pass;for(var d=Q(h,"closeBefore"),A=Q(h,"triples"),v=o.charAt(u+1)==S,m=T.listSelections(),R=u%2==0,x,f=0;f=0&&T.getRange(s,L(s.line,s.ch+3))==S+S+S?a="skipThree":a="skip";else if(v&&s.ch>1&&A.indexOf(S)>=0&&T.getRange(L(s.line,s.ch-2),s)==S+S){if(s.ch>2&&/\bstring/.test(T.getTokenTypeAt(L(s.line,s.ch-2))))return ie.Pass;a="addFour"}else if(v){var g=s.ch==0?" ":T.getRange(L(s.line,s.ch-1),s);if(!ie.isWordChar(b)&&g!=S&&!ie.isWordChar(g))a="both";else return ie.Pass}else if(R&&(b.length===0||/\s/.test(b)||d.indexOf(b)>-1))a="both";else return ie.Pass;if(!x)x=a;else if(x!=a)return ie.Pass}var E=u%2?o.charAt(u-1):S,P=u%2?S:o.charAt(u+1);T.operation(function(){if(x=="skip")T.execCommand("goCharRight");else if(x=="skipThree")for(var G=0;G<3;G++)T.execCommand("goCharRight");else if(x=="surround"){for(var V=T.getSelections(),G=0;G1&&arguments[1]!==void 0?arguments[1]:1,fe=Ne.length,te=0;te1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(F).map(function(ae,ce){if(!B.isValidElement(ae)||!ae.type)return null;var ve=ae.type.isSelectOptGroup,Me=ae.key,xe=ae.props,Ee=xe.children,Te=Object(H.a)(xe,["children"]);return ee||!ve?x(ae):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(Me===null?ce:Me,"__"),label:Me},Te),{},{options:f(Ee)})}).filter(function(ae){return ae})}var c=Z("2Qr1"),s=Z("qNPg"),a=Z("U8pU"),b=Z("Kwbf"),g=Z("WKfj");function E(F){var ee=F.mode,ae=F.options,ce=F.children,ve=F.backfill,Me=F.allowClear,xe=F.placeholder,Ee=F.getInputElement,Te=F.showSearch,Se=F.onSearch,me=F.defaultOpen,se=F.autoFocus,Re=F.labelInValue,Ve=F.value,We=F.inputValue,Je=F.optionLabelProp,Ze=ee==="multiple"||ee==="tags",De=Te!==void 0?Te:Ze||ee==="combobox",Ue=ae||f(ce);if(Object(b.a)(ee!=="tags"||Ue.every(function(Ie){return!Ie.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),ee==="tags"||ee==="combobox"){var Be=Ue.some(function(Ie){return Ie.options?Ie.options.some(function(Ne){return typeof("value"in Ne?Ne.value:Ne.key)=="number"}):typeof("value"in Ie?Ie.value:Ie.key)=="number"});Object(b.a)(!Be,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(ee!=="combobox"||!Je,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(ee==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(b.a)(ee==="combobox"||!Ee,"`getInputElement` only work with `combobox` mode."),Object(b.b)(ee!=="combobox"||!Ee||!Me||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Se&&!De&&ee!=="combobox"&&ee!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!me||se,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ve!=null){var qe=Object(g.d)(Ve);Object(b.a)(!Re||qe.every(function(Ie){return Object(a.a)(Ie)==="object"&&("key"in Ie||"value"in Ie)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Ze||Array.isArray(Ve),"`value` should be array when `mode` is `multiple` or `tags`")}if(ce){var Qe=null;Object(R.a)(ce).some(function(Ie){if(!B.isValidElement(Ie)||!Ie.type)return!1;var Ne=Ie.type;if(Ne.isSelectOption)return!1;if(Ne.isSelectOptGroup){var $e=Object(R.a)(Ie.props.children).every(function(et){return!B.isValidElement(et)||!Ie.type||et.type.isSelectOption?!0:(Qe=et.type,!1)});return!$e}return Qe=Ne,!0}),Qe&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Qe.displayName||Qe.name||Qe,"`.")),Object(b.a)(We===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=E,G=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:f,flattenOptions:c.d,getLabeledValue:c.e,filterOptions:c.b,isValueDisabled:c.g,findValueOption:c.c,warningProps:P,fillOptionsWithMissingValue:c.a}),V=function(F){Object(L.a)(ae,F);var ee=Object(Q.a)(ae);function ae(){var ce;return Object(ie.a)(this,ae),ce=ee.apply(this,arguments),ce.selectRef=B.createRef(),ce.focus=function(){ce.selectRef.current.focus()},ce.blur=function(){ce.selectRef.current.blur()},ce}return Object(Y.a)(ae,[{key:"render",value:function(){return B.createElement(G,Object.assign({ref:this.selectRef},this.props))}}]),ae}(B.Component);V.Option=d,V.OptGroup=v;var $=V,z=Le.c=$},M8RZ:function(Pe,Le,Z){"use strict";Z.d(Le,"a",function(){return O});var ie=Z("fWQN"),Y=Z("mtLc"),L=Z("yKVA"),Q=Z("879j"),B=Z("q1tI"),_=Z.n(B),H=Z("i8i4"),W=Z.n(H),O=function(M){Object(L.a)(w,M);var y=Object(Q.a)(w);function w(k){var D;Object(ie.a)(this,w),D=y.call(this,k);var T=window.document;return D.node=T.createElement("div"),T.body.appendChild(D.node),D}return Object(Y.a)(w,[{key:"render",value:function(){var D=this.props.children;return Object(H.createPortal)(D,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),w}(_.a.Component)},Nmxd:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAF4ElEQVRoQ91aW2wUVRj+/rPbSivURIgKjZcHjUYTgZ0lthgv3V0LSqB9IAQeNNEIaKKwZbcFnuQJoZ1piyYawJjIiwZDwiVBaHd28QItaWeLD4KJPgimiA+YCAZj6Z7fzPZiu7e57WriJE0f5v++//tm/j3nn3MOoQyXcmJ/LdfeCBOjEUA9EdUzUA9g0ST9VQJGmXkU5n/CAN2q043Vm295TU9uCRS9MwCiFWBqAmD++R1yjQNIgTgF5tNGuCPtEJ8Nd2xgWarzPil9UbBsA1G1m6R5GOYxkOgRItM71NRxzQmnIwMBvStKoCiAB50kcRB7mcG96XB7r12MLQNPJXrvzdD4QQZW2yX2EkfACR/7N56PRH+14rE0sDSpLRaM4wA/YEVW3vt0RRLWjIRi35biLWkgmOhaz0SflleYMzZi3jAcaf+sGKqoAUVX3wbwnrN0FYveYoTj7xdiL2ggqKsvMnCyYnJcEBPw0nA4/kUuNM9AINX9MMnMIEDzXeSpIISvs/A1pJu2/TgzSZ4BRVf7ALxQQSVeqPuNcLy5qIHJcb7HS4ZKYxncNnOemH4Dyqmehai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p63zEJ8QgCHeXW4AnPsZvGSkbLjR3/DCT5/+3vD7lTkl0bQHRPk9PrVxg5q1GpL3gZkvpLaZU93qW8r/dYhJiw3DTNudbTFMPb1lf5xIpxHEQ7i/XA7XFw/hZSLlmqLn094flLqWZzNzcZikO/JvbrCTkJjub3rYMZJ8YgwJJbSuBK7zRTb3pUGwfCGznTdk3MMm2tG/vIvL7tpJE1G3vlCeMMcYCvTye2TfSvP2qHeFTMY4NTI9Sek8AJFewlCGi7IEPc/JycmWYOUVCJMHitNmYOQF7NjAzmTK8v5Z/N4/biEYI1BN46riNeeTGvEazx21Ao5DmcRs5QHfV6UbQ+3GbvwHH7EQQahyMxwAAAABJRU5ErkJggg=="},OLES:function(Pe,Le,Z){"use strict";var ie=Z("U8pU"),Y=Z("VTBJ"),L=Z("Ff2n"),Q=Z("q1tI"),B=Z("uciX"),_=Z("7ixt"),H=function(k){var D=k.overlay,T=k.prefixCls,S=k.id,h=k.overlayInnerStyle;return Q.createElement("div",{className:"".concat(T,"-inner"),id:S,role:"tooltip",style:h},typeof D=="function"?D():D)},W=H,O=function(k,D){var T=k.overlayClassName,S=k.trigger,h=S===void 0?["hover"]:S,o=k.mouseEnterDelay,u=o===void 0?0:o,d=k.mouseLeaveDelay,A=d===void 0?.1:d,v=k.overlayStyle,m=k.prefixCls,R=m===void 0?"rc-tooltip":m,x=k.children,f=k.onVisibleChange,c=k.afterVisibleChange,s=k.transitionName,a=k.animation,b=k.placement,g=b===void 0?"right":b,E=k.align,P=E===void 0?{}:E,G=k.destroyTooltipOnHide,V=G===void 0?!1:G,$=k.defaultVisible,z=k.getTooltipContainer,F=k.overlayInnerStyle,ee=Object(L.a)(k,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ae=Object(Q.useRef)(null);Object(Q.useImperativeHandle)(D,function(){return ae.current});var ce=Object(Y.a)({},ee);"visible"in k&&(ce.popupVisible=k.visible);var ve=function(){var Se=k.arrowContent,me=Se===void 0?null:Se,se=k.overlay,Re=k.id;return[Q.createElement("div",{className:"".concat(R,"-arrow"),key:"arrow"},me),Q.createElement(W,{key:"content",prefixCls:R,id:Re,overlay:se,overlayInnerStyle:F})]},Me=!1,xe=!1;if(typeof V=="boolean")Me=V;else if(V&&Object(ie.a)(V)==="object"){var Ee=V.keepParent;Me=Ee===!0,xe=Ee===!1}return Q.createElement(B.a,Object.assign({popupClassName:T,prefixCls:R,popup:ve,action:h,builtinPlacements:_.a,popupPlacement:g,ref:ae,popupAlign:P,getPopupContainer:z,onPopupVisibleChange:f,afterPopupVisibleChange:c,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:$,destroyPopupOnHide:Me,autoDestroy:xe,mouseLeaveDelay:A,popupStyle:v,mouseEnterDelay:u},ce),x)},M=Object(Q.forwardRef)(O),y=Le.a=M},Ohmc:function(Pe,Le,Z){Pe.exports=Z.p+"static/certificate.fc32dc1b.jpg"},Ot1p:function(Pe,Le,Z){"use strict";var ie=Z("2qtc"),Y=Z("kLXV"),L=Z("rAM+"),Q=Z("miYZ"),B=Z("tsqr"),_=Z("9og8"),H=Z("tJVT"),W=Z("jrin"),O=Z("WmNS"),M=Z.n(O),y=Z("q1tI"),w=Z.n(y),k=Z("VrN/"),D=Z.n(k),T=Z("bdgK"),S=Z("p77/"),h=Z("Bd2K"),o=Z("ELLl"),u=Z("19Vz"),d=Z("lZu9"),A=Z("+NIl"),v=Z("kSUc"),m=Z("9Bee"),R=function(pe){var Ce=pe.value,Oe=Ce===void 0?"":Ce,st=pe.className,mt=pe.showTextOnly,ht=pe.showLines,Rt=pe.style,At=Rt===void 0?{}:Rt,ft=Object(y.useMemo)(function(){return""},[Oe]);return w.a.createElement(w.a.Fragment,null,w.a.createElement("div",{dangerouslySetInnerHTML:{__html:ft}}))},x=Z("0Owb"),f=Z("dejd"),c=Z("C+DQ"),s=Z("1vsH"),a=Z("m3rI"),b=[{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 g(pe){var Ce=pe.onActionCallback,Oe=pe.title,st=pe.icon,mt=pe.actionName,ht=pe.className,Rt=ht===void 0?"":ht,At=pe.children;function ft(){Ce(mt)}return w.a.createElement("a",{title:Oe,className:Rt,onClick:ft},w.a.createElement("i",{className:"md-iconfont ".concat(st)}),At)}var E=function(pe){var Ce=pe.watch,Oe=pe.showNullButton,st=pe.onActionCallback,mt=pe.fullScreen,ht=pe.insertTemp,Rt=pe.hidetoolBar,At=pe.uuid,ft=pe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(At,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ft=[].concat(b,[{title:"".concat(Ce?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ce?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return w.a.createElement("ul",{className:"markdown-toolbar-container"},!Rt&&Ft.map(function(kt,Ht){return w.a.createElement("li",{key:Ht},kt.actionName?w.a.createElement(g,Object(x.a)({},kt,{onActionCallback:st})):w.a.createElement("span",{className:"v-line"}))}),Oe?w.a.createElement("li",null,w.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:st},w.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ht&&w.a.createElement("li",null,w.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ht),onActionCallback:st},w.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),w.a.createElement("li",{className:"btn-full-screen"},w.a.createElement(g,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:st})))},P=Z("M8RZ"),G=Z("+L6B"),V=Z("2/Rp"),$=Z("y8nQ"),z=Z("Vl3Y"),F=Z("5NDa"),ee=Z("5rEg"),ae={labelCol:{span:4},wrapperCol:{span:20}},ce=function(pe){var Ce=pe.callback,Oe=pe.onCancel;function st(mt){Ce(mt)}return w.a.createElement(z.a,Object(x.a)({},ae,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:st}),w.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},w.a.createElement(ee.a,null)),w.a.createElement(z.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},w.a.createElement(ee.a,null)),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},ve=Z("7ahc"),Me=Z("HmJG"),xe=Z("BjJ7"),Ee=z.a.useForm,Te={width:280,marginRight:10},Se={labelCol:{span:5},wrapperCol:{span:19}},me=function(pe){var Ce=pe.callback,Oe=pe.onCancel,st=Ee(),mt=Object(H.a)(st,1),ht=mt[0];function Rt(Ft){Ce(Ft)}function At(Ft,kt){if(Ft.status===-1){B.b.error(Ft.message);return}ht.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:kt.type})}function ft(Ft){var kt=Ft.target.files[0];Re(kt,At)}return w.a.createElement(z.a,Object(x.a)({form:ht},Se,{className:"upload-image-panel",onFinish:Rt}),w.a.createElement(z.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},w.a.createElement("div",{className:"flex-container"},w.a.createElement(z.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},w.a.createElement(ee.a,{style:Te})),w.a.createElement(se,{onFileChange:ft}))),w.a.createElement(z.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},w.a.createElement(ee.a,{style:{width:264}})),w.a.createElement(z.a.Item,{style:{textAlign:"right"}},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))};function se(pe){var Ce=pe.onFileChange;return w.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",w.a.createElement("input",{type:"file",onChange:Ce}))}function Re(pe,Ce){if(!pe)throw new String("\u6CA1\u6709\u6587\u4EF6");var Oe=new FormData;Oe.append("editormd-image-file",pe),Oe.append("file_param_name","editormd-image-file"),Oe.append("byxhr","true");var st=new window.XMLHttpRequest;st.withCredentials=!0,st.addEventListener("load",function(mt){Ce(JSON.parse(mt.target.responseText),pe)},!1),st.addEventListener("error",function(mt){console.error(mt)},!1),st.open("POST","".concat(xe.a,"/api/attachments.json")),st.send(Oe)}var Ve=Z("giR+"),We=Z("fyUT"),Je=Z("7Kak"),Ze=Z("9yH6"),De=Ze.a.Group,Ue={margin:"0 8px"},Be=function(pe){var Ce=pe.callback,Oe=pe.onCancel;function st(mt){Ce(mt)}return w.a.createElement(z.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:st},w.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},w.a.createElement("span",{style:Ue},"\u5355\u5143\u683C\u6570\uFF1A"),w.a.createElement("span",{style:Ue},"\u884C\u6570"),w.a.createElement(z.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},w.a.createElement(We.a,null)),w.a.createElement("span",{style:Ue},"\u5217\u6570"),w.a.createElement(z.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},w.a.createElement(We.a,null))),w.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},w.a.createElement("span",{style:Ue},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),w.a.createElement(z.a.Item,{name:"align"},w.a.createElement(De,null,w.a.createElement(Ze.a,{value:"default"},w.a.createElement("i",{className:"fa fa-align-justify"})),w.a.createElement(Ze.a,{value:"left"},w.a.createElement("i",{className:"fa fa-align-left"})),w.a.createElement(Ze.a,{value:"center"},w.a.createElement("i",{className:"fa fa-align-center"})),w.a.createElement(Ze.a,{value:"right"},w.a.createElement("i",{className:"fa fa-align-right"}))))),w.a.createElement("div",{className:"flex-container flex-end"},w.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),w.a.createElement(V.a,{type:"ghost",onClick:Oe},"\u53D6\u6D88")))},qe=Z("ErOA"),Qe=Z("7Cbv"),Ie="link",Ne="upload-image",$e="code-block",et="add-table",Xe="------------",Ke={default:Xe,left:":".concat(Xe),center:":".concat(Xe,":"),right:"".concat(Xe,":")},ct=Z("9VGf"),rt,at;function Ae(){}var dt=0,ot=1e4,we="\u2581",Fe=`
**\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 ge(pe){return/^\d+$/.test(pe)?"".concat(pe,"px"):pe}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=de?"Cmd":"Ctrl",te=["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"],re=(rt={},Object(W.a)(rt,fe+"-B","bold"),Object(W.a)(rt,fe+"-I","italic"),rt),ne=(at={},Object(W.a)(at,Ie,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(at,$e,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(at,Ne,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(at,et,"\u6DFB\u52A0\u8868\u683C"),at),le=Le.a=function(pe){var Ce=pe.defaultValue,Oe=Ce===void 0?"":Ce,st=pe.onChange,mt=pe.width,ht=mt===void 0?"100%":mt,Rt=pe.height,At=Rt===void 0?400:Rt,ft=pe.miniToolbar,Ft=ft===void 0?!1:ft,kt=pe.isFocus,Ht=kt===void 0?!1:kt,It=pe.watch,xt=pe.insertTemp,Mt=pe.mode,jt=Mt===void 0?"markdown":Mt,lt=pe.id,$t=lt===void 0?"markdown-editor-id":lt,ar=pe.showResizeBar,ir=ar===void 0?!1:ar,Mr=pe.noStorage,ti=Mr===void 0?!1:Mr,Xt=pe.showNullButton,yt=Xt===void 0?!1:Xt,ze=pe.hidetoolBar,Kt=ze===void 0?!1:ze,wt=pe.fullScreen,tr=wt===void 0?!1:wt,Ot=pe.onBlur,ur=pe.onCMBeforeChange,bt=pe.onFullScreen,ri=pe.className,Ge=ri===void 0?"":ri,Dt=pe.disablePaste,pi=Dt===void 0?!1:Dt,mi=pe.placeholder,gi=mi===void 0?"":mi,vi=pe.values,j=vi===void 0?"":vi,l=Object(y.useState)(null),p=Object(H.a)(l,2),I=p[0],J=p[1],U=Object(y.useState)(Oe),he=Object(H.a)(U,2),_e=he[0],tt=he[1],gt=Object(y.useState)(It),je=Object(H.a)(gt,2),Ct=je[0],Gt=je[1],er=Object(y.useState)(tr),jr=Object(H.a)(er,2),Ar=jr[0],Tr=jr[1],Yr=Object(y.useState)(""),Ii=Object(H.a)(Yr,2),mr=Ii[0],zr=Ii[1],li=Object(y.useState)(0),ui=Object(H.a)(li,2),Wr=ui[0],Mi=ui[1],yi=Object(y.useState)(At),zi=Object(H.a)(yi,2),Ki=zi[0],Jr=zi[1],Qr=Object(y.useState)(!1),bi=Object(H.a)(Qr,2),hn=bi[0],Ei=bi[1],sr=Object(y.useRef)(Object(Qe.a)()),zt=Object(y.useRef)(!1),xr=Object(y.useRef)(),Bt=Object(y.useRef)(),dr=Object(y.useRef)(),Yt=Object(y.useRef)(),ii=Object(y.useRef)(),gr=function(){var vt=Object(_.a)(M.a.mark(function Lt(){var St,_t;return M.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(qe.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:sr.current}});case 2:_t=Zt.sent,_t!=null&&(St=_t.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",I,Bt),_t.attachments.map(function(Ut){Ut.content_type.indexOf("image")>-1?I.replaceSelection(".concat(Ut.content_type,")")):Ut.content_type.indexOf("video")>-1?I.replaceSelection(' ')):Ut.content_type.indexOf("pdf")>-1?I.replaceSelection('').concat(Ut.name," ")):I.replaceSelection("[".concat(Ut.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Ut.id,"?type=").concat(Ut.content_type,")"))}));case 4:case"end":return Zt.stop()}},Lt)}));return function(){return vt.apply(this,arguments)}}();Object(y.useEffect)(function(){tt(j),I==null||I.setValue(j)},[j]),Object(y.useEffect)(function(){bt==null||bt(Ar)},[Ar]),Object(y.useEffect)(function(){if(Bt.current){var vt=D.a.fromTextArea(Bt.current,{mode:jt,lineNumbers:!Ft,lineWrapping:!0,value:Oe,autoCloseTags:!0,autoCloseBrackets:!0});Ht&&vt.focus();function Lt(St,_t){if(pi){_t.preventDefault();return}var Wt=_t.clipboardData;if(Wt){var Zt=Wt.types.toString(),Ut=Wt.items;if(Zt==="Files"||Wt.types.indexOf("Files")>-1){if(_t.preventDefault(),jt=="stex")return;try{var fr,Or=Ut[1];((fr=Ut[0])===null||fr===void 0?void 0:fr.kind)==="file"&&(Or=Ut[0]);var Nt=Or.getAsFile(),di=Nt.name.split(".").pop();Re(Nt,function(Vt){if(Vt.id){var Pr,wr,Xr;(Nt==null||((Pr=Nt.type)===null||Pr===void 0)?void 0:Pr.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Nt==null||((wr=Nt.type)===null||wr===void 0)?void 0:wr.indexOf("video"))>-1?vt.replaceSelection(' ')):(Nt==null||((Xr=Nt.type)===null||Xr===void 0)?void 0:Xr.indexOf("pdf"))>-1?vt.replaceSelection('').concat(Nt.name," ")):te.includes(di)?vt.replaceSelection('').concat(Nt.name," ")):vt.replaceSelection("[".concat(Nt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})}catch(Vt){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return vt.on("paste",Lt),vt.on("dragleave",function(St,_t){dr.current.classList.remove("mouse-hover-md")}),vt.on("dragover",function(St,_t){dr.current.classList.add("mouse-hover-md")}),vt.on("drop",function(St,_t){dr.current.classList.add("mouse-hover-md");var Wt;if(Wt=_t.dataTransfer.files,Wt.length>0){_t.preventDefault(),_t.stopPropagation();for(var Zt=function(Or){var Nt=Wt[Or],di=Nt.name.split(".").pop();Re(Nt,function(Vt){if(Vt.id){var Pr,wr,Xr;(Nt==null||((Pr=Nt.type)===null||Pr===void 0)?void 0:Pr.indexOf("image"))>-1?vt.replaceSelection(".concat(Vt.content_type,")")):(Nt==null||((wr=Nt.type)===null||wr===void 0)?void 0:wr.indexOf("video"))>-1?vt.replaceSelection(' ')):(Nt==null||((Xr=Nt.type)===null||Xr===void 0)?void 0:Xr.indexOf("pdf"))>-1?vt.replaceSelection('').concat(Nt.name," ")):te.includes(di)?vt.replaceSelection('').concat(Nt.name," ")):vt.replaceSelection("[".concat(Nt.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Vt.id,"?type=").concat(Vt.content_type,")"))}else(Vt==null?void 0:Vt.status)===401&&(document.location.href="/user/login")})},Ut=0;Ut0||Ut.target.offsetWidth>0)&&(Lr(),I.setSize("100%","100%"),I.refresh())}}catch(fr){Wt.e(fr)}finally{Wt.f()}});return St.observe(Bt.current.parentElement),St}if(I){var Lt=vt();return function(){Lt.unobserve(Bt.current.parentElement)}}},[I,Lr]),Object(y.useEffect)(function(){if(I){for(var vt=[],Lt=function(){var Ut=_t[St];Wt=Object(H.a)(Ut,2);var fr=Wt[0],Or=Wt[1],Nt=Object(W.a)({},fr,function(){Vi(Or)});vt.push(Nt),I.addKeyMap(Nt)},St=0,_t=Object.entries(re);St<_t.length;St++){var Wt;Lt()}return xr.current=setInterval(function(){zt.current&&gr()},4e3),function(){clearInterval(xr.current);var Zt=Object(L.a)(vt),Ut;try{for(Zt.s();!(Ut=Zt.n()).done;){var fr=Ut.value;I.removeKeyMap(fr)}}catch(Or){Zt.e(Or)}finally{Zt.f()}}}},[I]),Object(y.useEffect)(function(){tr!==Ar&&Tr(tr)},[tr]),Object(ct.a)(function(){if(!ti&&Wr>0){var vt=new Date().getTime(),Lt=window.sessionStorage.getItem($t);vt>=Wr+ot&&(!Lt||Lt!==_e)&&(window.sessionStorage.setItem($t,_e),Ei(!0))}},ot),Object(y.useEffect)(function(){Gt(It)},[I,It]),Object(y.useEffect)(function(){I&&(Ht&&I.focus())},[I,Ht]),Object(y.useEffect)(function(){if(Ct&&I){var vt=I.getScrollerElement();function Lt(St){var _t=St.target;if(ii.current){var Wt=_t.scrollTop/_t.scrollHeight;ii.current.scrollTop=ii.current.scrollHeight*Wt}}return vt.addEventListener("scroll",Lt),function(){vt.removeEventListener("scroll",Lt)}}},[I,Ct]),Object(y.useEffect)(function(){if(I&&ur){function vt(Lt,St){ur(Lt,St)}return I.on("beforeChange",vt),function(){I.off("beforeChange",vt)}}},[I,ur]),Object(y.useEffect)(function(){if(I&&Ot){function vt(){Ot(I.getValue())}return I.on("blur",vt),function(){I.off("blur",vt)}}},[I,Ot]),Object(y.useEffect)(function(){if(I){function vt(Lt){var St=Lt.getValue();tt(St),Mi(new Date().getTime()),Lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),st&&st(St)}return I.on("change",vt),function(){I.off("change",vt)}}},[I,st]),Object(y.useEffect)(function(){I&&(Oe==null?(I.setValue(""),tt("")):Oe!==I.getValue()&&(I.setValue(Oe),tt(Oe),I.setCursor(I.lineCount(),0)))},[I,Oe]);var Vi=Object(y.useCallback)(function(vt){var Lt=I.getCursor(),St=I.getSelection(),_t=St.split(`
`);switch(vt){case"bold":return I.replaceSelection("**"+St+"**"),St===""&&I.setCursor(Lt.line,Lt.ch+2),I.focus();case"italic":return I.replaceSelection("*"+St+"*"),St===""&&I.setCursor(Lt.line,Lt.ch+1),I.focus();case"code":return I.replaceSelection("`"+St+"`"),St===""&&I.setCursor(Lt.line,Lt.ch+1),I.focus();case"inline-latex":return I.replaceSelection("`$$"+St+"$$`"),St===""&&I.setCursor(Lt.line,Lt.ch+3),I.focus();case"latex":return I.replaceSelection("```latex\n"+St+"\n```"),I.setCursor(Lt.line+1,St.length+1),I.focus();case"line-break":return I.replaceSelection(`
`),I.focus();case"list-ul":return St===""?I.replaceSelection("- "+St):I.replaceSelection(_t.map(function(Wt){return Wt===""?"":"- ".concat(Wt)}).join(`
`)),I.focus();case"list-ol":return St===""?I.replaceSelection("1. "+St):I.replaceSelection(_t.map(function(Wt,Zt){return Wt===""?"":"".concat(Zt+1,". ").concat(Wt)}).join(`
`)),I.focus();case"add-null-ch":return St===""&&I.setCursor(Lt.line,Lt.ch+1),I.replaceSelection(we),I.focus();case"inster-template-1":return St===""&&I.setCursor(Lt.line,Lt.ch),I.replaceSelection(Fe),I.focus();case"eraser":return I.setValue(""),I.focus();case"trigger-watch":return Gt(!Ct),I.focus();case"trigger-full-screen":return Tr(!Ar),I.focus();case Ie:zr(Ie);return;case $e:zr($e);return;case Ne:zr(Ne);return;case et:zr(et);return;default:throw new Error}},[I,Ct,Ar]),xi=Object(y.useCallback)(function(vt){zr("");switch(mr){case Ie:var Lt=vt.title,St=vt.link;return I.replaceSelection("[".concat(Lt,"](").concat(St,")")),I.focus();case $e:var _t=vt.language,Wt=vt.content;return I.replaceSelection(["```"+_t,Wt,"```"].join(`
`)),I.focus();case Ne:var Zt=vt.src,Ut=vt.alt;return Ut?I.replaceSelection(".concat(Zt,' "').concat(Ut,'" )')):I.replaceSelection("")),I.focus();case et:for(var fr=vt.row,Or=vt.col,Nt=vt.align,di=`
`,Vt=0;Vt300&&(fr=300);var Or=At+fr+"px";Jr(Or)}}return vt.addEventListener("mousedown",_t),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Wt),function(){vt.removeEventListener("mousedown",_t),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Wt)}}},[I,Yt]),Object(y.useEffect)(function(){Jr(At)},[At]);var ni=ge(ht),fn=ge(Ki),Zr={width:ni,height:fn},pn=Object(y.useMemo)(function(){if(Wr){var vt=new Date(Wr),Lt=vt.getHours(),St=vt.getMinutes(),_t=vt.getSeconds();return Lt=Lt<10?"0"+Lt:Lt,St=St<10?"0"+St:St,_t=_t<10?"0"+_t:_t,"".concat(Lt,":").concat(St,":").concat(_t)}return 0},[Wr]);function jn(){window.sessionStorage.removeItem($t),Ei(!1),Mi(0)}function Oi(){Ei(!1),Mi(0),I.setValue(window.sessionStorage.getItem($t))}function ua(vt,Lt){var St=I.getValue();St=St.replace(vt,Lt),tt(St),I==null||I.setValue(St)}return w.a.createElement(y.Fragment,null,w.a.createElement("div",{className:"markdown-editor-wrapper",ref:dr},w.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(Ct?"on-preview":""," ").concat(Ft?"mini":""," ").concat(Ar?"full-screen":""),style:Zr},w.a.createElement(E,{insertTemp:xt,watch:Ct,fullScreen:Ar,showNullButton:yt,onActionCallback:Vi,hidetoolBar:Kt,uuid:sr.current,setOpenPhones:function(){zt.current=!0}}),w.a.createElement("div",{className:"markdown-editor-body"},w.a.createElement("div",{className:"codemirror-container"},w.a.createElement("textarea",{ref:Bt,placeholder:gi})),Ct?w.a.createElement("div",{ref:ii,className:"preview-container"},jt==="stex"&&w.a.createElement(R,{value:_e}),jt!=="stex"&&w.a.createElement(m.a,{edit:!0,value:_e,replaces:ua})):null))),ir?w.a.createElement("a",{ref:Yt,className:"editor-resize"}):null,w.a.createElement(P.a,null,ne[mr]?w.a.createElement(Y.a,{centered:!0,title:ne[mr],visible:!0,onCancel:Ci,footer:null,className:"markdown-popup-form"},cn):null))}},RMFE:function(Pe,Le){Pe.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAAFyCAYAAADYqEAoAAAAAXNSR0IArs4c6QAADetJREFUeAHt1jFqXUEQRUHLaP9b/jZObmYU9MAJSlGDxNBUPw76+vz9+eWHAAECBHICv3MbWYgAAQIE/gkItA+BAAECUQGBjh7GWgQIEBBo3wABAgSiAgIdPYy1CBAgINC+AQIECEQFBDp6GGsRIEBAoH0DBAgQi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A4EBPoA0RMECBB4ISDQL1S9SYAAgQMBgT5A9AQBAgReCAj0C1VvEiBA4EBAoA8QPUGAAIEXAgL9QtWbBAgQOBAQ6ANETxAgQOCFgEC/UPUmAQIEDgQE+gDREwQIEHghINAvVL1JgACBAwGBPkD0BAECBF4ICPQLVW8SIEDgQECgDxA9QYAAgRcCAv1C1ZsECBA4EBDoA0RPECBA4IXAH7PYDOHnuk1pAAAAAElFTkSuQmCC"},SJMd:function(Pe,Le){/**
* @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 Z,ie,Y,L=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var _,H;(function(){var W=window,O=["break,continue,do,else,for,if,return,while"],M=[O,"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"],y=[M,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],w=[y,"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"],k=[y,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],D=[y,"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"],T="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",S=[y,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="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",o=[O,"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"],u=[O,"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"],d=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[w,D,k,S,h,o,u,d],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",R="kwd",x="com",f="typ",c="lit",s="pun",a="pln",b="tag",g="dec",E="src",P="atn",G="atv",V="nocode",$="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function z(De){for(var Ue=0,Be=!1,qe=!1,Qe=0,Ie=De.length;Qe122||(te<65||fe>90||dt.push([Math.max(65,fe)|32,Math.min(te,90)|32]),te<97||fe>122||dt.push([Math.max(97,fe)&~32,Math.min(te,122)&~32]))}}dt.sort(function(pe,Ce){return pe[0]-Ce[0]||Ce[1]-pe[1]});for(var re=[],ne=[],Fe=0;Fele[0]&&(le[1]+1>le[0]&&we.push("-"),we.push(Xe(le[1])))}return we.push("]"),we.join("")}function ct(at){for(var Ae=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")),dt=Ae.length,ot=[],we=0,Fe=0;we=2&&fe==="["?Ae[we]=Ke(ge):fe!=="\\"&&(Ae[we]=ge.replace(/[a-zA-Z]/g,function(ne){var le=ne.charCodeAt(0);return"["+String.fromCharCode(le&~32,le|32)+"]"}))}return Ae.join("")}for(var rt=[],Qe=0,Ie=De.length;Qe=0;)Be[rt.charAt(at)]=ct;var Ae=ct[1],dt=""+Ae;et.hasOwnProperty(dt)||($e.push(Ae),et[dt]=null)}$e.push(/[\0-\uffff]/),qe=z($e)})();var Qe=Ue.length,Ie=function(Ne){for(var $e=Ne.sourceCode,et=Ne.basePos,Xe=Ne.sourceNode,Ke=[et,a],ct=0,rt=$e.match(qe)||[],at={},Ae=0,dt=rt.length;Ae=5&&we.substring(0,5)==="lang-",ge&&!(Fe&&typeof Fe[1]=="string")&&(ge=!1,we=E),ge||(at[ot]=we)}var te=ct;if(ct+=ot.length,!ge)Ke.push(et+te,we);else{var re=Fe[1],ne=ot.indexOf(re),le=ne+re.length;Fe[2]&&(le=ot.length-Fe[2].length,ne=le-re.length);var pe=we.substring(5);ee(Xe,et+te,ot.substring(0,ne),Ie,Ke),ee(Xe,et+te+ne,re,se(pe,re),Ke),ee(Xe,et+te+le,ot.substring(le),Ie,Ke)}}Ne.decorations=Ke};return Ie}function Me(De){var Ue=[],Be=[];De.tripleQuotedStrings?Ue.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):De.multiLineStrings?Ue.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ue.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),De.verbatimStrings&&Be.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var qe=De.hashComments;qe&&(De.cStyleComments?(qe>1?Ue.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ue.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Be.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ue.push([x,/^#[^\r\n]*/,null,"#"])),De.cStyleComments&&(Be.push([x,/^\/\/[^\r\n]*/,null]),Be.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Qe=De.regexLiterals;if(Qe){var Ie=Qe>1?"":`
\r`,Ne=Ie?".":"[\\S\\s]",$e="/(?=[^/*"+Ie+"])(?:[^/\\x5B\\x5C"+Ie+"]|\\x5C"+Ne+"|\\x5B(?:[^\\x5C\\x5D"+Ie+"]|\\x5C"+Ne+")*(?:\\x5D|$))+/";Be.push(["lang-regex",RegExp("^"+$+"("+$e+")")])}var et=De.types;et&&Be.push([f,et]);var Xe=(""+De.keywords).replace(/^ | $/g,"");Xe.length&&Be.push([R,new RegExp("^(?:"+Xe.replace(/[\s,]+/g,"|")+")\\b"),null]),Ue.push([a,/^\s+/,null,` \r
\xA0`]);var Ke="^.[^\\s\\w.$@'\"`/\\\\]*";return De.regexLiterals&&(Ke+="(?!s*/)"),Be.push([c,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[c,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[s,new RegExp(Ke),null]),ve(Ue,Be)}var xe=Me({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ee(De,Ue,Be){for(var qe=/(?:^|\s)nocode(?:\s|$)/,Qe=/\r\n?|\n/,Ie=De.ownerDocument,Ne=Ie.createElement("li");De.firstChild;)Ne.appendChild(De.firstChild);var $e=[Ne];function et(Ae){var dt=Ae.nodeType;if(dt==1&&!qe.test(Ae.className))if(Ae.nodeName==="br")Xe(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var ot=Ae.firstChild;ot;ot=ot.nextSibling)et(ot);else if((dt==3||dt==4)&&Be){var we=Ae.nodeValue,Fe=we.match(Qe);if(Fe){var ge=we.substring(0,Fe.index);Ae.nodeValue=ge;var de=we.substring(Fe.index+Fe[0].length);if(de){var fe=Ae.parentNode;fe.insertBefore(Ie.createTextNode(de),Ae.nextSibling)}Xe(Ae),ge||Ae.parentNode.removeChild(Ae)}}}function Xe(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function dt(Fe,ge){var de=ge?Fe.cloneNode(!1):Fe,fe=Fe.parentNode;if(fe){var te=dt(fe,1),re=Fe.nextSibling;te.appendChild(de);for(var ne=re;ne;ne=re)re=ne.nextSibling,te.appendChild(ne)}return de}for(var ot=dt(Ae.nextSibling,0),we;(we=ot.parentNode)&&we.nodeType===1;)ot=we;$e.push(ot)}for(var Ke=0;Ke<$e.length;++Ke)et($e[Ke]);Ue===(Ue|0)&&$e[0].setAttribute("value",Ue);var ct=Ie.createElement("ol");ct.className="linenums";for(var rt=Math.max(0,Ue-1|0)||0,Ke=0,at=$e.length;Ke=fe&&(et+=2),Ie>=te&&(ct+=2)}}finally{we&&(we.style.display=Fe)}}var Se={};function me(De,Ue){for(var Be=Ue.length;--Be>=0;){var qe=Ue[Be];Se.hasOwnProperty(qe)?W.console&&console.warn("cannot override language handler %s",qe):Se[qe]=De}}function se(De,Ue){return De&&Se.hasOwnProperty(De)||(De=/^\s*]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^