(window.webpackJsonp=window.webpackJsonp||[]).push([[211,5,6,7,8,13],{"+NIl":function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){"use strict";N.defineMode("stex",function(v,C){"use strict";function k(i,o){i.cmdState.push(o)}function y(i){return i.cmdState.length>0?i.cmdState[i.cmdState.length-1]:null}function m(i){var o=i.cmdState.pop();o&&o.closeBracket()}function S(i){for(var o=i.cmdState,s=o.length-1;s>=0;s--){var c=o[s];if(c.name=="DEFAULT")continue;return c}return{styleIdentifier:function(){return null}}}function b(i,o,s){return function(){this.name=i,this.bracketNo=0,this.style=o,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 p={};p.importmodule=b("importmodule","tag",["string","builtin"]),p.documentclass=b("documentclass","tag",["","atom"]),p.usepackage=b("usepackage","tag",["atom"]),p.begin=b("begin","tag",["atom"]),p.end=b("end","tag",["atom"]),p.label=b("label","tag",["atom"]),p.ref=b("ref","tag",["atom"]),p.eqref=b("eqref","tag",["atom"]),p.cite=b("cite","tag",["atom"]),p.bibitem=b("bibitem","tag",["atom"]),p.Bibitem=b("Bibitem","tag",["atom"]),p.RBibitem=b("RBibitem","tag",["atom"]),p.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function d(i,o){i.f=o}function t(i,o){var s;if(i.match(/^\\[a-zA-Z@]+/)){var c=i.current().slice(1);return s=p.hasOwnProperty(c)?p[c]:p.DEFAULT,s=new s,k(o,s),d(o,r),s.style}if(i.match(/^\\[$&%#{}_]/))return"tag";if(i.match(/^\\[,;!\/\\]/))return"tag";if(i.match("\\["))return d(o,function(u,f){return l(u,f,"\\]")}),"keyword";if(i.match("\\("))return d(o,function(u,f){return l(u,f,"\\)")}),"keyword";if(i.match("$$"))return d(o,function(u,f){return l(u,f,"$$")}),"keyword";if(i.match("$"))return d(o,function(u,f){return l(u,f,"$")}),"keyword";var a=i.next();if(a=="%")return i.skipToEnd(),"comment";if(a=="}"||a=="]"){if(s=y(o),s)s.closeBracket(a),d(o,r);else return"error";return"bracket"}else return a=="{"||a=="["?(s=p.DEFAULT,s=new s,k(o,s),"bracket"):/\d/.test(a)?(i.eatWhile(/[\w.%]/),"atom"):(i.eatWhile(/[\w\-_]/),s=S(o),s.name=="begin"&&(s.argument=i.current()),s.styleIdentifier())}function l(i,o,s){if(i.eatSpace())return null;if(s&&i.match(s))return d(o,t),"keyword";if(i.match(/^\\[a-zA-Z@]+/))return"tag";if(i.match(/^[a-zA-Z]+/))return"variable-2";if(i.match(/^\\[$&%#{}_]/))return"tag";if(i.match(/^\\[,;!\/]/))return"tag";if(i.match(/^[\^_&]/))return"tag";if(i.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(i.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var c=i.next();return c=="{"||c=="}"||c=="["||c=="]"||c=="("||c==")"?"bracket":c=="%"?(i.skipToEnd(),"comment"):"error"}function r(i,o){var s=i.peek(),c;return s=="{"||s=="["?(c=y(o),c.openBracket(s),i.eat(s),d(o,t),"bracket"):/[ \t\r]/.test(s)?(i.eat(s),null):(d(o,t),m(o),t(i,o))}return{startState:function(){var i=C.inMathMode?function(o,s){return l(o,s)}:t;return{cmdState:[],f:i}},copyState:function(i){return{cmdState:i.cmdState.slice(),f:i.f}},token:function(i,o){return o.f(i,o)},blankLine:function(i){i.f=t,i.cmdState.length=0},lineComment:"%"}}),N.defineMIME("text/x-stex","stex"),N.defineMIME("text/x-latex","stex")})},"+ua5":function(F,Q,j){},"19Vz":function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){N.defineOption("placeholder","",function(b,p,d){var t=d&&d!=N.Init;if(p&&!t)b.on("blur",y),b.on("change",m),b.on("swapDoc",m),N.on(b.getInputField(),"compositionupdate",b.state.placeholderCompose=function(){k(b)}),m(b);else if(!p&&t){b.off("blur",y),b.off("change",m),b.off("swapDoc",m),N.off(b.getInputField(),"compositionupdate",b.state.placeholderCompose),v(b);var l=b.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}p&&!b.hasFocus()&&y(b)});function v(b){b.state.placeholder&&(b.state.placeholder.parentNode.removeChild(b.state.placeholder),b.state.placeholder=null)}function C(b){v(b);var p=b.state.placeholder=document.createElement("pre");p.style.cssText="height: 0; overflow: visible",p.style.direction=b.getOption("direction"),p.className="CodeMirror-placeholder CodeMirror-line-like";var d=b.getOption("placeholder");typeof d=="string"&&(d=document.createTextNode(d)),p.appendChild(d),b.display.lineSpace.insertBefore(p,b.display.lineSpace.firstChild)}function k(b){setTimeout(function(){var p=!1,d=b.getInputField();d.nodeName=="TEXTAREA"?p=!d.value:b.lineCount()==1&&(p=!/[^\u200b]/.test(d.querySelector(".CodeMirror-line").textContent)),p?C(b):v(b)},20)}function y(b){S(b)&&C(b)}function m(b){var p=b.getWrapperElement(),d=S(b);p.className=p.className.replace(" CodeMirror-empty","")+(d?" CodeMirror-empty":""),d?C(b):v(b)}function S(b){return b.lineCount()===1&&b.getLine(0)===""}})},"1T2W":function(F,Q,j){F.exports={"code-panel-container":"code-panel-container___1BMQ9","action-oj-bar":"action-oj-bar___1PRBr",active:"active___2710v"}},"1eCo":function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){"use strict";var v={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},C={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};N.defineMode("xml",function(k,y){var m=k.indentUnit,S={},b=y.htmlMode?v:C;for(var p in b)S[p]=b[p];for(var p in y)S[p]=y[p];var d,t;function l(T,M){function L(z){return M.tokenize=z,z(T,M)}var A=T.next();if(A=="<")return T.eat("!")?T.eat("[")?T.match("CDATA[")?L(o("atom","]]>")):null:T.match("--")?L(o("comment","-->")):T.match("DOCTYPE",!0,!0)?(T.eatWhile(/[\w\._\-]/),L(s(1))):null:T.eat("?")?(T.eatWhile(/[\w\._\-]/),M.tokenize=o("meta","?>"),"meta"):(d=T.eat("/")?"closeTag":"openTag",M.tokenize=r,"tag bracket");if(A=="&"){var V;return T.eat("#")?T.eat("x")?V=T.eatWhile(/[a-fA-F\d]/)&&T.eat(";"):V=T.eatWhile(/[\d]/)&&T.eat(";"):V=T.eatWhile(/[\w\.\-:]/)&&T.eat(";"),V?"atom":"error"}else return T.eatWhile(/[^&<]/),null}l.isInText=!0;function r(T,M){var L=T.next();if(L==">"||L=="/"&&T.eat(">"))return M.tokenize=l,d=L==">"?"endTag":"selfcloseTag","tag bracket";if(L=="=")return d="equals",null;if(L=="<"){M.tokenize=l,M.state=f,M.tagName=M.tagStart=null;var A=M.tokenize(T,M);return A?A+" tag error":"tag error"}else return/[\'\"]/.test(L)?(M.tokenize=i(L),M.stringStartCol=T.column(),M.tokenize(T,M)):(T.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function i(T){var M=function(L,A){for(;!L.eol();)if(L.next()==T){A.tokenize=r;break}return"string"};return M.isInAttribute=!0,M}function o(T,M){return function(L,A){for(;!L.eol();){if(L.match(M)){A.tokenize=l;break}L.next()}return T}}function s(T){return function(M,L){for(var A;(A=M.next())!=null;){if(A=="<")return L.tokenize=s(T+1),L.tokenize(M,L);if(A==">")if(T==1){L.tokenize=l;break}else return L.tokenize=s(T-1),L.tokenize(M,L)}return"meta"}}function c(T,M,L){this.prev=T.context,this.tagName=M,this.indent=T.indented,this.startOfLine=L,(S.doNotIndent.hasOwnProperty(M)||T.context&&T.context.noIndent)&&(this.noIndent=!0)}function a(T){T.context&&(T.context=T.context.prev)}function u(T,M){for(var L;;){if(!T.context)return;if(L=T.context.tagName,!S.contextGrabbers.hasOwnProperty(L)||!S.contextGrabbers[L].hasOwnProperty(M))return;a(T)}}function f(T,M,L){return T=="openTag"?(L.tagStart=M.column(),w):T=="closeTag"?_:f}function w(T,M,L){return T=="word"?(L.tagName=M.current(),t="tag",O):S.allowMissingTagName&&T=="endTag"?(t="tag bracket",O(T,M,L)):(t="error",w)}function _(T,M,L){if(T=="word"){var A=M.current();return L.context&&L.context.tagName!=A&&S.implicitlyClosed.hasOwnProperty(L.context.tagName)&&a(L),L.context&&L.context.tagName==A||S.matchClosing===!1?(t="tag",h):(t="tag error",R)}else return S.allowMissingTagName&&T=="endTag"?(t="tag bracket",h(T,M,L)):(t="error",R)}function h(T,M,L){return T!="endTag"?(t="error",h):(a(L),f)}function R(T,M,L){return t="error",h(T,M,L)}function O(T,M,L){if(T=="word")return t="attribute",g;if(T=="endTag"||T=="selfcloseTag"){var A=L.tagName,V=L.tagStart;return L.tagName=L.tagStart=null,T=="selfcloseTag"||S.autoSelfClosers.hasOwnProperty(A)?u(L,A):(u(L,A),L.context=new c(L,A,V==L.indented)),f}return t="error",O}function g(T,M,L){return T=="equals"?x:(S.allowMissing||(t="error"),O(T,M,L))}function x(T,M,L){return T=="string"?E:T=="word"&&S.allowUnquoted?(t="string",O):(t="error",O(T,M,L))}function E(T,M,L){return T=="string"?E:O(T,M,L)}return{startState:function(T){var M={tokenize:l,state:f,indented:T||0,tagName:null,tagStart:null,context:null};return T!=null&&(M.baseIndent=T),M},token:function(T,M){if(!M.tagName&&T.sol()&&(M.indented=T.indentation()),T.eatSpace())return null;d=null;var L=M.tokenize(T,M);return(L||d)&&L!="comment"&&(t=null,M.state=M.state(d||L,T,M),t&&(L=t=="error"?L+" error":t)),L},indent:function(T,M,L){var A=T.context;if(T.tokenize.isInAttribute)return T.tagStart==T.indented?T.stringStartCol+1:T.indented+m;if(A&&A.noIndent)return N.Pass;if(T.tokenize!=r&&T.tokenize!=l)return L?L.match(/^(\s*)/)[0].length:0;if(T.tagName)return S.multilineTagIndentPastTag!==!1?T.tagStart+T.tagName.length+2:T.tagStart+m*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/$/,blockCommentStart:"",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(T){T.state==x&&(T.state=O)},xmlCurrentTag:function(T){return T.tagName?{name:T.tagName,close:T.type=="closeTag"}:null},xmlCurrentContext:function(T){for(var M=[],L=T.context;L;L=L.prev)L.tagName&&M.push(L.tagName);return M.reverse()}}}),N.defineMIME("text/xml","xml"),N.defineMIME("application/xml","xml"),N.mimeModes.hasOwnProperty("text/html")||N.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1uat":function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("MlIO"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.Hasher,y=v.x64,m=y.Word,S=y.WordArray,b=v.algo;function p(){return m.create.apply(m,arguments)}var d=[p(1116352408,3609767458),p(1899447441,602891725),p(3049323471,3964484399),p(3921009573,2173295548),p(961987163,4081628472),p(1508970993,3053834265),p(2453635748,2937671579),p(2870763221,3664609560),p(3624381080,2734883394),p(310598401,1164996542),p(607225278,1323610764),p(1426881987,3590304994),p(1925078388,4068182383),p(2162078206,991336113),p(2614888103,633803317),p(3248222580,3479774868),p(3835390401,2666613458),p(4022224774,944711139),p(264347078,2341262773),p(604807628,2007800933),p(770255983,1495990901),p(1249150122,1856431235),p(1555081692,3175218132),p(1996064986,2198950837),p(2554220882,3999719339),p(2821834349,766784016),p(2952996808,2566594879),p(3210313671,3203337956),p(3336571891,1034457026),p(3584528711,2466948901),p(113926993,3758326383),p(338241895,168717936),p(666307205,1188179964),p(773529912,1546045734),p(1294757372,1522805485),p(1396182291,2643833823),p(1695183700,2343527390),p(1986661051,1014477480),p(2177026350,1206759142),p(2456956037,344077627),p(2730485921,1290863460),p(2820302411,3158454273),p(3259730800,3505952657),p(3345764771,106217008),p(3516065817,3606008344),p(3600352804,1432725776),p(4094571909,1467031594),p(275423344,851169720),p(430227734,3100823752),p(506948616,1363258195),p(659060556,3750685593),p(883997877,3785050280),p(958139571,3318307427),p(1322822218,3812723403),p(1537002063,2003034995),p(1747873779,3602036899),p(1955562222,1575990012),p(2024104815,1125592928),p(2227730452,2716904306),p(2361852424,442776044),p(2428436474,593698344),p(2756734187,3733110249),p(3204031479,2999351573),p(3329325298,3815920427),p(3391569614,3928383900),p(3515267271,566280711),p(3940187606,3454069534),p(4118630271,4000239992),p(116418474,1914138554),p(174292421,2731055270),p(289380356,3203993006),p(460393269,320620315),p(685471733,587496836),p(852142971,1086792851),p(1017036298,365543100),p(1126000580,2618297676),p(1288033470,3409855158),p(1501505948,4234509866),p(1607167915,987167468),p(1816402316,1246189591)],t=[];(function(){for(var r=0;r<80;r++)t[r]=p()})();var l=b.SHA512=k.extend({_doReset:function(){this._hash=new S.init([new m.init(1779033703,4089235720),new m.init(3144134277,2227873595),new m.init(1013904242,4271175723),new m.init(2773480762,1595750129),new m.init(1359893119,2917565137),new m.init(2600822924,725511199),new m.init(528734635,4215389547),new m.init(1541459225,327033209)])},_doProcessBlock:function(r,i){for(var o=this._hash.words,s=o[0],c=o[1],a=o[2],u=o[3],f=o[4],w=o[5],_=o[6],h=o[7],R=s.high,O=s.low,g=c.high,x=c.low,E=a.high,T=a.low,M=u.high,L=u.low,A=f.high,V=f.low,z=w.high,W=w.low,G=_.high,U=_.low,P=h.high,H=h.low,$=R,re=O,te=g,ge=x,ve=E,de=T,De=M,Te=L,he=A,ue=V,ie=z,Se=W,ne=G,ce=U,Oe=P,oe=H,q=0;q<80;q++){var Y,Z,ye=t[q];if(q<16)Z=ye.high=r[i+q*2]|0,Y=ye.low=r[i+q*2+1]|0;else{var be=t[q-15],Re=be.high,Qe=be.low,rt=(Re>>>1|Qe<<31)^(Re>>>8|Qe<<24)^Re>>>7,at=(Qe>>>1|Re<<31)^(Qe>>>8|Re<<24)^(Qe>>>7|Re<<25),qe=t[q-2],st=qe.high,lt=qe.low,je=(st>>>19|lt<<13)^(st<<3|lt>>>29)^st>>>6,Ie=(lt>>>19|st<<13)^(lt<<3|st>>>29)^(lt>>>6|st<<26),tt=t[q-7],ot=tt.high,ze=tt.low,Ze=t[q-16],Ne=Ze.high,Ae=Ze.low;Y=at+ze,Z=rt+ot+(Y>>>0>>0?1:0),Y=Y+Ie,Z=Z+je+(Y>>>0>>0?1:0),Y=Y+Ae,Z=Z+Ne+(Y>>>0>>0?1:0),ye.high=Z,ye.low=Y}var Me=he&ie^~he&ne,Ee=ue&Se^~ue&ce,Ce=$&te^$&ve^te&ve,ke=re&ge^re&de^ge&de,Fe=($>>>28|re<<4)^($<<30|re>>>2)^($<<25|re>>>7),Be=(re>>>28|$<<4)^(re<<30|$>>>2)^(re<<25|$>>>7),et=(he>>>14|ue<<18)^(he>>>18|ue<<14)^(he<<23|ue>>>9),ct=(ue>>>14|he<<18)^(ue>>>18|he<<14)^(ue<<23|he>>>9),yt=d[q],ft=yt.high,mt=yt.low,It=oe+ct,At=Oe+et+(It>>>0>>0?1:0),It=It+Ee,At=At+Me+(It>>>0>>0?1:0),It=It+mt,At=At+ft+(It>>>0>>0?1:0),It=It+Y,At=At+Z+(It>>>0>>0?1:0),_t=Be+ke,Vt=Fe+Ce+(_t>>>0>>0?1:0);Oe=ne,oe=ce,ne=ie,ce=Se,ie=he,Se=ue,ue=Te+It|0,he=De+At+(ue>>>0>>0?1:0)|0,De=ve,Te=de,ve=te,de=ge,te=$,ge=re,re=It+_t|0,$=At+Vt+(re>>>0>>0?1:0)|0}O=s.low=O+re,s.high=R+$+(O>>>0>>0?1:0),x=c.low=x+ge,c.high=g+te+(x>>>0>>0?1:0),T=a.low=T+de,a.high=E+ve+(T>>>0>>0?1:0),L=u.low=L+Te,u.high=M+De+(L>>>0>>0?1:0),V=f.low=V+ue,f.high=A+he+(V>>>0>>0?1:0),W=w.low=W+Se,w.high=z+ie+(W>>>0>>0?1:0),U=_.low=U+ce,_.high=G+ne+(U>>>0>>0?1:0),H=h.low=H+oe,h.high=P+Oe+(H>>>0>>0?1:0)},_doFinalize:function(){var r=this._data,i=r.words,o=this._nDataBytes*8,s=r.sigBytes*8;i[s>>>5]|=128<<24-s%32,i[(s+128>>>10<<5)+30]=Math.floor(o/4294967296),i[(s+128>>>10<<5)+31]=o,r.sigBytes=i.length*4,this._process();var c=this._hash.toX32();return c},clone:function(){var r=k.clone.call(this);return r._hash=this._hash.clone(),r},blockSize:1024/32});v.SHA512=k._createHelper(l),v.HmacSHA512=k._createHmacHelper(l)}(),N.SHA512})},"3y9D":function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=C.Hasher,m=v.algo,S=[],b=m.SHA1=y.extend({_doReset:function(){this._hash=new k.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(p,d){for(var t=this._hash.words,l=t[0],r=t[1],i=t[2],o=t[3],s=t[4],c=0;c<80;c++){if(c<16)S[c]=p[d+c]|0;else{var a=S[c-3]^S[c-8]^S[c-14]^S[c-16];S[c]=a<<1|a>>>31}var u=(l<<5|l>>>27)+s+S[c];c<20?u+=(r&i|~r&o)+1518500249:c<40?u+=(r^i^o)+1859775393:c<60?u+=(r&i|r&o|i&o)-1894007588:u+=(r^i^o)-899497514,s=o,o=i,i=r<<30|r>>>2,r=l,l=u}t[0]=t[0]+l|0,t[1]=t[1]+r|0,t[2]=t[2]+i|0,t[3]=t[3]+o|0,t[4]=t[4]+s|0},_doFinalize:function(){var p=this._data,d=p.words,t=this._nDataBytes*8,l=p.sigBytes*8;return d[l>>>5]|=128<<24-l%32,d[(l+64>>>9<<4)+14]=Math.floor(t/4294967296),d[(l+64>>>9<<4)+15]=t,p.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var p=y.clone.call(this);return p._hash=this._hash.clone(),p}});v.SHA1=y._createHelper(b),v.HmacSHA1=y._createHmacHelper(b)}(),N.SHA1})},4:function(F,Q){},"5VLF":function(F,Q,j){"use strict";var N,v;function C(k,y,m){var S=function(b,p){return k.js_beautify(b,p)};return S.js=k.js_beautify,S.css=y.css_beautify,S.html=m.html_beautify,S.js_beautify=k.js_beautify,S.css_beautify=y.css_beautify,S.html_beautify=m.html_beautify,S}!(N=[j("6UM0"),j("TXwP"),j("psGv")],v=function(k,y,m){return C(k,y,m)}.apply(Q,N),v!==void 0&&(F.exports=v))},"5hvy":function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("MlIO"))})(this,function(N){return function(v){var C=N,k=C.lib,y=k.WordArray,m=k.Hasher,S=C.x64,b=S.Word,p=C.algo,d=[],t=[],l=[];(function(){for(var o=1,s=0,c=0;c<24;c++){d[o+5*s]=(c+1)*(c+2)/2%64;var a=s%5,u=(2*o+3*s)%5;o=a,s=u}for(var o=0;o<5;o++)for(var s=0;s<5;s++)t[o+5*s]=s+(2*o+3*s)%5*5;for(var f=1,w=0;w<24;w++){for(var _=0,h=0,R=0;R<7;R++){if(f&1){var O=(1<>>24)&16711935|(f<<24|f>>>8)&4278255360,w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360;var _=c[u];_.high^=w,_.low^=f}for(var h=0;h<24;h++){for(var R=0;R<5;R++){for(var O=0,g=0,x=0;x<5;x++){var _=c[R+5*x];O^=_.high,g^=_.low}var E=r[R];E.high=O,E.low=g}for(var R=0;R<5;R++)for(var T=r[(R+4)%5],M=r[(R+1)%5],L=M.high,A=M.low,O=T.high^(L<<1|A>>>31),g=T.low^(A<<1|L>>>31),x=0;x<5;x++){var _=c[R+5*x];_.high^=O,_.low^=g}for(var V=1;V<25;V++){var O,g,_=c[V],z=_.high,W=_.low,G=d[V];G<32?(O=z<>>32-G,g=W<>>32-G):(O=W<>>64-G,g=z<>>64-G);var U=r[t[V]];U.high=O,U.low=g}var P=r[0],H=c[0];P.high=H.high,P.low=H.low;for(var R=0;R<5;R++)for(var x=0;x<5;x++){var V=R+5*x,_=c[V],$=r[V],re=r[(R+1)%5+5*x],te=r[(R+2)%5+5*x];_.high=$.high^~re.high&te.high,_.low=$.low^~re.low&te.low}var _=c[0],ge=l[h];_.high^=ge.high,_.low^=ge.low}},_doFinalize:function(){var o=this._data,s=o.words,c=this._nDataBytes*8,a=o.sigBytes*8,u=this.blockSize*32;s[a>>>5]|=1<<24-a%32,s[(v.ceil((a+1)/u)*u>>>5)-1]|=128,o.sigBytes=s.length*4,this._process();for(var f=this._state,w=this.cfg.outputLength/8,_=w/8,h=[],R=0;R<_;R++){var O=f[R],g=O.high,x=O.low;g=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,x=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,h.push(x),h.push(g)}return new y.init(h,w)},clone:function(){for(var o=m.clone.call(this),s=o._state=this._state.slice(0),c=0;c<25;c++)s[c]=s[c].clone();return o}});C.SHA3=m._createHelper(i),C.HmacSHA3=m._createHmacHelper(i)}(Math),N.SHA3})},"5nXd":function(F,Q,j){var N=j("MFOe"),v=N.slice,C=N.pluck,k=N.each,y=N.bind,m=N.create,S=N.isList,b=N.isFunction,p=N.isObject;F.exports={createStore:l};var d={version:"2.0.12",enabled:!1,get:function(r,i){var o=this.storage.read(this._namespacePrefix+r);return this._deserialize(o,i)},set:function(r,i){return i===void 0?this.remove(r):(this.storage.write(this._namespacePrefix+r,this._serialize(i)),i)},remove:function(r){this.storage.remove(this._namespacePrefix+r)},each:function(r){var i=this;this.storage.each(function(o,s){r.call(i,i._deserialize(o),(s||"").replace(i._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(r){return this._namespacePrefix=="__storejs_"+r+"_"},createStore:function(){return l.apply(this,arguments)},addPlugin:function(r){this._addPlugin(r)},namespace:function(r){return l(this.storage,this.plugins,r)}};function t(){var r=typeof console=="undefined"?null:console;if(!r)return;var i=r.warn?r.warn:r.log;i.apply(r,arguments)}function l(r,i,o){o||(o=""),r&&!S(r)&&(r=[r]),i&&!S(i)&&(i=[i]);var s=o?"__storejs_"+o+"_":"",c=o?new RegExp("^"+s):null,a=/^[a-zA-Z0-9_\-]*$/;if(!a.test(o))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var u={_namespacePrefix:s,_namespaceRegexp:c,_testStorage:function(w){try{var _="__storejs__test__";w.write(_,_);var h=w.read(_)===_;return w.remove(_),h}catch(R){return!1}},_assignPluginFnProp:function(w,_){var h=this[_];this[_]=function(){var O=v(arguments,0),g=this;function x(){return h?(k(arguments,function(T,M){O[M]=T}),h.apply(g,O)):void 0}var E=[x].concat(O);return w.apply(g,E)}},_serialize:function(w){return JSON.stringify(w)},_deserialize:function(w,_){if(!w)return _;var h="";try{h=JSON.parse(w)}catch(R){h=w}return h!==void 0?h:_},_addStorage:function(w){if(this.enabled)return;this._testStorage(w)&&(this.storage=w,this.enabled=!0)},_addPlugin:function(w){var _=this;if(S(w)){k(w,function(O){_._addPlugin(O)});return}var h=C(this.plugins,function(O){return w===O});if(h)return;if(this.plugins.push(w),!b(w))throw new Error("Plugins must be function values that return objects");var R=w.call(this);if(!p(R))throw new Error("Plugins must return an object of function properties");k(R,function(O,g){if(!b(O))throw new Error("Bad plugin property: "+g+" from plugin "+w.name+". Plugins should only return functions.");_._assignPluginFnProp(O,g)})},addStorage:function(w){t("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(w)}},f=m(u,d,{plugins:[]});return f.raw={},k(f,function(w,_){b(w)&&(f.raw[_]=y(f,w))}),k(r,function(w){f._addStorage(w)}),k(i,function(w){f._addPlugin(w)}),f}},"6+eU":function(F,Q,j){"use strict";j.d(Q,"a",function(){return h});var N=j("wx14"),v=j("rePB"),C=j("VTBJ"),k=j("1OyB"),y=j("vuIU"),m=j("Ji7U"),S=j("LK+K"),b=j("cDcd"),p=j.n(b),d=j("TSYQ"),t=j.n(d),l=function(O){var g,x="".concat(O.rootPrefixCls,"-item"),E=t()(x,"".concat(x,"-").concat(O.page),(g={},Object(v.a)(g,"".concat(x,"-active"),O.active),Object(v.a)(g,O.className,!!O.className),Object(v.a)(g,"".concat(x,"-disabled"),!O.page),g)),T=function(){O.onClick(O.page)},M=function(A){O.onKeyPress(A,O.onClick,O.page)};return p.a.createElement("li",{title:O.showTitle?O.page:null,className:E,onClick:T,onKeyPress:M,tabIndex:"0"},O.itemRender(O.page,"page",p.a.createElement("a",{rel:"nofollow"},O.page)))},r=l,i={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},o=function(R){Object(m.a)(g,R);var O=Object(S.a)(g);function g(){var x;Object(k.a)(this,g);for(var E=arguments.length,T=new Array(E),M=0;M=0||L.relatedTarget.className.indexOf("".concat(W,"-next"))>=0))return;x.setState({goInputText:""}),z(x.getValidValue())},x.go=function(L){var A=x.state.goInputText;if(A==="")return;(L.keyCode===i.ENTER||L.type==="click")&&(x.setState({goInputText:""}),x.props.quickGo(x.getValidValue()))},x}return Object(y.a)(g,[{key:"getValidValue",value:function(){var E=this.state,T=E.goInputText,M=E.current;return!T||isNaN(T)?M:Number(T)}},{key:"getPageSizeOptions",value:function(){var E=this.props,T=E.pageSize,M=E.pageSizeOptions;return M.some(function(L){return L.toString()===T.toString()})?M:M.concat([T.toString()]).sort(function(L,A){var V=isNaN(Number(L))?0:Number(L),z=isNaN(Number(A))?0:Number(A);return V-z})}},{key:"render",value:function(){var E=this,T=this.props,M=T.pageSize,L=T.locale,A=T.rootPrefixCls,V=T.changeSize,z=T.quickGo,W=T.goButton,G=T.selectComponentClass,U=T.buildOptionText,P=T.selectPrefixCls,H=T.disabled,$=this.state.goInputText,re="".concat(A,"-options"),te=G,ge=null,ve=null,de=null;if(!V&&!z)return null;var De=this.getPageSizeOptions();if(V&&te){var Te=De.map(function(he,ue){return p.a.createElement(te.Option,{key:ue,value:he.toString()},(U||E.buildOptionText)(he))});ge=p.a.createElement(te,{disabled:H,prefixCls:P,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(M||De[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ue){return ue.parentNode}},Te)}return z&&(W&&(de=typeof W=="boolean"?p.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(re,"-quick-jumper-button")},L.jump_to_confirm):p.a.createElement("span",{onClick:this.go,onKeyUp:this.go},W)),ve=p.a.createElement("div",{className:"".concat(re,"-quick-jumper")},L.jump_to,p.a.createElement("input",{disabled:H,type:"text",value:$,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),L.page,de)),p.a.createElement("li",{className:"".concat(re)},ge,ve)}}]),g}(p.a.Component);o.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=o,c=j("N2Kk");function a(){}function u(R){return typeof R=="number"&&isFinite(R)&&Math.floor(R)===R}function f(R,O,g){return g}function w(R,O,g){var x=typeof R=="undefined"?O.pageSize:R;return Math.floor((g.total-1)/x)+1}var _=function(R){Object(m.a)(g,R);var O=Object(S.a)(g);function g(x){var E;Object(k.a)(this,g),E=O.call(this,x),E.getJumpPrevPage=function(){return Math.max(1,E.state.current-(E.props.showLessItems?3:5))},E.getJumpNextPage=function(){return Math.min(w(void 0,E.state,E.props),E.state.current+(E.props.showLessItems?3:5))},E.getItemIcon=function(V,z){var W=E.props.prefixCls,G=V||p.a.createElement("button",{type:"button","aria-label":z,className:"".concat(W,"-item-link")});return typeof V=="function"&&(G=p.a.createElement(V,Object(C.a)({},E.props))),G},E.savePaginationNode=function(V){E.paginationNode=V},E.isValid=function(V){return u(V)&&V!==E.state.current},E.shouldDisplayQuickJumper=function(){var V=E.props,z=V.showQuickJumper,W=V.pageSize,G=V.total;return G<=W?!1:z},E.handleKeyDown=function(V){(V.keyCode===i.ARROW_UP||V.keyCode===i.ARROW_DOWN)&&V.preventDefault()},E.handleKeyUp=function(V){var z=E.getValidValue(V),W=E.state.currentInputValue;z!==W&&E.setState({currentInputValue:z}),V.keyCode===i.ENTER?E.handleChange(z):V.keyCode===i.ARROW_UP?E.handleChange(z-1):V.keyCode===i.ARROW_DOWN&&E.handleChange(z+1)},E.changePageSize=function(V){var z=E.state.current,W=w(V,E.state,E.props);z=z>W?W:z,W===0&&(z=E.state.current),typeof V=="number"&&("pageSize"in E.props||E.setState({pageSize:V}),"current"in E.props||E.setState({current:z,currentInputValue:z})),E.props.onShowSizeChange(z,V),"onChange"in E.props&&E.props.onChange&&E.props.onChange(z,V)},E.handleChange=function(V){var z=E.props.disabled,W=V;if(E.isValid(W)&&!z){var G=w(void 0,E.state,E.props);W>G?W=G:W<1&&(W=1),"current"in E.props||E.setState({current:W,currentInputValue:W});var U=E.state.pageSize;return E.props.onChange(W,U),W}return E.state.current},E.prev=function(){E.hasPrev()&&E.handleChange(E.state.current-1)},E.next=function(){E.hasNext()&&E.handleChange(E.state.current+1)},E.jumpPrev=function(){E.handleChange(E.getJumpPrevPage())},E.jumpNext=function(){E.handleChange(E.getJumpNextPage())},E.hasPrev=function(){return E.state.current>1},E.hasNext=function(){return E.state.current2?W-2:0),U=2;U=M?A=M:A=Number(T),A}},{key:"getShowSizeChanger",value:function(){var E=this.props,T=E.showSizeChanger,M=E.total,L=E.totalBoundaryShowSizeChanger;return typeof T!="undefined"?T:M>L}},{key:"renderPrev",value:function(E){var T=this.props,M=T.prevIcon,L=T.itemRender,A=L(E,"prev",this.getItemIcon(M,"prev page")),V=!this.hasPrev();return Object(b.isValidElement)(A)?Object(b.cloneElement)(A,{disabled:V}):A}},{key:"renderNext",value:function(E){var T=this.props,M=T.nextIcon,L=T.itemRender,A=L(E,"next",this.getItemIcon(M,"next page")),V=!this.hasNext();return Object(b.isValidElement)(A)?Object(b.cloneElement)(A,{disabled:V}):A}},{key:"render",value:function(){var E=this,T=this.props,M=T.prefixCls,L=T.className,A=T.style,V=T.disabled,z=T.hideOnSinglePage,W=T.total,G=T.locale,U=T.showQuickJumper,P=T.showLessItems,H=T.showTitle,$=T.showTotal,re=T.simple,te=T.itemRender,ge=T.showPrevNextJumpers,ve=T.jumpPrevIcon,de=T.jumpNextIcon,De=T.selectComponentClass,Te=T.selectPrefixCls,he=T.pageSizeOptions,ue=this.state,ie=ue.current,Se=ue.pageSize,ne=ue.currentInputValue;if(z===!0&&W<=Se)return null;var ce=w(void 0,this.state,this.props),Oe=[],oe=null,q=null,Y=null,Z=null,ye=null,be=U&&U.goButton,Re=P?1:2,Qe=ie-1>0?ie-1:0,rt=ie+1=Re*2&&ie!==1+2&&(Oe[0]=Object(b.cloneElement)(Oe[0],{className:"".concat(M,"-item-after-jump-prev")}),Oe.unshift(oe)),ce-ie>=Re*2&&ie!==ce-2&&(Oe[Oe.length-1]=Object(b.cloneElement)(Oe[Oe.length-1],{className:"".concat(M,"-item-before-jump-next")}),Oe.push(q)),tt!==1&&Oe.unshift(Y),ot!==ce&&Oe.push(Z)}var Ne=null;$&&(Ne=p.a.createElement("li",{className:"".concat(M,"-total-text")},$(W,[W===0?0:(ie-1)*Se+1,ie*Se>W?W:ie*Se])));var Ae=!this.hasPrev()||!ce,Me=!this.hasNext()||!ce;return p.a.createElement("ul",Object(N.a)({className:t()(M,L,Object(v.a)({},"".concat(M,"-disabled"),V)),style:A,unselectable:"unselectable",ref:this.savePaginationNode},at),Ne,p.a.createElement("li",{title:H?G.prev_page:null,onClick:this.prev,tabIndex:Ae?null:0,onKeyPress:this.runIfEnterPrev,className:t()("".concat(M,"-prev"),Object(v.a)({},"".concat(M,"-disabled"),Ae)),"aria-disabled":Ae},this.renderPrev(Qe)),Oe,p.a.createElement("li",{title:H?G.next_page:null,onClick:this.next,tabIndex:Me?null:0,onKeyPress:this.runIfEnterNext,className:t()("".concat(M,"-next"),Object(v.a)({},"".concat(M,"-disabled"),Me)),"aria-disabled":Me},this.renderNext(rt)),p.a.createElement(s,{disabled:V,locale:G,rootPrefixCls:M,selectComponentClass:De,selectPrefixCls:Te,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ie,pageSize:Se,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:be}))}}],[{key:"getDerivedStateFromProps",value:function(E,T){var M={};if("current"in E&&(M.current=E.current,E.current!==T.current&&(M.currentInputValue=M.current)),"pageSize"in E&&E.pageSize!==T.pageSize){var L=T.current,A=w(E.pageSize,T,E);L=L>A?A:L,"current"in E||(M.current=L,M.currentInputValue=L),M.pageSize=E.pageSize}return M}}]),g}(p.a.Component);_.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:c.a,style:{},itemRender:f,totalBoundaryShowSizeChanger:50};var h=_},"6RRn":function(F,Q,j){"use strict";var N=j("wCXF"),v=j("n6Qo");j.d(Q,"b",function(){return v.a});var C=j("IBYe"),k=j("6eGT"),y=j("hW8S");j.d(Q,"a",function(){return y.a}),Q.c=N.b},"6UM0":function(F,Q,j){var N,v;(function(){var C;(function(){"use strict";var y=[function(p,d,t){var l=t(1).Beautifier,r=t(5).Options;function i(o,s){var c=new l(o,s);return c.beautify()}p.exports=i,p.exports.defaultOptions=function(){return new r}},function(p,d,t){var l=t(2).Output,r=t(3).Token,i=t(4),o=t(5).Options,s=t(7).Tokenizer,c=t(7).line_starters,a=t(7).positionable_operators,u=t(7).TOKEN;function f(P,H){return H.indexOf(P)!==-1}function w(P){return P.replace(/^\s+/g,"")}function _(P){for(var H={},$=0;$$&&($=P.line_indent_level));var re={mode:H,parent:P,last_token:P?P.last_token:new r(u.START_BLOCK,""),last_word:P?P.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:$,alignment:0,line_indent_level:P?P.line_indent_level:$,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},G.prototype._reset=function(P){var H=P.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new l(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(T.BlockStatement);var $=new s(P,this._options);return this._tokens=$.tokenize(),P},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var P,H=this._reset(this._source_text),$=this._options.eol;this._options.eol==="auto"&&($=`
`,H&&i.lineBreak.test(H||"")&&($=H.match(i.lineBreak)[0]));for(var re=this._tokens.next();re;)this.handle_token(re),this._last_last_text=this._flags.last_token.text,this._flags.last_token=re,re=this._tokens.next();return P=this._output.get_code($),P},G.prototype.handle_token=function(P,H){P.type===u.START_EXPR?this.handle_start_expr(P):P.type===u.END_EXPR?this.handle_end_expr(P):P.type===u.START_BLOCK?this.handle_start_block(P):P.type===u.END_BLOCK?this.handle_end_block(P):P.type===u.WORD?this.handle_word(P):P.type===u.RESERVED?this.handle_word(P):P.type===u.SEMICOLON?this.handle_semicolon(P):P.type===u.STRING?this.handle_string(P):P.type===u.EQUALS?this.handle_equals(P):P.type===u.OPERATOR?this.handle_operator(P):P.type===u.COMMA?this.handle_comma(P):P.type===u.BLOCK_COMMENT?this.handle_block_comment(P,H):P.type===u.COMMENT?this.handle_comment(P,H):P.type===u.DOT?this.handle_dot(P):P.type===u.EOF?this.handle_eof(P):P.type===u.UNKNOWN?this.handle_unknown(P,H):this.handle_unknown(P,H)},G.prototype.handle_whitespace_and_comments=function(P,H){var $=P.newlines,re=this._options.keep_array_indentation&&A(this._flags.mode);if(P.comments_before)for(var te=P.comments_before.next();te;)this.handle_whitespace_and_comments(te,H),this.handle_token(te,H),te=P.comments_before.next();if(re)for(var ge=0;ge<$;ge+=1)this.print_newline(ge>0,H);else if(this._options.max_preserve_newlines&&$>this._options.max_preserve_newlines&&($=this._options.max_preserve_newlines),this._options.preserve_newlines&&$>1){this.print_newline(!1,H);for(var ve=1;ve<$;ve+=1)this.print_newline(!0,H)}};var U=["async","break","continue","return","throw","yield"];G.prototype.allow_wrap_or_preserved_newline=function(P,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var $=this._options.preserve_newlines&&P.newlines||H,re=f(this._flags.last_token.text,a)||f(P.text,a);if(re){var te=f(this._flags.last_token.text,a)&&f(this._options.operator_position,E)||f(P.text,a);$=$&&te}if($)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(R(this._flags.last_token,U))return;this._output.set_wrap_point()}},G.prototype.print_newline=function(P,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var $=this._tokens.peek();this._flags.mode===T.Statement&&!(this._flags.if_block&&h($,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(P)&&(this._flags.multiline_frame=!0)},G.prototype.print_token_line_indentation=function(P){this._output.just_added_newline()&&(this._options.keep_array_indentation&&P.newlines&&(P.text==="["||A(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(P.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},G.prototype.print_token=function(P){if(this._output.raw){this._output.add_raw_token(P);return}if(this._options.comma_first&&P.previous&&P.previous.type===u.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(P),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(P),this._output.non_breaking_space=!0,this._output.add_token(P.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},G.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.set_mode=function(P){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,P),this._flags=this.create_flags(this._previous_flags,P),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===T.Statement&&M(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.start_of_object_property=function(){return this._flags.parent.mode===T.ObjectLiteral&&this._flags.mode===T.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(P){var H=!1;return H=H||R(this._flags.last_token,["var","let","const"])&&P.type===u.WORD,H=H||h(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===T.ObjectLiteral&&this._flags.mode===T.Statement)&&R(this._flags.last_token,U)&&!P.newlines,H=H||h(this._flags.last_token,"else")&&!(h(P,"if")&&!P.comments_before),H=H||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===T.ForInitializer||this._previous_flags.mode===T.Conditional),H=H||this._flags.last_token.type===u.WORD&&this._flags.mode===T.BlockStatement&&!this._flags.in_case&&!(P.text==="--"||P.text==="++")&&this._last_last_text!=="function"&&P.type!==u.WORD&&P.type!==u.RESERVED,H=H||this._flags.mode===T.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||R(this._flags.last_token,["get","set"])),H?(this.set_mode(T.Statement),this.indent(),this.handle_whitespace_and_comments(P,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P,R(P,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(P){this.start_of_statement(P)||this.handle_whitespace_and_comments(P);var H=T.Expression;if(P.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){R(this._flags.last_token,c)&&(this._output.space_before_token=!0),this.print_token(P),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=T.ArrayLiteral,A(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),f(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=T.ForInitializer):f(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=T.Conditional):f(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&P.whitespace_before===""?this._output.space_before_token=!1:(f(this._flags.last_token.text,c)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var $=this._tokens.peek(-3);if(this._options.space_after_named_function&&$){var re=this._tokens.peek(-4);R($,["async","function"])||$.text==="*"&&R(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===T.ObjectLiteral?($.text==="{"||$.text===","||$.text==="*"&&(re.text==="{"||re.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(P);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===T.ObjectLiteral&&f(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(P,P.newlines),this.print_token(P),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(P){for(;this._flags.mode===T.Statement;)this.restore_mode();this.handle_whitespace_and_comments(P),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(P,P.text==="]"&&A(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(P),this.restore_mode(),M(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===T.Conditional&&(this._previous_flags.mode=T.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(P){this.handle_whitespace_and_comments(P);var H=this._tokens.peek(),$=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(T.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(T.BlockStatement):$&&(f($.text,[":",","])&&f(H.type,[u.STRING,u.WORD,u.RESERVED])||f(H.text,["get","set","..."])&&f($.type,[u.WORD,u.RESERVED]))?f(this._last_last_text,["class","interface"])&&!f($.text,[":",","])?this.set_mode(T.BlockStatement):this.set_mode(T.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(T.BlockStatement):f(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||R(this._flags.last_token,["return","throw","import","default"])?this.set_mode(T.ObjectLiteral):this.set_mode(T.BlockStatement),this._flags.last_token&&(R(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!H.comments_before&&H.text==="}",te=re&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var ge=0,ve=null;this._flags.inline_frame=!0;do if(ge+=1,ve=this._tokens.peek(ge-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==u.EOF&&!(ve.type===u.END_BLOCK&&ve.opened===P))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&P.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(te||this._flags.last_token.type===u.EQUALS||R(this._flags.last_token,O)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(A(this._previous_flags.mode)&&(this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.COMMA)&&((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(P),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(P),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(P){for(this.handle_whitespace_and_comments(P);this._flags.mode===T.Statement;)this.restore_mode();var H=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(A(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(P)},G.prototype.handle_word=function(P){if(P.type===u.RESERVED){if(f(P.text,["set","get"])&&this._flags.mode!==T.ObjectLiteral)P.type=u.WORD;else if(P.text==="import"&&f(this._tokens.peek().text,["(","."]))P.type=u.WORD;else if(f(P.text,["as","from"])&&!this._flags.import_block)P.type=u.WORD;else if(this._flags.mode===T.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(P.type=u.WORD)}}if(this.start_of_statement(P)?R(this._flags.last_token,["var","let","const"])&&P.type===u.WORD&&(this._flags.declaration_statement=!0):P.newlines&&!V(this._flags.mode)&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==u.EQUALS&&(this._options.preserve_newlines||!R(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(P),this.print_newline()):this.handle_whitespace_and_comments(P),this._flags.do_block&&!this._flags.do_while)if(h(P,"while")){this._output.space_before_token=!0,this.print_token(P),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&h(P,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===T.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&R(P,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(P),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P)),h(P,"function")){(f(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(f(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!P.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?R(this._flags.last_token,["get","set","new","export"])||R(this._flags.last_token,U)?this._output.space_before_token=!0:h(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(V(this._flags.mode)||A(this._flags.mode))||this.print_newline(),this.print_token(P),this._flags.last_word=P.text;return}var $="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?$="SPACE":R(P,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&P.newlines?$="NEWLINE":($="SPACE",this._output.space_before_token=!0):$="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===T.BlockStatement?$="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&V(this._flags.mode)?$="SPACE":this._flags.last_token.type===u.STRING?$="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===T.ObjectLiteral&&f(this._last_last_text,["{",","]))?$="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?$="SPACE":$="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,$="NEWLINE"),R(P,c)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?$="SPACE":$="NEWLINE"),R(P,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===T.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&P.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var re=this._output.current_line;re.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else $==="NEWLINE"?R(this._flags.last_token,O)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&R(P,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!R(P,["var","let","const"]))&&this._flags.last_token.text!==":"&&(h(P,"if")&&h(P.previous,"else")?this._output.space_before_token=!0:this.print_newline()):R(P,c)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&A(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():$==="SPACE"&&(this._output.space_before_token=!0);P.previous&&(P.previous.type===u.WORD||P.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(P),this._flags.last_word=P.text,P.type===u.RESERVED&&(P.text==="do"?this._flags.do_block=!0:P.text==="if"?this._flags.if_block=!0:P.text==="import"?this._flags.import_block=!0:this._flags.import_block&&h(P,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(P){this.start_of_statement(P)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(P);for(var H=this._tokens.peek();this._flags.mode===T.Statement&&!(this._flags.if_block&&h(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(P)},G.prototype.handle_string=function(P){P.text.startsWith("`")&&P.newlines===0&&P.whitespace_before===""&&(P.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(P)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(P),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(P):P.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(P.previous.text==="]"||P.previous.text===")")&&P.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(P)},G.prototype.handle_equals=function(P){this.start_of_statement(P)||this.handle_whitespace_and_comments(P),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(P),this._output.space_before_token=!0},G.prototype.handle_comma=function(P){this.handle_whitespace_and_comments(P,!0),this.print_token(P),this._output.space_before_token=!0,this._flags.declaration_statement?(V(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(P)):this._flags.mode===T.ObjectLiteral||this._flags.mode===T.Statement&&this._flags.parent.mode===T.ObjectLiteral?(this._flags.mode===T.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(P)},G.prototype.handle_operator=function(P){var H=P.text==="*"&&(R(this._flags.last_token,["function","yield"])||f(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),$=f(P.text,["-","+"])&&(f(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||f(this._flags.last_token.text,c)||this._flags.last_token.text===",");if(!this.start_of_statement(P)){var re=!H;this.handle_whitespace_and_comments(P,re)}if(P.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(P);return}if(P.text==="::"){this.print_token(P);return}if(this._flags.last_token.type===u.OPERATOR&&f(this._options.operator_position,E)&&this.allow_wrap_or_preserved_newline(P),P.text===":"&&this._flags.in_case){this.print_token(P),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var te=!0,ge=!0,ve=!1;if(P.text===":"?this._flags.ternary_depth===0?te=!1:(this._flags.ternary_depth-=1,ve=!0):P.text==="?"&&(this._flags.ternary_depth+=1),!$&&!H&&this._options.preserve_newlines&&f(P.text,a)){var de=P.text===":",De=de&&ve,Te=de&&!ve;switch(this._options.operator_position){case x.before_newline:this._output.space_before_token=!Te,this.print_token(P),(!de||De)&&this.allow_wrap_or_preserved_newline(P),this._output.space_before_token=!0;return;case x.after_newline:this._output.space_before_token=!0,!de||De?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(P):this._output.space_before_token=!1,this.print_token(P),this._output.space_before_token=!0;return;case x.preserve_newline:Te||this.allow_wrap_or_preserved_newline(P),te=!(this._output.just_added_newline()||Te),this._output.space_before_token=te,this.print_token(P),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(P),te=!1;var he=this._tokens.peek();ge=he&&f(he.type,[u.WORD,u.RESERVED])}else if(P.text==="...")this.allow_wrap_or_preserved_newline(P),te=this._flags.last_token.type===u.START_BLOCK,ge=!1;else if(f(P.text,["--","++","!","~"])||$){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(P),te=!1,ge=!1,P.newlines&&(P.text==="--"||P.text==="++"||P.text==="~")){var ue=R(this._flags.last_token,O)&&P.newlines;ue&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ue,!0)}this._flags.last_token.text===";"&&V(this._flags.mode)&&(te=!0),this._flags.last_token.type===u.RESERVED?te=!0:this._flags.last_token.type===u.END_EXPR?te=!(this._flags.last_token.text==="]"&&(P.text==="--"||P.text==="++")):this._flags.last_token.type===u.OPERATOR&&(te=f(P.text,["--","-","++","+"])&&f(this._flags.last_token.text,["--","-","++","+"]),f(P.text,["+","-"])&&f(this._flags.last_token.text,["--","++"])&&(ge=!0)),(this._flags.mode===T.BlockStatement&&!this._flags.inline_frame||this._flags.mode===T.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||te,this.print_token(P),this._output.space_before_token=ge},G.prototype.handle_block_comment=function(P,H){if(this._output.raw){this._output.add_raw_token(P),P.directives&&P.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(P.directives){this.print_newline(!1,H),this.print_token(P),P.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!i.newline.test(P.text)&&!P.newlines){this._output.space_before_token=!0,this.print_token(P),this._output.space_before_token=!0;return}else this.print_block_commment(P,H)},G.prototype.print_block_commment=function(P,H){var $=L(P.text),re,te=!1,ge=!1,ve=P.whitespace_before,de=ve.length;if(this.print_newline(!1,H),this.print_token_line_indentation(P),this._output.add_token($[0]),this.print_newline(!1,H),$.length>1){for($=$.slice(1),te=z($,"*"),ge=W($,ve),te&&(this._flags.alignment=1),re=0;re<$.length;re++)te?(this.print_token_line_indentation(P),this._output.add_token(w($[re]))):ge&&$[re]?(this.print_token_line_indentation(P),this._output.add_token($[re].substring(de))):(this._output.current_line.set_indent(-1),this._output.add_token($[re])),this.print_newline(!1,H);this._flags.alignment=0}},G.prototype.handle_comment=function(P,H){P.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(P),this.print_newline(!1,H)},G.prototype.handle_dot=function(P){this.start_of_statement(P)||this.handle_whitespace_and_comments(P,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),R(this._flags.last_token,O)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(P,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(P)},G.prototype.handle_unknown=function(P,H){this.print_token(P),P.text[P.text.length-1]===`
`&&this.print_newline(!1,H)},G.prototype.handle_eof=function(P){for(;this._flags.mode===T.Statement;)this.restore_mode();this.handle_whitespace_and_comments(P)},p.exports.Beautifier=G},function(p){function d(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}d.prototype.clone_empty=function(){var r=new d(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},d.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},d.prototype.has_match=function(r){for(var i=this.__items.length-1;i>=0;i--)if(this.__items[i].match(r))return!0;return!1},d.prototype.set_indent=function(r,i){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=i||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},d.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},d.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},d.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},d.prototype.is_empty=function(){return this.__items.length===0},d.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},d.prototype.push=function(r){this.__items.push(r);var i=r.lastIndexOf(`
`);i!==-1?this.__character_count=r.length-i:this.__character_count+=r.length},d.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},d.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},d.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},d.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},d.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function t(r,i){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),i=i||"",r.indent_level>0&&(i=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=i,this.__base_string_length=i.length}t.prototype.get_indent_size=function(r,i){var o=this.__base_string_length;return i=i||0,r<0&&(o=0),o+=r*this.__indent_size,o+=i,o},t.prototype.get_indent_string=function(r,i){var o=this.__base_string;return i=i||0,r<0&&(r=0,o=""),i+=r*this.__indent_size,this.__ensure_cache(i),o+=this.__cache[i],o},t.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var r=this.__cache.length,i=0,o="";this.__indent_size&&r>=this.__indent_size&&(i=Math.floor(r/this.__indent_size),r-=i*this.__indent_size,o=new Array(i+1).join(this.__indent_string)),r&&(o+=new Array(r+1).join(" ")),this.__cache.push(o)};function l(r,i){this.__indent_cache=new t(r,i),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new d(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}l.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},l.prototype.get_line_number=function(){return this.__lines.length},l.prototype.get_indent_string=function(r,i){return this.__indent_cache.get_indent_string(r,i)},l.prototype.get_indent_size=function(r,i){return this.__indent_cache.get_indent_size(r,i)},l.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},l.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},l.prototype.get_code=function(r){this.trim(!0);var i=this.current_line.pop();i&&(i[i.length-1]===`
`&&(i=i.replace(/\n+$/g,"")),this.current_line.push(i)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(`
`);return r!==`
`&&(o=o.replace(/[\n]/g,r)),o},l.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},l.prototype.set_indent=function(r,i){return r=r||0,i=i||0,this.next_line.set_indent(r,i),this.__lines.length>1?(this.current_line.set_indent(r,i),!0):(this.current_line.set_indent(),!1)},l.prototype.add_raw_token=function(r){for(var i=0;i1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},l.prototype.just_added_newline=function(){return this.current_line.is_empty()},l.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},l.prototype.ensure_empty_line_above=function(r,i){for(var o=this.__lines.length-2;o>=0;){var s=this.__lines[o];if(s.is_empty())break;if(s.item(0).indexOf(r)!==0&&s.item(-1)!==i){this.__lines.splice(o+1,0,new d(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},p.exports.Output=l},function(p){function d(t,l,r,i){this.type=t,this.text=l,this.comments_before=null,this.newlines=r||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}p.exports.Token=d},function(p,d){var t="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",l="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",i="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+t+r+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+l+r+i+"])*";d.identifier=new RegExp(o+s,"g"),d.identifierStart=new RegExp(o),d.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+l+r+i+"])+");var c=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;d.newline=/[\n\r\u2028\u2029]/,d.lineBreak=new RegExp(`\r
|`+d.newline.source),d.allLineBreaks=new RegExp(d.lineBreak.source,"g")},function(p,d,t){var l=t(6).Options,r=["before-newline","after-newline","preserve-newline"];function i(o){l.call(this,o,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var c=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),g=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";g=g.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),g="\\?\\.(?!\\d) "+g,g=g.replace(/ /g,"|");var x=new RegExp(g),E="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),T=E.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),M=new RegExp("^(?:"+T.join("|")+")$"),L,A=function(z,W){r.call(this,z,W),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new c(this._input),U=new a(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(s.identifier).matching(s.identifierMatch),number:G.matching(_),punct:G.matching(x),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(//),include:G.starting_with(/#include/).until_after(s.lineBreak),shebang:G.starting_with(/#!/).until_after(s.lineBreak),xml:G.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};A.prototype=new r,A.prototype._is_comment=function(z){return z.type===f.COMMENT||z.type===f.BLOCK_COMMENT||z.type===f.UNKNOWN},A.prototype._is_opening=function(z){return z.type===f.START_BLOCK||z.type===f.START_EXPR},A.prototype._is_closing=function(z,W){return(z.type===f.END_BLOCK||z.type===f.END_EXPR)&&W&&(z.text==="]"&&W.text==="["||z.text===")"&&W.text==="("||z.text==="}"&&W.text==="{")},A.prototype._reset=function(){L=!1},A.prototype._get_next_token=function(z,W){var G=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(f.EOF,""):(G=G||this._read_non_javascript(U),G=G||this._read_string(U),G=G||this._read_word(z),G=G||this._read_singles(U),G=G||this._read_comment(U),G=G||this._read_regexp(U,z),G=G||this._read_xml(U,z),G=G||this._read_punctuation(),G=G||this._create_token(f.UNKNOWN,this._input.next()),G)},A.prototype._read_word=function(z){var W;if(W=this.__patterns.identifier.read(),W!=="")return W=W.replace(s.allLineBreaks,`
`),!(z.type===f.DOT||z.type===f.RESERVED&&(z.text==="set"||z.text==="get"))&&M.test(W)?(W==="in"||W==="of")&&(z.type===f.WORD||z.type===f.STRING)?this._create_token(f.OPERATOR,W):this._create_token(f.RESERVED,W):this._create_token(f.WORD,W);if(W=this.__patterns.number.read(),W!=="")return this._create_token(f.WORD,W)},A.prototype._read_singles=function(z){var W=null;return z==="("||z==="["?W=this._create_token(f.START_EXPR,z):z===")"||z==="]"?W=this._create_token(f.END_EXPR,z):z==="{"?W=this._create_token(f.START_BLOCK,z):z==="}"?W=this._create_token(f.END_BLOCK,z):z===";"?W=this._create_token(f.SEMICOLON,z):z==="."&&R.test(this._input.peek(1))?W=this._create_token(f.DOT,z):z===","&&(W=this._create_token(f.COMMA,z)),W&&this._input.next(),W},A.prototype._read_punctuation=function(){var z=this.__patterns.punct.read();if(z!=="")return z==="="?this._create_token(f.EQUALS,z):z==="?."?this._create_token(f.DOT,z):this._create_token(f.OPERATOR,z)},A.prototype._read_non_javascript=function(z){var W="";if(z==="#"){if(this._is_first_token()&&(W=this.__patterns.shebang.read(),W))return this._create_token(f.UNKNOWN,W.trim()+`
`);if(W=this.__patterns.include.read(),W)return this._create_token(f.UNKNOWN,W.trim()+`
`);z=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(h)){do z=this._input.next(),G+=z;while(this._input.hasNext()&&z!=="#"&&z!=="=");return z==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(f.WORD,G)}this._input.back()}else if(z==="<"&&this._is_first_token()){if(W=this.__patterns.html_comment_start.read(),W){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)W+=this._input.next();return L=!0,this._create_token(f.COMMENT,W)}}else if(L&&z==="-"&&(W=this.__patterns.html_comment_end.read(),W))return L=!1,this._create_token(f.COMMENT,W);return null},A.prototype._read_comment=function(z){var W=null;if(z==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var U=w.get_directives(G);U&&U.ignore==="start"&&(G+=w.readIgnored(this._input)),G=G.replace(s.allLineBreaks,`
`),W=this._create_token(f.BLOCK_COMMENT,G),W.directives=U}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),W=this._create_token(f.COMMENT,G))}return W},A.prototype._read_string=function(z){if(z==="`"||z==="'"||z==='"'){var W=this._input.next();return this.has_char_escapes=!1,z==="`"?W+=this._read_string_recursive("`",!0,"${"):W+=this._read_string_recursive(z),this.has_char_escapes&&this._options.unescape_strings&&(W=V(W)),this._input.peek()===z&&(W+=this._input.next()),W=W.replace(s.allLineBreaks,`
`),this._create_token(f.STRING,W)}return null},A.prototype._allow_regexp_or_xml=function(z){return z.type===f.RESERVED&&u(z.text,["return","case","throw","else","do","typeof","yield"])||z.type===f.END_EXPR&&z.text===")"&&z.opened.previous.type===f.RESERVED&&u(z.opened.previous.text,["if","while","for"])||u(z.type,[f.COMMENT,f.START_EXPR,f.START_BLOCK,f.START,f.END_BLOCK,f.OPERATOR,f.EQUALS,f.EOF,f.SEMICOLON,f.COMMA])},A.prototype._read_regexp=function(z,W){if(z==="/"&&this._allow_regexp_or_xml(W)){for(var G=this._input.next(),U=!1,P=!1;this._input.hasNext()&&(U||P||this._input.peek()!==z)&&!this._input.testChar(s.newline);)G+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?P=!0:this._input.peek()==="]"&&(P=!1)),this._input.next();return this._input.peek()===z&&(G+=this._input.next(),G+=this._input.read(s.identifier)),this._create_token(f.STRING,G)}return null},A.prototype._read_xml=function(z,W){if(this._options.e4x&&z==="<"&&this._allow_regexp_or_xml(W)){var G="",U=this.__patterns.xml.read_match();if(U){for(var P=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=P.indexOf("{")===0,$=0;U;){var re=!!U[1],te=U[2],ge=!!U[U.length-1]||te.slice(0,8)==="![CDATA[";if(!ge&&(te===P||H&&te.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--$:++$),G+=U[0],$<=0)break;U=this.__patterns.xml.read_match()}return U||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(s.allLineBreaks,`
`),this._create_token(f.STRING,G)}}return null};function V(z){for(var W="",G=0,U=new l(z),P=null;U.hasNext();)if(P=U.match(/([\s]|[^\\]|\\\\)+/g),P&&(W+=P[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")P=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")P=U.match(/u([0-9A-Fa-f]{4})/g);else{W+="\\",U.hasNext()&&(W+=U.next());continue}if(!P)return z;if(G=parseInt(P[1],16),G>126&&G<=255&&P[0].indexOf("x")===0)return z;if(G>=0&&G<32){W+="\\"+P[0];continue}else G===34||G===39||G===92?W+="\\"+String.fromCharCode(G):W+=String.fromCharCode(G)}return W}A.prototype._read_string_recursive=function(z,W,G){var U,P;z==="'"?P=this.__patterns.single_quote:z==='"'?P=this.__patterns.double_quote:z==="`"?P=this.__patterns.template_text:z==="}"&&(P=this.__patterns.template_expression);for(var H=P.read(),$="";this._input.hasNext();){if($=this._input.next(),$===z||!W&&s.newline.test($)){this._input.back();break}else $==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),$+=this._input.next()):G&&(G==="${"&&$==="$"&&this._input.peek()==="{"&&($+=this._input.next()),G===$&&(z==="`"?$+=this._read_string_recursive("}",W,"`"):$+=this._read_string_recursive("`",W,"${"),this._input.hasNext()&&($+=this._input.next())));$+=P.read(),H+=$}return H},p.exports.Tokenizer=A,p.exports.TOKEN=f,p.exports.positionable_operators=O.slice(),p.exports.line_starters=E.slice()},function(p){var d=RegExp.prototype.hasOwnProperty("sticky");function t(l){this.__input=l||"",this.__input_length=this.__input.length,this.__position=0}t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position=0&&l=0&&r=l.length&&this.__input.substring(r-l.length,r).toLowerCase()===l},p.exports.InputScanner=t},function(p,d,t){var l=t(8).InputScanner,r=t(3).Token,i=t(10).TokenStream,o=t(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(a,u){this._input=new l(a),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new o(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new i,this._reset();for(var a,u=new r(s.START,""),f=null,w=[],_=new i;u.type!==s.EOF;){for(a=this._get_next_token(u,f);this._is_comment(a);)_.add(a),a=this._get_next_token(u,f);_.isEmpty()||(a.comments_before=_,_=new i),a.parent=f,this._is_opening(a)?(w.push(f),f=a):f&&this._is_closing(a,f)&&(a.opened=f,f.closed=a,f=w.pop(),a.parent=f),a.previous=u,u.next=a,this.__tokens.add(a),u=a}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(a,u){this._readWhitespace();var f=this._input.read(/.+/g);return f?this._create_token(s.RAW,f):this._create_token(s.EOF,"")},c.prototype._is_comment=function(a){return!1},c.prototype._is_opening=function(a){return!1},c.prototype._is_closing=function(a,u){return!1},c.prototype._create_token=function(a,u){var f=new r(a,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return f},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},p.exports.Tokenizer=c,p.exports.TOKEN=s},function(p){function d(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}d.prototype.restart=function(){this.__position=0},d.prototype.isEmpty=function(){return this.__tokens_length===0},d.prototype.hasNext=function(){return this.__position=0&&t/),erb:c.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:c.starting_with(/{%/).until_after(/%}/),django_value:c.starting_with(/{{/).until_after(/}}/),django_comment:c.starting_with(/{#/).until_after(/#}/),smarty:c.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:c.starting_with(/{\*/).until_after(/\*}/),smarty_literal:c.starting_with(/{literal}/).until_after(/{\/literal}/)}}i.prototype=new l,i.prototype._create=function(){return new i(this._input,this)},i.prototype._update=function(){this.__set_templated_pattern()},i.prototype.disable=function(o){var s=this._create();return s._disabled[o]=!0,s._update(),s},i.prototype.read_options=function(o){var s=this._create();for(var c in r)s._disabled[c]=o.templating.indexOf(c)===-1;return s._update(),s},i.prototype.exclude=function(o){var s=this._create();return s._excluded[o]=!0,s._update(),s},i.prototype.read=function(){var o="";this._match_pattern?o=this._input.read(this._starting_pattern):o=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),o+=s,s=this._read_template();return this._until_after&&(o+=this._input.readUntilAfter(this._until_pattern)),o},i.prototype.__set_templated_pattern=function(){var o=[];this._disabled.php||o.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||o.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||o.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(o.push(this.__patterns.django._starting_pattern.source),o.push(this.__patterns.django_value._starting_pattern.source),o.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||o.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&o.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+o.join("|")+")")},i.prototype._read_template=function(){var o="",s=this._input.peek();if(s==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(o=o||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(o=o||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(o=o||this.__patterns.handlebars_comment.read(),o=o||this.__patterns.handlebars_unescaped.read(),o=o||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(o=o||this.__patterns.django_value.read()),this._excluded.django||(o=o||this.__patterns.django_comment.read(),o=o||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(o=o||this.__patterns.smarty_comment.read(),o=o||this.__patterns.smarty_literal.read(),o=o||this.__patterns.smarty.read()));return o},p.exports.TemplatablePattern=i}],m={};function S(p){var d=m[p];if(d!==void 0)return d.exports;var t=m[p]={exports:{}};return y[p](t,t.exports,S),t.exports}var b=S(0);C=b})();var k=C;!(N=[],v=function(){return{js_beautify:k}}.apply(Q,N),v!==void 0&&(F.exports=v))})()},"6eGT":function(F,Q,j){"use strict";function N(v){return null}Q.a=N},"7Cbv":function(F,Q,j){"use strict";var N=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),v=new Uint8Array(16);function C(){if(!N)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return N(v)}var k=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function y(r){return typeof r=="string"&&k.test(r)}for(var m=y,S=[],b=0;b<256;++b)S.push((b+256).toString(16).substr(1));function p(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=(S[r[i+0]]+S[r[i+1]]+S[r[i+2]]+S[r[i+3]]+"-"+S[r[i+4]]+S[r[i+5]]+"-"+S[r[i+6]]+S[r[i+7]]+"-"+S[r[i+8]]+S[r[i+9]]+"-"+S[r[i+10]]+S[r[i+11]]+S[r[i+12]]+S[r[i+13]]+S[r[i+14]]+S[r[i+15]]).toLowerCase();if(!m(o))throw TypeError("Stringified UUID is invalid");return o}var d=p;function t(r,i,o){r=r||{};var s=r.random||(r.rng||C)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,i){o=o||0;for(var c=0;c<16;++c)i[o+c]=s[c];return i}return d(s)}var l=Q.a=t},"7ahc":function(F,Q,j){"use strict";j.d(Q,"a",function(){return w});var N=j("k1fw"),v=j("0Owb"),C=j("+L6B"),k=j("2/Rp"),y=j("y8nQ"),m=j("Vl3Y"),S=j("tJVT"),b=j("OaEy"),p=j("2fM7"),d=j("cDcd"),t=j.n(d),l=j("VrN/"),r=j.n(l),i=j("p77/"),o=j.n(i),s=j("c5Ni"),c=j.n(s),a=p.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},f={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"]};Q.b=function(_){var h=_.callback,R=_.onCancel,O=Object(d.useState)("python"),g=Object(S.a)(O,2),x=g[0],E=g[1];function T(L){E(f[L][1])}function M(L){h(L)}return t.a.createElement(m.a,Object(v.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:M}),t.a.createElement(m.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},t.a.createElement(p.a,{onChange:T},Object.keys(f).map(function(L){return t.a.createElement(a,{key:L,value:L},f[L][0])}))),t.a.createElement(m.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},t.a.createElement(w,{mode:x})),t.a.createElement("div",{className:"flex-container flex-end"},t.a.createElement(k.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),t.a.createElement(k.a,{type:"ghost",onClick:R},"\u53D6\u6D88")))};function w(_){var h=_.value,R=_.onChange,O=_.mode,g=_.options,x=g===void 0?{}:g,E=Object(d.useRef)(),T=Object(d.useState)(),M=Object(S.a)(T,2),L=M[0],A=M[1];return Object(d.useEffect)(function(){if(L){function V(z){var W=z.getValue();R&&R(W)}return L.on("change",V),function(){L.off("change",V)}}},[L,R]),Object(d.useEffect)(function(){L&&L.setOption("mode",O)},[L,O]),Object(d.useEffect)(function(){L&&((h!==L.getValue()||h==="")&&setTimeout(function(){L.setValue(h||" ")},300))},[L,h]),Object(d.useEffect)(function(){if(E.current&&!L){var V=r.a.fromTextArea(E.current,Object(N.a)({mode:O,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},x));A(V)}},[E.current,L]),t.a.createElement("div",{className:"my-codemirror-container"},t.a.createElement("textarea",{ref:E}))}},"815F":function(F,Q,j){"use strict";j.d(Q,"e",function(){return S}),j.d(Q,"c",function(){return p}),j.d(Q,"d",function(){return d}),j.d(Q,"a",function(){return l}),j.d(Q,"f",function(){return r}),j.d(Q,"b",function(){return i});var N=j("KQm4"),v=j("VTBJ"),C=j("Ff2n"),k=j("Zm9Q"),y=j("Kwbf"),m=j("OZM5");function S(o,s){return o!=null?o:s}function b(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function c(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(f){var w=f.key,_=f.children;Object(y.a)(w!=null,"Tree node must have a certain key: [".concat(u).concat(w,"]"));var h=String(w);Object(y.a)(!s.has(h)||w===null||w===void 0,"Same 'key' exist in the Tree: ".concat(h)),s.set(h,!0),c(_,"".concat(u).concat(h," > "))})}c(o)}function p(o){function s(c){var a=Object(k.a)(c);return a.map(function(u){if(!Object(m.i)(u))return Object(y.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var f=u.key,w=u.props,_=w.children,h=Object(C.a)(w,["children"]),R=Object(v.a)({key:f},h),O=s(_);return O.length&&(R.children=O),R}).filter(function(u){return u})}return s(o)}function d(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],c=new Set(s===!0?[]:s),a=[];function u(f){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return f.map(function(_,h){var R=Object(m.h)(w?w.pos:"0",h),O=S(_.key,R),g=Object(v.a)(Object(v.a)({},_),{},{parent:w,pos:R,children:null,data:_,isStart:[].concat(Object(N.a)(w?w.isStart:[]),[h===0]),isEnd:[].concat(Object(N.a)(w?w.isEnd:[]),[h===f.length-1])});return a.push(g),s===!0||c.has(O)?g.children=u(_.children||[],g):g.children=[],g})}return u(o),a}function t(o,s,c){var a;c?typeof c=="string"?a=function(w){return w[c]}:typeof c=="function"&&(a=function(w){return c(w)}):a=function(w,_){return S(w.key,_)};function u(f,w,_){var h=f?f.children:o,R=f?Object(m.h)(_.pos,w):"0";if(f){var O=a(f,R),g={node:f,index:w,pos:R,key:O,parentPos:_.node?_.pos:null,level:_.level+1};s(g)}h&&h.forEach(function(x,E){u(x,E,{node:f,pos:R,level:_?_.level+1:-1})})}u(null)}function l(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=s.initWrapper,a=s.processEntity,u=s.onProcessFinished,f=arguments.length>2?arguments[2]:void 0,w={},_={},h={posEntities:w,keyEntities:_};return c&&(h=c(h)||h),t(o,function(R){var O=R.node,g=R.index,x=R.pos,E=R.key,T=R.parentPos,M=R.level,L={node:O,index:g,key:E,pos:x,level:M},A=S(E,x);w[x]=L,_[A]=L,L.parent=w[T],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),a&&a(L,h)},f),u&&u(h),h}function r(o,s){var c=s.expandedKeys,a=s.selectedKeys,u=s.loadedKeys,f=s.loadingKeys,w=s.checkedKeys,_=s.halfCheckedKeys,h=s.dragOverNodeKey,R=s.dropPosition,O=s.keyEntities,g=O[o],x={eventKey:o,expanded:c.indexOf(o)!==-1,selected:a.indexOf(o)!==-1,loaded:u.indexOf(o)!==-1,loading:f.indexOf(o)!==-1,checked:w.indexOf(o)!==-1,halfChecked:_.indexOf(o)!==-1,pos:String(g?g.pos:""),dragOver:h===o&&R===0,dragOverGapTop:h===o&&R===-1,dragOverGapBottom:h===o&&R===1};return x}function i(o){var s=o.data,c=o.expanded,a=o.selected,u=o.checked,f=o.loaded,w=o.loading,_=o.halfChecked,h=o.dragOver,R=o.dragOverGapTop,O=o.dragOverGapBottom,g=o.pos,x=o.active,E=Object(v.a)(Object(v.a)({},s),{},{expanded:c,selected:a,checked:u,loaded:f,loading:w,halfChecked:_,dragOver:h,dragOverGapTop:R,dragOverGapBottom:O,pos:g,active:x});return"props"in E||Object.defineProperty(E,"props",{get:function(){return Object(y.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),o}}),E}},"8EBN":function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){"use strict";N.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 v=0;v-1&&k.substring(S+1,k.length);if(b)return N.findModeByExtension(b)},N.findModeByName=function(k){k=k.toLowerCase();for(var y=0;y=ee.length?me.slice(ee.length):me}).join(`
`)}var c=[],a=[""],u=new i.a.Renderer,f=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function w(){c.length=0,a=[""]}var _={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function h(le,K,X,ee){if(K>=le.length||le[K].level<=X)return K;var me=le[K];ee.push("- "+me.text+""),K++;var ae=[];return K=h(le,K,me.level,ae),ae.length>0&&(ee.push("
"),ae.forEach(function(Ke){ee.push(Ke)}),ee.push("
")),ee.push(" "),K=h(le,K,X,ee),K}function R(){return h(c,0,0,a),a.push("
"),a.join("")}var O={heading:function(K){var X=f.exec(K);if(X)return{type:"heading",raw:X[0],depth:X[1].length,text:X[2]}},fences:function(K){var X=this.rules.block.fences.exec(K);if(X){var ee=X[0],me=s(ee,X[3]||""),ae=X[2]?X[2].trim():X[2];if(["latex","katex","math"].indexOf(ae)>=0){var Ke=E(),pt=me;me=Ke,T[Ke]={type:"block",expression:pt}}return{type:"code",raw:ee,lang:ae,text:me}}}},g=/(?:\${2})([^\n`]+?)(?:\${2})/gi,x=0,E=function(){return"__special_katext_id_".concat(x++,"__")},T={};function M(){return T}function L(){x=0,T={}}function A(le){return le=le.replace(g,function(K,X){var ee=E();return T[ee]={type:"inline",expression:X},ee}),le}var V=u.listitem;u.listitem=function(le){return V(A(le))};var z=u.paragraph;u.paragraph=function(le){return z(A(le))};var W=u.tablecell;u.tablecell=function(le,K){return W(A(le),K)},u.code=function(le,K,X){var ee=(K||"").match(/\S*/)[0];return ee?["latex","katex","math"].indexOf(ee)>=0?"".concat(le,"
"):'
').concat(X?le:Object(o.escape)(le,!0),`
`):''+(X?le:Object(o.escape)(le,!0))+"
"},u.heading=function(le,K,X){var ee=this.options.headerPrefix+X.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return c.push({anchor:ee,level:K,text:le}),"'+le+""},i.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),i.a.use({tokenizer:O,renderer:u});var G=i.a,U=j("SJMd"),P=j("ulZh"),H=j.n(P),$=j("m3rI"),re=j("Oy/b"),te=j("p5ED"),ge=j("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 ve=function(le,K){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ee){X.__proto__=ee}||function(X,ee){for(var me in ee)Object.prototype.hasOwnProperty.call(ee,me)&&(X[me]=ee[me])})(le,K)};function de(le,K){function X(){this.constructor=le}ve(le,K),le.prototype=K===null?Object.create(K):(X.prototype=K.prototype,new X)}function De(le,K,X,ee){return new(X||(X=Promise))(function(me,ae){function Ke(Ht){try{Ot(ee.next(Ht))}catch(vt){ae(vt)}}function pt(Ht){try{Ot(ee.throw(Ht))}catch(vt){ae(vt)}}function Ot(Ht){var vt;Ht.done?me(Ht.value):(vt=Ht.value,vt instanceof X?vt:new X(function(Xt){Xt(vt)})).then(Ke,pt)}Ot((ee=ee.apply(le,K||[])).next())})}function Te(le,K){var X,ee,me,ae,Ke={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return ae={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(ae[Symbol.iterator]=function(){return this}),ae;function pt(Ot){return function(Ht){return function(vt){if(X)throw new TypeError("Generator is already executing.");for(;Ke;)try{if(X=1,ee&&(me=2&vt[0]?ee.return:vt[0]?ee.throw||((me=ee.return)&&me.call(ee),0):ee.next)&&!(me=me.call(ee,vt[1])).done)return me;switch(ee=0,me&&(vt=[2&vt[0],me.value]),vt[0]){case 0:case 1:me=vt;break;case 4:return Ke.label++,{value:vt[1],done:!1};case 5:Ke.label++,ee=vt[1],vt=[0];continue;case 7:vt=Ke.ops.pop(),Ke.trys.pop();continue;default:if(!(me=Ke.trys,(me=me.length>0&&me[me.length-1])||vt[0]!==6&&vt[0]!==2)){Ke=0;continue}if(vt[0]===3&&(!me||vt[1]>me[0]&&vt[1]',"select"),this.addActionButton(ee,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(ee,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(ee,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(ee,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(ee,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(ee,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(ee,'',"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(ae){var Ke=document.createElement("div");Ke.className=""+X.toolbarButtonStyleClass.name,Ke.setAttribute("data-type-name",ae.typeName),Ke.innerHTML=ae.icon,Ke.addEventListener("click",function(){X.markerToolbarButtonClicked(Ke,ae)}),X.buttons.push(Ke),X.markerButtons.push(Ke)}),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 me=document.createElement("div");me.className=this.toolbarBlockStyleClass.name,me.style.whiteSpace="nowrap",me.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(me),this.addActionButton(me,'',"render"),this.addActionButton(me,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},le.prototype.addButtonClickListener=function(K){this.buttonClickListeners.push(K)},le.prototype.removeButtonClickListener=function(K){this.buttonClickListeners.indexOf(K)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(K),1)},le.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},le.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var K=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var X=0;X0&&this.buttonClickListeners.forEach(function(ee){return ee("marker",X)}),this.markerButtonOverflowBlock.style.display="none"},le.prototype.actionToolbarButtonClicked=function(K,X){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(ee){return ee("action",X)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},le.prototype.setActiveButton=function(K){this.resetButtonStyles(),K.className=K.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),K.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},le.prototype.setActiveMarkerButton=function(K){var X=this.markerButtons.find(function(ee){return ee.getAttribute("data-type-name")===K});X&&this.setActiveButton(X)},le.prototype.setCurrentMarker=function(K){var X=this;this.currentMarker=K,this.buttons.filter(function(ee){return/delete|notes/.test(ee.getAttribute("data-action"))}).forEach(function(ee){X.currentMarker===void 0?(ee.style.fillOpacity="0.4",ee.style.pointerEvents="none"):(ee.style.fillOpacity="1",ee.style.pointerEvents="all")})},le}(),Y=function(){function le(K,X,ee,me){this.panels=[],this.panelButtons=[],this.markerjsContainer=K,this.displayMode=X,this.uiStyleSettings=ee,this.styles=me,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return le.prototype.addStyles=function(){var K;this.toolboxStyleClass=this.styles.addClass(new oe("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 oe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var X=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new oe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new oe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new oe("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 oe("toolbox-panel-row_colors",`
background-color: `+((K=this.uiStyleSettings.toolboxBackgroundColor)!==null&&K!==void 0?K:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new oe("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*X)+`px;
padding: `+X+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new oe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Oe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},le.prototype.show=function(K){var X;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=K,this.uiContainer.className=this.toolboxStyleClass.name+" "+((X=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},le.prototype.setPanelButtons=function(K){var X,ee,me=this;this.panels=K,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((ee=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&ee!==void 0?ee:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(ae){var Ke;ae.uiStyleSettings=me.uiStyleSettings;var pt=document.createElement("div");pt.className=me.toolboxButtonStyleClass.name+" "+((Ke=me.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ke!==void 0?Ke:me.toolboxButtonStyleColorsClass.name),pt.innerHTML=ae.icon,pt.title=ae.title,pt.addEventListener("click",function(){me.panelButtonClick(ae)}),me.panelButtons.push(pt),me.buttonRow.appendChild(pt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},le.prototype.panelButtonClick=function(K){var X=this,ee=-1;if(K!==this.activePanel){ee=this.panels.indexOf(K),this.panelRow.innerHTML="";var me=K.getUi();me.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(me),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=K}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){X.displayMode==="inline"?X.panelRow.style.display="none":X.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(ae,Ke){var pt,Ot;ae.className=X.toolboxButtonStyleClass.name+" "+(Ke===ee?""+((pt=X.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&pt!==void 0?pt:X.toolboxActiveButtonStyleColorsClass.name):""+((Ot=X.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ot!==void 0?Ot:X.toolboxButtonStyleColorsClass.name))})},le}(),Z=function(le,K){this.title=le,this.icon=K},ye=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'')||this;return Ke.colors=[],Ke.addTransparent=!1,Ke.colorBoxes=[],Ke.colors=ee,Ke.currentColor=me,Ke.setCurrentColor=Ke.setCurrentColor.bind(Ke),Ke.getColorBox=Ke.getColorBox.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.whiteSpace="nowrap",this.colors.forEach(function(me){var ae=X.getColorBox(me);ee.appendChild(ae),X.colorBoxes.push(ae)}),ee},K.prototype.getColorBox=function(X){var ee=this,me=this.uiStyleSettings.toolbarHeight/4,ae=this.uiStyleSettings.toolbarHeight-me,Ke=document.createElement("div");Ke.style.display="inline-block",Ke.style.boxSizing="content-box",Ke.style.width=ae-2+"px",Ke.style.height=ae-2+"px",Ke.style.padding="1px",Ke.style.marginRight="2px",Ke.style.marginBottom="2px",Ke.style.borderWidth="2px",Ke.style.borderStyle="solid",Ke.style.borderRadius=(ae+2)/2+"px",Ke.style.borderColor=X===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ke.addEventListener("click",function(){ee.setCurrentColor(X,Ke)});var pt=document.createElement("div");return pt.style.display="inline-block",pt.style.width=ae-2+"px",pt.style.height=ae-2+"px",pt.style.backgroundColor=X,pt.style.borderRadius=ae/2+"px",X==="transparent"&&(pt.style.fill=this.uiStyleSettings.toolboxAccentColor,pt.innerHTML=``),Ke.appendChild(pt),Ke},K.prototype.setCurrentColor=function(X,ee){var me=this;this.currentColor=X,this.colorBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(X)},K}(Z),be=function(){function le(K,X,ee){this._state="new",this._isSelected=!1,this._container=K,this._overlayContainer=X,this.globalSettings=ee,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(le.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),le.prototype.ownsTarget=function(K){return!1},Object.defineProperty(le.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),le.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},le.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},le.prototype.pointerDown=function(K,X){},le.prototype.dblClick=function(K,X){},le.prototype.manipulate=function(K){},le.prototype.pointerUp=function(K){this.stateChanged()},le.prototype.dispose=function(){},le.prototype.addMarkerVisualToContainer=function(K){this.container.childNodes.length>0?this.container.insertBefore(K,this.container.childNodes[0]):this.container.appendChild(K)},le.prototype.getState=function(){return{typeName:le.typeName,state:this.state,notes:this.notes}},le.prototype.restoreState=function(K){this._state=K.state,this.notes=K.notes},le.prototype.scale=function(K,X){},le.prototype.colorChanged=function(K){this.onColorChanged&&this.onColorChanged(K),this.stateChanged()},le.prototype.fillColorChanged=function(K){this.onFillColorChanged&&this.onFillColorChanged(K),this.stateChanged()},le.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var K=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),K.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(K)&&this.onStateChanged(this)}},le.typeName="MarkerBase",le}(),Re=function(){function le(){this.findGripByVisual=this.findGripByVisual.bind(this)}return le.prototype.findGripByVisual=function(K){return this.topLeft.ownsTarget(K)?this.topLeft:this.topCenter.ownsTarget(K)?this.topCenter:this.topRight.ownsTarget(K)?this.topRight:this.centerLeft.ownsTarget(K)?this.centerLeft:this.centerRight.ownsTarget(K)?this.centerRight:this.bottomLeft.ownsTarget(K)?this.bottomLeft:this.bottomCenter.ownsTarget(K)?this.bottomCenter:this.bottomRight.ownsTarget(K)?this.bottomRight:void 0},le}(),Qe=function(){function le(){this.GRIP_SIZE=10,this.visual=ue.createGroup(),this.visual.appendChild(ue.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ue.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return le.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},le}(),rt=function(){function le(){}return le.toITransformMatrix=function(K){return{a:K.a,b:K.b,c:K.c,d:K.d,e:K.e,f:K.f}},le.toSVGMatrix=function(K,X){return K.a=X.a,K.b=X.b,K.c=X.c,K.d=X.d,K.e=X.e,K.f=X.f,K},le}(),at=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.left=0,ae.top=0,ae.width=0,ae.height=0,ae.defaultSize={x:50,y:20},ae.offsetX=0,ae.offsetY=0,ae.rotationAngle=0,ae.CB_DISTANCE=10,ae._suppressMarkerCreateEvent=!1,ae.container.transform.baseVal.appendItem(ue.createTransform()),ae.setupControlBox(),ae}return de(K,le),Object.defineProperty(K.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(K.prototype,"visual",{get:function(){return this._visual},set:function(X){this._visual=X;var ee=ue.createTransform();this._visual.transform.baseVal.appendItem(ee)},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(X){return!!le.prototype.ownsTarget.call(this,X)||!!(this.controlGrips.findGripByVisual(X)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X))},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="new"&&(this.left=X.x,this.top=X.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var me=this.unrotatePoint(X);if(this.manipulationStartX=me.x,this.manipulationStartY=me.y,this.offsetX=me.x-this.left,this.offsetY=me.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(ee),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(ee)){this.activeGrip=this.rotatorGrip;var ae=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=ae.x-this.width/2,this.top=ae.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ke=this.container.transform.baseVal.getItem(0);Ke.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ke,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},K.prototype.pointerUp=function(X){var ee=this.state;le.prototype.pointerUp.call(this,X),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(X),this._state="select",ee==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},K.prototype.moveVisual=function(X){this.visual.style.transform="translate("+X.x+"px, "+X.y+"px)"},K.prototype.manipulate=function(X){var ee=this.unrotatePoint(X);this.state==="creating"?this.resize(X):this.state==="move"?(this.left=this.manipulationStartLeft+(ee.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(ee.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(ee):this.state==="rotate"&&this.rotate(X)},K.prototype.resize=function(X){var ee=this.manipulationStartLeft,me=this.manipulationStartWidth,ae=this.manipulationStartTop,Ke=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:ee=this.manipulationStartLeft+X.x-this.manipulationStartX,me=this.manipulationStartWidth+this.manipulationStartLeft-ee;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:me=this.manipulationStartWidth+X.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:ae=this.manipulationStartTop+X.y-this.manipulationStartY,Ke=this.manipulationStartHeight+this.manipulationStartTop-ae;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ke=this.manipulationStartHeight+X.y-this.manipulationStartY}me>=0?(this.left=ee,this.width=me):(this.left=ee+me,this.width=-me),Ke>=0?(this.top=ae,this.height=Ke):(this.top=ae+Ke,this.height=-Ke),this.setSize()},K.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},K.prototype.rotate=function(X){if(Math.abs(X.x-this.centerX)>.1){var ee=Math.sign(X.x-this.centerX);this.rotationAngle=180*Math.atan((X.y-this.centerY)/(X.x-this.centerX))/Math.PI+90*ee,this.applyRotation()}},K.prototype.applyRotation=function(){var X=this.container.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(X,0)},K.prototype.rotatePoint=function(X){if(this.rotationAngle===0)return X;var ee=this.container.getCTM(),me=ue.createPoint(X.x,X.y);return{x:(me=me.matrixTransform(ee)).x,y:me.y}},K.prototype.unrotatePoint=function(X){if(this.rotationAngle===0)return X;var ee=this.container.getCTM();ee=ee.inverse();var me=ue.createPoint(X.x,X.y);return{x:(me=me.matrixTransform(ee)).x,y:me.y}},K.prototype.select=function(){le.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},K.prototype.deselect=function(){le.prototype.deselect.call(this),this.controlBox.style.display="none"},K.prototype.setupControlBox=function(){this.controlBox=ue.createGroup();var X=ue.createTransform();X.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(X),this.container.appendChild(this.controlBox),this.controlRect=ue.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=ue.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 Re,this.addControlGrips(),this.controlBox.style.display="none"},K.prototype.adjustControlBox=function(){var X=this.controlBox.transform.baseVal.getItem(0);X.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(X,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()},K.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()},K.prototype.createGrip=function(){var X=new Qe;return X.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(X.visual),X},K.prototype.positionGrips=function(){var X=this.controlGrips.topLeft.GRIP_SIZE,ee=-X/2,me=ee,ae=(this.width+this.CB_DISTANCE)/2-X/2,Ke=(this.height+this.CB_DISTANCE)/2-X/2,pt=this.height+this.CB_DISTANCE-X/2,Ot=this.width+this.CB_DISTANCE-X/2;this.positionGrip(this.controlGrips.topLeft.visual,ee,me),this.positionGrip(this.controlGrips.topCenter.visual,ae,me),this.positionGrip(this.controlGrips.topRight.visual,Ot,me),this.positionGrip(this.controlGrips.centerLeft.visual,ee,Ke),this.positionGrip(this.controlGrips.centerRight.visual,Ot,Ke),this.positionGrip(this.controlGrips.bottomLeft.visual,ee,pt),this.positionGrip(this.controlGrips.bottomCenter.visual,ae,pt),this.positionGrip(this.controlGrips.bottomRight.visual,Ot,pt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,ae,me-3*this.CB_DISTANCE)},K.prototype.positionGrip=function(X,ee,me){var ae=X.transform.baseVal.getItem(0);ae.setTranslate(ee,me),X.transform.baseVal.replaceItem(ae,0)},K.prototype.hideControlBox=function(){this.controlBox.style.display="none"},K.prototype.showControlBox=function(){this.controlBox.style.display=""},K.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:rt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:rt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},le.prototype.getState.call(this))},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.left=ee.left,this.top=ee.top,this.width=ee.width,this.height=ee.height,this.rotationAngle=ee.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,ee.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,ee.containerTransformMatrix))},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee);var me=this.rotatePoint({x:this.left,y:this.top}),ae=this.unrotatePoint({x:me.x*X,y:me.y*ee});this.left=ae.x,this.top=ae.y,this.width=this.width*X,this.height=this.height*ee,this.adjustControlBox()},K}(be),qe=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.fillColor="transparent",ae.strokeColor="transparent",ae.strokeWidth=0,ae.strokeDasharray="",ae.opacity=1,ae.setStrokeColor=ae.setStrokeColor.bind(ae),ae.setFillColor=ae.setFillColor.bind(ae),ae.setStrokeWidth=ae.setStrokeWidth.bind(ae),ae.setStrokeDasharray=ae.setStrokeDasharray.bind(ae),ae.createVisual=ae.createVisual.bind(ae),ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual)},K.prototype.createVisual=function(){this.visual=ue.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)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},K.prototype.manipulate=function(X){le.prototype.manipulate.call(this,X)},K.prototype.resize=function(X){le.prototype.resize.call(this,X),this.setSize()},K.prototype.setSize=function(){le.prototype.setSize.call(this),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},K.prototype.pointerUp=function(X){le.prototype.pointerUp.call(this,X),this.setSize()},K.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},K.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},K.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},K.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},K.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},le.prototype.getState.call(this))},K.prototype.restoreState=function(X){var ee=X;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),le.prototype.restoreState.call(this,X),this.setSize()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.setSize()},K.title="Rectangle marker",K}(at),st=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'')||this;return Ke.widths=[],Ke.widthBoxes=[],Ke.widths=ee,Ke.currentWidth=me,Ke.setCurrentWidth=Ke.setCurrentWidth.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.widths.forEach(function(me){var ae=document.createElement("div");ae.style.display="flex",ae.style.flexGrow="2",ae.style.alignItems="center",ae.style.justifyContent="space-between",ae.style.padding="5px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.borderColor=me===X.currentWidth?X.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){X.setCurrentWidth(me,ae)}),ee.appendChild(ae);var Ke=document.createElement("div");Ke.innerText=me.toString(),Ke.style.marginRight="5px",ae.appendChild(Ke);var pt=document.createElement("div");pt.style.minHeight="20px",pt.style.flexGrow="2",pt.style.display="flex",pt.style.alignItems="center";var Ot=document.createElement("hr");Ot.style.minWidth="20px",Ot.style.border="0px",Ot.style.borderTop=me+"px solid "+X.uiStyleSettings.toolboxColor,Ot.style.flexGrow="2",pt.appendChild(Ot),ae.appendChild(pt),X.widthBoxes.push(ae)}),ee},K.prototype.setCurrentWidth=function(X,ee){var me=this;this.currentWidth=X,this.widthBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},K}(Z),lt=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'')||this;return Ke.styles=[],Ke.styleBoxes=[],Ke.styles=ee,Ke.currentStyle=me,Ke.setCurrentStyle=Ke.setCurrentStyle.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",this.styles.forEach(function(me){var ae=document.createElement("div");ae.style.display="flex",ae.style.alignItems="center",ae.style.justifyContent="space-between",ae.style.padding="5px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.overflow="hidden",ae.style.maxWidth=100/X.styles.length-5+"%",ae.style.borderColor=me===X.currentStyle?X.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){X.setCurrentStyle(me,ae)}),ee.appendChild(ae);var Ke=document.createElement("div");Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.overflow="hidden";var pt=``;Ke.innerHTML=pt,ae.appendChild(Ke),X.styleBoxes.push(ae)}),ee},K.prototype.setCurrentStyle=function(X,ee){var me=this;this.currentStyle=X,this.styleBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},K}(Z),je=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.strokeColor=me.defaultColor,ae.strokeWidth=me.defaultStrokeWidth,ae.strokeDasharray=me.defaultStrokeDasharray,ae.strokePanel=new ye("Line color",me.defaultColorSet,me.defaultColor),ae.strokePanel.onColorChanged=ae.setStrokeColor,ae.strokeWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.strokeWidthPanel.onWidthChanged=ae.setStrokeWidth,ae.strokeStylePanel=new lt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ae.strokeStylePanel.onStyleChanged=ae.setStrokeDasharray,ae}return de(K,le),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.typeName="FrameMarker",K.title="Frame marker",K.icon='',K}(qe),Ie=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},tt=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.x1=0,ae.y1=0,ae.x2=0,ae.y2=0,ae.defaultLength=50,ae.manipulationStartX=0,ae.manipulationStartY=0,ae.manipulationStartX1=0,ae.manipulationStartY1=0,ae.manipulationStartX2=0,ae.manipulationStartY2=0,ae.setupControlBox(),ae}return de(K,le),K.prototype.ownsTarget=function(X){return!!le.prototype.ownsTarget.call(this,X)||!(!this.grip1.ownsTarget(X)&&!this.grip2.ownsTarget(X))},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.manipulationStartX=X.x,this.manipulationStartY=X.y,this.state==="new"&&(this.x1=X.x,this.y1=X.y,this.x2=X.x,this.y2=X.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(ee)?this.activeGrip=this.grip1:this.grip2.ownsTarget(ee)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},K.prototype.pointerUp=function(X){var ee=this.state;le.prototype.pointerUp.call(this,X),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(X),this._state="select",ee==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},K.prototype.adjustVisual=function(){},K.prototype.manipulate=function(X){this.state==="creating"?this.resize(X):this.state==="move"?(this.x1=this.manipulationStartX1+X.x-this.manipulationStartX,this.y1=this.manipulationStartY1+X.y-this.manipulationStartY,this.x2=this.manipulationStartX2+X.x-this.manipulationStartX,this.y2=this.manipulationStartY2+X.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(X)},K.prototype.resize=function(X){switch(this.activeGrip){case this.grip1:this.x1=X.x,this.y1=X.y;break;case this.grip2:case void 0:this.x2=X.x,this.y2=X.y}this.adjustVisual(),this.adjustControlBox()},K.prototype.select=function(){le.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},K.prototype.deselect=function(){le.prototype.deselect.call(this),this.controlBox.style.display="none"},K.prototype.setupControlBox=function(){this.controlBox=ue.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},K.prototype.adjustControlBox=function(){this.positionGrips()},K.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},K.prototype.createGrip=function(){var X=new Qe;return X.visual.transform.baseVal.appendItem(ue.createTransform()),this.controlBox.appendChild(X.visual),X},K.prototype.positionGrips=function(){var X=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-X/2,this.y1-X/2),this.positionGrip(this.grip2.visual,this.x2-X/2,this.y2-X/2)},K.prototype.positionGrip=function(X,ee,me){var ae=X.transform.baseVal.getItem(0);ae.setTranslate(ee,me),X.transform.baseVal.replaceItem(ae,0)},K.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},le.prototype.getState.call(this))},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.x1=ee.x1,this.y1=ee.y1,this.x2=ee.x2,this.y2=ee.y2},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.x1=this.x1*X,this.y1=this.y1*ee,this.x2=this.x2*X,this.y2=this.y2*ee,this.adjustVisual(),this.adjustControlBox()},K}(be),ot=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.strokeColor="transparent",ae.strokeWidth=0,ae.strokeDasharray="",ae.setStrokeColor=ae.setStrokeColor.bind(ae),ae.setStrokeWidth=ae.setStrokeWidth.bind(ae),ae.setStrokeDasharray=ae.setStrokeDasharray.bind(ae),ae.strokeColor=me.defaultColor,ae.strokeWidth=me.defaultStrokeWidth,ae.strokeDasharray=me.defaultStrokeDasharray,ae.strokePanel=new ye("Line color",me.defaultColorSet,me.defaultColor),ae.strokePanel.onColorChanged=ae.setStrokeColor,ae.strokeWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.strokeWidthPanel.onWidthChanged=ae.setStrokeWidth,ae.strokeStylePanel=new lt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ae.strokeStylePanel.onStyleChanged=ae.setStrokeDasharray,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorLine&&X!==this.visibleLine)},K.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorLine=ue.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ue.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)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},K.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()),ue.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},K.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},K.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},K.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.createVisual(),this.adjustVisual()},K.typeName="LineMarker",K.title="Line marker",K.icon='',K}(tt),ze=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'')||this;return Ke.fonts=[],Ke.fontBoxes=[],Ke.fonts=ee,Ke.currentFont=me,Ke.setCurrentFont=Ke.setCurrentFont.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.overflow="hidden",ee.style.flexGrow="2",this.fonts.forEach(function(me){var ae=document.createElement("div");ae.style.display="inline-block",ae.style.alignItems="center",ae.style.justifyContent="space-between",ae.style.padding="5px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.overflow="hidden",ae.style.maxWidth=100/X.fonts.length-5+"%",ae.style.borderColor=me===X.currentFont?X.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){X.setCurrentFont(me,ae)}),ee.appendChild(ae);var Ke=document.createElement("div");Ke.style.display="flex",Ke.style.minHeight="20px",Ke.style.flexGrow="2",Ke.style.fontFamily=me,Ke.style.overflow="hidden";var pt=document.createElement("div");pt.style.whiteSpace="nowrap",pt.style.overflow="hidden",pt.style.textOverflow="ellipsis",pt.innerHTML="The quick brown fox jumps over the lazy dog",Ke.appendChild(pt),ae.appendChild(Ke),X.fontBoxes.push(ae)}),ee},K.prototype.setCurrentFont=function(X,ee){var me=this;this.currentFont=X,this.fontBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},K}(Z),Ze=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.color="transparent",ae.padding=5,ae.DEFAULT_TEXT="your text here",ae.text=ae.DEFAULT_TEXT,ae.isMoved=!1,ae.color=me.defaultColor,ae.fontFamily=me.defaultFontFamily,ae.defaultSize={x:100,y:30},ae.setColor=ae.setColor.bind(ae),ae.setFont=ae.setFont.bind(ae),ae.renderText=ae.renderText.bind(ae),ae.sizeText=ae.sizeText.bind(ae),ae.textEditDivClicked=ae.textEditDivClicked.bind(ae),ae.showTextEditor=ae.showTextEditor.bind(ae),ae.setSize=ae.setSize.bind(ae),ae.positionTextEditor=ae.positionTextEditor.bind(ae),ae.colorPanel=new ye("Color",me.defaultColorSet,me.defaultColor),ae.colorPanel.onColorChanged=ae.setColor,ae.fontFamilyPanel=new ze("Font",me.defaultFontFamilies,me.defaultFontFamily),ae.fontFamilyPanel.onFontChanged=ae.setFont,ae}return de(K,le),K.prototype.ownsTarget=function(X){if(le.prototype.ownsTarget.call(this,X)||X===this.visual||X===this.textElement||X===this.bgRectangle)return!0;var ee=!1;return this.textElement.childNodes.forEach(function(me){me===X&&(ee=!0)}),ee},K.prototype.createVisual=function(){this.visual=ue.createGroup(),this.bgRectangle=ue.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ue.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.textElement.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.isMoved=!1,this.pointerDownPoint=X,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},K.prototype.renderText=function(){var X=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(ee){X.textElement.appendChild(ue.createTSpan(ee.trim()===""?" ":ee.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},K.prototype.getTextScale=function(){var X=this.textElement.getBBox(),ee=1;if(X.width>0&&X.height>0){var me=(1*this.width-this.width*this.padding*2/100)/X.width,ae=(1*this.height-this.height*this.padding*2/100)/X.height;ee=Math.min(me,ae)}return ee},K.prototype.getTextPosition=function(X){var ee=this.textElement.getBBox(),me=0,ae=0;return ee.width>0&&ee.height>0&&(me=(this.width-ee.width*X)/2,ae=this.height/2-ee.height*X/2),{x:me,y:ae}},K.prototype.sizeText=function(){var X=this.textElement.getBBox(),ee=this.getTextScale(),me=this.getTextPosition(ee);me.y-=X.y*ee,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+me.x+"px, "+me.y+"px) scale("+ee+", "+ee+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(me.x,me.y),this.textElement.transform.baseVal.getItem(1).setScale(ee,ee))},K.prototype.manipulate=function(X){le.prototype.manipulate.call(this,X),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(X.x-this.pointerDownPoint.x)>5||Math.abs(X.y-this.pointerDownPoint.y)>5)},K.prototype.resize=function(X){le.prototype.resize.call(this,X),this.isMoved=!0,this.setSize(),this.sizeText()},K.prototype.setSize=function(){le.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},K.prototype.pointerUp=function(X){var ee=this.state;ee==="creating"&&(this._suppressMarkerCreateEvent=!0),le.prototype.pointerUp.call(this,X),this.setSize(),(ee==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},K.prototype.showTextEditor=function(){var X=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(ee){ee.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var ee=Number.parseFloat(X.textEditor.style.fontSize);X.textEditor.clientWidth>=Number.parseInt(X.textEditor.style.maxWidth)&&ee>.9;)ee-=.1,X.textEditor.style.fontSize=Math.max(ee,.9)+"em"}),this.textEditor.addEventListener("keyup",function(ee){ee.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(ee){if(ee.clipboardData){var me=ee.clipboardData.getData("text"),ae=window.getSelection();if(!ae.rangeCount)return!1;ae.deleteFromDocument(),ae.getRangeAt(0).insertNode(document.createTextNode(me)),ee.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){X.textEditDivClicked(X.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},K.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var X=this.getTextScale(),ee=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),me=this.textElement.getBBox(),ae={x:me.width*X,y:me.height*X};ee.x-=ae.x/2,ee.y-=ae.y/2,this.textEditor.style.top=ee.y+"px",this.textEditor.style.left=ee.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-ee.x+"px",this.textEditor.style.fontSize=Math.max(16*X,12)+"px",this.textElement.style.display="none"}},K.prototype.textEditDivClicked=function(X){this.text=X.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},K.prototype.select=function(){le.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},K.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),le.prototype.deselect.call(this)},K.prototype.dblClick=function(X,ee){le.prototype.dblClick.call(this,X,ee),this.showTextEditor()},K.prototype.setColor=function(X){this.textElement&&ue.setAttributes(this.textElement,[["fill",X]]),this.color=X,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(X)},K.prototype.setFont=function(X){this.textElement&&ue.setAttributes(this.textElement,[["font-family",X]]),this.fontFamily=X,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},K.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},K.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){var ee=X;this.color=ee.color,this.fontFamily=ee.fontFamily,this.padding=ee.padding,this.text=ee.text,this.createVisual(),le.prototype.restoreState.call(this,X),this.setSize()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.setSize(),this.sizeText(),this.positionTextEditor()},K.typeName="TextMarker",K.title="Text marker",K.icon='',K}(at),Ne=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.color="transparent",ae.lineWidth=3,ae.drawing=!1,ae.pixelRatio=1,ae.color=me.defaultColor,ae.lineWidth=me.defaultStrokeWidth,ae.pixelRatio=me.freehandPixelRatio,ae.setColor=ae.setColor.bind(ae),ae.addCanvas=ae.addCanvas.bind(ae),ae.finishCreation=ae.finishCreation.bind(ae),ae.setLineWidth=ae.setLineWidth.bind(ae),ae.colorPanel=new ye("Color",me.defaultColorSet,me.defaultColor),ae.colorPanel.onColorChanged=ae.setColor,ae.lineWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.lineWidthPanel.onWidthChanged=ae.setLineWidth,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.drawingImage)},K.prototype.createVisual=function(){this.visual=ue.createGroup(),this.drawingImage=ue.createImage(),this.visual.appendChild(this.drawingImage);var X=ue.createTransform();this.visual.transform.baseVal.appendItem(X),this.addMarkerVisualToContainer(this.visual)},K.prototype.pointerDown=function(X,ee){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(X.x,X.y),this.drawing=!0):le.prototype.pointerDown.call(this,X,ee)},K.prototype.manipulate=function(X){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(X.x,X.y),this.canvasContext.stroke()):le.prototype.manipulate.call(this,X)},K.prototype.resize=function(X){le.prototype.resize.call(this,X),ue.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},K.prototype.pointerUp=function(X){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):le.prototype.pointerUp.call(this,X)},K.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)},K.prototype.select=function(){this.state==="creating"&&this.finishCreation(),le.prototype.select.call(this)},K.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),le.prototype.deselect.call(this)},K.prototype.finishCreation=function(){for(var X=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),ee=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],me=ee[0],ae=ee[1],Ke=ee[2],pt=ee[3],Ot=!1,Ht=0;Ht0&&(Ot=!0,Htpt&&(pt=Ht),vt>Ke&&(Ke=vt));if(Ot){this.left=me/this.pixelRatio,this.top=ae/this.pixelRatio,this.width=(Ke-me)/this.pixelRatio,this.height=(pt-ae)/this.pixelRatio;var Xt=document.createElement("canvas");Xt.width=Ke-me,Xt.height=pt-ae,Xt.getContext("2d").putImageData(this.canvasContext.getImageData(me,ae,Ke-me,pt-ae),0,0),this.drawingImgUrl=Xt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},K.prototype.setDrawingImage=function(){ue.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ue.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},K.prototype.setColor=function(X){this.color=X,this.colorChanged(X)},K.prototype.setLineWidth=function(X){this.lineWidth=X},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({drawingImgUrl:this.drawingImgUrl},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){this.createVisual(),le.prototype.restoreState.call(this,X),this.drawingImgUrl=X.drawingImgUrl,this.setDrawingImage()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.setDrawingImage()},K.typeName="FreehandMarker",K.title="Freehand marker",K.icon='',K}(at),Ae=function(le){function K(X,ee,me){var ae=le.call(this,X,me||'')||this;return ae.typeBoxes=[],ae.currentType=ee,ae.setCurrentType=ae.setCurrentType.bind(ae),ae}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2";for(var me=function(pt){var Ot="both";switch(pt){case 0:Ot="both";break;case 1:Ot="start";break;case 2:Ot="end";break;case 3:Ot="none"}var Ht=document.createElement("div");if(Ht.style.display="flex",Ht.style.flexGrow="2",Ht.style.alignItems="center",Ht.style.justifyContent="space-between",Ht.style.padding="5px",Ht.style.borderWidth="2px",Ht.style.borderStyle="solid",Ht.style.borderColor=Ot===ae.currentType?ae.uiStyleSettings.toolboxAccentColor:"transparent",Ht.addEventListener("click",function(){X.setCurrentType(Ot,Ht)}),ee.appendChild(Ht),Ot==="both"||Ot==="start"){var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.innerHTML=``,vt.style.marginLeft="5px",Ht.appendChild(vt)}var Xt=document.createElement("div");Xt.style.display="flex",Xt.style.alignItems="center",Xt.style.minHeight="20px",Xt.style.flexGrow="2";var qt=document.createElement("hr");if(qt.style.minWidth="20px",qt.style.border="0px",qt.style.borderTop="3px solid "+(ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxColor:"#eeeeee"),qt.style.flexGrow="2",Xt.appendChild(qt),Ht.appendChild(Xt),Ot==="both"||Ot==="end"){var Hr=document.createElement("div");Hr.style.display="flex",Hr.style.alignItems="center",Hr.style.minHeight="20px",Hr.innerHTML=``,Hr.style.marginRight="5px",Ht.appendChild(Hr)}ae.typeBoxes.push(Ht)},ae=this,Ke=0;Ke<4;Ke++)me(Ke);return ee},K.prototype.setCurrentType=function(X,ee){var me=this;this.currentType=X,this.typeBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings!==void 0?me.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},K}(Z),Me=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.arrowType="end",ae.arrowBaseHeight=10,ae.arrowBaseWidth=10,ae.getArrowPoints=ae.getArrowPoints.bind(ae),ae.setArrowType=ae.setArrowType.bind(ae),ae.arrowTypePanel=new Ae("Arrow type","end"),ae.arrowTypePanel.onArrowTypeChanged=ae.setArrowType,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.arrow1&&X!==this.arrow2)},K.prototype.getArrowPoints=function(X,ee){var me=this.arrowBaseWidth+2*this.strokeWidth,ae=this.arrowBaseHeight+2*this.strokeWidth;return X-me/2+","+(ee+ae/2)+" "+X+","+(ee-ae/2)+" "+(X+me/2)+","+(ee+ae/2)},K.prototype.createTips=function(){this.arrow1=ue.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ue.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ue.createTransform()),this.visual.appendChild(this.arrow2)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="creating"&&this.createTips()},K.prototype.adjustVisual=function(){if(le.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",ue.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ue.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ee=this.arrow1.transform.baseVal.getItem(0);ee.setRotate(X,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(ee,0);var me=this.arrow2.transform.baseVal.getItem(0);me.setRotate(X+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(me,0)}},K.prototype.setArrowType=function(X){this.arrowType=X,this.adjustVisual(),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({arrowType:this.arrowType},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.arrowType=ee.arrowType,this.createTips(),this.adjustVisual()},K.typeName="ArrowMarker",K.title="Arrow marker",K.icon='',K}(ot),Ee=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.fillColor=me.defaultFillColor,ae.strokeWidth=0,ae.fillPanel=new ye("Color",me.defaultColorSet,me.defaultFillColor),ae.fillPanel.onColorChanged=ae.setFillColor,ae}return de(K,le),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.typeName="CoverMarker",K.title="Cover marker",K.icon='',K}(qe),Ce=function(le){function K(X,ee,me,ae){var Ke=le.call(this,X,ae||'')||this;return Ke.opacities=[],Ke.opacityBoxes=[],Ke.opacities=ee,Ke.currentOpacity=me,Ke.setCurrentOpacity=Ke.setCurrentOpacity.bind(Ke),Ke}return de(K,le),K.prototype.getUi=function(){var X=this,ee=document.createElement("div");return ee.style.display="flex",ee.style.overflow="hidden",ee.style.flexGrow="2",ee.style.justifyContent="space-between",this.opacities.forEach(function(me){var ae=document.createElement("div");ae.style.display="flex",ae.style.alignItems="center",ae.style.justifyContent="center",ae.style.padding="5px",ae.style.borderWidth="2px",ae.style.borderStyle="solid",ae.style.borderColor=me===X.currentOpacity?X.uiStyleSettings.toolboxAccentColor:"transparent",ae.addEventListener("click",function(){X.setCurrentOpacity(me,ae)}),ee.appendChild(ae);var Ke=document.createElement("div");Ke.innerText=100*me+"%",ae.appendChild(Ke),X.opacityBoxes.push(ae)}),ee},K.prototype.setCurrentOpacity=function(X,ee){var me=this;this.currentOpacity=X,this.opacityBoxes.forEach(function(ae){ae.style.borderColor=ae===ee?me.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},K}(Z),ke=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.setOpacity=ae.setOpacity.bind(ae),ae.fillColor=me.defaultHighlightColor,ae.strokeWidth=0,ae.opacity=me.defaultHighlightOpacity,ae.fillPanel=new ye("Color",me.defaultColorSet,ae.fillColor),ae.fillPanel.onColorChanged=ae.setFillColor,ae.opacityPanel=new Ce("Opacity",me.defaultOpacitySteps,ae.opacity),ae.opacityPanel.onOpacityChanged=ae.setOpacity,ae}return de(K,le),K.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.typeName="HighlightMarker",K.title="Highlight marker",K.icon='',K}(Ee),Fe='',Be=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.bgColor="transparent",ae.tipPosition={x:0,y:0},ae.tipBase1Position={x:0,y:0},ae.tipBase2Position={x:0,y:0},ae.tipMoving=!1,ae.color=me.defaultStrokeColor,ae.bgColor=me.defaultFillColor,ae.fontFamily=me.defaultFontFamily,ae.defaultSize={x:100,y:30},ae.setBgColor=ae.setBgColor.bind(ae),ae.getTipPoints=ae.getTipPoints.bind(ae),ae.positionTip=ae.positionTip.bind(ae),ae.setTipPoints=ae.setTipPoints.bind(ae),ae.colorPanel=new ye("Text color",me.defaultColorSet,ae.color,''),ae.colorPanel.onColorChanged=ae.setColor,ae.bgColorPanel=new ye("Fill color",me.defaultColorSet,ae.bgColor,Fe),ae.bgColorPanel.onColorChanged=ae.setBgColor,ae.fontFamilyPanel=new ze("Font",me.defaultFontFamilies,me.defaultFontFamily),ae.fontFamilyPanel.onFontChanged=ae.setFont,ae.tipGrip=new Qe,ae.tipGrip.visual.transform.baseVal.appendItem(ue.createTransform()),ae.controlBox.appendChild(ae.tipGrip.visual),ae}return de(K,le),K.prototype.ownsTarget=function(X){return le.prototype.ownsTarget.call(this,X)||this.tipGrip.ownsTarget(X)||this.tip===X},K.prototype.createTip=function(){ue.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ue.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},K.prototype.pointerDown=function(X,ee){this.state==="new"&&le.prototype.pointerDown.call(this,X,ee),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(ee)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):le.prototype.pointerDown.call(this,X,ee)},K.prototype.pointerUp=function(X){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,le.prototype.pointerUp.call(this,X);else{var ee=this.state==="creating";le.prototype.pointerUp.call(this,X),this.setTipPoints(ee),this.positionTip()}},K.prototype.manipulate=function(X){if(this.tipMoving){var ee=this.unrotatePoint(X);this.tipPosition={x:ee.x-this.manipulationStartLeft,y:ee.y-this.manipulationStartTop},this.positionTip()}else le.prototype.manipulate.call(this,X)},K.prototype.setBgColor=function(X){this.bgRectangle&&this.tip&&(ue.setAttributes(this.bgRectangle,[["fill",X]]),ue.setAttributes(this.tip,[["fill",X]])),this.bgColor=X,this.fillColorChanged(X)},K.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},K.prototype.setTipPoints=function(X){X===void 0&&(X=!1);var ee=Math.min(this.height/2,15),me=this.height/5;X&&(this.tipPosition={x:ee+me/2,y:this.height+20});var ae=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?ae',K}(Ze),et=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.fillColor="transparent",ae.strokeColor="transparent",ae.strokeWidth=0,ae.strokeDasharray="",ae.opacity=1,ae.strokeColor=me.defaultColor,ae.strokeWidth=me.defaultStrokeWidth,ae.strokeDasharray=me.defaultStrokeDasharray,ae.fillColor=me.defaultFillColor,ae.setStrokeColor=ae.setStrokeColor.bind(ae),ae.setFillColor=ae.setFillColor.bind(ae),ae.setStrokeWidth=ae.setStrokeWidth.bind(ae),ae.setStrokeDasharray=ae.setStrokeDasharray.bind(ae),ae.setOpacity=ae.setOpacity.bind(ae),ae.createVisual=ae.createVisual.bind(ae),ae.strokePanel=new ye("Line color",he(me.defaultColorSet,["transparent"]),me.defaultColor),ae.strokePanel.onColorChanged=ae.setStrokeColor,ae.fillPanel=new ye("Fill color",he(me.defaultColorSet,["transparent"]),ae.fillColor,Fe),ae.fillPanel.onColorChanged=ae.setFillColor,ae.strokeWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.strokeWidthPanel.onWidthChanged=ae.setStrokeWidth,ae.strokeStylePanel=new lt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ae.strokeStylePanel.onStyleChanged=ae.setStrokeDasharray,ae.opacityPanel=new Ce("Opacity",me.defaultOpacitySteps,ae.opacity),ae.opacityPanel.onOpacityChanged=ae.setOpacity,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual)},K.prototype.createVisual=function(){this.visual=ue.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)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="new"&&(this.createVisual(),this.moveVisual(X),this._state="creating")},K.prototype.manipulate=function(X){le.prototype.manipulate.call(this,X)},K.prototype.resize=function(X){le.prototype.resize.call(this,X),this.setSize()},K.prototype.setSize=function(){le.prototype.setSize.call(this),ue.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},K.prototype.pointerUp=function(X){le.prototype.pointerUp.call(this,X),this.setSize()},K.prototype.setStrokeColor=function(X){this.strokeColor=X,this.visual&&ue.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(X),this.stateChanged()},K.prototype.setFillColor=function(X){this.fillColor=X,this.visual&&ue.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(X),this.stateChanged()},K.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.visual&&ue.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},K.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.visual&&ue.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},K.prototype.setOpacity=function(X){this.opacity=X,this.visual&&ue.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){var ee=X;this.fillColor=ee.fillColor,this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.opacity=ee.opacity,this.createVisual(),le.prototype.restoreState.call(this,X),this.setSize()},K.prototype.scale=function(X,ee){le.prototype.scale.call(this,X,ee),this.setSize()},K.typeName="EllipseMarker",K.title="Ellipse marker",K.icon='',K}(at),ct=function(le){function K(X,ee,me){return le.call(this,X,ee,me)||this}return de(K,le),Object.defineProperty(K.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.tip1&&X!==this.tip2)},K.prototype.createTips=function(){this.tip1=ue.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(ue.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ue.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(ue.createTransform()),this.visual.appendChild(this.tip2)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.state==="creating"&&this.createTips()},K.prototype.adjustVisual=function(){if(le.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ue.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()]]),ue.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 X=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),ee=this.tip1.transform.baseVal.getItem(0);ee.setRotate(X,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(ee,0);var me=this.tip2.transform.baseVal.getItem(0);me.setRotate(X+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(me,0)}},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X),this.createTips(),this.adjustVisual()},K.typeName="MeasurementMarker",K.title="Measurement marker",K.icon='',K}(ot),yt=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.strokePanel.colors=me.defaultColorSet,ae.fillColor="transparent",ae}return de(K,le),Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=le.prototype.getState.call(this);return X.typeName=K.typeName,X},K.typeName="EllipseFrameMarker",K.title="Ellipse frame marker",K.icon='',K}(et),ft=function(){function le(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(le.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),le.prototype.addUndoStep=function(K){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(K)||(this.undoStack.push(K),JSON.stringify(this.lastRedoStep)!==JSON.stringify(K)&&this.redoStack.splice(0,this.redoStack.length))},le.prototype.replaceLastUndoStep=function(K){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=K)},le.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},le.prototype.undo=function(){if(this.undoStack.length>1){var K=this.undoStack.pop();return K!==void 0&&this.redoStack.push(K),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},le.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},le}(),mt=function(le){function K(X,ee,me){var ae=le.call(this,X,ee,me)||this;return ae.strokeColor="transparent",ae.strokeWidth=0,ae.strokeDasharray="",ae.curveX=0,ae.curveY=0,ae.manipulationStartCurveX=0,ae.manipulationStartCurveY=0,ae.setStrokeColor=ae.setStrokeColor.bind(ae),ae.setStrokeWidth=ae.setStrokeWidth.bind(ae),ae.setStrokeDasharray=ae.setStrokeDasharray.bind(ae),ae.positionGrips=ae.positionGrips.bind(ae),ae.addControlGrips=ae.addControlGrips.bind(ae),ae.adjustVisual=ae.adjustVisual.bind(ae),ae.setupControlBox=ae.setupControlBox.bind(ae),ae.resize=ae.resize.bind(ae),ae.strokeColor=me.defaultColor,ae.strokeWidth=me.defaultStrokeWidth,ae.strokeDasharray=me.defaultStrokeDasharray,ae.strokePanel=new ye("Line color",me.defaultColorSet,me.defaultColor),ae.strokePanel.onColorChanged=ae.setStrokeColor,ae.strokeWidthPanel=new st("Line width",me.defaultStrokeWidths,me.defaultStrokeWidth),ae.strokeWidthPanel.onWidthChanged=ae.setStrokeWidth,ae.strokeStylePanel=new lt("Line style",me.defaultStrokeDasharrays,me.defaultStrokeDasharray),ae.strokeStylePanel.onStyleChanged=ae.setStrokeDasharray,ae}return de(K,le),K.prototype.ownsTarget=function(X){return!(!le.prototype.ownsTarget.call(this,X)&&X!==this.visual&&X!==this.selectorCurve&&X!==this.visibleCurve&&!this.curveGrip.ownsTarget(X))},K.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},K.prototype.createVisual=function(){this.visual=ue.createGroup(),this.selectorCurve=ue.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ue.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)},K.prototype.pointerDown=function(X,ee){le.prototype.pointerDown.call(this,X,ee),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=X.x,this.curveY=X.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(ee)&&(this.activeGrip=this.curveGrip,this._state="resize")},K.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ue.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ue.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ue.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},K.prototype.setupControlBox=function(){le.prototype.setupControlBox.call(this),this.curveControlLine1=ue.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ue.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)},K.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,le.prototype.addControlGrips.call(this)},K.prototype.positionGrips=function(){le.prototype.positionGrips.call(this);var X=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-X/2,this.curveY-X/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()))},K.prototype.manipulate=function(X){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+X.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+X.y-this.manipulationStartY),le.prototype.manipulate.call(this,X)},K.prototype.resize=function(X){this.activeGrip===this.curveGrip&&(this.curveX=X.x,this.curveY=X.y),le.prototype.resize.call(this,X),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},K.prototype.setStrokeColor=function(X){this.strokeColor=X,this.adjustVisual(),this.colorChanged(X)},K.prototype.setStrokeWidth=function(X){this.strokeWidth=X,this.adjustVisual()},K.prototype.setStrokeDasharray=function(X){this.strokeDasharray=X,this.adjustVisual()},K.prototype.scale=function(X,ee){this.curveX=this.curveX*X,this.curveY=this.curveY*ee,le.prototype.scale.call(this,X,ee)},Object.defineProperty(K.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),K.prototype.getState=function(){var X=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},le.prototype.getState.call(this));return X.typeName=K.typeName,X},K.prototype.restoreState=function(X){le.prototype.restoreState.call(this,X);var ee=X;this.strokeColor=ee.strokeColor,this.strokeWidth=ee.strokeWidth,this.strokeDasharray=ee.strokeDasharray,this.curveX=ee.curveX,this.curveY=ee.curveY,this.createVisual(),this.adjustVisual()},K.typeName="CurveMarker",K.title="Curve marker",K.icon='',K}(tt),It=function(){function le(K,X){X===void 0&&(X=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=K,this.cancelable=X}return Object.defineProperty(le.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),le.prototype.preventDefault=function(){this._defaultPrevented=!0},le}(),At=function(le){function K(X,ee,me){var ae=le.call(this,X,!1)||this;return ae.dataUrl=ee,ae.state=me,ae}return de(K,le),K}(It),_t=function(le){function K(X,ee,me){me===void 0&&(me=!1);var ae=le.call(this,X,me)||this;return ae.marker=ee,ae}return de(K,le),K}(It),Vt=function(){function le(){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 le.prototype.addEventListener=function(K,X){this[K].push(X)},le.prototype.removeEventListener=function(K,X){var ee=this[K].indexOf(X);ee>-1&&this[K].splice(ee,1)},le}(),Kt=function(){function le(K){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ie,this._isOpen=!1,this.undoRedoManager=new ft,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 Vt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=le.instanceCounter++,this.styles=new ce(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=K,this.targetRoot=document.body,this.width=K.clientWidth,this.height=K.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(le.prototype,"ALL_MARKER_TYPES",{get:function(){return[je,Ne,Me,Ze,yt,et,ke,Be,ct,Ee,ot,mt]},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[je,Ne,Me,Ze,et,ke,Be]},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"BASIC_MARKER_TYPES",{get:function(){return[je,Ne,Me,Ze,ke]},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(K){var X=this;this._availableMarkerTypes.splice(0),K.forEach(function(ee){if(typeof ee=="string"){var me=X.ALL_MARKER_TYPES.find(function(ae){return ae.typeName===ee});me!==void 0&&X._availableMarkerTypes.push(me)}else X._availableMarkerTypes.push(ee)})},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(K){this._zoomLevel=K,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(le.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),le.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ie.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},le.prototype.show=function(){var K=this;this.styles.styleSheetRoot===void 0&&ne.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ne.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(X){return X(new It(K))})},le.prototype.render=function(){return De(this,void 0,void 0,function(){var K;return Te(this,function(X){switch(X.label){case 0:return this.setCurrentMarker(),(K=new Se).naturalSize=this.renderAtNaturalSize,K.imageType=this.renderImageType,K.imageQuality=this.renderImageQuality,K.markersOnly=this.renderMarkersOnly,K.width=this.renderWidth,K.height=this.renderHeight,[4,K.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return X.sent(),[4,K.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,X.sent()]}})})},le.prototype.close=function(K){var X=this;if(K===void 0&&(K=!1),this.isOpen){var ee=!1;K||this.eventListeners.beforeclose.forEach(function(me){var ae=new It(X,!0);me(ae),ae.defaultPrevented&&(ee=!0)}),ee||(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(me){return me(new It(X))}),this.detachEvents(),this._isOpen=!1)}},le.prototype.addMarkersToToolbar=function(){for(var K,X=[],ee=0;eethis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*K:this.editorCanvas.clientWidth,ee=X',K.title="Powered by marker.js",K.style.display="grid",K.style.alignItems="center",K.style.justifyItems="center",K.style.padding="3px",K.style.width="20px",K.style.height="20px",this.logoUI.appendChild(K),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},le.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")},le.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"},le.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},le.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 K=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=K+"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 q(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(K),1),K.dispose()},le.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())},le.prototype.toolbarButtonClicked=function(K,X){if(K==="marker"&&X!==void 0)this.createNewMarker(X);else if(K==="action")switch(X){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()}},le.prototype.deleteSelectedMarker=function(){var K=this;if(this._currentMarker!==void 0){var X=!1;if(this.eventListeners.markerbeforedelete.forEach(function(me){var ae=new _t(K,K._currentMarker,!0);me(ae),ae.defaultPrevented&&(X=!0)}),!X){var ee=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(me){return me(new _t(K,ee))})}}},le.prototype.clear=function(){var K=this,X=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ke){var pt=new _t(K,void 0,!0);Ke(pt),pt.defaultPrevented&&(X=!0)}),!X)){this.setCurrentMarker();for(var ee=function(Ke){var pt=me.markers[Ke];me.setCurrentMarker(me.markers[Ke]),me._currentMarker.dispose(),me.markerImage.removeChild(me._currentMarker.container),me.markers.splice(me.markers.indexOf(me._currentMarker),1),me.eventListeners.markerdelete.forEach(function(Ot){return Ot(new _t(K,pt))})},me=this,ae=this.markers.length-1;ae>=0;ae--)ee(ae);this.addUndoStep()}},Object.defineProperty(le.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),le.prototype.showNotesEditor=function(){var K;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=(K=this._currentMarker.notes)!==null&&K!==void 0?K:"",this.overlayContainer.appendChild(this.notesArea))},le.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)},le.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},le.prototype.addUndoStep=function(){var K=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var X=this.getState(),ee=this.undoRedoManager.getLastUndoStep();if(!ee||ee.width===X.width&&ee.height===X.height){var me=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(X),me1&&this.panTo({x:K.clientX,y:K.clientY}))},le.prototype.onPointerUp=function(K){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(K.clientX,K.clientY)),this.isDragging=!1,this.addUndoStep()},le.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},le.prototype.onKeyUp=function(K){this._currentMarker===void 0||this.notesArea!==void 0||K.key!=="Delete"&&K.key!=="Backspace"||this.deleteSelectedMarker()},le.prototype.clientToLocalCoordinates=function(K,X){var ee=this.markerImage.getBoundingClientRect();return{x:(K-ee.left)/this.zoomLevel,y:(X-ee.top)/this.zoomLevel}},le.prototype.onWindowResize=function(){this.positionUI()},le.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var K=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=K+"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()},le.prototype.addLicenseKey=function(K){ie.addKey(K)},le.prototype.addEventListener=function(K,X){this.eventListeners.addEventListener(K,X)},le.prototype.removeEventListener=function(K,X){this.eventListeners.removeEventListener(K,X)},le.prototype.renderState=function(K){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(K),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(le.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),le.prototype.focus=function(){var K=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(X){return X(new It(K))}))},le.prototype.blur=function(){var K=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(X){return X(new It(K))}))},le.instanceCounter=0,le}();/* **********************************
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 tr=function(le,K){return(tr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(X,ee){X.__proto__=ee}||function(X,ee){for(var me in ee)Object.prototype.hasOwnProperty.call(ee,me)&&(X[me]=ee[me])})(le,K)};function rr(le,K){if(typeof K!="function"&&K!==null)throw new TypeError("Class extends value "+String(K)+" is not a constructor or null");function X(){this.constructor=le}tr(le,K),le.prototype=K===null?Object.create(K):(X.prototype=K.prototype,new X)}function Wt(le,K,X,ee){return new(X||(X=Promise))(function(me,ae){function Ke(Ht){try{Ot(ee.next(Ht))}catch(vt){ae(vt)}}function pt(Ht){try{Ot(ee.throw(Ht))}catch(vt){ae(vt)}}function Ot(Ht){var vt;Ht.done?me(Ht.value):(vt=Ht.value,vt instanceof X?vt:new X(function(Xt){Xt(vt)})).then(Ke,pt)}Ot((ee=ee.apply(le,K||[])).next())})}function Lt(le,K){var X,ee,me,ae,Ke={label:0,sent:function(){if(1&me[0])throw me[1];return me[1]},trys:[],ops:[]};return ae={next:pt(0),throw:pt(1),return:pt(2)},typeof Symbol=="function"&&(ae[Symbol.iterator]=function(){return this}),ae;function pt(Ot){return function(Ht){return function(vt){if(X)throw new TypeError("Generator is already executing.");for(;Ke;)try{if(X=1,ee&&(me=2&vt[0]?ee.return:vt[0]?ee.throw||((me=ee.return)&&me.call(ee),0):ee.next)&&!(me=me.call(ee,vt[1])).done)return me;switch(ee=0,me&&(vt=[2&vt[0],me.value]),vt[0]){case 0:case 1:me=vt;break;case 4:return Ke.label++,{value:vt[1],done:!1};case 5:Ke.label++,ee=vt[1],vt=[0];continue;case 7:vt=Ke.ops.pop(),Ke.trys.pop();continue;default:if(!(me=Ke.trys,(me=me.length>0&&me[me.length-1])||vt[0]!==6&&vt[0]!==2)){Ke=0;continue}if(vt[0]===3&&(!me||vt[1]>me[0]&&vt[1]0&&X>0){var ee=new wr(K,X),me=ee.ratio>=1?20:ee.getHorizontalLength(20),ae=ee.ratio<1?20:ee.getVerticalLength(20),Ke=document.createElementNS("http://www.w3.org/2000/svg","svg");Ke.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ke.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ke);var pt=dt.createDefs();Ke.appendChild(pt);var Ot=dt.createElement("clipPath",[["id","text-bg-clip"]]);pt.appendChild(Ot);var Ht=dt.createPath(dt.getHollowRectanglePath((24-me)/2,(24-ae)/2,me,ae,(24-me)/2+2,(24-ae)/2+2,me-4,ae-4));Ke.appendChild(Ht);var vt=dt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);vt.appendChild(dt.createTSpan(K+":"+X)),Ke.appendChild(vt);var Xt=vt.getBBox();dt.setAttributes(vt,[["x",((24-Xt.width)/2).toString()],["y",((24-Xt.height)/2-Xt.y).toString()]]);var qt=dt.createPath(dt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Xt.width))/2,(24-Math.ceil(Xt.height))/2,Math.ceil(Xt.width),Math.ceil(Xt.height)));return Ot.appendChild(qt),dt.setAttributes(Ht,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ke),Ke.outerHTML}return''},le}(),Jt=function(le){function K(X,ee,me){var ae=le.call(this,X,ee)||this;return ae.isDropdownOpen=!1,ae.onClick=ae.dropdownButtonClicked,ae.dropdownButtons=me,ae}return rr(K,le),K.prototype.setupDropdown=function(){var X=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(ee){ee.className=X.className,ee.colorsClassName=X.colorsClassName,X.dropdownBlock.appendChild(ee.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},K.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},K.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},K.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},K.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},K.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},K}(Dt),Ut=function(){function le(K,X){this.GRIP_SIZE=10,this.color=K,this.fillColor=X,this.visual=dt.createGroup(),this.visual.appendChild(dt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(dt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return le.prototype.ownsTarget=function(K){return K===this.visual||K===this.visual.childNodes[0]||K===this.visual.childNodes[1]},le.prototype.setCenter=function(K,X){this.visual.childNodes.forEach(function(ee){return dt.setAttributes(ee,[["cx",K.toString()],["cy",X.toString()]])})},le}(),Or=function(){function le(K,X,ee,me){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=K,this.canvasHeight=X,this.margin=ee,this.container=me,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(le.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(K){this._aspectRatio=K,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.gridContainer&&dt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(K){this._zoomFactor=K,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),le.prototype.open=function(){var K=this;this.cropShadeElement=dt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=dt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var X=0;Xthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-X.height/2),dt.setAttributes(this.cropRectElement,[["x",X.x.toString()],["y",X.y.toString()],["width",X.width.toString()],["height",X.height.toString()]]);var ee=X.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(ae,Ke){var pt=X.y+ee*(Ke+1);dt.setAttributes(ae,[["x1",""+X.x],["y1",""+pt],["x2",""+(X.x+X.width)],["y2",""+pt]])});var me=X.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(ae,Ke){var pt=X.x+me*(Ke+1);dt.setAttributes(ae,[["x1",""+pt],["y1",""+X.y],["x2",""+pt],["y2",""+(X.y+X.height)]])}),dt.setAttributes(this.cropShadeElement,[["d",dt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,X.x,X.y,X.width,X.height)]]),this.topLeftGrip.setCenter(X.x,X.y),this.topRightGrip.setCenter(X.x+X.width,X.y),this.bottomLeftGrip.setCenter(X.x,X.y+X.height),this.bottomRightGrip.setCenter(X.x+X.width,X.y+X.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},le.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)},le.prototype.clientToLocalCoordinates=function(K,X){var ee=this.container.getBoundingClientRect();return{x:K-ee.left+this.margin,y:X-ee.top+this.margin}},le.prototype.onPointerDown=function(K){this.container.setPointerCapture(K.pointerId),this.previousPoint=this.clientToLocalCoordinates(K.clientX,K.clientY),this.cropRectElement===K.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(K.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(K.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(K.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(K.target)&&(this.activeGrip=this.bottomRightGrip)},le.prototype.onPointerMove=function(K){if(this.isMoving)this.move(this.clientToLocalCoordinates(K.clientX,K.clientY));else if(this.activeGrip){var X=this.clientToLocalCoordinates(K.clientX,K.clientY);this.resize(X)}K.preventDefault()},le.prototype.onPointerUp=function(K){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(K.pointerId)},le.prototype.move=function(K){var X=K.x-this.previousPoint.x,ee=K.y-this.previousPoint.y;this.zoomFactor!==1&&(X=-X/this.zoomFactor,ee=-ee/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+X),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+ee),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=K},le.prototype.resize=function(K){var X=Object.assign({},this.cropRect),ee=K.x-this.previousPoint.x,me=K.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:X.x+eethis.canvasWidth*this.zoomFactor&&(ee=this.canvasWidth*this.zoomFactor-X.width),X.width+=ee}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(X.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(ee),X.height=this.aspectRatio.getVerticalLength(X.width)):(X.y+=me,X.height=this.cropRect.y+this.cropRect.height-X.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?X.height=this.aspectRatio.getVerticalLength(X.width):X.height+=me}X.width<10&&(X.x=this.cropRect.x,X.width=10),X.height<10&&(X.y=this.cropRect.y,X.height=10),this.previousPoint=K,X.x>=this.margin&&X.y>=this.margin&&X.x-this.margin+X.width<=this.canvasWidth&&X.y-this.margin+X.height<=this.canvasHeight&&(this.cropRect=X,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},le.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var K=this.cropRect.x+this.cropRect.width/2,X=this.cropRect.y+this.cropRect.height/2,ee=this.aspectRatio.getHorizontalLength(this.cropRect.height),me=this.aspectRatio.getVerticalLength(this.cropRect.width);ee/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=K-this.cropRect.width/2,this.cropRect.y=X-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)}},le.prototype.getRescaledRect=function(K,X,ee,me,ae,Ke){var pt=ee/K,Ot=me/X;return{x:(ae.x-Ke)*pt+Ke,y:(ae.y-Ke)*Ot+Ke,width:ae.width*pt,height:ae.height*Ot}},le.prototype.scaleCanvas=function(K,X){var ee=this.getRescaledRect(this.canvasWidth,this.canvasHeight,K,X,this.cropRect,this.margin);this.canvasWidth=K,this.canvasHeight=X,this.onCropChange&&this.onCropChange(ee),this.setCropRectangle(ee)},le}(),un=function(){function le(K){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=K,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(le.prototype,"angle",{get:function(){return this._angle},set:function(K){this._angle=K,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),le.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},le.prototype.onPointerDown=function(K){this.controlContainer.setPointerCapture(K.pointerId),this.isDragging=!0,this.previousPoint={x:K.clientX,y:K.clientY}},le.prototype.onPointerMove=function(K){this.isDragging&&(this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.previousPoint.x=K.clientX)},le.prototype.onPointerUp=function(K){this.isDragging&&this.onAngleChange&&this.onAngleChange((K.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(K.pointerId)},le.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var K=this.angleLabelText.getBBox();dt.setAttributes(this.angleLabelElement,[["x",((this.width-K.width)/2).toString()],["y",(this.height/2).toString()]])}},le.prototype.positionScaleShape=function(){if(this.scaleShape){var K=this.scaleShape.transform.baseVal.getItem(0);K.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(K,0)}},le.prototype.getVisual=function(){var K=document.createElementNS("http://www.w3.org/2000/svg","svg");K.setAttribute("xmlns","http://www.w3.org/2000/svg"),K.setAttribute("width",this.width+"px"),K.setAttribute("height",this.height+"px"),K.setAttribute("viewBox","0 0 "+this.width+" "+this.height),K.style.flexShrink="0",document.body.appendChild(K);for(var X="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,ee=1;ee<=this.width/5+10;ee++){var me=ee%5==0?this.height/3:this.height/6;X+="h4v"+-me+"h1v"+me}X+="v1H0Z",this.scaleShape=dt.createPath(X);var ae=dt.createTransform();this.scaleShape.transform.baseVal.appendItem(ae),K.appendChild(this.scaleShape),this.angleLabelElement=dt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=dt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ke=dt.createTSpan("");return Ke.innerHTML="°",this.angleLabelElement.appendChild(Ke),K.appendChild(this.angleLabelElement),document.body.removeChild(K),K},le}(),Nr=function(){function le(){this.naturalSize=!1,this.imageType="image/png"}return le.prototype.rasterize=function(K,X,ee,me,ae,Ke,pt){var Ot=this;return new Promise(function(Ht){var vt=document.createElement("canvas");vt.width=K.width.baseVal.value-2*me,vt.height=K.height.baseVal.value-2*me;var Xt=1,qt=1;Ot.naturalSize===!0?(Xt=X.naturalWidth/(K.width.baseVal.value-2*me)/Ke,qt=X.naturalHeight/(K.height.baseVal.value-2*me)/pt,vt.width=X.naturalWidth/Ke,vt.height=X.naturalHeight/pt):Ot.width!==void 0&&Ot.height!==void 0&&(Xt=Ot.width/ee.width,qt=Ot.height/ee.height,vt.width*=Xt,vt.height*=qt);var Hr=vt.getContext("2d");Hr.translate(vt.width/2,vt.height/2),Hr.rotate(ae*Math.PI/180),Hr.scale(Ke,pt),Hr.translate(-vt.width/2,-vt.height/2),Hr.drawImage(X,0,0,vt.width,vt.height);var nn=document.createElement("canvas");nn.width=ee.width*Xt,nn.height=ee.height*qt,nn.getContext("2d").putImageData(Hr.getImageData((ee.x-me)*Xt,(ee.y-me)*qt,ee.width*Xt,ee.height*qt),0,0),Ht(nn.toDataURL(Ot.imageType,Ot.imageQuality))})},le}(),bt=function(){function le(K){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=le.instanceCounter++,this.styles=new Et(this.instanceNo),this.target=K,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(le.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(K){this._zoomToCropEnabled=K,K?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(K){this._isGridVisible=K,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"gridLines",{get:function(){return this._gridLines},set:function(K){this._gridLines=K,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(K){this._rotationAngle=K,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(le.prototype,"aspectRatio",{get:function(){var K;return(K=this._aspectRatio)!==null&&K!==void 0?K:this.aspectRatios[0]},set:function(K){this._aspectRatio=K},enumerable:!1,configurable:!0}),le.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},le.prototype.show=function(){this.showUI(),this.open()},le.prototype.close=function(K){K===void 0&&(K=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),K||this.closeEventListeners.forEach(function(X){return X()}),this._isOpen=!1)},le.prototype.addRenderEventListener=function(K){this.renderEventListeners.push(K)},le.prototype.removeRenderEventListener=function(K){this.renderEventListeners.indexOf(K)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(K),1)},le.prototype.addCloseEventListener=function(K){this.closeEventListeners.push(K)},le.prototype.removeCloseEventListener=function(K){this.closeEventListeners.indexOf(K)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(K),1)},le.prototype.setupResizeObserver=function(){var K=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){K.resize(K.target.clientWidth,K.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))},le.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var K=1*this.target.clientWidth/this.target.clientHeight,X=this.contentDiv.clientWidth/K>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*K:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,ee=X+2*this.CANVAS_MARGINK+this.CANVAS_MARGIN?this.target.offsetTop-(K+this.CANVAS_MARGIN):0;this.coverDiv.style.top=X+"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},le.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},le.prototype.addTopToolbar=function(){var K=this;this.topToolbar=new hr,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 X=new Ct;X.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(X);var ee=[];this.aspectRatios.forEach(function(qt){var Hr=new Dt(Cr.getIcon(qt.horizontal,qt.vertical),qt.horizontal===0&&qt.vertical===0?"FREE":qt.horizontal+":"+qt.vertical);Hr.onClick=function(){return K.ratioButtonClicked(qt)},ee.push(Hr)}),this.aspectRatioButton=new Jt(Cr.getIcon(0,0),"Aspect ratio",ee),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,X.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var me=new Dt('',"Toggle grid");me.isActive=this.isGridVisible,me.onClick=function(){K.isGridVisible=!K.isGridVisible,me.isActive=K.isGridVisible},X.addButton(me);var ae=new Dt('',"Zoom to selection");if(ae.isActive=this.zoomToCropEnabled,ae.onClick=function(){K.zoomToCropEnabled=!K.zoomToCropEnabled,ae.isActive=K.zoomToCropEnabled},X.addButton(ae),!nr.isLicensed){var Ke=new wt;this.topToolbar.addElementBlock(Ke);var pt=document.createElement("div");pt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ot=document.createElement("a");Ot.style.color="currentColor",Ot.href="https://markerjs.com/products/cropro",Ot.target="_blank",Ot.innerHTML='',pt.appendChild(Ot),Ke.addElement(pt)}var Ht=new Ct;Ht.minWidth=3*this.toolbarHeight+"px",Ht.contentAlign="end",this.topToolbar.addButtonBlock(Ht);var vt=new Dt('',"OK");vt.onClick=this.startRenderAndClose,Ht.addButton(vt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Xt=new Dt('',"Close");Xt.onClick=this.close,Ht.addButton(Xt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Xt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},le.prototype.addBottomToolbar=function(){var K=this;this.bottomToolbar=new hr,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 X=new Ct;X.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(X);var ee=new Dt('',"Rotate left");ee.onClick=this.rotateLeftButtonClicked,X.addButton(ee);var me=new Dt('',"Rotate right");me.onClick=this.rotateRightButtonClicked,X.addButton(me);var ae=new wt;ae.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(ae),this.straightener=new un("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Ht){K.rotateBy(Ht),K.straightener.angle=K.rotationAngle},ae.addElement(this.straightener.getUI());var Ke=new Ct;Ke.minWidth=2*this.toolbarHeight+"px",Ke.contentAlign="end",this.bottomToolbar.addButtonBlock(Ke);var pt=new Dt('',"Flip horizontal");pt.onClick=this.flipHorizontallyButtonClicked,Ke.addButton(pt);var Ot=new Dt('',"Flip vertical");Ot.onClick=this.flipVerticallyButtonClicked,Ke.addButton(Ot)},le.prototype.ratioButtonClicked=function(K){this.aspectRatio=K,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},le.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Cr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},le.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new wr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},le.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},le.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},le.prototype.restoreState=function(K){if(K){var X=this.cropLayer.getRescaledRect(K.width,K.height,this.imageWidth,this.imageHeight,K.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(X),this.cropRectChanged(X),this.flippedHorizontally=K.flippedHorizontally,this.flippedVertically=K.flippedVertically,this.applyFlip(),this.rotationAngle=K.rotationAngle,this.applyRotation()}},le.prototype.clientToLocalCoordinates=function(K,X){var ee=this.cropImage.getBoundingClientRect();return{x:K-ee.left,y:X-ee.top}},le.prototype.onWindowResize=function(){this.positionUI()},le.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var K=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=K+"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()},le.prototype.rotateLeftButtonClicked=function(){var K=this.rotationAngle-90;this.rotationAngle%90!=0&&(K+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(K)},le.prototype.rotateRightButtonClicked=function(){var K=this.rotationAngle+90;this.rotationAngle%90!=0&&(K-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(K)},le.prototype.rotateTo=function(K){K=(K=K>180?K-360:K)<=-180?K+360:K,this.rotationAngle=K,this.applyRotation()},le.prototype.rotateBy=function(K){this.rotateTo((this.rotationAngle+K)%360)},le.prototype.applyRotation=function(){var K=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var X=this.editingTargetRotationContainer.transform.baseVal.getItem(0);X.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(X,0);var ee=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/ee.width,this.imageHeight/ee.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=K},le.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},le.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},le.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},le.prototype.startRenderAndClose=function(){return Wt(this,void 0,void 0,function(){var K,X;return Lt(this,function(ee){switch(ee.label){case 0:return[4,this.render()];case 1:return K=ee.sent(),X=this.getState(),this.renderEventListeners.forEach(function(me){return me(K,X)}),this.close(!0),[2]}})})},le.prototype.render=function(){return Wt(this,void 0,void 0,function(){var K;return Lt(this,function(X){switch(X.label){case 0:return(K=new Nr).naturalSize=this.renderAtNaturalSize,K.imageType=this.renderImageType,K.imageQuality=this.renderImageQuality,K.width=this.renderWidth,K.height=this.renderHeight,this.unzoomFromCrop(),dt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,K.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 X.sent(),[4,K.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,X.sent()]}})})},le.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new kt("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 kt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new kt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var K=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new kt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*K)+`px;
height: `+(this.toolbarHeight-2*K)+`px;
padding: `+K+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new kt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new kt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new jt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new kt("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 kt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new kt("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 kt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*K)+`px;
padding: `+K+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new kt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},le.instanceCounter=0,le}(),Bt=j("8hTe"),Jr=j.n(Bt),on=/]*>/g;function Ln(le){var K=document.createElement("div");return K.innerHTML=le,K.childNodes.length===0?"":K.childNodes[0].nodeValue}var Sn=Q.a=function(le){var K=le.value,X=K===void 0?"":K,ee=le.edit,me=ee===void 0?!1:ee,ae=le.className,Ke=le.showTextOnly,pt=le.showLines,Ot=le.replaces,Ht=le.zoomImg,vt=le.hasMask,Xt=le.style,qt=Xt===void 0?{}:Xt,Hr=le.stylesPrev,nn=Hr===void 0?{}:Hr,zr=String(X),or=Object(d.useRef)(),Qr=Object(d.useRef)(),Cn=Object(d.useState)(""),zt=Object(S.a)(Cn,2),pr=zt[0],fr=zt[1],jr=Object(d.useState)("office"),Er=Object(S.a)(jr,2),li=Er[0],On=Er[1],Ui=function(){var cr=new bt(Qr.current);cr.displayMode="popup",cr.addRenderEventListener(function(){var tn=Object(m.a)(p.a.mark(function br(hn){var Fr;return p.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return or.current.style.display="none",_n.next=3,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hn}});case 3:Fr=_n.sent,Fr!=null&&Fr.id&&Ot(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Fr==null?void 0:Fr.id,"?type=").concat(Fr.content_type));case 5:case"end":return _n.stop()}},br)}));return function(br){return tn.apply(this,arguments)}}()),cr.show()},Bi=function(){var cr=new Kt(Qr.current);cr.settings.displayMode="popup",cr.addEventListener("render",function(){var tn=Object(m.a)(p.a.mark(function br(hn){var Fr;return p.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(or.current.style.display="none",!Qr.current){_n.next=6;break}return _n.next=4,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:hn.dataUrl}});case 4:Fr=_n.sent,Fr!=null&&Fr.id&&Ot(Qr.current.getAttribute("src").replace($.a.API_SERVER,""),"/api/attachments/".concat(Fr==null?void 0:Fr.id,"?type=").concat(Fr.content_type));case 6:case"end":return _n.stop()}},br)}));return function(br){return tn.apply(this,arguments)}}()),cr.show(),window.markerArea=cr},qn=Object(d.useMemo)(function(){or.current&&(or.current.style.zIndex=-1);try{var Zr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,cr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,tn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;zr=zr.replace(Zr,"("+$.a.API_SERVER+"/api/attachments/").replace(cr,'"'+$.a.API_SERVER+"/api/attachments/").replace(tn,'"'+$.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(mi){}var br=G(zr),hn=M();if(zr.match(/\[TOC\]/)&&(br=br.replace("[TOC]
",R()),w()),br=br.replace(/(__special_katext_id_\d+__)/g,function(mi,_n){var Un=hn[_n],Di=Un.type,ui=Un.expression;return Object(re.renderToString)(Ln(ui)||"",{displayMode:Di==="block",throwOnError:!1,output:"html"})}),br=br.replace(/▁/g,"\u2581\u2581\u2581"),L(),Ke){var Fr=document.createElement("div");return Fr.innerHTML=br,Fr.innerText}return setTimeout(function(){return dn()},500),br},[zr]),sn=Object(d.useRef)();_.WebkitLineClamp=pt,pt&&(qt=Object(y.a)(Object(y.a)({},qt),_));function Si(Zr){var cr=Zr.target;if(cr.tagName.toUpperCase()==="IMG"){if(Ht){var tn=cr.getAttribute("src");fr(tn),On("image")}}else if(cr.tagName.toUpperCase()==="A"){var br=cr.getAttribute("href");if(br.indexOf("office")>-1)Zr.preventDefault(),fr(br),On("office");else if(br.indexOf("application/pdf")>-1)Zr.preventDefault(),fr(br),On("pdf");else if(br.indexOf("text/html")>-1)Zr.preventDefault(),fr(br),On("html");else if(br.startsWith("#")){Zr.preventDefault();var hn=document.getElementById(br.replace("#",""));hn&&hn.scrollIntoView(!0)}}}var dn=function(){var cr,tn=(cr=sn.current)===null||cr===void 0?void 0:cr.querySelectorAll("video");tn==null||tn.forEach(function(br){if(br.oncontextmenu=function(){return!1},br.src.indexOf(".m3u8")>-1&&!br.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var hn=new H.a;hn.loadSource(br.src),hn.attachMedia(br)}}})};Object(d.useEffect)(function(){if(sn.current&&qn&&(qn.match(on)&&window.PR.prettyPrint()),sn.current)return sn.current.addEventListener("click",Si),function(){sn.current.removeEventListener("click",Si),L(),w()}},[qn,sn.current,Si]);var Yn=function(cr){if(!me)return;cr.target.nodeName==="IMG"?(or.current.style.zIndex=1,or.current.style.display="flex",or.current.style.width=cr.target.clientWidth+"px",or.current.style.height=cr.target.clientHeight+"px",or.current.style.top=cr.target.offsetTop+"px",or.current.style.left=cr.target.offsetLeft+"px",Qr.current.src=cr.target.getAttribute("src")):or.current.style.display="none"};return t.a.createElement("div",{style:{position:"relative"}},t.a.createElement("div",{ref:sn,style:Object(y.a)({},qt),className:"".concat(ae||""," markdown-body ").concat(Jr.a.mdBody),onMouseOver:Yn,dangerouslySetInnerHTML:{__html:qn}}),t.a.createElement("div",{ref:or,className:Jr.a.button},t.a.createElement(v.a,null,t.a.createElement(k.a,{onClick:function(){return Ui()}},"\u88C1\u526A"),t.a.createElement(k.a,{onClick:function(){return Bi()}},"\u7F16\u8F91"))),t.a.createElement("img",{ref:Qr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),t.a.createElement(te.a,{close:!0,data:pr,type:pr!=null&&pr.length?li:"",style:Object(y.a)({},nn),onClose:function(){return fr("")}}))}},"9OqN":function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.mode.CTR=function(){var v=N.lib.BlockCipherMode.extend(),C=v.Encryptor=v.extend({processBlock:function(k,y){var m=this._cipher,S=m.blockSize,b=this._iv,p=this._counter;b&&(p=this._counter=b.slice(0),this._iv=void 0);var d=p.slice(0);m.encryptBlock(d,0),p[S-1]=p[S-1]+1|0;for(var t=0;t0&&Ne.current===oe.length){at(!1);var dt=H(nr);dt=dt.filter(function(Et){var jt,kt;return!!((jt=Et[0])!==null&&jt!==void 0&&jt.name&&(kt=Et[1])!==null&&kt!==void 0&&kt.name)}),dt=dt.map(function(Et){return Object(c.a)(Object(c.a)(Object(c.a)({},Et[0]),Et[1]),{},{is_file:!1})}),de(dt),ve()}}else at(!1),ve()});return}if(ot){var At=new FormData;At.append("file",ft.file),At.append("identifier",he);var _t=Object(z.a)("/api/attachments.json",{method:"post",body:At},!0);_t.then(function(Lt){if(Lt.filename){Ne.current=Ne.current+1;var nr=Ze.current.map(function(Et){if(Et.name===(Lt==null?void 0:Lt.filename)){var jt,kt=Object(c.a)(Object(c.a)({},Et),{},{is_oss:!ot});return Lt!=null&&(jt=Lt.filename)!==null&&jt!==void 0&&jt.includes(".in")?(kt.in_object_key=Lt==null?void 0:Lt.object,kt.in_object_size=Lt==null?void 0:Lt.size,kt.input=Lt==null?void 0:Lt.filename,kt.in_file=ft):(kt.out_object_key=Lt==null?void 0:Lt.object,kt.out_object_size=Lt==null?void 0:Lt.size,kt.output=Lt==null?void 0:Lt.filename,kt.out_file=ft),kt}return Et});if(Ze.current=Object(f.a)(nr),q(Object(f.a)(nr)),Ne.current>0&&Ne.current===oe.length){at(!1);var dt=H(nr);dt=dt.filter(function(Et){var jt,kt;return!!((jt=Et[0])!==null&&jt!==void 0&&jt.name&&(kt=Et[1])!==null&&kt!==void 0&&kt.name)}),dt=dt.map(function(Et){return Object(c.a)(Object(c.a)(Object(c.a)({},Et[0]),Et[1]),{},{is_file:!0})}),de(dt),ve()}}else at(!1),ve()});return}var Vt=new A.a({endpoint:ye.end_point,region:ye.region,accessKeyId:ye.access_key_id,accessKeySecret:ye.access_key_secret,bucket:ye.bucket,stsToken:ye.security_token}),Kt=ft.name,tr={container_type:"TestSet",file_name:Kt},rr=Object(W.a)(),Wt="testsets/".concat(he,"/").concat(rr).concat(Kt.indexOf(".")>-1?"."+Kt.split(".").pop():"");he===null&&(Wt="testsets/".concat(rr).concat(Kt.indexOf(".")>-1?"."+Kt.split(".").pop():"")),Vt.multipartUpload(Wt,new Blob([ft.file],{type:ft.file.type}),{timeout:3600*1e3,partSize:1002400,callback:{customValue:{id:Kt+""},url:ye==null?void 0:ye.callback_url,host:ye==null?void 0:ye.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(z.e)(tr)}}).then(function(Lt){if(Lt.data.status===0){Ne.current=Ne.current+1;var nr=Ze.current.map(function(Et){var jt,kt;if(Et.name===((jt=Lt.data)===null||jt===void 0||((kt=jt.data)===null||kt===void 0)?void 0:kt.file_name)){var hr,Nn,Ct,Dt=Object(c.a)(Object(c.a)({},Et),{},{is_oss:!ot});if((hr=Lt.data)!==null&&hr!==void 0&&(Nn=hr.data)!==null&&Nn!==void 0&&(Ct=Nn.file_name)!==null&&Ct!==void 0&&Ct.includes(".in")){var wt,wr,Cr,Jt,Ut,Or;Dt.in_object_key=(wt=Lt.data)===null||wt===void 0||((wr=wt.data)===null||wr===void 0)?void 0:wr.object,Dt.in_object_size=(Cr=Lt.data)===null||Cr===void 0||((Jt=Cr.data)===null||Jt===void 0)?void 0:Jt.size,Dt.input=(Ut=Lt.data)===null||Ut===void 0||((Or=Ut.data)===null||Or===void 0)?void 0:Or.file_name,Dt.in_file=ft}else{var un,Nr,bt,Bt,Jr,on;Dt.out_object_key=(un=Lt.data)===null||un===void 0||((Nr=un.data)===null||Nr===void 0)?void 0:Nr.object,Dt.out_object_size=(bt=Lt.data)===null||bt===void 0||((Bt=bt.data)===null||Bt===void 0)?void 0:Bt.size,Dt.output=(Jr=Lt.data)===null||Jr===void 0||((on=Jr.data)===null||on===void 0)?void 0:on.file_name,Dt.out_file=ft}return Dt}return Et});if(Ze.current=Object(f.a)(nr),q(Object(f.a)(nr)),Ne.current>0&&Ne.current===oe.length){at(!1);var dt=H(nr);dt=dt.filter(function(Et){var jt,kt;return!!((jt=Et[0])!==null&&jt!==void 0&&jt.name&&(kt=Et[1])!==null&&kt!==void 0&&kt.name)}),dt=dt.map(function(Et){return Object(c.a)(Object(c.a)(Object(c.a)({},Et[0]),Et[1]),{},{is_file:!0})}),de(dt),ve()}}})},Fe=function(ft){return new Promise(function(mt,It){for(var At=0,_t=[],Vt=function(rr){ft[rr].file.slice(0,1).arrayBuffer().then(function(){At++,At===ft.length&&(_t.length?(s.b.warn("".concat(_t.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),It()):mt(ft))}).catch(function(Wt){console.log("\u9519\u8BEF\u4FE1\u606F\uFF1A",Wt),At++,_t.push(ft[rr].name),At===ft.length&&(_t.length?(s.b.warn("".concat(_t.join("\uFF0C"),"\u6587\u4EF6\u5DF2\u635F\u574F\u6216\u5DF2\u88AB\u4FEE\u6539\uFF0C\u8BF7\u5220\u9664\u540E\u91CD\u65B0\u4E0A\u4F20\uFF01")),It()):mt(ft))})},Kt=0;Kt100)return s.b.info("\u6587\u4EF6\u8D85\u8FC7100M\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42"),!1;if(!/\.(in|out|IN|OUT)$/.test(ft.name))return s.b.warn("\u8F93\u5165\u6587\u4EF6\u53EA\u80FD\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6"),!1;var mt={name:ft.name,uid:ft.uid,file:ft,percent:0};return oe.push(mt),Ze.current=Object(f.a)(oe),q(Object(f.a)(oe)),!1}},ct=H(oe);return console.log(oe,ct,"fileList"),g.a.createElement(i.a,{visible:De,wrapClassName:Te,onOk:Be,centered:!0,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",okButtonProps:{loading:rt},onCancel:Ae,width:"1000px",title:"\u6279\u91CF\u4E0A\u4F20\u6D4B\u8BD5\u7528\u4F8B"},g.a.createElement("div",{className:E.a.wrap},oe.length?g.a.createElement("div",null,g.a.createElement(b.a,{justify:"space-between",align:"middle",className:"mb20"},g.a.createElement("div",{style:{visibility:ie?"visible":"hidden"}},"\u6D4B\u8BD5\u7528\u4F8B\u7C7B\u578B\uFF1A",g.a.createElement(d.a.Group,{className:"ml10",value:lt,onChange:function(ft){return je(ft.target.value)}},g.a.createElement(d.a,{value:!1},"\u6587\u672C"),g.a.createElement(d.a,{value:!0},"\u6587\u4EF6"))),g.a.createElement(_.a,et,g.a.createElement(l.a,{className:E.a.btnS},"\u4E0A\u4F20\u6587\u4EF6"))),g.a.createElement(re,{data:ct,onRemove:Ce})):g.a.createElement("div",{className:E.a.noData},g.a.createElement("img",{src:M.a,alt:""}),g.a.createElement(_.a,et,g.a.createElement(l.a,{className:E.a.btn},"\u4E0A\u4F20\u6587\u4EF6"))),g.a.createElement("div",{className:E.a.text},"\u4E0A\u4F20\u9650\u5236\uFF1A",g.a.createElement("br",null),"1\u3001\u6587\u4EF6\u5FC5\u987B\u4E0A\u4F20.in\u548C.out\u7C7B\u578B\u7684\u6587\u672C\u6587\u4EF6\u3002",g.a.createElement("br",null),"2\u3001\u4E0A\u4F20\u7684\u6587\u4EF6\u7F16\u7801\u4EC5\u652F\u6301UTF-8\uFF0C\u5426\u5219\u53EF\u80FD\u4F1A\u51FA\u73B0\u6587\u672C\u4E71\u7801\u3002",g.a.createElement("br",null),"3\u3001\u8F93\u5165\u8F93\u51FA\u6587\u4EF6\u9700\u6587\u4EF6\u540D\u79F0\u4E00\u4E00\u5BF9\u5E94\uFF0C\u672A\u5BF9\u5E94\u65F6\uFF0C\u5C06\u65E0\u6CD5\u4E0A\u4F20\u3002",g.a.createElement("br",null),"4\u3001\u5355\u4E2A\u4E0A\u4F20\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7100MB\uFF0C\u8D85\u8FC7\u65F6\u53EF\u4EE5\u5206\u6279\u6B21\u4E0A\u4F20\u3002",g.a.createElement("br",null))))},re=function(ge){var ve=ge.data,de=ve===void 0?[]:ve,De=ge.onRemove,Te=ge.width,he=Te===void 0?"auto":Te,ue=ge.showScore,ie=ue===void 0?!1:ue,Se=ge.disabled,ne=Se===void 0?!1:Se,ce=ge.inputChange,Oe=ge.onEvaluatingChange,oe=ge.showEvaluatingSetting,q=oe===void 0?!1:oe,Y={value:"",filename:"",dataUrl:""},Z=Object(O.useState)(Object(c.a)({},Y)),ye=Object(u.a)(Z,2),be=ye[0],Re=ye[1],Qe=function(st){var lt=document.createElement("a");document.body.appendChild(lt);var je=URL.createObjectURL(st.file);lt.href=je,lt.download=st.name,lt.click(),URL.revokeObjectURL(je),document.body.removeChild(lt)},rt=function(st,lt){Object(G.y)(st,lt)},at=function(st,lt){i.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:g.a.createElement("div",{className:"tc font16"},"\u8BF7\u786E\u8BA4\u662F\u5426\u5220\u9664\u8BE5\u6D4B\u8BD5\u7528\u4F8B?"),onOk:function(){De(st,lt)},onCancel:function(){}})};return de.length?g.a.createElement("div",{style:{width:he}},g.a.createElement("div",{className:E.a.head},q&&g.a.createElement("div",{style:{width:"10%"}},"\u9690\u85CF",g.a.createElement(m.a,{title:'\u9690\u85CF\u6D4B\u8BD5\u96C6\u53EF\u4EE5\u9632\u6B62\u5B66\u751F\u901A\u8FC7"print"\u7B49\u624B\u6BB5\u76F4\u63A5\u901A\u5173'},g.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),g.a.createElement("div",{style:{width:"20%"}},"\u7528\u4F8B"),g.a.createElement("div",{style:{width:ie?"25%":"35%",padding:"0 12px"}},"\u8F93\u5165"),g.a.createElement("div",{style:{width:ie?"25%":"35%",padding:"0 12px"}},"\u8F93\u51FA"),ie&&g.a.createElement("div",{style:{width:"20%"}},"\u5F97\u5206\u6BD4\u4F8B"),q&&g.a.createElement("div",{style:{width:"20%"}},"\u9884\u671F\u8F93\u51FA",g.a.createElement(m.a,{title:"\u52FE\u9009\u540E\uFF0C\u9884\u671F\u8F93\u51FA\u5BF9\u5B66\u5458\u59CB\u7EC8\u4E0D\u53EF\u89C1"},g.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),q&&g.a.createElement("div",{style:{width:"20%"}},"\u7279\u6B8A\u5224\u5B9A",g.a.createElement(m.a,{title:"\u52FE\u9009\u540E\uFF0C\u5B9E\u9645\u8F93\u51FA\u4E0E\u9884\u671F\u8F93\u51FA\u6700\u540E\u4E00\u884C\u76F8\u540C\u5373\u53EF\u901A\u5173"},g.a.createElement("i",{className:"ml5 font14 iconfont icon-xiaowenhao1"}))),g.a.createElement("div",{style:{width:"10%"}},"\u64CD\u4F5C")),de.map(function(qe,st){var lt,je,Ie,tt;return g.a.createElement("div",{key:st,className:E.a.list},q&&g.a.createElement("div",{style:{width:"10%"}},g.a.createElement(k.a,{checked:!!qe.hidden,onChange:function(ze){Oe(ze.target.checked?1:0,st,"hidden")}})),g.a.createElement("div",{style:{width:"20%"}},"\u6D4B\u8BD5\u7528\u4F8B",st+1),g.a.createElement("div",{className:E.a.info,style:{width:ie?"25%":"35%"}},g.a.createElement("span",{title:qe.input||((lt=qe[0])===null||lt===void 0?void 0:lt.name),onClick:Object(a.a)(R.a.mark(function ot(){var ze,Ze;return R.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:if(qe.input?qe.input_file_url?ze=qe.input_file_url:ze=qe.in_file:ze=qe[0],!(typeof ze=="string")){Ae.next=14;break}return Ae.next=4,fetch(ze,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return Ze=Ae.sent,Ae.t0=Re,Ae.next=8,Ze.text();case 8:Ae.t1=Ae.sent,Ae.t2=ze,Ae.t3={value:Ae.t1,filename:"",dataUrl:Ae.t2},(0,Ae.t0)(Ae.t3),Ae.next=18;break;case 14:return Ae.next=16,Object(G.H)(ze.file);case 16:Ze=Ae.sent,Re({value:Ze.text,filename:ze.name,dataUrl:Ze.link});case 18:case"end":return Ae.stop()}},ot)}))},qe.input||((je=qe[0])===null||je===void 0?void 0:je.name))),g.a.createElement("div",{className:E.a.info,style:{width:ie?"25%":"35%"}},g.a.createElement("span",{title:qe.output||((Ie=qe[1])===null||Ie===void 0?void 0:Ie.name),onClick:Object(a.a)(R.a.mark(function ot(){var ze,Ze;return R.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:if(qe.input?qe.output_file_url?ze=qe.output_file_url:ze=qe.out_file:ze=qe[1],!(typeof ze=="string")){Ae.next=14;break}return Ae.next=4,fetch(ze,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 4:return Ze=Ae.sent,Ae.t0=Re,Ae.next=8,Ze.text();case 8:Ae.t1=Ae.sent,Ae.t2=ze,Ae.t3={value:Ae.t1,filename:"",dataUrl:Ae.t2},(0,Ae.t0)(Ae.t3),Ae.next=18;break;case 14:return Ae.next=16,Object(G.H)(ze.file);case 16:Ze=Ae.sent,Re({value:Ze.text,filename:ze.name,dataUrl:Ze.link});case 18:case"end":return Ae.stop()}},ot)}))},qe.output||((tt=qe[1])===null||tt===void 0?void 0:tt.name))),ie&&g.a.createElement("div",{style:{width:"20%"}},g.a.createElement(v.a,{disabled:ne,style:{width:"70%"},onChange:function(ze){return ce(ze,st)},value:qe.score}),g.a.createElement("span",null,"\xA0%")),q&&g.a.createElement("div",{style:{width:"20%"}},g.a.createElement(k.a,{checked:qe.is_invisible||!1,onChange:function(ze){Oe(ze.target.checked,st,"is_invisible")},className:"font14"},"\u5BF9\u5B66\u5458\u4E0D\u53EF\u89C1")),q&&g.a.createElement("div",{style:{width:"20%"}},g.a.createElement(k.a,{checked:qe.last_match_rule||!1,onChange:function(ze){Oe(ze.target.checked,st,"last_match_rule")},className:"font14"},"\u672B\u5C3E\u5339\u914D")),g.a.createElement("div",{onClick:function(){return at(qe,st)},style:{width:"10%"}},g.a.createElement("span",{className:E.a.del},"\u5220\u9664")))}),g.a.createElement(U.a,{close:!0,data:be.dataUrl,filename:be.filename,type:be.dataUrl.length?"txt":"",onClose:function(){return Re(Object(c.a)({},Y))},monacoEditor:{value:be.value,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}})):g.a.createElement(g.a.Fragment,null)};Q.b=$},BU3w:function(F,Q,j){"use strict";j.d(Q,"a",function(){return m});var N=j("MNnm"),v="rc-util-key";function C(S){if(S.attachTo)return S.attachTo;var b=document.querySelector("head");return b||document.body}function k(S){var b,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(N.a)())return null;var d=document.createElement("style");if((b=p.csp)===null||b===void 0?void 0:b.nonce){var t;d.nonce=(t=p.csp)===null||t===void 0?void 0:t.nonce}d.innerHTML=S;var l=C(p),r=l.firstChild;return p.prepend&&l.prepend?l.prepend(d):p.prepend&&r?l.insertBefore(d,r):l.appendChild(d),d}var y=new Map;function m(S,b){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=C(p);if(!y.has(d)){var t=k("",p),l=t.parentNode;y.set(d,l),l.removeChild(t)}var r=Array.from(y.get(d).children).find(function(a){return a.tagName==="STYLE"&&a[v]===b});if(r){var i,o;if(((i=p.csp)===null||i===void 0?void 0:i.nonce)&&r.nonce!==((o=p.csp)===null||o===void 0?void 0:o.nonce)){var s;r.nonce=(s=p.csp)===null||s===void 0?void 0:s.nonce}return r.innerHTML!==S&&(r.innerHTML=S),r}var c=k(S,p);return c[v]=b,c}},Bd2K:function(F,Q,j){(function(N){N(j("VrN/"),j("osHv"))})(function(N){N.defineOption("autoCloseTags",!1,function(p,d,t){if(t!=N.Init&&t&&p.removeKeyMap("autoCloseTags"),!d)return;var l={name:"autoCloseTags"};(typeof d!="object"||d.whenClosing!==!1)&&(l["'/'"]=function(r){return m(r)}),(typeof d!="object"||d.whenOpening!==!1)&&(l["'>'"]=function(r){return k(r)}),p.addKeyMap(l)});var v=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],C=["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 k(p){if(p.getOption("disableInput"))return N.Pass;for(var d=p.listSelections(),t=[],l=p.getOption("autoCloseTags"),r=0;ri.ch&&(u=u.slice(0,u.length-o.end+i.ch));var h=u.toLowerCase();if(!u||o.type=="string"&&(o.end!=i.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&a.close||o.string.indexOf("/")==i.ch-o.start-1||w&&S(w,h)>-1||b(p,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(c)||[],u,i,!0))return N.Pass;var R=typeof l=="object"&&l.emptyTags;if(R&&S(R,u)>-1){t[r]={text:"/>",newPos:N.Pos(i.line,i.ch+2)};continue}var O=_&&S(_,h)>-1;t[r]={indent:O,text:">"+(O?`
`:"")+""+u+">",newPos:O?N.Pos(i.line+1,0):N.Pos(i.line,i.ch+1)}}for(var g=typeof l=="object"&&l.dontIndentOnAutoClose,r=d.length-1;r>=0;r--){var x=t[r];p.replaceRange(x.text,d[r].head,d[r].anchor,"+insert");var E=p.listSelections().slice(0);E[r]={head:x.newPos,anchor:x.newPos},p.setSelections(E),!g&&x.indent&&(p.indentLine(x.newPos.line,null,!0),p.indentLine(x.newPos.line+1,null,!0))}}function y(p,d){for(var t=p.listSelections(),l=[],r=d?"/":"",i=p.getOption("autoCloseTags"),o=typeof i=="object"&&i.dontIndentOnSlash,s=0;s"&&(w+=">"),l[s]=w}if(p.replaceSelections(l),t=p.listSelections(),!o)for(var s=0;s=0&&d[c]==t;c--)++s;l=o.to;for(var c=1;c0){for(var d=0;d1&&arguments[1]!==void 0?arguments[1]:"",d=[],t=0;t=0;d--){var t=C().key(d);p(k(t),t)}}function S(p){return C().removeItem(p)}function b(){return C().clear()}},DlQD:function(F,Q,j){(function(N,v){F.exports=v()})(this,function(){"use strict";function N(Ne,Ae){for(var Me=0;MeNe.length)&&(Ae=Ne.length);for(var Me=0,Ee=new Array(Ae);Me=Ne.length?{done:!0}:{done:!1,value:Ne[Ee++]}}}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 Me=Ne[Symbol.iterator](),Me.next.bind(Me)}function m(Ne,Ae){return Ae={exports:{}},Ne(Ae,Ae.exports),Ae.exports}var S=m(function(Ne){function Ae(){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 Me(Ee){Ne.exports.defaults=Ee}Ne.exports={defaults:Ae(),getDefaults:Ae,changeDefaults:Me}}),b=S.defaults,p=S.getDefaults,d=S.changeDefaults,t=/[&<>"']/,l=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,i=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},s=function(Ae){return o[Ae]};function c(Ne,Ae){if(Ae){if(t.test(Ne))return Ne.replace(l,s)}else if(r.test(Ne))return Ne.replace(i,s);return Ne}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(Ne){return Ne.replace(a,function(Ae,Me){return Me=Me.toLowerCase(),Me==="colon"?":":Me.charAt(0)==="#"?Me.charAt(1)==="x"?String.fromCharCode(parseInt(Me.substring(2),16)):String.fromCharCode(+Me.substring(1)):""})}var f=/(^|[^\[])\^/g;function w(Ne,Ae){Ne=Ne.source||Ne,Ae=Ae||"";var Me={replace:function(Ce,ke){return ke=ke.source||ke,ke=ke.replace(f,"$1"),Ne=Ne.replace(Ce,ke),Me},getRegex:function(){return new RegExp(Ne,Ae)}};return Me}var _=/[^\w:]/g,h=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function R(Ne,Ae,Me){if(Ne){var Ee;try{Ee=decodeURIComponent(u(Me)).replace(_,"").toLowerCase()}catch(Ce){return null}if(Ee.indexOf("javascript:")===0||Ee.indexOf("vbscript:")===0||Ee.indexOf("data:")===0)return null}Ae&&!h.test(Me)&&(Me=T(Ae,Me));try{Me=encodeURI(Me).replace(/%25/g,"%")}catch(Ce){return null}return Me}var O={},g=/^[^:]+:\/*[^/]*$/,x=/^([^:]+:)[\s\S]*$/,E=/^([^:]+:\/*[^/]*)[\s\S]*$/;function T(Ne,Ae){O[" "+Ne]||(g.test(Ne)?O[" "+Ne]=Ne+"/":O[" "+Ne]=V(Ne,"/",!0)),Ne=O[" "+Ne];var Me=Ne.indexOf(":")===-1;return Ae.substring(0,2)==="//"?Me?Ae:Ne.replace(x,"$1")+Ae:Ae.charAt(0)==="/"?Me?Ae:Ne.replace(E,"$1")+Ae:Ne+Ae}var M={exec:function(){}};function L(Ne){for(var Ae=1,Me,Ee;Ae=0&&Be[ct]==="\\";)et=!et;return et?"|":" |"}),Ee=Me.split(/ \|/),Ce=0;if(Ee.length>Ae)Ee.splice(Ae);else for(;Ee.length=Ee.length?Ce.slice(Ee.length):Ce}).join(`
`)}var ve=function(){function Ne(Me){this.options=Me||U}var Ae=Ne.prototype;return Ae.space=function(Ee){var Ce=this.rules.block.newline.exec(Ee);if(Ce)return Ce[0].length>1?{type:"space",raw:Ce[0]}:{raw:`
`}},Ae.code=function(Ee,Ce){var ke=this.rules.block.code.exec(Ee);if(ke){var Fe=Ce[Ce.length-1];if(Fe&&Fe.type==="paragraph")return{raw:ke[0],text:ke[0].trimRight()};var Be=ke[0].replace(/^ {4}/gm,"");return{type:"code",raw:ke[0],codeBlockStyle:"indented",text:this.options.pedantic?Be:P(Be,`
`)}}},Ae.fences=function(Ee){var Ce=this.rules.block.fences.exec(Ee);if(Ce){var ke=Ce[0],Fe=ge(ke,Ce[3]||"");return{type:"code",raw:ke,lang:Ce[2]?Ce[2].trim():Ce[2],text:Fe}}},Ae.heading=function(Ee){var Ce=this.rules.block.heading.exec(Ee);if(Ce)return{type:"heading",raw:Ce[0],depth:Ce[1].length,text:Ce[2]}},Ae.nptable=function(Ee){var Ce=this.rules.block.nptable.exec(Ee);if(Ce){var ke={type:"table",header:H(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
`):[],raw:Ce[0]};if(ke.header.length===ke.align.length){var Fe=ke.align.length,Be;for(Be=0;Be ?/gm,"");return{type:"blockquote",raw:Ce[0],text:ke}}},Ae.list=function(Ee){var Ce=this.rules.block.list.exec(Ee);if(Ce){for(var ke=Ce[0],Fe=Ce[2],Be=Fe.length>1,et=Fe[Fe.length-1]===")",ct={type:"list",raw:ke,ordered:Be,start:Be?+Fe.slice(0,-1):"",loose:!1,items:[]},yt=Ce[0].match(this.rules.block.item),ft=!1,mt,It,At,_t,Vt,Kt,tr,rr=yt.length,Wt=0;Wt1||this.options.smartLists&&At!==Fe)&&(_t=yt.slice(Wt+1).join(`
`),ct.raw=ct.raw.substring(0,ct.raw.length-_t.length),Wt=rr-1)),Vt=ft||/\n\n(?!\s*$)/.test(mt),Wt!==rr-1&&(ft=mt.charAt(mt.length-1)===`
`,Vt||(Vt=ft)),Vt&&(ct.loose=!0),Kt=/^\[[ xX]\] /.test(mt),tr=void 0,Kt&&(tr=mt[1]!==" ",mt=mt.replace(/^\[[ xX]\] +/,"")),ct.items.push({type:"list_item",raw:ke,task:Kt,checked:tr,loose:Vt,text:mt});return ct}},Ae.html=function(Ee){var Ce=this.rules.block.html.exec(Ee);if(Ce)return{type:this.options.sanitize?"paragraph":"html",raw:Ce[0],pre:!this.options.sanitizer&&(Ce[1]==="pre"||Ce[1]==="script"||Ce[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ce[0]):$(Ce[0]):Ce[0]}},Ae.def=function(Ee){var Ce=this.rules.block.def.exec(Ee);if(Ce){Ce[3]&&(Ce[3]=Ce[3].substring(1,Ce[3].length-1));var ke=Ce[1].toLowerCase().replace(/\s+/g," ");return{tag:ke,raw:Ce[0],href:Ce[2],title:Ce[3]}}},Ae.table=function(Ee){var Ce=this.rules.block.table.exec(Ee);if(Ce){var ke={type:"table",header:H(Ce[1].replace(/^ *| *\| *$/g,"")),align:Ce[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ce[3]?Ce[3].replace(/\n$/,"").split(`
`):[]};if(ke.header.length===ke.align.length){ke.raw=Ce[0];var Fe=ke.align.length,Be;for(Be=0;Be/i.test(Fe[0])&&(Ce=!1),!ke&&/^<(pre|code|kbd|script)(\s|>)/i.test(Fe[0])?ke=!0:ke&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Fe[0])&&(ke=!1),{type:this.options.sanitize?"text":"html",raw:Fe[0],inLink:Ce,inRawBlock:ke,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Fe[0]):$(Fe[0]):Fe[0]}},Ae.link=function(Ee){var Ce=this.rules.inline.link.exec(Ee);if(Ce){var ke=re(Ce[2],"()");if(ke>-1){var Fe=Ce[0].indexOf("!")===0?5:4,Be=Fe+Ce[1].length+ke;Ce[2]=Ce[2].substring(0,ke),Ce[0]=Ce[0].substring(0,Be).trim(),Ce[3]=""}var et=Ce[2],ct="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(et);yt?(et=yt[1],ct=yt[3]):ct=""}else ct=Ce[3]?Ce[3].slice(1,-1):"";et=et.trim().replace(/^<([\s\S]*)>$/,"$1");var ft=te(Ce,{href:et&&et.replace(this.rules.inline._escapes,"$1"),title:ct&&ct.replace(this.rules.inline._escapes,"$1")},Ce[0]);return ft}},Ae.reflink=function(Ee,Ce){var ke;if((ke=this.rules.inline.reflink.exec(Ee))||(ke=this.rules.inline.nolink.exec(Ee))){var Fe=(ke[2]||ke[1]).replace(/\s+/g," ");if(Fe=Ce[Fe.toLowerCase()],!Fe||!Fe.href){var Be=ke[0].charAt(0);return{type:"text",raw:Be,text:Be}}var et=te(ke,Fe,ke[0]);return et}},Ae.strong=function(Ee,Ce,ke){ke===void 0&&(ke="");var Fe=this.rules.inline.strong.start.exec(Ee);if(Fe&&(!Fe[1]||Fe[1]&&(ke===""||this.rules.inline.punctuation.exec(ke)))){Ce=Ce.slice(-1*Ee.length);var Be=Fe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Be.lastIndex=0;for(var et;(Fe=Be.exec(Ce))!=null;)if(et=this.rules.inline.strong.middle.exec(Ce.slice(0,Fe.index+3)),et)return{type:"strong",raw:Ee.slice(0,et[0].length),text:Ee.slice(2,et[0].length-2)}}},Ae.em=function(Ee,Ce,ke){ke===void 0&&(ke="");var Fe=this.rules.inline.em.start.exec(Ee);if(Fe&&(!Fe[1]||Fe[1]&&(ke===""||this.rules.inline.punctuation.exec(ke)))){Ce=Ce.slice(-1*Ee.length);var Be=Fe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Be.lastIndex=0;for(var et;(Fe=Be.exec(Ce))!=null;)if(et=this.rules.inline.em.middle.exec(Ce.slice(0,Fe.index+2)),et)return{type:"em",raw:Ee.slice(0,et[0].length),text:Ee.slice(1,et[0].length-1)}}},Ae.codespan=function(Ee){var Ce=this.rules.inline.code.exec(Ee);if(Ce){var ke=Ce[2].replace(/\n/g," "),Fe=/[^ ]/.test(ke),Be=ke.startsWith(" ")&&ke.endsWith(" ");return Fe&&Be&&(ke=ke.substring(1,ke.length-1)),ke=$(ke,!0),{type:"codespan",raw:Ce[0],text:ke}}},Ae.br=function(Ee){var Ce=this.rules.inline.br.exec(Ee);if(Ce)return{type:"br",raw:Ce[0]}},Ae.del=function(Ee){var Ce=this.rules.inline.del.exec(Ee);if(Ce)return{type:"del",raw:Ce[0],text:Ce[1]}},Ae.autolink=function(Ee,Ce){var ke=this.rules.inline.autolink.exec(Ee);if(ke){var Fe,Be;return ke[2]==="@"?(Fe=$(this.options.mangle?Ce(ke[1]):ke[1]),Be="mailto:"+Fe):(Fe=$(ke[1]),Be=Fe),{type:"link",raw:ke[0],text:Fe,href:Be,tokens:[{type:"text",raw:Fe,text:Fe}]}}},Ae.url=function(Ee,Ce){var ke;if(ke=this.rules.inline.url.exec(Ee)){var Fe,Be;if(ke[2]==="@")Fe=$(this.options.mangle?Ce(ke[0]):ke[0]),Be="mailto:"+Fe;else{var et;do et=ke[0],ke[0]=this.rules.inline._backpedal.exec(ke[0])[0];while(et!==ke[0]);Fe=$(ke[0]),ke[1]==="www."?Be="http://"+Fe:Be=Fe}return{type:"link",raw:ke[0],text:Fe,href:Be,tokens:[{type:"text",raw:Fe,text:Fe}]}}},Ae.inlineText=function(Ee,Ce,ke){var Fe=this.rules.inline.text.exec(Ee);if(Fe){var Be;return Ce?Be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Fe[0]):$(Fe[0]):Fe[0]:Be=$(this.options.smartypants?ke(Fe[0]):Fe[0]),{type:"text",raw:Fe[0],text:Be}}},Ne}(),de=G.noopTest,De=G.edit,Te=G.merge,he={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:de,table:de,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=De(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=De(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=De(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=//,he.html=De(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=De(he._paragraph).replace("hr",he.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",he._tag).getRegex(),he.blockquote=De(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=Te({},he),he.gfm=Te({},he.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*|$)"}),he.gfm.nptable=De(he.gfm.nptable).replace("hr",he.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",he._tag).getRegex(),he.gfm.table=De(he.gfm.table).replace("hr",he.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",he._tag).getRegex(),he.pedantic=Te({},he.normal,{html:De(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._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:de,paragraph:De(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ue={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:de,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:de,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ue.punctuation=De(ue.punctuation).replace(/punctuation/g,ue._punctuation).getRegex(),ue._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ue._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ue.em.start=De(ue.em.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.middle=De(ue.em.middle).replace(/punctuation/g,ue._punctuation).replace(/overlapSkip/g,ue._overlapSkip).getRegex(),ue.em.endAst=De(ue.em.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.em.endUnd=De(ue.em.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.start=De(ue.strong.start).replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.middle=De(ue.strong.middle).replace(/punctuation/g,ue._punctuation).replace(/blockSkip/g,ue._blockSkip).getRegex(),ue.strong.endAst=De(ue.strong.endAst,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.strong.endUnd=De(ue.strong.endUnd,"g").replace(/punctuation/g,ue._punctuation).getRegex(),ue.blockSkip=De(ue._blockSkip,"g").getRegex(),ue.overlapSkip=De(ue._overlapSkip,"g").getRegex(),ue._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ue._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ue._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])?)+(?![-_])/,ue.autolink=De(ue.autolink).replace("scheme",ue._scheme).replace("email",ue._email).getRegex(),ue._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ue.tag=De(ue.tag).replace("comment",he._comment).replace("attribute",ue._attribute).getRegex(),ue._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ue._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ue._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ue.link=De(ue.link).replace("label",ue._label).replace("href",ue._href).replace("title",ue._title).getRegex(),ue.reflink=De(ue.reflink).replace("label",ue._label).getRegex(),ue.reflinkSearch=De(ue.reflinkSearch,"g").replace("reflink",ue.reflink).replace("nolink",ue.nolink).getRegex(),ue.normal=Te({},ue),ue.pedantic=Te({},ue.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:De(/^!?\[(label)\]\((.*?)\)/).replace("label",ue._label).getRegex(),reflink:De(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ue._label).getRegex()}),ue.gfm=Te({},ue.normal,{escape:De(ue.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&&(Ee="x"+Ee.toString(16)),Ae+=""+Ee+";";return Ae}var q=function(){function Ne(Me){this.tokens=[],this.tokens.links=Object.create(null),this.options=Me||Se,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Ee={block:ne.normal,inline:ce.normal};this.options.pedantic?(Ee.block=ne.pedantic,Ee.inline=ce.pedantic):this.options.gfm&&(Ee.block=ne.gfm,this.options.breaks?Ee.inline=ce.breaks:Ee.inline=ce.gfm),this.tokenizer.rules=Ee}Ne.lex=function(Ee,Ce){var ke=new Ne(Ce);return ke.lex(Ee)};var Ae=Ne.prototype;return Ae.lex=function(Ee){return Ee=Ee.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(Ee,this.tokens,!0),this.inline(this.tokens),this.tokens},Ae.blockTokens=function(Ee,Ce,ke){Ce===void 0&&(Ce=[]),ke===void 0&&(ke=!0),Ee=Ee.replace(/^ +$/gm,"");for(var Fe,Be,et,ct;Ee;){if(Fe=this.tokenizer.space(Ee)){Ee=Ee.substring(Fe.raw.length),Fe.type&&Ce.push(Fe);continue}if(Fe=this.tokenizer.code(Ee,Ce)){Ee=Ee.substring(Fe.raw.length),Fe.type?Ce.push(Fe):(ct=Ce[Ce.length-1],ct.raw+=`
`+Fe.raw,ct.text+=`
`+Fe.text);continue}if(Fe=this.tokenizer.fences(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.heading(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.nptable(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.hr(Ee)){Ee=Ee.substring(Fe.raw.length),Ce.push(Fe);continue}if(Fe=this.tokenizer.blockquote(Ee)){Ee=Ee.substring(Fe.raw.length),Fe.tokens=this.blockTokens(Fe.text,[],ke),Ce.push(Fe);continue}if(Fe=this.tokenizer.list(Ee)){for(Ee=Ee.substring(Fe.raw.length),et=Fe.items.length,Be=0;Be0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(ct))!=null;)ft.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(ct=ct.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(ct))!=null;)ct=ct.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+ct.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Ee;){if(et=this.tokenizer.escape(Ee)){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(et=this.tokenizer.tag(Ee,ke,Fe)){Ee=Ee.substring(et.raw.length),ke=et.inLink,Fe=et.inRawBlock,Ce.push(et);continue}if(et=this.tokenizer.link(Ee)){Ee=Ee.substring(et.raw.length),et.type==="link"&&(et.tokens=this.inlineTokens(et.text,[],!0,Fe)),Ce.push(et);continue}if(et=this.tokenizer.reflink(Ee,this.tokens.links)){Ee=Ee.substring(et.raw.length),et.type==="link"&&(et.tokens=this.inlineTokens(et.text,[],!0,Fe)),Ce.push(et);continue}if(et=this.tokenizer.strong(Ee,ct,Be)){Ee=Ee.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],ke,Fe),Ce.push(et);continue}if(et=this.tokenizer.em(Ee,ct,Be)){Ee=Ee.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],ke,Fe),Ce.push(et);continue}if(et=this.tokenizer.codespan(Ee)){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(et=this.tokenizer.br(Ee)){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(et=this.tokenizer.del(Ee)){Ee=Ee.substring(et.raw.length),et.tokens=this.inlineTokens(et.text,[],ke,Fe),Ce.push(et);continue}if(et=this.tokenizer.autolink(Ee,oe)){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(!ke&&(et=this.tokenizer.url(Ee,oe))){Ee=Ee.substring(et.raw.length),Ce.push(et);continue}if(et=this.tokenizer.inlineText(Ee,Fe,Oe)){Ee=Ee.substring(et.raw.length),Be=et.raw.slice(-1),Ce.push(et);continue}if(Ee){var mt="Infinite loop on byte: "+Ee.charCodeAt(0);if(this.options.silent){console.error(mt);break}else throw new Error(mt)}}return Ce},v(Ne,null,[{key:"rules",get:function(){return{block:ne,inline:ce}}}]),Ne}(),Y=S.defaults,Z=G.cleanUrl,ye=G.escape,be=function(){function Ne(Me){this.options=Me||Y}var Ae=Ne.prototype;return Ae.code=function(Ee,Ce,ke){var Fe=(Ce||"").match(/\S*/)[0];if(this.options.highlight){var Be=this.options.highlight(Ee,Fe);Be!=null&&Be!==Ee&&(ke=!0,Ee=Be)}return Fe?''+(ke?Ee:ye(Ee,!0))+`
`:""+(ke?Ee:ye(Ee,!0))+`
`},Ae.blockquote=function(Ee){return`
`+Ee+`
`},Ae.html=function(Ee){return Ee},Ae.heading=function(Ee,Ce,ke,Fe){return this.options.headerIds?"
`:""+Ee+"
`},Ae.hr=function(){return this.options.xhtml?`
`:`
`},Ae.list=function(Ee,Ce,ke){var Fe=Ce?"ol":"ul",Be=Ce&&ke!==1?' start="'+ke+'"':"";return"<"+Fe+Be+`>
`+Ee+""+Fe+`>
`},Ae.listitem=function(Ee){return""+Ee+`
`},Ae.checkbox=function(Ee){return" "},Ae.paragraph=function(Ee){return""+Ee+`
`},Ae.table=function(Ee,Ce){return Ce&&(Ce=""+Ce+""),`
`},Ae.tablerow=function(Ee){return`
`+Ee+`
`},Ae.tablecell=function(Ee,Ce){var ke=Ce.header?"th":"td",Fe=Ce.align?"<"+ke+' align="'+Ce.align+'">':"<"+ke+">";return Fe+Ee+""+ke+`>
`},Ae.strong=function(Ee){return""+Ee+""},Ae.em=function(Ee){return""+Ee+""},Ae.codespan=function(Ee){return""+Ee+""},Ae.br=function(){return this.options.xhtml?"
":"
"},Ae.del=function(Ee){return""+Ee+""},Ae.link=function(Ee,Ce,ke){if(Ee=Z(this.options.sanitize,this.options.baseUrl,Ee),Ee===null)return ke;var Fe='"+ke+"",Fe},Ae.image=function(Ee,Ce,ke){if(Ee=Z(this.options.sanitize,this.options.baseUrl,Ee),Ee===null)return ke;var Fe='
":">",Fe},Ae.text=function(Ee){return Ee},Ne}(),Re=function(){function Ne(){}var Ae=Ne.prototype;return Ae.strong=function(Ee){return Ee},Ae.em=function(Ee){return Ee},Ae.codespan=function(Ee){return Ee},Ae.del=function(Ee){return Ee},Ae.html=function(Ee){return Ee},Ae.text=function(Ee){return Ee},Ae.link=function(Ee,Ce,ke){return""+ke},Ae.image=function(Ee,Ce,ke){return""+ke},Ae.br=function(){return""},Ne}(),Qe=function(){function Ne(){this.seen={}}var Ae=Ne.prototype;return Ae.slug=function(Ee){var Ce=Ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ce)){var ke=Ce;do this.seen[ke]++,Ce=ke+"-"+this.seen[ke];while(this.seen.hasOwnProperty(Ce))}return this.seen[Ce]=0,Ce},Ne}(),rt=S.defaults,at=G.unescape,qe=function(){function Ne(Me){this.options=Me||rt,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Re,this.slugger=new Qe}Ne.parse=function(Ee,Ce){var ke=new Ne(Ce);return ke.parse(Ee)};var Ae=Ne.prototype;return Ae.parse=function(Ee,Ce){Ce===void 0&&(Ce=!0);var ke="",Fe,Be,et,ct,yt,ft,mt,It,At,_t,Vt,Kt,tr,rr,Wt,Lt,nr,dt,Et=Ee.length;for(Fe=0;Fe0&&Wt.tokens[0].type==="text"?(Wt.tokens[0].text=dt+" "+Wt.tokens[0].text,Wt.tokens[0].tokens&&Wt.tokens[0].tokens.length>0&&Wt.tokens[0].tokens[0].type==="text"&&(Wt.tokens[0].tokens[0].text=dt+" "+Wt.tokens[0].tokens[0].text)):Wt.tokens.unshift({type:"text",text:dt}):rr+=dt),rr+=this.parse(Wt.tokens,tr),At+=this.renderer.listitem(rr,nr,Lt);ke+=this.renderer.list(At,Vt,Kt);continue}case"html":{ke+=this.renderer.html(_t.text);continue}case"paragraph":{ke+=this.renderer.paragraph(this.parseInline(_t.tokens));continue}case"text":{for(At=_t.tokens?this.parseInline(_t.tokens):_t.text;Fe+1An error occurred:
"+je(et.message+"",!0)+"
";throw et}}ze.options=ze.setOptions=function(Ne){return st(ze.defaults,Ne),tt(ze.defaults),ze},ze.getDefaults=Ie,ze.defaults=ot,ze.use=function(Ne){var Ae=st({},Ne);if(Ne.renderer&&function(){var Ee=ze.defaults.renderer||new be,Ce=function(Be){var et=Ee[Be];Ee[Be]=function(){for(var ct=arguments.length,yt=new Array(ct),ft=0;ft=0;r--){if(!C(l[r]))continue;var i=l[r].split("="),o=unescape(i[0]),s=unescape(i[1]);t(s,o)}}function S(t,l){if(!t)return;k.cookie=escape(t)+"="+escape(l)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function b(t){if(!t||!d(t))return;k.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function p(){m(function(t,l){b(l)})}function d(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(k.cookie)}},E4JC:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("ETIr"),j("cv67"),j("K3mO"),j("OLod"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.StreamCipher,y=v.algo,m=[],S=[],b=[],p=y.Rabbit=k.extend({_doReset:function(){for(var t=this._key.words,l=this.cfg.iv,r=0;r<4;r++)t[r]=(t[r]<<8|t[r]>>>24)&16711935|(t[r]<<24|t[r]>>>8)&4278255360;var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],o=this._C=[t[2]<<16|t[2]>>>16,t[0]&4294901760|t[1]&65535,t[3]<<16|t[3]>>>16,t[1]&4294901760|t[2]&65535,t[0]<<16|t[0]>>>16,t[2]&4294901760|t[3]&65535,t[1]<<16|t[1]>>>16,t[3]&4294901760|t[0]&65535];this._b=0;for(var r=0;r<4;r++)d.call(this);for(var r=0;r<8;r++)o[r]^=i[r+4&7];if(l){var s=l.words,c=s[0],a=s[1],u=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,f=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,w=u>>>16|f&4294901760,_=f<<16|u&65535;o[0]^=u,o[1]^=w,o[2]^=f,o[3]^=_,o[4]^=u,o[5]^=w,o[6]^=f,o[7]^=_;for(var r=0;r<4;r++)d.call(this)}},_doProcessBlock:function(t,l){var r=this._X;d.call(this),m[0]=r[0]^r[5]>>>16^r[3]<<16,m[1]=r[2]^r[7]>>>16^r[5]<<16,m[2]=r[4]^r[1]>>>16^r[7]<<16,m[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)m[i]=(m[i]<<8|m[i]>>>24)&16711935|(m[i]<<24|m[i]>>>8)&4278255360,t[l+i]^=m[i]},blockSize:128/32,ivSize:64/32});function d(){for(var t=this._X,l=this._C,r=0;r<8;r++)S[r]=l[r];l[0]=l[0]+1295307597+this._b|0,l[1]=l[1]+3545052371+(l[0]>>>0>>0?1:0)|0,l[2]=l[2]+886263092+(l[1]>>>0>>0?1:0)|0,l[3]=l[3]+1295307597+(l[2]>>>0>>0?1:0)|0,l[4]=l[4]+3545052371+(l[3]>>>0>>0?1:0)|0,l[5]=l[5]+886263092+(l[4]>>>0>>0?1:0)|0,l[6]=l[6]+1295307597+(l[5]>>>0>>0?1:0)|0,l[7]=l[7]+3545052371+(l[6]>>>0>>0?1:0)|0,this._b=l[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var i=t[r]+l[r],o=i&65535,s=i>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,a=((i&4294901760)*i|0)+((i&65535)*i|0);b[r]=c^a}t[0]=b[0]+(b[7]<<16|b[7]>>>16)+(b[6]<<16|b[6]>>>16)|0,t[1]=b[1]+(b[0]<<8|b[0]>>>24)+b[7]|0,t[2]=b[2]+(b[1]<<16|b[1]>>>16)+(b[0]<<16|b[0]>>>16)|0,t[3]=b[3]+(b[2]<<8|b[2]>>>24)+b[1]|0,t[4]=b[4]+(b[3]<<16|b[3]>>>16)+(b[2]<<16|b[2]>>>16)|0,t[5]=b[5]+(b[4]<<8|b[4]>>>24)+b[3]|0,t[6]=b[6]+(b[5]<<16|b[5]>>>16)+(b[4]<<16|b[4]>>>16)|0,t[7]=b[7]+(b[6]<<8|b[6]>>>24)+b[5]|0}v.Rabbit=k._createHelper(p)}(),N.Rabbit})},ELLl:function(F,Q,j){(function(N){N(j("VrN/"))})(function(N){var v={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},C=N.Pos;N.defineOption("autoCloseBrackets",!1,function(o,s,c){c&&c!=N.Init&&(o.removeKeyMap(y),o.state.closeBrackets=null),s&&(m(k(s,"pairs")),o.state.closeBrackets=s,o.addKeyMap(y))});function k(o,s){return s=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[s]!=null?o[s]:v[s]}var y={Backspace:p,Enter:d};function m(o){for(var s=0;s=0;u--){var w=a[u].head;o.replaceRange("",C(w.line,w.ch-1),C(w.line,w.ch+1),"+delete")}}function d(o){var s=b(o),c=s&&k(s,"explode");if(!c||o.getOption("disableInput"))return N.Pass;for(var a=o.listSelections(),u=0;u0;return{anchor:new C(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new C(o.head.line,o.head.ch+(s?1:-1))}}function l(o,s){var c=b(o);if(!c||o.getOption("disableInput"))return N.Pass;var a=k(c,"pairs"),u=a.indexOf(s);if(u==-1)return N.Pass;for(var f=k(c,"closeBefore"),w=k(c,"triples"),_=a.charAt(u+1)==s,h=o.listSelections(),R=u%2==0,O,g=0;g=0&&o.getRange(E,C(E.line,E.ch+3))==s+s+s?T="skipThree":T="skip";else if(_&&E.ch>1&&w.indexOf(s)>=0&&o.getRange(C(E.line,E.ch-2),E)==s+s){if(E.ch>2&&/\bstring/.test(o.getTokenTypeAt(C(E.line,E.ch-2))))return N.Pass;T="addFour"}else if(_){var L=E.ch==0?" ":o.getRange(C(E.line,E.ch-1),E);if(!N.isWordChar(M)&&L!=s&&!N.isWordChar(L))T="both";else return N.Pass}else if(R&&(M.length===0||/\s/.test(M)||f.indexOf(M)>-1))T="both";else return N.Pass;if(!O)O=T;else if(O!=T)return N.Pass}var A=u%2?a.charAt(u-1):s,V=u%2?s:a.charAt(u+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var z=0;z<3;z++)o.execCommand("goCharRight");else if(O=="surround"){for(var W=o.getSelections(),z=0;z>>24)&16711935|(O<<24|O>>>8)&4278255360}var g=this._hash.words,x=l.words,E=r.words,T=b.words,M=p.words,L=d.words,A=t.words,V,z,W,G,U,P,H,$,re,te;P=V=g[0],H=z=g[1],$=W=g[2],re=G=g[3],te=U=g[4];for(var ge,h=0;h<80;h+=1)ge=V+w[_+T[h]]|0,h<16?ge+=o(z,W,G)+x[0]:h<32?ge+=s(z,W,G)+x[1]:h<48?ge+=c(z,W,G)+x[2]:h<64?ge+=a(z,W,G)+x[3]:ge+=u(z,W,G)+x[4],ge=ge|0,ge=f(ge,L[h]),ge=ge+U|0,V=U,U=G,G=f(W,10),W=z,z=ge,ge=P+w[_+M[h]]|0,h<16?ge+=u(H,$,re)+E[0]:h<32?ge+=a(H,$,re)+E[1]:h<48?ge+=c(H,$,re)+E[2]:h<64?ge+=s(H,$,re)+E[3]:ge+=o(H,$,re)+E[4],ge=ge|0,ge=f(ge,A[h]),ge=ge+te|0,P=te,te=re,re=f($,10),$=H,H=ge;ge=g[1]+W+re|0,g[1]=g[2]+G+te|0,g[2]=g[3]+U+P|0,g[3]=g[4]+V+H|0,g[4]=g[0]+z+$|0,g[0]=ge},_doFinalize:function(){var w=this._data,_=w.words,h=this._nDataBytes*8,R=w.sigBytes*8;_[R>>>5]|=128<<24-R%32,_[(R+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,w.sigBytes=(_.length+1)*4,this._process();for(var O=this._hash,g=O.words,x=0;x<5;x++){var E=g[x];g[x]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}return O},clone:function(){var w=m.clone.call(this);return w._hash=this._hash.clone(),w}});function o(w,_,h){return w^_^h}function s(w,_,h){return w&_|~w&h}function c(w,_,h){return(w|~_)^h}function a(w,_,h){return w&h|_&~h}function u(w,_,h){return w^(_|~h)}function f(w,_){return w<<_|w>>>32-_}C.RIPEMD160=m._createHelper(i),C.HmacRIPEMD160=m._createHmacHelper(i)}(Math),N.RIPEMD160})},ETIr:function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=v.enc,m=y.Base64={stringify:function(b){var p=b.words,d=b.sigBytes,t=this._map;b.clamp();for(var l=[],r=0;r>>2]>>>24-r%4*8&255,o=p[r+1>>>2]>>>24-(r+1)%4*8&255,s=p[r+2>>>2]>>>24-(r+2)%4*8&255,c=i<<16|o<<8|s,a=0;a<4&&r+a*.75>>6*(3-a)&63));var u=t.charAt(64);if(u)for(;l.length%4;)l.push(u);return l.join("")},parse:function(b){var p=b.length,d=this._map,t=this._reverseMap;if(!t){t=this._reverseMap=[];for(var l=0;l>>6-r%4*2,s=i|o;t[l>>>2]|=s<<24-l%4*8,l++}return k.create(t,l)}}(),N.enc.Base64})},"F+F2":function(F,Q,j){(function(N,v){F.exports=Q=v(j("Ib8C"))})(this,function(N){return function(){if(typeof ArrayBuffer!="function")return;var v=N,C=v.lib,k=C.WordArray,y=k.init,m=k.init=function(S){if(S instanceof ArrayBuffer&&(S=new Uint8Array(S)),(S instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&S instanceof Uint8ClampedArray||S instanceof Int16Array||S instanceof Uint16Array||S instanceof Int32Array||S instanceof Uint32Array||S instanceof Float32Array||S instanceof Float64Array)&&(S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength)),S instanceof Uint8Array){for(var b=S.byteLength,p=[],d=0;d>>2]|=S[d]<<24-d%4*8;y.call(this,p,b)}else y.apply(this,arguments)};m.prototype=k}(),N.lib.WordArray})},GRuw:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("lPiR"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.WordArray,y=v.algo,m=y.SHA256,S=y.SHA224=m.extend({_doReset:function(){this._hash=new k.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var b=m._doFinalize.call(this);return b.sigBytes-=4,b}});v.SHA224=m._createHelper(S),v.HmacSHA224=m._createHmacHelper(S)}(),N.SHA224})},GfqC:function(F,Q,j){"use strict";var N=j("cDcd"),v=j.n(N),C=j("TSYQ"),k=j.n(C);function y(G,U){var P="cannot "+G.method+" "+G.action+" "+U.status+"'",H=new Error(P);return H.status=U.status,H.method=G.method,H.url=G.action,H}function m(G){var U=G.responseText||G.response;if(!U)return U;try{return JSON.parse(U)}catch(P){return U}}function S(G){var U=new XMLHttpRequest;G.onProgress&&U.upload&&(U.upload.onprogress=function(re){re.total>0&&(re.percent=re.loaded/re.total*100),G.onProgress(re)});var P=new FormData;G.data&&Object.keys(G.data).forEach(function($){var re=G.data[$];if(Array.isArray(re)){re.forEach(function(te){P.append($+"[]",te)});return}P.append($,G.data[$])}),G.file instanceof Blob?P.append(G.filename,G.file,G.file.name):P.append(G.filename,G.file),U.onerror=function(re){G.onError(re)},U.onload=function(){return U.status<200||U.status>=300?G.onError(y(G,U),m(U)):G.onSuccess(m(U),U)},U.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in U&&(U.withCredentials=!0);var H=G.headers||{};return H["X-Requested-With"]!==null&&U.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function($){H[$]!==null&&U.setRequestHeader($,H[$])}),U.send(P),{abort:function(){U.abort()}}}var b=+new Date,p=0;function d(){return"rc-upload-"+b+"-"+ ++p}function t(G,U){return G.indexOf(U,G.length-U.length)!==-1}var l=function(G,U){if(G&&U){var P=Array.isArray(U)?U:U.split(","),H=G.name||"",$=G.type||"",re=$.replace(/\/.*$/,"");return P.some(function(te){var ge=te.trim();return ge.charAt(0)==="."?t(H.toLowerCase(),ge.toLowerCase()):/\/\*$/.test(ge)?re===ge.replace(/\/.*$/,""):$===ge})}return!0};function r(G,U){var P=G.createReader(),H=[];function $(){P.readEntries(function(re){var te=Array.prototype.slice.apply(re);H=H.concat(te);var ge=!te.length;ge?U(H):$()})}$()}var i=function(U,P,H){var $=function re(te,ge){ge=ge||"",te.isFile?te.file(function(ve){H(ve)&&(te.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=te.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),P([ve]))}):te.isDirectory&&r(te,function(ve){ve.forEach(function(de){re(de,""+ge+te.name+"/")})})};U.forEach(function(re){$(re.webkitGetAsEntry())})},o=i,s=Object.assign||function(G){for(var U=1;U=0)continue;if(!Object.prototype.hasOwnProperty.call(G,H))continue;P[H]=G[H]}return P}function w(G,U){if(!(G instanceof U))throw new TypeError("Cannot call a class as a function")}function _(G,U){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return U&&(typeof U=="object"||typeof U=="function")?U:G}function h(G,U){if(typeof U!="function"&&U!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof U);G.prototype=Object.create(U&&U.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),U&&(Object.setPrototypeOf?Object.setPrototypeOf(G,U):G.__proto__=U)}var R=function(U){return Object.keys(U).reduce(function(P,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(P[H]=U[H]),P},{})},O=function(G){h(U,G);function U(){var P,H,$,re;w(this,U);for(var te=arguments.length,ge=Array(te),ve=0;ve>>2]>>>24-R%4*8&255;f[_+R>>>2]|=O<<24-(_+R)%4*8}else for(var g=0;g>>2]=w[g>>>2];return this.sigBytes+=h,this},clamp:function(){var u=this.words,f=this.sigBytes;u[f>>>2]&=4294967295<<32-f%4*8,u.length=C.ceil(f/4)},clone:function(){var u=d.clone.call(this);return u.words=this.words.slice(0),u},random:function(u){for(var f=[],w=0;w>>2]>>>24-h%4*8&255;_.push((R>>>4).toString(16)),_.push((R&15).toString(16))}return _.join("")},parse:function(u){for(var f=u.length,w=[],_=0;_>>3]|=parseInt(u.substr(_,2),16)<<24-_%8*4;return new t.init(w,f/2)}},i=l.Latin1={stringify:function(u){for(var f=u.words,w=u.sigBytes,_=[],h=0;h>>2]>>>24-h%4*8&255;_.push(String.fromCharCode(R))}return _.join("")},parse:function(u){for(var f=u.length,w=[],_=0;_>>2]|=(u.charCodeAt(_)&255)<<24-_%4*8;return new t.init(w,f)}},o=l.Utf8={stringify:function(u){try{return decodeURIComponent(escape(i.stringify(u)))}catch(f){throw new Error("Malformed UTF-8 data")}},parse:function(u){return i.parse(unescape(encodeURIComponent(u)))}},s=p.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new t.init,this._nDataBytes=0},_append:function(u){typeof u=="string"&&(u=o.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},_process:function(u){var f,w=this._data,_=w.words,h=w.sigBytes,R=this.blockSize,O=R*4,g=h/O;u?g=C.ceil(g):g=C.max((g|0)-this._minBufferSize,0);var x=g*R,E=C.min(x*4,h);if(x){for(var T=0;T>>6)+p(128|V&63):p(224|V>>>12&15)+p(128|V>>>6&63)+p(128|V&63)}else{var V=65536+(A.charCodeAt(0)-55296)*1024+(A.charCodeAt(1)-56320);return p(240|V>>>18&7)+p(128|V>>>12&63)+p(128|V>>>6&63)+p(128|V&63)}},t=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(A){return A.replace(t,d)},r=function(A){var V=[0,2,1][A.length%3],z=A.charCodeAt(0)<<16|(A.length>1?A.charCodeAt(1):0)<<8|(A.length>2?A.charCodeAt(2):0),W=[S.charAt(z>>>18),S.charAt(z>>>12&63),V>=2?"=":S.charAt(z>>>6&63),V>=1?"=":S.charAt(z&63)];return W.join("")},i=k.btoa&&typeof k.btoa=="function"?function(A){return k.btoa(A)}:function(A){if(A.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return A.replace(/[\s\S]{1,3}/g,r)},o=function(A){return i(l(String(A)))},s=function(A){return A.replace(/[+\/]/g,function(V){return V=="+"?"-":"_"}).replace(/=/g,"")},c=function(A,V){return V?s(o(A)):o(A)},a=function(A){return c(A,!0)},u;k.Uint8Array&&(u=function(A,V){for(var z="",W=0,G=A.length;W>>18)+S.charAt($>>>12&63)+(typeof P!="undefined"?S.charAt($>>>6&63):"=")+(typeof H!="undefined"?S.charAt($&63):"=")}return V?s(z):z});var f=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(A){switch(A.length){case 4:var V=(7&A.charCodeAt(0))<<18|(63&A.charCodeAt(1))<<12|(63&A.charCodeAt(2))<<6|63&A.charCodeAt(3),z=V-65536;return p((z>>>10)+55296)+p((z&1023)+56320);case 3:return p((15&A.charCodeAt(0))<<12|(63&A.charCodeAt(1))<<6|63&A.charCodeAt(2));default:return p((31&A.charCodeAt(0))<<6|63&A.charCodeAt(1))}},_=function(A){return A.replace(f,w)},h=function(A){var V=A.length,z=V%4,W=(V>0?b[A.charAt(0)]<<18:0)|(V>1?b[A.charAt(1)]<<12:0)|(V>2?b[A.charAt(2)]<<6:0)|(V>3?b[A.charAt(3)]:0),G=[p(W>>>16),p(W>>>8&255),p(W&255)];return G.length-=[0,0,2,1][z],G.join("")},R=k.atob&&typeof k.atob=="function"?function(A){return k.atob(A)}:function(A){return A.replace(/\S{1,4}/g,h)},O=function(A){return R(String(A).replace(/[^A-Za-z0-9\+\/]/g,""))},g=function(A){return _(R(A))},x=function(A){return String(A).replace(/[-_]/g,function(V){return V=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},E=function(A){return g(x(A))},T;k.Uint8Array&&(T=function(A){return Uint8Array.from(O(x(A)),function(V){return V.charCodeAt(0)})});var M=function(){var A=k.Base64;return k.Base64=y,A};if(k.Base64={VERSION:m,atob:O,btoa:i,fromBase64:E,toBase64:c,utob:l,encode:c,encodeURI:a,btou:_,decode:E,noConflict:M,fromUint8Array:u,toUint8Array:T},typeof Object.defineProperty=="function"){var L=function(A){return{value:A,enumerable:!1,writable:!0,configurable:!0}};k.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",L(function(){return E(this)})),Object.defineProperty(String.prototype,"toBase64",L(function(A){return c(this,A)})),Object.defineProperty(String.prototype,"toBase64URI",L(function(){return c(this,!0)}))}}return k.Meteor&&(Base64=k.Base64),F.exports?F.exports.Base64=k.Base64:!(v=[],C=function(){return k.Base64}.apply(Q,v),C!==void 0&&(F.exports=C)),{Base64:k.Base64}})}).call(this,j("IyRk"))},K3mO:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("3y9D"),j("WYAk"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.Base,y=C.WordArray,m=v.algo,S=m.MD5,b=m.EvpKDF=k.extend({cfg:k.extend({keySize:128/32,hasher:S,iterations:1}),init:function(p){this.cfg=this.cfg.extend(p)},compute:function(p,d){for(var t,l=this.cfg,r=l.hasher.create(),i=y.create(),o=i.words,s=l.keySize,c=l.iterations;o.lengthTe)){ue.next=7;break}return C.b.info("\u6587\u4EF6\u8D85\u8FC7".concat(Te/1024/1024/1024,"GB\uFF0C\u4E0D\u7B26\u5408\u4E0A\u4F20\u8981\u6C42")),ue.abrupt("return",!1);case 7:return W.push({name:De.name,file:De}),G(Object(k.a)(W)),A.onChange(W),ue.abrupt("return",!1);case 11:case"end":return ue.stop()}},de)}));function ve(de){return ge.apply(this,arguments)}return ve}()},te=function(){var ge=Object(b.a)(l.a.mark(function ve(de,De){var Te,he,ue,ie,Se,ne,ce,Oe,oe,q;return l.a.wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return De.file_name=de.name,ce=de.name,Z.next=4,Object(o.a)("/api/buckets/get_upload_token_for_big_files.json",{method:"get"});case 4:if(Oe=Z.sent,Oe.data=JSON.parse(h(Oe.data)),!((Oe==null?void 0:Oe.status)!==0)){Z.next=12;break}return W[W.findIndex(function(ye){return ye.name===ce})].status="error",W[W.findIndex(function(ye){return ye.name===ce})].file.status="error",A.onChange(W),C.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),Z.abrupt("return");case 12:return H=new w.a({endpoint:Oe==null||((Te=Oe.data)===null||Te===void 0)?void 0:Te.end_point,region:Oe==null||((he=Oe.data)===null||he===void 0)?void 0:he.region,accessKeyId:Oe==null||((ue=Oe.data)===null||ue===void 0)?void 0:ue.access_key_id,accessKeySecret:Oe==null||((ie=Oe.data)===null||ie===void 0)?void 0:ie.access_key_secret,bucket:Oe==null||((Se=Oe.data)===null||Se===void 0)?void 0:Se.bucket,stsToken:Oe==null||((ne=Oe.data)===null||ne===void 0)?void 0:ne.security_token}),console.log(de,"file"),$(H),oe=de.name.split("."),oe.pop(),q=De.realFileName?oe:Object(a.a)(),Z.abrupt("return",new Promise(function(ye,be){try{var Re;H.multipartUpload("".concat(A.identifier,"/").concat(q).concat(ce.indexOf(".")>-1?"."+ce.split(".").pop():""),new Blob([de.file],{type:de.file.type}),{timeout:3600*1e3,partSize:1002400,progress:function(rt,at,qe){try{console.log("\u8FDB\u5EA6",rt,at,qe);var st=W.findIndex(function(lt){return lt.name===ce});W[st].file.percent=rt*100,W[st].tempCheckpoint=at,G(Object(k.a)(W))}catch(lt){}},checkpoint:W[W.findIndex(function(Qe){return Qe.name===ce})].tempCheckpoint,callback:{customValue:{id:ce+""},url:Oe==null||((Re=Oe.data)===null||Re===void 0)?void 0:Re.callback_url,host:Oe==null?void 0:Oe.data.bucket_host,body:"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var=${x:my_var}&"+Object(o.e)(De)}}).then(function(Qe){var rt,at=W.findIndex(function(Ie){return Ie.name===ce}),qe="done";if(((rt=Qe.data)===null||rt===void 0?void 0:rt.status)===0){var st;de.response=(st=Qe.data)===null||st===void 0?void 0:st.data;var lt=W.findIndex(function(Ie){return Ie.name===ce});W[lt].status="done",W[lt].file.status="done"}else{var je;C.b.warn((je=Qe.data)===null||je===void 0?void 0:je.message),qe="error"}W[at].status=qe,W[at].file.status=qe,A.onChange(W),ye(Qe==null?void 0:Qe.data)}).catch(function(Qe){W[W.findIndex(function(rt){return rt.name===ce})].status="error",W[W.findIndex(function(rt){return rt.name===ce})].file.status="error",C.b.warn("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u5C1D\u8BD5"),G(Object(k.a)(W)),A.onChange(W),be(Qe),console.log("err:",Qe)})}catch(Qe){}}));case 19:case"end":return Z.stop()}},ve)}));return function(de,De){return ge.apply(this,arguments)}}();return Object(r.useEffect)(function(){W.every(function(ge){return ge==="done"||ge==="error"})&&A.onComplete(W)},[W]),Object(r.useEffect)(function(){if(L){var ge;(ge=H)===null||ge===void 0||ge.cancel()}},[L]),Object(r.useEffect)(function(){A.uploading&&W.map(function(){var ge=Object(b.a)(l.a.mark(function ve(de){var De,Te;return l.a.wrap(function(ue){for(;;)switch(ue.prev=ue.next){case 0:if(!((!de.status||de.status==="error")&&!L)){ue.next=6;break}return de.status="uploading",de.file.status="uploading",ue.next=5,te(de,{login:M==null||((De=M.userInfo)===null||De===void 0)?void 0:De.login,container_type:A.container_type,container_id:A.container_id,description:A.description,realFileName:A.realFileName});case 5:Te=ue.sent;case 6:case"end":return ue.stop()}},ve)}));return function(ve){return ge.apply(this,arguments)}}())},[A.uploading]),i.a.createElement(_,Object(N.a)({},re,{height:A.height,className:A.className}),i.a.createElement("p",{className:"ant-upload-hint"},A.text||"\u62D6\u62FD\u6587\u4EF6\u6216\u8005\u70B9\u51FB\u4E0A\u4F20"))};Q.b=Object(u.a)(function(E){var T=E.loading,M=E.globalSetting,L=E.user;return{globalSetting:M,loading:T.models.competitions,user:L}})(x)},KmYQ:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.pad.ZeroPadding={pad:function(v,C){var k=C*4;v.clamp(),v.sigBytes+=k-(v.sigBytes%k||k)},unpad:function(v){for(var C=v.words,k=v.sigBytes-1,k=v.sigBytes-1;k>=0;k--)if(C[k>>>2]>>>24-k%4*8&255){v.sigBytes=k+1;break}}},N.pad.ZeroPadding})},L9qf:function(F,Q,j){F.exports={flex_box_center:"flex_box_center___3J7Qj",flex_space_between:"flex_space_between___3P3xx",flex_box_vertical_center:"flex_box_vertical_center___3QrMz",flex_box_center_end:"flex_box_center_end___37g4V",flex_box_column:"flex_box_column___2PxMN",wrap:"wrap___1xDeN",in:"in___364z1",btns:"btns___8vHXH",customModal:"customModal___2Vkln"}},LdHM:function(F,Q,j){"use strict";j.d(Q,"b",function(){return f}),j.d(Q,"a",function(){return _});var N=j("1OyB"),v=j("vuIU"),C=j("Ji7U"),k=j("LK+K"),y=j("cDcd"),m=j("rePB"),S=j("Ff2n"),b=j("ODXe"),p=j("4IlW"),d=j("bX4T"),t=j("YrtM"),l=j("TSYQ"),r=j.n(l),i=j("+nKL"),o=j("8OUc"),s=function(H,$){var re=H.prefixCls,te=H.id,ge=H.flattenOptions,ve=H.childrenAsData,de=H.values,De=H.searchValue,Te=H.multiple,he=H.defaultActiveFirstOption,ue=H.height,ie=H.itemHeight,Se=H.notFoundContent,ne=H.open,ce=H.menuItemSelectedIcon,Oe=H.virtual,oe=H.onSelect,q=H.onToggleOpen,Y=H.onActiveValue,Z=H.onScroll,ye=H.onMouseEnter,be="".concat(re,"-item"),Re=Object(t.a)(function(){return ge},[ne,ge],function(Ze,Ne){return Ne[0]&&Ze[1]!==Ne[1]}),Qe=y.useRef(null),rt=function(Ne){Ne.preventDefault()},at=function(Ne){Qe.current&&Qe.current.scrollTo({index:Ne})},qe=function(Ne){for(var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Me=Re.length,Ee=0;Ee1&&arguments[1]!==void 0?arguments[1]:!1;return Object(R.a)(P).map(function($,re){if(!y.isValidElement($)||!$.type)return null;var te=$.type.isSelectOptGroup,ge=$.key,ve=$.props,de=ve.children,De=Object(S.a)(ve,["children"]);return H||!te?O($):Object(h.a)(Object(h.a)({key:"__RC_SELECT_GRP__".concat(ge===null?re:ge,"__"),label:ge},De),{},{options:g(de)})}).filter(function($){return $})}var x=j("2Qr1"),E=j("qNPg"),T=j("U8pU"),M=j("Kwbf"),L=j("WKfj");function A(P){var H=P.mode,$=P.options,re=P.children,te=P.backfill,ge=P.allowClear,ve=P.placeholder,de=P.getInputElement,De=P.showSearch,Te=P.onSearch,he=P.defaultOpen,ue=P.autoFocus,ie=P.labelInValue,Se=P.value,ne=P.inputValue,ce=P.optionLabelProp,Oe=H==="multiple"||H==="tags",oe=De!==void 0?De:Oe||H==="combobox",q=$||g(re);if(Object(M.a)(H!=="tags"||q.every(function(be){return!be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var Y=q.some(function(be){return be.options?be.options.some(function(Re){return typeof("value"in Re?Re.value:Re.key)=="number"}):typeof("value"in be?be.value:be.key)=="number"});Object(M.a)(!Y,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(M.a)(H!=="combobox"||!ce,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(M.a)(H==="combobox"||!te,"`backfill` only works with `combobox` mode."),Object(M.a)(H==="combobox"||!de,"`getInputElement` only work with `combobox` mode."),Object(M.b)(H!=="combobox"||!de||!ge||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Te&&!oe&&H!=="combobox"&&H!=="tags"&&Object(M.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(M.b)(!he||ue,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Se!=null){var Z=Object(L.d)(Se);Object(M.a)(!ie||Z.every(function(be){return Object(T.a)(be)==="object"&&("key"in be||"value"in be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(M.a)(!Oe||Array.isArray(Se),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var ye=null;Object(R.a)(re).some(function(be){if(!y.isValidElement(be)||!be.type)return!1;var Re=be.type;if(Re.isSelectOption)return!1;if(Re.isSelectOptGroup){var Qe=Object(R.a)(be.props.children).every(function(rt){return!y.isValidElement(rt)||!be.type||rt.type.isSelectOption?!0:(ye=rt.type,!1)});return!Qe}return ye=Re,!0}),ye&&Object(M.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ye.displayName||ye.name||ye,"`.")),Object(M.a)(ne===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var V=A,z=Object(E.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:g,flattenOptions:x.d,getLabeledValue:x.e,filterOptions:x.b,isValueDisabled:x.g,findValueOption:x.c,warningProps:V,fillOptionsWithMissingValue:x.a}),W=function(P){Object(C.a)($,P);var H=Object(k.a)($);function $(){var re;return Object(N.a)(this,$),re=H.apply(this,arguments),re.selectRef=y.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(v.a)($,[{key:"render",value:function(){return y.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),$}(y.Component);W.Option=f,W.OptGroup=_;var G=W,U=Q.c=G},M8RZ:function(F,Q,j){"use strict";j.d(Q,"a",function(){return p});var N=j("fWQN"),v=j("mtLc"),C=j("yKVA"),k=j("879j"),y=j("cDcd"),m=j.n(y),S=j("faye"),b=j.n(S),p=function(d){Object(C.a)(l,d);var t=Object(k.a)(l);function l(r){var i;Object(N.a)(this,l),i=t.call(this,r);var o=window.document;return i.node=o.createElement("div"),o.body.appendChild(i.node),i}return Object(v.a)(l,[{key:"render",value:function(){var i=this.props.children;return Object(S.createPortal)(i,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),l}(m.a.Component)},MFOe:function(F,Q,j){(function(N){var v=m(),C=S(),k=b(),y=typeof window!="undefined"?window:N;F.exports={assign:v,create:C,trim:k,bind:p,slice:d,each:t,map:l,pluck:r,isList:i,isFunction:o,isObject:s,Global:y};function m(){return Object.assign?Object.assign:function(a,u,f,w){for(var _=1;_=0;s-=1){var c=b.get(s)||new Set;c.forEach(function(a){var u=a.parent,f=a.node;if(d(f)||!a.parent||o.has(a.parent.key))return;if(d(a.parent.node)){o.add(u.key);return}var w=!0,_=!1;(u.children||[]).filter(function(h){return!d(h.node)}).forEach(function(h){var R=h.key,O=t.has(R);w&&!O&&(w=!1),!_&&(O||l.has(R))&&(_=!0)}),w&&t.add(u.key),_&&l.add(u.key),o.add(u.key)})}return{checkedKeys:Array.from(t),halfCheckedKeys:Array.from(v(l,t))}}function y(S,b,p,d,t){for(var l=new Set(S),r=new Set(b),i=0;i<=d;i+=1){var o=p.get(i)||new Set;o.forEach(function(u){var f=u.key,w=u.node,_=u.children,h=_===void 0?[]:_;!l.has(f)&&!r.has(f)&&!t(w)&&h.filter(function(R){return!t(R.node)}).forEach(function(R){l.delete(R.key)})})}r=new Set;for(var s=new Set,c=d;c>=0;c-=1){var a=p.get(c)||new Set;a.forEach(function(u){var f=u.parent,w=u.node;if(t(w)||!u.parent||s.has(u.parent.key))return;if(t(u.parent.node)){s.add(f.key);return}var _=!0,h=!1;(f.children||[]).filter(function(R){return!t(R.node)}).forEach(function(R){var O=R.key,g=l.has(O);_&&!g&&(_=!1),!h&&(g||r.has(O))&&(h=!0)}),_||l.delete(f.key),h&&r.add(f.key),s.add(f.key)})}return{checkedKeys:Array.from(l),halfCheckedKeys:Array.from(v(r,l))}}function m(S,b,p,d){var t=[],l;d?l=d:l=C;var r=new Set(S.filter(function(c){var a=!!p[c];return a||t.push(c),a})),i=new Map,o=0;Object.keys(p).forEach(function(c){var a=p[c],u=a.level,f=i.get(u);f||(f=new Set,i.set(u,f)),f.add(a),o=Math.max(o,u)}),Object(N.a)(!t.length,"Tree missing follow keys: ".concat(t.slice(0,100).map(function(c){return"'".concat(c,"'")}).join(", ")));var s;return b===!0?s=k(r,i,o,l):s=y(r,b.halfCheckedKeys,i,o,l),s}},OLod:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("K3mO"))})(this,function(N){N.lib.Cipher||function(v){var C=N,k=C.lib,y=k.Base,m=k.WordArray,S=k.BufferedBlockAlgorithm,b=C.enc,p=b.Utf8,d=b.Base64,t=C.algo,l=t.EvpKDF,r=k.Cipher=S.extend({cfg:y.extend(),createEncryptor:function(E,T){return this.create(this._ENC_XFORM_MODE,E,T)},createDecryptor:function(E,T){return this.create(this._DEC_XFORM_MODE,E,T)},init:function(E,T,M){this.cfg=this.cfg.extend(M),this._xformMode=E,this._key=T,this.reset()},reset:function(){S.reset.call(this),this._doReset()},process:function(E){return this._append(E),this._process()},finalize:function(E){E&&this._append(E);var T=this._doFinalize();return T},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function E(T){return typeof T=="string"?x:R}return function(T){return{encrypt:function(M,L,A){return E(L).encrypt(T,M,L,A)},decrypt:function(M,L,A){return E(L).decrypt(T,M,L,A)}}}}()}),i=k.StreamCipher=r.extend({_doFinalize:function(){var E=this._process(!0);return E},blockSize:1}),o=C.mode={},s=k.BlockCipherMode=y.extend({createEncryptor:function(E,T){return this.Encryptor.create(E,T)},createDecryptor:function(E,T){return this.Decryptor.create(E,T)},init:function(E,T){this._cipher=E,this._iv=T}}),c=o.CBC=function(){var E=s.extend();E.Encryptor=E.extend({processBlock:function(M,L){var A=this._cipher,V=A.blockSize;T.call(this,M,L,V),A.encryptBlock(M,L),this._prevBlock=M.slice(L,L+V)}}),E.Decryptor=E.extend({processBlock:function(M,L){var A=this._cipher,V=A.blockSize,z=M.slice(L,L+V);A.decryptBlock(M,L),T.call(this,M,L,V),this._prevBlock=z}});function T(M,L,A){var V,z=this._iv;z?(V=z,this._iv=v):V=this._prevBlock;for(var W=0;W>>2]&255;E.sigBytes-=T}},f=k.BlockCipher=r.extend({cfg:r.cfg.extend({mode:c,padding:u}),reset:function(){var E;r.reset.call(this);var T=this.cfg,M=T.iv,L=T.mode;this._xformMode==this._ENC_XFORM_MODE?E=L.createEncryptor:(E=L.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==E?this._mode.init(this,M&&M.words):(this._mode=E.call(L,this,M&&M.words),this._mode.__creator=E)},_doProcessBlock:function(E,T){this._mode.processBlock(E,T)},_doFinalize:function(){var E,T=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(T.pad(this._data,this.blockSize),E=this._process(!0)):(E=this._process(!0),T.unpad(E)),E},blockSize:128/32}),w=k.CipherParams=y.extend({init:function(E){this.mixIn(E)},toString:function(E){return(E||this.formatter).stringify(this)}}),_=C.format={},h=_.OpenSSL={stringify:function(E){var T,M=E.ciphertext,L=E.salt;return L?T=m.create([1398893684,1701076831]).concat(L).concat(M):T=M,T.toString(d)},parse:function(E){var T,M=d.parse(E),L=M.words;return L[0]==1398893684&&L[1]==1701076831&&(T=m.create(L.slice(2,4)),L.splice(0,4),M.sigBytes-=16),w.create({ciphertext:M,salt:T})}},R=k.SerializableCipher=y.extend({cfg:y.extend({format:h}),encrypt:function(E,T,M,L){L=this.cfg.extend(L);var A=E.createEncryptor(M,L),V=A.finalize(T),z=A.cfg;return w.create({ciphertext:V,key:M,iv:z.iv,algorithm:E,mode:z.mode,padding:z.padding,blockSize:E.blockSize,formatter:L.format})},decrypt:function(E,T,M,L){L=this.cfg.extend(L),T=this._parse(T,L.format);var A=E.createDecryptor(M,L).finalize(T.ciphertext);return A},_parse:function(E,T){return typeof E=="string"?T.parse(E,this):E}}),O=C.kdf={},g=O.OpenSSL={execute:function(E,T,M,L){L||(L=m.random(64/8));var A=l.create({keySize:T+M}).compute(E,L),V=m.create(A.words.slice(T),M*4);return A.sigBytes=T*4,w.create({key:A,iv:V,salt:L})}},x=k.PasswordBasedCipher=R.extend({cfg:R.cfg.extend({kdf:g}),encrypt:function(E,T,M,L){L=this.cfg.extend(L);var A=L.kdf.execute(M,E.keySize,E.ivSize);L.iv=A.iv;var V=R.encrypt.call(this,E,T,A.key,L);return V.mixIn(A),V},decrypt:function(E,T,M,L){L=this.cfg.extend(L),T=this._parse(T,L.format);var A=L.kdf.execute(M,E.keySize,E.ivSize,T.salt);L.iv=A.iv;var V=R.decrypt.call(this,E,T,A.key,L);return V}})}()})},OZM5:function(F,Q,j){"use strict";j.d(Q,"b",function(){return d}),j.d(Q,"a",function(){return t}),j.d(Q,"k",function(){return l}),j.d(Q,"h",function(){return r}),j.d(Q,"i",function(){return i}),j.d(Q,"g",function(){return o}),j.d(Q,"c",function(){return s}),j.d(Q,"d",function(){return c}),j.d(Q,"j",function(){return f}),j.d(Q,"e",function(){return w}),j.d(Q,"f",function(){return _});var N=j("KQm4"),v=j("U8pU"),C=j("Ff2n"),k=j("cDcd"),y=j.n(k),m=j("Kwbf"),S=j("WaYH"),b=.25,p=2;function d(h,R){var O=h.slice(),g=O.indexOf(R);return g>=0&&O.splice(g,1),O}function t(h,R){var O=h.slice();return O.indexOf(R)===-1&&O.push(R),O}function l(h){return h.split("-")}function r(h,R){return"".concat(h,"-").concat(R)}function i(h){return h&&h.type&&h.type.isTreeNode}function o(h,R){var O=[h],g=R[h];function x(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];E.forEach(function(T){var M=T.key,L=T.children;O.push(M),x(L)})}return x(g.children),O}function s(h,R){var O=h.clientY,g=R.selectHandle.getBoundingClientRect(),x=g.top,E=g.bottom,T=g.height,M=Math.max(T*b,p);return O<=x+M?-1:O>=E-M?1:0}function c(h,R){if(!h)return;var O=R.multiple;return O?h.slice():h.length?[h[0]]:h}var a=function(R){return R};function u(h,R){if(!h)return[];var O=R||{},g=O.processProps,x=g===void 0?a:g,E=Array.isArray(h)?h:[h];return E.map(function(T){var M=T.children,L=Object(C.a)(T,["children"]),A=u(M,R);return y.a.createElement(S.a,Object.assign({},x(L)),A)})}function f(h){if(!h)return null;var R;if(Array.isArray(h))R={checkedKeys:h,halfCheckedKeys:void 0};else if(Object(v.a)(h)==="object")R={checkedKeys:h.checked||void 0,halfCheckedKeys:h.halfChecked||void 0};else return Object(m.a)(!1,"`checkedKeys` is not an array or an object"),null;return R}function w(h,R){var O=new Set;function g(x){if(O.has(x))return;var E=R[x];if(!E)return;O.add(x);var T=E.parent,M=E.node;if(M.disabled)return;T&&g(T.key)}return(h||[]).forEach(function(x){g(x)}),Object(N.a)(O)}function _(h){var R={};return Object.keys(h).forEach(function(O){(O.startsWith("data-")||O.startsWith("aria-"))&&(R[O]=h[O])}),R}},Ot1p:function(F,Q,j){"use strict";var N=j("2qtc"),v=j("kLXV"),C=j("rAM+"),k=j("miYZ"),y=j("tsqr"),m=j("9og8"),S=j("tJVT"),b=j("jrin"),p=j("WmNS"),d=j.n(p),t=j("cDcd"),l=j.n(t),r=j("VrN/"),i=j.n(r),o=j("bdgK"),s=j("p77/"),c=j("Bd2K"),a=j("ELLl"),u=j("19Vz"),f=j("lZu9"),w=j("+NIl"),_=j("kSUc"),h=j("9Bee"),R=function(Be){var et=Be.value,ct=et===void 0?"":et,yt=Be.className,ft=Be.showTextOnly,mt=Be.showLines,It=Be.style,At=It===void 0?{}:It,_t=Object(t.useMemo)(function(){return""},[ct]);return l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{dangerouslySetInnerHTML:{__html:_t}}))},O=j("0Owb"),g=j("dejd"),x=j("C+DQ"),E=j("1vsH"),T=j("m3rI"),M=[{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 L(Be){var et=Be.onActionCallback,ct=Be.title,yt=Be.icon,ft=Be.actionName,mt=Be.className,It=mt===void 0?"":mt,At=Be.children;function _t(){et(ft)}return l.a.createElement("a",{title:ct,className:It,onClick:_t},l.a.createElement("i",{className:"md-iconfont ".concat(yt)}),At)}var A=function(Be){var et=Be.watch,ct=Be.showNullButton,yt=Be.onActionCallback,ft=Be.fullScreen,mt=Be.insertTemp,It=Be.hidetoolBar,At=Be.uuid,_t=Be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(E.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(E.G)("_educoder_session"),"&key=").concat(At,"&api=").concat(encodeURIComponent(T.a.PROXY_SERVER)));var Vt=[].concat(M,[{title:"".concat(et?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(et?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return l.a.createElement("ul",{className:"markdown-toolbar-container"},!It&&Vt.map(function(Kt,tr){return l.a.createElement("li",{key:tr},Kt.actionName?l.a.createElement(L,Object(O.a)({},Kt,{onActionCallback:yt})):l.a.createElement("span",{className:"v-line"}))}),ct?l.a.createElement("li",null,l.a.createElement(L,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:yt},l.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,mt&&l.a.createElement("li",null,l.a.createElement(L,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(mt),onActionCallback:yt},l.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),l.a.createElement("li",{className:"btn-full-screen"},l.a.createElement(L,{icon:"".concat(ft?"icon-shrink":"icon-enlarge"),title:ft?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:yt})))},V=j("M8RZ"),z=j("+L6B"),W=j("2/Rp"),G=j("y8nQ"),U=j("Vl3Y"),P=j("5NDa"),H=j("5rEg"),$={labelCol:{span:4},wrapperCol:{span:20}},re=function(Be){var et=Be.callback,ct=Be.onCancel;function yt(ft){et(ft)}return l.a.createElement(U.a,Object(O.a)({},$,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:yt}),l.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},l.a.createElement(H.a,null)),l.a.createElement(U.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},l.a.createElement(H.a,null)),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(W.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},te=j("7ahc"),ge=j("HmJG"),ve=j("BjJ7"),de=U.a.useForm,De={width:280,marginRight:10},Te={labelCol:{span:5},wrapperCol:{span:19}},he=function(Be){var et=Be.callback,ct=Be.onCancel,yt=de(),ft=Object(S.a)(yt,1),mt=ft[0];function It(Vt){et(Vt)}function At(Vt,Kt){if(Vt.status===-1){y.b.error(Vt.message);return}mt.setFieldsValue({src:"/api/attachments/".concat(Vt.id),type:Kt.type})}function _t(Vt){var Kt=Vt.target.files[0];ie(Kt,At)}return l.a.createElement(U.a,Object(O.a)({form:mt},Te,{className:"upload-image-panel",onFinish:It}),l.a.createElement(U.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},l.a.createElement("div",{className:"flex-container"},l.a.createElement(U.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},l.a.createElement(H.a,{style:De})),l.a.createElement(ue,{onFileChange:_t}))),l.a.createElement(U.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},l.a.createElement(H.a,{style:{width:264}})),l.a.createElement(U.a.Item,{style:{textAlign:"right"}},l.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(W.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))};function ue(Be){var et=Be.onFileChange;return l.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",l.a.createElement("input",{type:"file",onChange:et}))}function ie(Be,et){if(!Be)throw new String("\u6CA1\u6709\u6587\u4EF6");var ct=new FormData;ct.append("editormd-image-file",Be),ct.append("file_param_name","editormd-image-file"),ct.append("byxhr","true");var yt=new window.XMLHttpRequest;yt.withCredentials=!0,yt.addEventListener("load",function(ft){et(JSON.parse(ft.target.responseText),Be)},!1),yt.addEventListener("error",function(ft){console.error(ft)},!1),yt.open("POST","".concat(ve.a,"/api/attachments.json")),yt.send(ct)}var Se=j("giR+"),ne=j("fyUT"),ce=j("7Kak"),Oe=j("9yH6"),oe=Oe.a.Group,q={margin:"0 8px"},Y=function(Be){var et=Be.callback,ct=Be.onCancel;function yt(ft){et(ft)}return l.a.createElement(U.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:yt},l.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},l.a.createElement("span",{style:q},"\u5355\u5143\u683C\u6570\uFF1A"),l.a.createElement("span",{style:q},"\u884C\u6570"),l.a.createElement(U.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},l.a.createElement(ne.a,null)),l.a.createElement("span",{style:q},"\u5217\u6570"),l.a.createElement(U.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},l.a.createElement(ne.a,null))),l.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},l.a.createElement("span",{style:q},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),l.a.createElement(U.a.Item,{name:"align"},l.a.createElement(oe,null,l.a.createElement(Oe.a,{value:"default"},l.a.createElement("i",{className:"fa fa-align-justify"})),l.a.createElement(Oe.a,{value:"left"},l.a.createElement("i",{className:"fa fa-align-left"})),l.a.createElement(Oe.a,{value:"center"},l.a.createElement("i",{className:"fa fa-align-center"})),l.a.createElement(Oe.a,{value:"right"},l.a.createElement("i",{className:"fa fa-align-right"}))))),l.a.createElement("div",{className:"flex-container flex-end"},l.a.createElement(W.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),l.a.createElement(W.a,{type:"ghost",onClick:ct},"\u53D6\u6D88")))},Z=j("ErOA"),ye=j("7Cbv"),be="link",Re="upload-image",Qe="code-block",rt="add-table",at="------------",qe={default:at,left:":".concat(at),center:":".concat(at,":"),right:"".concat(at,":")},st=j("9VGf"),lt,je;function Ie(){}var tt=0,ot=1e4,ze="\u2581",Ze=`
**\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 Ne(Be){return/^\d+$/.test(Be)?"".concat(Be,"px"):Be}var Ae=navigator.platform.toUpperCase().indexOf("MAC")>=0,Me=Ae?"Cmd":"Ctrl",Ee=["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"],Ce=(lt={},Object(b.a)(lt,Me+"-B","bold"),Object(b.a)(lt,Me+"-I","italic"),lt),ke=(je={},Object(b.a)(je,be,"\u6DFB\u52A0\u94FE\u63A5"),Object(b.a)(je,Qe,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(b.a)(je,Re,"\u6DFB\u52A0\u6587\u4EF6"),Object(b.a)(je,rt,"\u6DFB\u52A0\u8868\u683C"),je),Fe=Q.a=function(Be){var et=Be.defaultValue,ct=et===void 0?"":et,yt=Be.onChange,ft=Be.width,mt=ft===void 0?"100%":ft,It=Be.height,At=It===void 0?400:It,_t=Be.miniToolbar,Vt=_t===void 0?!1:_t,Kt=Be.isFocus,tr=Kt===void 0?!1:Kt,rr=Be.watch,Wt=Be.insertTemp,Lt=Be.mode,nr=Lt===void 0?"markdown":Lt,dt=Be.id,Et=dt===void 0?"markdown-editor-id":dt,jt=Be.showResizeBar,kt=jt===void 0?!1:jt,hr=Be.noStorage,Nn=hr===void 0?!1:hr,Ct=Be.showNullButton,Dt=Ct===void 0?!1:Ct,wt=Be.hidetoolBar,wr=wt===void 0?!1:wt,Cr=Be.fullScreen,Jt=Cr===void 0?!1:Cr,Ut=Be.onBlur,Or=Be.onCMBeforeChange,un=Be.onFullScreen,Nr=Be.className,bt=Nr===void 0?"":Nr,Bt=Be.disablePaste,Jr=Bt===void 0?!1:Bt,on=Be.placeholder,Ln=on===void 0?"":on,Sn=Be.values,le=Sn===void 0?"":Sn,K=Object(t.useState)(null),X=Object(S.a)(K,2),ee=X[0],me=X[1],ae=Object(t.useState)(ct),Ke=Object(S.a)(ae,2),pt=Ke[0],Ot=Ke[1],Ht=Object(t.useState)(rr),vt=Object(S.a)(Ht,2),Xt=vt[0],qt=vt[1],Hr=Object(t.useState)(Jt),nn=Object(S.a)(Hr,2),zr=nn[0],or=nn[1],Qr=Object(t.useState)(""),Cn=Object(S.a)(Qr,2),zt=Cn[0],pr=Cn[1],fr=Object(t.useState)(0),jr=Object(S.a)(fr,2),Er=jr[0],li=jr[1],On=Object(t.useState)(At),Ui=Object(S.a)(On,2),Bi=Ui[0],qn=Ui[1],sn=Object(t.useState)(!1),Si=Object(S.a)(sn,2),dn=Si[0],Yn=Si[1],Zr=Object(t.useRef)(Object(ye.a)()),cr=Object(t.useRef)(!1),tn=Object(t.useRef)(),br=Object(t.useRef)(),hn=Object(t.useRef)(),Fr=Object(t.useRef)(),mi=Object(t.useRef)(),_n=function(){var Yt=Object(m.a)(d.a.mark(function sr(){var Qt,gr;return d.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:return Kr.next=2,Object(Z.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Zr.current}});case 2:gr=Kr.sent,gr!=null&&(Qt=gr.attachments)!==null&&Qt!==void 0&&Qt.length&&(console.log("cm:",ee,br),gr.attachments.map(function(Ar){Ar.content_type.indexOf("image")>-1?ee.replaceSelection(".concat(Ar.content_type,")")):Ar.content_type.indexOf("video")>-1?ee.replaceSelection('')):Ar.content_type.indexOf("pdf")>-1?ee.replaceSelection('').concat(Ar.name,"")):ee.replaceSelection("[".concat(Ar.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Ar.id,"?type=").concat(Ar.content_type,")"))}));case 4:case"end":return Kr.stop()}},sr)}));return function(){return Yt.apply(this,arguments)}}();Object(t.useEffect)(function(){Ot(le),ee==null||ee.setValue(le)},[le]),Object(t.useEffect)(function(){un==null||un(zr)},[zr]),Object(t.useEffect)(function(){if(br.current){var Yt=i.a.fromTextArea(br.current,{mode:nr,lineNumbers:!Vt,lineWrapping:!0,value:ct,autoCloseTags:!0,autoCloseBrackets:!0});tr&&Yt.focus();function sr(Qt,gr){if(Jr){gr.preventDefault();return}var Lr=gr.clipboardData;if(Lr){var Kr=Lr.types.toString(),Ar=Lr.items;if(Kr==="Files"||Lr.types.indexOf("Files")>-1){if(gr.preventDefault(),nr=="stex")return;try{var gn,$n=Ar[1];((gn=Ar[0])===null||gn===void 0?void 0:gn.kind)==="file"&&($n=Ar[0]);var xr=$n.getAsFile(),Ei=xr.name.split(".").pop();ie(xr,function(Vr){if(Vr.id){var jn,Bn,gi;(xr==null||((jn=xr.type)===null||jn===void 0)?void 0:jn.indexOf("image"))>-1?Yt.replaceSelection(".concat(Vr.content_type,")")):(xr==null||((Bn=xr.type)===null||Bn===void 0)?void 0:Bn.indexOf("video"))>-1?Yt.replaceSelection('')):(xr==null||((gi=xr.type)===null||gi===void 0)?void 0:gi.indexOf("pdf"))>-1?Yt.replaceSelection('').concat(xr.name,"")):Ee.includes(Ei)?Yt.replaceSelection('').concat(xr.name,"")):Yt.replaceSelection("[".concat(xr.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,"?type=").concat(Vr.content_type,")"))}else(Vr==null?void 0:Vr.status)===401&&(document.location.href="/user/login")})}catch(Vr){y.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Yt.on("paste",sr),Yt.on("dragleave",function(Qt,gr){hn.current.classList.remove("mouse-hover-md")}),Yt.on("dragover",function(Qt,gr){hn.current.classList.add("mouse-hover-md")}),Yt.on("drop",function(Qt,gr){hn.current.classList.add("mouse-hover-md");var Lr;if(Lr=gr.dataTransfer.files,Lr.length>0){gr.preventDefault(),gr.stopPropagation();for(var Kr=function($n){var xr=Lr[$n],Ei=xr.name.split(".").pop();ie(xr,function(Vr){if(Vr.id){var jn,Bn,gi;(xr==null||((jn=xr.type)===null||jn===void 0)?void 0:jn.indexOf("image"))>-1?Yt.replaceSelection(".concat(Vr.content_type,")")):(xr==null||((Bn=xr.type)===null||Bn===void 0)?void 0:Bn.indexOf("video"))>-1?Yt.replaceSelection('')):(xr==null||((gi=xr.type)===null||gi===void 0)?void 0:gi.indexOf("pdf"))>-1?Yt.replaceSelection('').concat(xr.name,"")):Ee.includes(Ei)?Yt.replaceSelection('').concat(xr.name,"")):Yt.replaceSelection("[".concat(xr.name,"](").concat(T.a.API_SERVER,"/api/attachments/").concat(Vr.id,"?type=").concat(Vr.content_type,")"))}else(Vr==null?void 0:Vr.status)===401&&(document.location.href="/user/login")})},Ar=0;Ar0||Ar.target.offsetWidth>0)&&(Un(),ee.setSize("100%","100%"),ee.refresh())}}catch(gn){Lr.e(gn)}finally{Lr.f()}});return Qt.observe(br.current.parentElement),Qt}if(ee){var sr=Yt();return function(){sr.unobserve(br.current.parentElement)}}},[ee,Un]),Object(t.useEffect)(function(){if(ee){for(var Yt=[],sr=function(){var Ar=gr[Qt];Lr=Object(S.a)(Ar,2);var gn=Lr[0],$n=Lr[1],xr=Object(b.a)({},gn,function(){Di($n)});Yt.push(xr),ee.addKeyMap(xr)},Qt=0,gr=Object.entries(Ce);Qt0){var Yt=new Date().getTime(),sr=window.sessionStorage.getItem(Et);Yt>=Er+ot&&(!sr||sr!==pt)&&(window.sessionStorage.setItem(Et,pt),Yn(!0))}},ot),Object(t.useEffect)(function(){qt(rr)},[ee,rr]),Object(t.useEffect)(function(){ee&&(tr&&ee.focus())},[ee,tr]),Object(t.useEffect)(function(){if(Xt&&ee){var Yt=ee.getScrollerElement();function sr(Qt){var gr=Qt.target;if(mi.current){var Lr=gr.scrollTop/gr.scrollHeight;mi.current.scrollTop=mi.current.scrollHeight*Lr}}return Yt.addEventListener("scroll",sr),function(){Yt.removeEventListener("scroll",sr)}}},[ee,Xt]),Object(t.useEffect)(function(){if(ee&&Or){function Yt(sr,Qt){Or(sr,Qt)}return ee.on("beforeChange",Yt),function(){ee.off("beforeChange",Yt)}}},[ee,Or]),Object(t.useEffect)(function(){if(ee&&Ut){function Yt(){Ut(ee.getValue())}return ee.on("blur",Yt),function(){ee.off("blur",Yt)}}},[ee,Ut]),Object(t.useEffect)(function(){if(ee){function Yt(sr){var Qt=sr.getValue();Ot(Qt),li(new Date().getTime()),sr.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),yt&&yt(Qt)}return ee.on("change",Yt),function(){ee.off("change",Yt)}}},[ee,yt]),Object(t.useEffect)(function(){ee&&(ct==null?(ee.setValue(""),Ot("")):ct!==ee.getValue()&&(ee.setValue(ct),Ot(ct),ee.setCursor(ee.lineCount(),0)))},[ee,ct]);var Di=Object(t.useCallback)(function(Yt){var sr=ee.getCursor(),Qt=ee.getSelection(),gr=Qt.split(`
`);switch(Yt){case"bold":return ee.replaceSelection("**"+Qt+"**"),Qt===""&&ee.setCursor(sr.line,sr.ch+2),ee.focus();case"italic":return ee.replaceSelection("*"+Qt+"*"),Qt===""&&ee.setCursor(sr.line,sr.ch+1),ee.focus();case"code":return ee.replaceSelection("`"+Qt+"`"),Qt===""&&ee.setCursor(sr.line,sr.ch+1),ee.focus();case"inline-latex":return ee.replaceSelection("`$$"+Qt+"$$`"),Qt===""&&ee.setCursor(sr.line,sr.ch+3),ee.focus();case"latex":return ee.replaceSelection("```latex\n"+Qt+"\n```"),ee.setCursor(sr.line+1,Qt.length+1),ee.focus();case"line-break":return ee.replaceSelection(`
`),ee.focus();case"list-ul":return Qt===""?ee.replaceSelection("- "+Qt):ee.replaceSelection(gr.map(function(Lr){return Lr===""?"":"- ".concat(Lr)}).join(`
`)),ee.focus();case"list-ol":return Qt===""?ee.replaceSelection("1. "+Qt):ee.replaceSelection(gr.map(function(Lr,Kr){return Lr===""?"":"".concat(Kr+1,". ").concat(Lr)}).join(`
`)),ee.focus();case"add-null-ch":return Qt===""&&ee.setCursor(sr.line,sr.ch+1),ee.replaceSelection(ze),ee.focus();case"inster-template-1":return Qt===""&&ee.setCursor(sr.line,sr.ch),ee.replaceSelection(Ze),ee.focus();case"eraser":return ee.setValue(""),ee.focus();case"trigger-watch":return qt(!Xt),ee.focus();case"trigger-full-screen":return or(!zr),ee.focus();case be:pr(be);return;case Qe:pr(Qe);return;case Re:pr(Re);return;case rt:pr(rt);return;default:throw new Error}},[ee,Xt,zr]),ui=Object(t.useCallback)(function(Yt){pr("");switch(zt){case be:var sr=Yt.title,Qt=Yt.link;return ee.replaceSelection("[".concat(sr,"](").concat(Qt,")")),ee.focus();case Qe:var gr=Yt.language,Lr=Yt.content;return ee.replaceSelection(["```"+gr,Lr,"```"].join(`
`)),ee.focus();case Re:var Kr=Yt.src,Ar=Yt.alt;return Ar?ee.replaceSelection(".concat(Kr,' "').concat(Ar,'" )')):ee.replaceSelection("")),ee.focus();case rt:for(var gn=Yt.row,$n=Yt.col,xr=Yt.align,Ei=`
`,Vr=0;Vr300&&(gn=300);var $n=At+gn+"px";qn($n)}}return Yt.addEventListener("mousedown",gr),document.addEventListener("mousemove",Kr),document.addEventListener("mouseup",Lr),function(){Yt.removeEventListener("mousedown",gr),document.removeEventListener("mousemove",Kr),document.removeEventListener("mouseup",Lr)}}},[ee,Fr]),Object(t.useEffect)(function(){qn(At)},[At]);var ti=Ne(mt),ji=Ne(Bi),ci={width:ti,height:ji},_i=Object(t.useMemo)(function(){if(Er){var Yt=new Date(Er),sr=Yt.getHours(),Qt=Yt.getMinutes(),gr=Yt.getSeconds();return sr=sr<10?"0"+sr:sr,Qt=Qt<10?"0"+Qt:Qt,gr=gr<10?"0"+gr:gr,"".concat(sr,":").concat(Qt,":").concat(gr)}return 0},[Er]);function Hi(){window.sessionStorage.removeItem(Et),Yn(!1),li(0)}function di(){Yn(!1),li(0),ee.setValue(window.sessionStorage.getItem(Et))}function qr(Yt,sr){var Qt=ee.getValue();Qt=Qt.replace(Yt,sr),Ot(Qt),ee==null||ee.setValue(Qt)}return l.a.createElement(t.Fragment,null,l.a.createElement("div",{className:"markdown-editor-wrapper",ref:hn},l.a.createElement("div",{className:"markdown-editor-container ".concat(bt," ").concat(Xt?"on-preview":""," ").concat(Vt?"mini":""," ").concat(zr?"full-screen":""),style:ci},l.a.createElement(A,{insertTemp:Wt,watch:Xt,fullScreen:zr,showNullButton:Dt,onActionCallback:Di,hidetoolBar:wr,uuid:Zr.current,setOpenPhones:function(){cr.current=!0}}),l.a.createElement("div",{className:"markdown-editor-body"},l.a.createElement("div",{className:"codemirror-container"},l.a.createElement("textarea",{ref:br,placeholder:Ln})),Xt?l.a.createElement("div",{ref:mi,className:"preview-container"},nr==="stex"&&l.a.createElement(R,{value:pt}),nr!=="stex"&&l.a.createElement(h.a,{edit:!0,value:pt,replaces:qr})):null))),kt?l.a.createElement("a",{ref:Fr,className:"editor-resize"}):null,l.a.createElement(V.a,null,ke[zt]?l.a.createElement(v.a,{centered:!0,title:ke[zt],visible:!0,onCancel:ei,footer:null,className:"markdown-popup-form"},bi):null))}},PD8m:function(F,Q){F.exports={name:"memoryStorage",read:N,write:v,each:C,remove:k,clearAll:y};var j={};function N(m){return j[m]}function v(m,S){j[m]=S}function C(m){for(var S in j)j.hasOwnProperty(S)&&m(j[S],S)}function k(m){delete j[m]}function y(m){j={}}},PVpz:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("ETIr"),j("cv67"),j("K3mO"),j("OLod"))})(this,function(N){return function(){var v=N,C=v.lib,k=C.StreamCipher,y=v.algo,m=[],S=[],b=[],p=y.RabbitLegacy=k.extend({_doReset:function(){var t=this._key.words,l=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,t[0]&4294901760|t[1]&65535,t[3]<<16|t[3]>>>16,t[1]&4294901760|t[2]&65535,t[0]<<16|t[0]>>>16,t[2]&4294901760|t[3]&65535,t[1]<<16|t[1]>>>16,t[3]&4294901760|t[0]&65535];this._b=0;for(var o=0;o<4;o++)d.call(this);for(var o=0;o<8;o++)i[o]^=r[o+4&7];if(l){var s=l.words,c=s[0],a=s[1],u=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,f=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,w=u>>>16|f&4294901760,_=f<<16|u&65535;i[0]^=u,i[1]^=w,i[2]^=f,i[3]^=_,i[4]^=u,i[5]^=w,i[6]^=f,i[7]^=_;for(var o=0;o<4;o++)d.call(this)}},_doProcessBlock:function(t,l){var r=this._X;d.call(this),m[0]=r[0]^r[5]>>>16^r[3]<<16,m[1]=r[2]^r[7]>>>16^r[5]<<16,m[2]=r[4]^r[1]>>>16^r[7]<<16,m[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)m[i]=(m[i]<<8|m[i]>>>24)&16711935|(m[i]<<24|m[i]>>>8)&4278255360,t[l+i]^=m[i]},blockSize:128/32,ivSize:64/32});function d(){for(var t=this._X,l=this._C,r=0;r<8;r++)S[r]=l[r];l[0]=l[0]+1295307597+this._b|0,l[1]=l[1]+3545052371+(l[0]>>>0>>0?1:0)|0,l[2]=l[2]+886263092+(l[1]>>>0>>0?1:0)|0,l[3]=l[3]+1295307597+(l[2]>>>0>>0?1:0)|0,l[4]=l[4]+3545052371+(l[3]>>>0>>0?1:0)|0,l[5]=l[5]+886263092+(l[4]>>>0>>0?1:0)|0,l[6]=l[6]+1295307597+(l[5]>>>0>>0?1:0)|0,l[7]=l[7]+3545052371+(l[6]>>>0>>0?1:0)|0,this._b=l[7]>>>0>>0?1:0;for(var r=0;r<8;r++){var i=t[r]+l[r],o=i&65535,s=i>>>16,c=((o*o>>>17)+o*s>>>15)+s*s,a=((i&4294901760)*i|0)+((i&65535)*i|0);b[r]=c^a}t[0]=b[0]+(b[7]<<16|b[7]>>>16)+(b[6]<<16|b[6]>>>16)|0,t[1]=b[1]+(b[0]<<8|b[0]>>>24)+b[7]|0,t[2]=b[2]+(b[1]<<16|b[1]>>>16)+(b[0]<<16|b[0]>>>16)|0,t[3]=b[3]+(b[2]<<8|b[2]>>>24)+b[1]|0,t[4]=b[4]+(b[3]<<16|b[3]>>>16)+(b[2]<<16|b[2]>>>16)|0,t[5]=b[5]+(b[4]<<8|b[4]>>>24)+b[3]|0,t[6]=b[6]+(b[5]<<16|b[5]>>>16)+(b[4]<<16|b[4]>>>16)|0,t[7]=b[7]+(b[6]<<8|b[6]>>>24)+b[5]|0}v.RabbitLegacy=k._createHelper(p)}(),N.RabbitLegacy})},RELg:function(F,Q,j){var N=j("MFOe"),v=N.Global;F.exports={name:"oldIE-userDataStorage",write:S,read:b,each:p,remove:d,clearAll:t};var C="storejs",k=v.document,y=i(),m=(v.navigator?v.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function S(o,s){if(m)return;var c=r(o);y(function(a){a.setAttribute(c,s),a.save(C)})}function b(o){if(m)return;var s=r(o),c=null;return y(function(a){c=a.getAttribute(s)}),c}function p(o){y(function(s){for(var c=s.XMLDocument.documentElement.attributes,a=c.length-1;a>=0;a--){var u=c[a];o(s.getAttribute(u.name),u.name)}})}function d(o){var s=r(o);y(function(c){c.removeAttribute(s),c.save(C)})}function t(){y(function(o){var s=o.XMLDocument.documentElement.attributes;o.load(C);for(var c=s.length-1;c>=0;c--)o.removeAttribute(s[c].name);o.save(C)})}var l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function r(o){return o.replace(/^\d/,"___$&").replace(l,"___")}function i(){if(!k||!k.documentElement||!k.documentElement.addBehavior)return null;var o="script",s,c,a;try{c=new ActiveXObject("htmlfile"),c.open(),c.write("<"+o+">document.w=window"+o+'>'),c.close(),s=c.w.frames[0].document,a=s.createElement("div")}catch(u){a=k.createElement("div"),s=k.body}return function(u){var f=[].slice.call(arguments,0);f.unshift(a),s.appendChild(a),a.addBehavior("#default#userData"),a.load(C),u.apply(this,f),s.removeChild(a);return}}},S6kV:function(F,Q,j){(function(N,v,C){F.exports=Q=v(j("Ib8C"),j("OLod"))})(this,function(N){return N.mode.OFB=function(){var v=N.lib.BlockCipherMode.extend(),C=v.Encryptor=v.extend({processBlock:function(k,y){var m=this._cipher,S=m.blockSize,b=this._iv,p=this._keystream;b&&(p=this._keystream=b.slice(0),this._iv=void 0),m.encryptBlock(p,0);for(var d=0;d|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(oe){for(var q=0,Y=!1,Z=!1,ye=0,be=oe.length;ye122||(Ee<65||Me>90||tt.push([Math.max(65,Me)|32,Math.min(Ee,90)|32]),Ee<97||Me>122||tt.push([Math.max(97,Me)&~32,Math.min(Ee,122)&~32]))}}tt.sort(function(Be,et){return Be[0]-et[0]||et[1]-Be[1]});for(var Ce=[],ke=[],Ze=0;ZeFe[0]&&(Fe[1]+1>Fe[0]&&ze.push("-"),ze.push(at(Fe[1])))}return ze.push("]"),ze.join("")}function st(je){for(var Ie=je.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")),tt=Ie.length,ot=[],ze=0,Ze=0;ze=2&&Me==="["?Ie[ze]=qe(Ne):Me!=="\\"&&(Ie[ze]=Ne.replace(/[a-zA-Z]/g,function(ke){var Fe=ke.charCodeAt(0);return"["+String.fromCharCode(Fe&~32,Fe|32)+"]"}))}return Ie.join("")}for(var lt=[],ye=0,be=oe.length;ye=0;)Y[lt.charAt(je)]=st;var Ie=st[1],tt=""+Ie;rt.hasOwnProperty(tt)||(Qe.push(Ie),rt[tt]=null)}Qe.push(/[\0-\uffff]/),Z=U(Qe)})();var ye=q.length,be=function(Re){for(var Qe=Re.sourceCode,rt=Re.basePos,at=Re.sourceNode,qe=[rt,T],st=0,lt=Qe.match(Z)||[],je={},Ie=0,tt=lt.length;Ie=5&&ze.substring(0,5)==="lang-",Ne&&!(Ze&&typeof Ze[1]=="string")&&(Ne=!1,ze=A),Ne||(je[ot]=ze)}var Ee=st;if(st+=ot.length,!Ne)qe.push(rt+Ee,ze);else{var Ce=Ze[1],ke=ot.indexOf(Ce),Fe=ke+Ce.length;Ze[2]&&(Fe=ot.length-Ze[2].length,ke=Fe-Ce.length);var Be=ze.substring(5);H(at,rt+Ee,ot.substring(0,ke),be,qe),H(at,rt+Ee+ke,Ce,ue(Be,Ce),qe),H(at,rt+Ee+Fe,ot.substring(Fe),be,qe)}}Re.decorations=qe};return be}function ge(oe){var q=[],Y=[];oe.tripleQuotedStrings?q.push([h,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):oe.multiLineStrings?q.push([h,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):q.push([h,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),oe.verbatimStrings&&Y.push([h,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Z=oe.hashComments;Z&&(oe.cStyleComments?(Z>1?q.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):q.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Y.push([h,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):q.push([O,/^#[^\r\n]*/,null,"#"])),oe.cStyleComments&&(Y.push([O,/^\/\/[^\r\n]*/,null]),Y.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ye=oe.regexLiterals;if(ye){var be=ye>1?"":`
\r`,Re=be?".":"[\\S\\s]",Qe="/(?=[^/*"+be+"])(?:[^/\\x5B\\x5C"+be+"]|\\x5C"+Re+"|\\x5B(?:[^\\x5C\\x5D"+be+"]|\\x5C"+Re+")*(?:\\x5D|$))+/";Y.push(["lang-regex",RegExp("^"+G+"("+Qe+")")])}var rt=oe.types;rt&&Y.push([g,rt]);var at=(""+oe.keywords).replace(/^ | $/g,"");at.length&&Y.push([R,new RegExp("^(?:"+at.replace(/[\s,]+/g,"|")+")\\b"),null]),q.push([T,/^\s+/,null,` \r
\xA0`]);var qe="^.[^\\s\\w.$@'\"`/\\\\]*";return oe.regexLiterals&&(qe+="(?!s*/)"),Y.push([x,/^@[a-z_$][a-z_$@0-9]*/i,null],[g,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[T,/^[a-z_$][a-z_$@0-9]*/i,null],[x,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[T,/^\\[\s\S]?/,null],[E,new RegExp(qe),null]),te(q,Y)}var ve=ge({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function de(oe,q,Y){for(var Z=/(?:^|\s)nocode(?:\s|$)/,ye=/\r\n?|\n/,be=oe.ownerDocument,Re=be.createElement("li");oe.firstChild;)Re.appendChild(oe.firstChild);var Qe=[Re];function rt(Ie){var tt=Ie.nodeType;if(tt==1&&!Z.test(Ie.className))if(Ie.nodeName==="br")at(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var ot=Ie.firstChild;ot;ot=ot.nextSibling)rt(ot);else if((tt==3||tt==4)&&Y){var ze=Ie.nodeValue,Ze=ze.match(ye);if(Ze){var Ne=ze.substring(0,Ze.index);Ie.nodeValue=Ne;var Ae=ze.substring(Ze.index+Ze[0].length);if(Ae){var Me=Ie.parentNode;Me.insertBefore(be.createTextNode(Ae),Ie.nextSibling)}at(Ie),Ne||Ie.parentNode.removeChild(Ie)}}}function at(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function tt(Ze,Ne){var Ae=Ne?Ze.cloneNode(!1):Ze,Me=Ze.parentNode;if(Me){var Ee=tt(Me,1),Ce=Ze.nextSibling;Ee.appendChild(Ae);for(var ke=Ce;ke;ke=Ce)Ce=ke.nextSibling,Ee.appendChild(ke)}return Ae}for(var ot=tt(Ie.nextSibling,0),ze;(ze=ot.parentNode)&&ze.nodeType===1;)ot=ze;Qe.push(ot)}for(var qe=0;qe=Me&&(rt+=2),be>=Ee&&(st+=2)}}finally{ze&&(ze.style.display=Ze)}}var Te={};function he(oe,q){for(var Y=q.length;--Y>=0;){var Z=q[Y];Te.hasOwnProperty(Z)?b.console&&console.warn("cannot override language handler %s",Z):Te[Z]=oe}}function ue(oe,q){return oe&&Te.hasOwnProperty(oe)||(oe=/^\s*]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^