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

350 lines
638 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[288,6,7,14,17],{"+NIl":function(nt,Ge,v){(function(H){H(v("VrN/"))})(function(H){"use strict";H.defineMode("stex",function(he,oe){"use strict";function _e(z,N){z.cmdState.push(N)}function le(z){return z.cmdState.length>0?z.cmdState[z.cmdState.length-1]:null}function V(z){var N=z.cmdState.pop();N&&N.closeBracket()}function O(z){for(var N=z.cmdState,J=N.length-1;J>=0;J--){var K=N[J];if(K.name=="DEFAULT")continue;return K}return{styleIdentifier:function(){return null}}}function I(z,N,J){return function(){this.name=z,this.bracketNo=0,this.style=N,this.styles=J,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var R={};R.importmodule=I("importmodule","tag",["string","builtin"]),R.documentclass=I("documentclass","tag",["","atom"]),R.usepackage=I("usepackage","tag",["atom"]),R.begin=I("begin","tag",["atom"]),R.end=I("end","tag",["atom"]),R.label=I("label","tag",["atom"]),R.ref=I("ref","tag",["atom"]),R.eqref=I("eqref","tag",["atom"]),R.cite=I("cite","tag",["atom"]),R.bibitem=I("bibitem","tag",["atom"]),R.Bibitem=I("Bibitem","tag",["atom"]),R.RBibitem=I("RBibitem","tag",["atom"]),R.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function A(z,N){z.f=N}function S(z,N){var J;if(z.match(/^\\[a-zA-Z@]+/)){var K=z.current().slice(1);return J=R.hasOwnProperty(K)?R[K]:R.DEFAULT,J=new J,_e(N,J),A(N,$),J.style}if(z.match(/^\\[$&%#{}_]/))return"tag";if(z.match(/^\\[,;!\/\\]/))return"tag";if(z.match("\\["))return A(N,function(de,Ne){return T(de,Ne,"\\]")}),"keyword";if(z.match("\\("))return A(N,function(de,Ne){return T(de,Ne,"\\)")}),"keyword";if(z.match("$$"))return A(N,function(de,Ne){return T(de,Ne,"$$")}),"keyword";if(z.match("$"))return A(N,function(de,Ne){return T(de,Ne,"$")}),"keyword";var Q=z.next();if(Q=="%")return z.skipToEnd(),"comment";if(Q=="}"||Q=="]"){if(J=le(N),J)J.closeBracket(Q),A(N,$);else return"error";return"bracket"}else return Q=="{"||Q=="["?(J=R.DEFAULT,J=new J,_e(N,J),"bracket"):/\d/.test(Q)?(z.eatWhile(/[\w.%]/),"atom"):(z.eatWhile(/[\w\-_]/),J=O(N),J.name=="begin"&&(J.argument=z.current()),J.styleIdentifier())}function T(z,N,J){if(z.eatSpace())return null;if(J&&z.match(J))return A(N,S),"keyword";if(z.match(/^\\[a-zA-Z@]+/))return"tag";if(z.match(/^[a-zA-Z]+/))return"variable-2";if(z.match(/^\\[$&%#{}_]/))return"tag";if(z.match(/^\\[,;!\/]/))return"tag";if(z.match(/^[\^_&]/))return"tag";if(z.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(z.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var K=z.next();return K=="{"||K=="}"||K=="["||K=="]"||K=="("||K==")"?"bracket":K=="%"?(z.skipToEnd(),"comment"):"error"}function $(z,N){var J=z.peek(),K;return J=="{"||J=="["?(K=le(N),K.openBracket(J),z.eat(J),A(N,S),"bracket"):/[ \t\r]/.test(J)?(z.eat(J),null):(A(N,S),V(N),S(z,N))}return{startState:function(){var z=oe.inMathMode?function(N,J){return T(N,J)}:S;return{cmdState:[],f:z}},copyState:function(z){return{cmdState:z.cmdState.slice(),f:z.f}},token:function(z,N){return N.f(z,N)},blankLine:function(z){z.f=S,z.cmdState.length=0},lineComment:"%"}}),H.defineMIME("text/x-stex","stex"),H.defineMIME("text/x-latex","stex")})},"19Vz":function(nt,Ge,v){(function(H){H(v("VrN/"))})(function(H){H.defineOption("placeholder","",function(I,R,A){var S=A&&A!=H.Init;if(R&&!S)I.on("blur",le),I.on("change",V),I.on("swapDoc",V),H.on(I.getInputField(),"compositionupdate",I.state.placeholderCompose=function(){_e(I)}),V(I);else if(!R&&S){I.off("blur",le),I.off("change",V),I.off("swapDoc",V),H.off(I.getInputField(),"compositionupdate",I.state.placeholderCompose),he(I);var T=I.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}R&&!I.hasFocus()&&le(I)});function he(I){I.state.placeholder&&(I.state.placeholder.parentNode.removeChild(I.state.placeholder),I.state.placeholder=null)}function oe(I){he(I);var R=I.state.placeholder=document.createElement("pre");R.style.cssText="height: 0; overflow: visible",R.style.direction=I.getOption("direction"),R.className="CodeMirror-placeholder CodeMirror-line-like";var A=I.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),R.appendChild(A),I.display.lineSpace.insertBefore(R,I.display.lineSpace.firstChild)}function _e(I){setTimeout(function(){var R=!1,A=I.getInputField();A.nodeName=="TEXTAREA"?R=!A.value:I.lineCount()==1&&(R=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),R?oe(I):he(I)},20)}function le(I){O(I)&&oe(I)}function V(I){var R=I.getWrapperElement(),A=O(I);R.className=R.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?oe(I):he(I)}function O(I){return I.lineCount()===1&&I.getLine(0)===""}})},"1ZF9":function(nt,Ge,v){nt.exports=v.p+"static/Authorize.cc9c212f.png"},"1eCo":function(nt,Ge,v){(function(H){H(v("VrN/"))})(function(H){"use strict";var he={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},oe={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};H.defineMode("xml",function(_e,le){var V=_e.indentUnit,O={},I=le.htmlMode?he:oe;for(var R in I)O[R]=I[R];for(var R in le)O[R]=le[R];var A,S;function T(L,ue){function Y(D){return ue.tokenize=D,D(L,ue)}var x=L.next();if(x=="<")return L.eat("!")?L.eat("[")?L.match("CDATA[")?Y(N("atom","]]>")):null:L.match("--")?Y(N("comment","-->")):L.match("DOCTYPE",!0,!0)?(L.eatWhile(/[\w\._\-]/),Y(J(1))):null:L.eat("?")?(L.eatWhile(/[\w\._\-]/),ue.tokenize=N("meta","?>"),"meta"):(A=L.eat("/")?"closeTag":"openTag",ue.tokenize=$,"tag bracket");if(x=="&"){var j;return L.eat("#")?L.eat("x")?j=L.eatWhile(/[a-fA-F\d]/)&&L.eat(";"):j=L.eatWhile(/[\d]/)&&L.eat(";"):j=L.eatWhile(/[\w\.\-:]/)&&L.eat(";"),j?"atom":"error"}else return L.eatWhile(/[^&<]/),null}T.isInText=!0;function $(L,ue){var Y=L.next();if(Y==">"||Y=="/"&&L.eat(">"))return ue.tokenize=T,A=Y==">"?"endTag":"selfcloseTag","tag bracket";if(Y=="=")return A="equals",null;if(Y=="<"){ue.tokenize=T,ue.state=Ne,ue.tagName=ue.tagStart=null;var x=ue.tokenize(L,ue);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(Y)?(ue.tokenize=z(Y),ue.stringStartCol=L.column(),ue.tokenize(L,ue)):(L.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function z(L){var ue=function(Y,x){for(;!Y.eol();)if(Y.next()==L){x.tokenize=$;break}return"string"};return ue.isInAttribute=!0,ue}function N(L,ue){return function(Y,x){for(;!Y.eol();){if(Y.match(ue)){x.tokenize=T;break}Y.next()}return L}}function J(L){return function(ue,Y){for(var x;(x=ue.next())!=null;){if(x=="<")return Y.tokenize=J(L+1),Y.tokenize(ue,Y);if(x==">")if(L==1){Y.tokenize=T;break}else return Y.tokenize=J(L-1),Y.tokenize(ue,Y)}return"meta"}}function K(L,ue,Y){this.prev=L.context,this.tagName=ue,this.indent=L.indented,this.startOfLine=Y,(O.doNotIndent.hasOwnProperty(ue)||L.context&&L.context.noIndent)&&(this.noIndent=!0)}function Q(L){L.context&&(L.context=L.context.prev)}function de(L,ue){for(var Y;;){if(!L.context)return;if(Y=L.context.tagName,!O.contextGrabbers.hasOwnProperty(Y)||!O.contextGrabbers[Y].hasOwnProperty(ue))return;Q(L)}}function Ne(L,ue,Y){return L=="openTag"?(Y.tagStart=ue.column(),Xe):L=="closeTag"?ke:Ne}function Xe(L,ue,Y){return L=="word"?(Y.tagName=ue.current(),S="tag",me):O.allowMissingTagName&&L=="endTag"?(S="tag bracket",me(L,ue,Y)):(S="error",Xe)}function ke(L,ue,Y){if(L=="word"){var x=ue.current();return Y.context&&Y.context.tagName!=x&&O.implicitlyClosed.hasOwnProperty(Y.context.tagName)&&Q(Y),Y.context&&Y.context.tagName==x||O.matchClosing===!1?(S="tag",be):(S="tag error",Fe)}else return O.allowMissingTagName&&L=="endTag"?(S="tag bracket",be(L,ue,Y)):(S="error",Fe)}function be(L,ue,Y){return L!="endTag"?(S="error",be):(Q(Y),Ne)}function Fe(L,ue,Y){return S="error",be(L,ue,Y)}function me(L,ue,Y){if(L=="word")return S="attribute",Se;if(L=="endTag"||L=="selfcloseTag"){var x=Y.tagName,j=Y.tagStart;return Y.tagName=Y.tagStart=null,L=="selfcloseTag"||O.autoSelfClosers.hasOwnProperty(x)?de(Y,x):(de(Y,x),Y.context=new K(Y,x,j==Y.indented)),Ne}return S="error",me}function Se(L,ue,Y){return L=="equals"?Pe:(O.allowMissing||(S="error"),me(L,ue,Y))}function Pe(L,ue,Y){return L=="string"?xe:L=="word"&&O.allowUnquoted?(S="string",me):(S="error",me(L,ue,Y))}function xe(L,ue,Y){return L=="string"?xe:me(L,ue,Y)}return{startState:function(L){var ue={tokenize:T,state:Ne,indented:L||0,tagName:null,tagStart:null,context:null};return L!=null&&(ue.baseIndent=L),ue},token:function(L,ue){if(!ue.tagName&&L.sol()&&(ue.indented=L.indentation()),L.eatSpace())return null;A=null;var Y=ue.tokenize(L,ue);return(Y||A)&&Y!="comment"&&(S=null,ue.state=ue.state(A||Y,L,ue),S&&(Y=S=="error"?Y+" error":S)),Y},indent:function(L,ue,Y){var x=L.context;if(L.tokenize.isInAttribute)return L.tagStart==L.indented?L.stringStartCol+1:L.indented+V;if(x&&x.noIndent)return H.Pass;if(L.tokenize!=$&&L.tokenize!=T)return Y?Y.match(/^(\s*)/)[0].length:0;if(L.tagName)return O.multilineTagIndentPastTag!==!1?L.tagStart+L.tagName.length+2:L.tagStart+V*(O.multilineTagIndentFactor||1);if(O.alignCDATA&&/<!\[CDATA\[/.test(ue))return 0;var j=ue&&/^<(\/)?([\w_:\.-]*)/.exec(ue);if(j&&j[1])for(;x;)if(x.tagName==j[2]){x=x.prev;break}else if(O.implicitlyClosed.hasOwnProperty(x.tagName))x=x.prev;else break;else if(j)for(;x;){var D=O.contextGrabbers[x.tagName];if(D&&D.hasOwnProperty(j[2]))x=x.prev;else break}for(;x&&x.prev&&!x.startOfLine;)x=x.prev;return x?x.indent+V:L.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:O.htmlMode?"html":"xml",helperType:O.htmlMode?"html":"xml",skipAttribute:function(L){L.state==Pe&&(L.state=me)},xmlCurrentTag:function(L){return L.tagName?{name:L.tagName,close:L.type=="closeTag"}:null},xmlCurrentContext:function(L){for(var ue=[],Y=L.context;Y;Y=Y.prev)Y.tagName&&ue.push(Y.tagName);return ue.reverse()}}}),H.defineMIME("text/xml","xml"),H.defineMIME("application/xml","xml"),H.mimeModes.hasOwnProperty("text/html")||H.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"3vs6":function(nt,Ge,v){"use strict";var H=v("+L6B"),he=v("2/Rp"),oe=v("5Dmo"),_e=v("3S7+"),le=v("k1fw"),V=v("miYZ"),O=v("tsqr"),I=v("9og8"),R=v("2qtc"),A=v("kLXV"),S=v("tJVT"),T=v("WmNS"),$=v.n(T),z=v("q1tI"),N=v.n(z),J=v("ttuQ"),K=v.n(J),Q=v("ErOA"),de=v("m3rI"),Ne=v("IE1O"),Xe=v("xKgJ"),ke=v("NLgs"),be=v("Ty5D"),Fe=v("9kvl"),me=function(Pe){var xe=Pe.virtualSpaces,L=Pe.user,ue=Pe.dispatch,Y=Object(z.useState)(!1),x=Object(S.a)(Y,2),j=x[0],D=x[1],_=Object(be.i)(),k=xe.virtualSpacesDetails;Object(z.useEffect)(function(){p()},[]);var p=function(){ue({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:_==null?void 0:_.virtual_spacesId}})},d=function(){if(!Object(ke.f)(ue))return;A.a.confirm({centered:!0,width:424,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u7533\u8BF7\u52A0\u5165",icon:null,className:"custom-modal-divider",content:N.a.createElement("div",{className:"font14"},"\u786E\u8BA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\u52A0\u5165\u8BE5\u865A\u62DF\u793E\u533A\u5417\uFF1F"),onOk:function(){var pe=Object(I.a)($.a.mark(function re(){var se;return $.a.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,Object(Q.a)("/api/virtual_classrooms/".concat(_==null?void 0:_.virtual_spacesId,"/apply_become_member.json"),{method:"post"});case 2:se=B.sent,(se==null?void 0:se.status)!==-1&&(O.b.success(se==null?void 0:se.message),p());case 4:case"end":return B.stop()}},re)}));function fe(){return pe.apply(this,arguments)}return fe}()})},w=function(){A.a.confirm({centered:!0,width:424,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u7533\u8BF7\u516C\u5F00",icon:null,className:"custom-modal-divider",content:N.a.createElement("div",{className:"font14"},N.a.createElement("p",null,"\u786E\u8BA4\u5411\u5E73\u53F0\u7533\u8BF7\u516C\u5F00\u865A\u62DF\u793E\u533A\u5417\uFF1F"),N.a.createElement("p",null,"\u516C\u5F00\u865A\u62DF\u793E\u533A\u9700\u7ECF\u8FC7\u5E73\u53F0\u6807\u51C6\u5316\u5BA1\u6838\uFF0C\u5BA1\u6838\u5468\u671F\u4E3A1-2\u5929\uFF0C"),N.a.createElement("div",null,"\u516C\u5F00\u7684\u865A\u62DF\u793E\u533A\u5C06\u5BF9\u5E73\u53F0\u6240\u6709\u4EBA\u53EF\u89C1\u3002")),onOk:function(){var pe=Object(I.a)($.a.mark(function re(){var se;return $.a.wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,Object(Q.a)("/api/virtual_classrooms/".concat(_==null?void 0:_.virtual_spacesId,"/apply_public.json"),{method:"post"});case 2:se=B.sent,(se==null?void 0:se.status)!==-1&&(O.b.success(se==null?void 0:se.message),p());case 4:case"end":return B.stop()}},re)}));function fe(){return pe.apply(this,arguments)}return fe}()})},F=function(){var Le=Object(I.a)($.a.mark(function pe(fe){var re;return $.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,Object(Q.a)("/api/virtual_classrooms/".concat(_==null?void 0:_.virtual_spacesId,".json"),{method:"put",body:fe});case 2:re=ee.sent,(re==null?void 0:re.status)===0&&(p(),D(!1));case 4:case"end":return ee.stop()}},pe)}));return function(fe){return Le.apply(this,arguments)}}(),te=function(){var Le=Object(I.a)($.a.mark(function pe(fe){return $.a.wrap(function(se){for(;;)switch(se.prev=se.next){case 0:D(Object(le.a)({},k));case 1:case"end":return se.stop()}},pe)}));return function(fe){return Le.apply(this,arguments)}}(),Ee=(k==null?void 0:k.is_member)||Object(Xe.v)();return N.a.createElement("div",{className:K.a.bg,style:{background:"url('".concat(de.a.IMG_SERVER+(k==null?void 0:k.backbground_image_url),"') no-repeat center center")}},N.a.createElement("aside",null,N.a.createElement("div",null,N.a.createElement("div",{className:K.a.member},N.a.createElement("div",null,N.a.createElement(_e.a,{title:"\u6210\u5458\u603B\u6570"},N.a.createElement("i",{style:{color:"#FF8B58",fontSize:24},className:"iconfont icon-a-chengyuan1"})),N.a.createElement(_e.a,{title:"\u6210\u5458\u603B\u6570"},N.a.createElement("span",null,k==null?void 0:k.members_count))),N.a.createElement("div",null,N.a.createElement(_e.a,{title:"\u8D44\u6E90\u603B\u6570"},N.a.createElement("i",{style:{color:"#07C160",marginLeft:100},className:"iconfont icon-a-ziyuanku1"})),N.a.createElement(_e.a,{title:"\u8D44\u6E90\u603B\u6570"},N.a.createElement("span",null,k==null?void 0:k.resources_count)))),Ee&&N.a.createElement(he.a,{disabled:(k==null?void 0:k.status)!==2,onClick:w,type:"primary"},N.a.createElement("i",{className:"iconfont icon-sheweigongkai2 mr5 font14"}),(k==null?void 0:k.status)===2?"\u7533\u8BF7\u516C\u5F00":(k==null?void 0:k.status)===0?"\u7533\u8BF7\u4E2D":"\u5DF2\u516C\u5F00"),!Ee&&N.a.createElement(he.a,{onClick:d,type:"primary"},N.a.createElement("i",{className:"iconfont icon-shenqingjiaru2 mr5 font14"}),"\u7533\u8BF7\u52A0\u5165"))),N.a.createElement(Ne.b,{visible:j,title:"\u7F16\u8F91\u865A\u62DF\u793E\u533A",onCancel:function(){return D(!1)},onOk:F}))};Ge.a=Object(Fe.a)(function(Se){var Pe=Se.virtualSpaces,xe=Se.user;return{virtualSpaces:Pe,user:xe}})(me)},"500L":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return ke});var H=v("+L6B"),he=v("2/Rp"),oe=v("2qtc"),_e=v("kLXV"),le=v("9og8"),V=v("k1fw"),O=v("miYZ"),I=v("tsqr"),R=v("oBTY"),A=v("tJVT"),S=v("DZo9"),T=v("8z0m"),$=v("WmNS"),z=v.n($),N=v("q1tI"),J=v.n(N),K=v("m3rI"),Q=v("wzkS"),de=v("y5JW"),Ne=v("LtfV"),Xe=T.a.Dragger;function ke(be){var Fe=[];return be&&be.length>0&&(Fe=be.map(function(me){return{uid:me.id,id:me.id,name:me.title+de.c+me.filesize,url:me.url,filesize:me.filesize,status:"done",response:{id:me.id}}})),Fe}Ge.b=function(be){var Fe=be.value,me=be.onChange,Se=be.action,Pe=be.className,xe=be.maxSize,L=xe===void 0?150:xe,ue=be.title,Y=ue===void 0?"\u4E0A\u4F20\u9644\u4EF6":ue,x=be.showRemoveModal,j=x===void 0?!1:x,D=be.accept,_=D===void 0?"":D,k=be.additionalText,p=be.isDragger,d=be.number,w=d===void 0?1e3:d,F=be.aloneClear,te=F===void 0?!1:F,Ee=be.restrict,Le=Ee===void 0?!0:Ee,pe=Object(N.useState)(!1),fe=Object(A.a)(pe,2),re=fe[0],se=fe[1],ee=Object(N.useState)(Fe||[]),B=Object(A.a)(ee,2),b=B[0],G=B[1];Object(N.useEffect)(function(){Fe&&(G(Object(R.a)(Fe)),w===(Fe==null?void 0:Fe.length)&&se(!0))},[Fe]);var M=function(){setTimeout(function(){b.pop(),G(Object(R.a)(b))},500)},ge={multiple:!0,disabled:re,accept:_,withCredentials:!0,fileList:b,beforeUpload:function(Te,Ie){var De=Te.size/1024/1024;return b.concat(Ie).length>w?(b.pop(),G(Object(R.a)(b)),I.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(w,"\u4E2A\u6587\u4EF6")),te?Promise.reject():(M(),!1)):De<L?!0:(I.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(L,"MB).")),te?Promise.reject():(M(),!1))},action:Se||"".concat(K.a.API_SERVER,"/api/attachments.json"),onChange:function(Te){var Ie=Object(R.a)(Te.fileList);Ie.length>=w?se(!0):se(!1),G(Object(R.a)(Ie)),Ie=Ie.map(function(De){var Ae;if(De!=null&&(Ae=De.response)!==null&&Ae!==void 0&&Ae.id){var Me;De.url="/api/attachments/".concat(De==null||((Me=De.response)===null||Me===void 0)?void 0:Me.id)}return De.name.indexOf(de.c)===-1&&(De.name="".concat(De.name).concat(de.c).concat(Object(de.a)(De.size))),Object(V.a)({},De)}),console.log("info:",Te),me(Ie)},onRemove:function(){var ne=Object(le.a)(z.a.mark(function Ie(De){var Ae;return z.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:if(Ae=function(){var et=Object(le.a)(z.a.mark(function Ve(){var Ze,Qe;return z.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:if(Ze=De.response?De.response.id:De.id,!Ze){tt.next=8;break}return tt.next=4,Object(Q.d)(De.response?De.response.id:De.uid);case 4:return Qe=tt.sent,tt.abrupt("return",Qe);case 8:return tt.abrupt("return",!0);case 9:case"end":return tt.stop()}},Ve)}));return function(){return et.apply(this,arguments)}}(),!j){Ue.next=5;break}return Ue.abrupt("return",new Promise(function(et,Ve){_e.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:J.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var Ze=Object(le.a)(z.a.mark(function at(){var tt;return z.a.wrap(function(Re){for(;;)switch(Re.prev=Re.next){case 0:return Re.next=2,Ae();case 2:tt=Re.sent,I.b.success("\u5220\u9664\u6210\u529F"),et(!0);case 5:case"end":return Re.stop()}},at)}));function Qe(){return Ze.apply(this,arguments)}return Qe}(),onCancel:function(){return et(!1)}})}));case 5:return Ue.next=7,Ae();case 7:return Ue.abrupt("return",Ue.sent);case 8:case"end":return Ue.stop()}},Ie)}));function Te(Ie){return ne.apply(this,arguments)}return Te}()};function we(ne){ne.preventDefault(),ne.stopPropagation()}return J.a.createElement("div",{className:"multi-upload ".concat(Pe||"")},p&&J.a.createElement(Xe,ge,J.a.createElement("p",{className:"ant-upload-drag-icon"},J.a.createElement(Ne.a,null)),J.a.createElement("p",{className:"ant-upload-text"},"\u70B9\u51FB\u4E0A\u4F20\u56FE\u6807\uFF0C\u9009\u62E9\u8981\u4E0A\u4F20\u7684\u6587\u4EF6\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64",J.a.createElement("br",null),J.a.createElement("span",{style:{display:Le?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",L,"MB) ")),k),!p&&J.a.createElement(T.a,ge,J.a.createElement(he.a,{disabled:re},Y),J.a.createElement("span",{onClick:we,style:{marginLeft:10,color:"#FA6400",display:Le?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",L,"MB) ")))}},"7Cbv":function(nt,Ge,v){"use strict";var H=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),he=new Uint8Array(16);function oe(){if(!H)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return H(he)}var _e=/^(?:[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 le($){return typeof $=="string"&&_e.test($)}for(var V=le,O=[],I=0;I<256;++I)O.push((I+256).toString(16).substr(1));function R($){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,N=(O[$[z+0]]+O[$[z+1]]+O[$[z+2]]+O[$[z+3]]+"-"+O[$[z+4]]+O[$[z+5]]+"-"+O[$[z+6]]+O[$[z+7]]+"-"+O[$[z+8]]+O[$[z+9]]+"-"+O[$[z+10]]+O[$[z+11]]+O[$[z+12]]+O[$[z+13]]+O[$[z+14]]+O[$[z+15]]).toLowerCase();if(!V(N))throw TypeError("Stringified UUID is invalid");return N}var A=R;function S($,z,N){$=$||{};var J=$.random||($.rng||oe)();if(J[6]=J[6]&15|64,J[8]=J[8]&63|128,z){N=N||0;for(var K=0;K<16;++K)z[N+K]=J[K];return z}return A(J)}var T=Ge.a=S},"7ahc":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return Xe});var H=v("k1fw"),he=v("0Owb"),oe=v("+L6B"),_e=v("2/Rp"),le=v("y8nQ"),V=v("Vl3Y"),O=v("tJVT"),I=v("OaEy"),R=v("2fM7"),A=v("q1tI"),S=v.n(A),T=v("VrN/"),$=v.n(T),z=v("p77/"),N=v.n(z),J=v("c5Ni"),K=v.n(J),Q=R.a.Option,de={labelCol:{span:4},wrapperCol:{span:20}},Ne={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"]};Ge.b=function(ke){var be=ke.callback,Fe=ke.onCancel,me=Object(A.useState)("python"),Se=Object(O.a)(me,2),Pe=Se[0],xe=Se[1];function L(Y){xe(Ne[Y][1])}function ue(Y){be(Y)}return S.a.createElement(V.a,Object(he.a)({},de,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ue}),S.a.createElement(V.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},S.a.createElement(R.a,{onChange:L},Object.keys(Ne).map(function(Y){return S.a.createElement(Q,{key:Y,value:Y},Ne[Y][0])}))),S.a.createElement(V.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},S.a.createElement(Xe,{mode:Pe})),S.a.createElement("div",{className:"flex-container flex-end"},S.a.createElement(_e.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),S.a.createElement(_e.a,{type:"ghost",onClick:Fe},"\u53D6\u6D88")))};function Xe(ke){var be=ke.value,Fe=ke.onChange,me=ke.mode,Se=ke.options,Pe=Se===void 0?{}:Se,xe=Object(A.useRef)(),L=Object(A.useState)(),ue=Object(O.a)(L,2),Y=ue[0],x=ue[1];return Object(A.useEffect)(function(){if(Y){function j(D){var _=D.getValue();Fe&&Fe(_)}return Y.on("change",j),function(){Y.off("change",j)}}},[Y,Fe]),Object(A.useEffect)(function(){Y&&Y.setOption("mode",me)},[Y,me]),Object(A.useEffect)(function(){Y&&((be!==Y.getValue()||be==="")&&setTimeout(function(){Y.setValue(be||" ")},300))},[Y,be]),Object(A.useEffect)(function(){if(xe.current&&!Y){var j=$.a.fromTextArea(xe.current,Object(H.a)({mode:me,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Pe));x(j)}},[xe.current,Y]),S.a.createElement("div",{className:"my-codemirror-container"},S.a.createElement("textarea",{ref:xe}))}},"7ixt":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return oe});var H={adjustX:1,adjustY:1},he=[0,0],oe={left:{points:["cr","cl"],overflow:H,offset:[-4,0],targetOffset:he},right:{points:["cl","cr"],overflow:H,offset:[4,0],targetOffset:he},top:{points:["bc","tc"],overflow:H,offset:[0,-4],targetOffset:he},bottom:{points:["tc","bc"],overflow:H,offset:[0,4],targetOffset:he},topLeft:{points:["bl","tl"],overflow:H,offset:[0,-4],targetOffset:he},leftTop:{points:["tr","tl"],overflow:H,offset:[-4,0],targetOffset:he},topRight:{points:["br","tr"],overflow:H,offset:[0,-4],targetOffset:he},rightTop:{points:["tl","tr"],overflow:H,offset:[4,0],targetOffset:he},bottomRight:{points:["tr","br"],overflow:H,offset:[0,4],targetOffset:he},rightBottom:{points:["bl","br"],overflow:H,offset:[4,0],targetOffset:he},bottomLeft:{points:["tl","bl"],overflow:H,offset:[0,4],targetOffset:he},leftBottom:{points:["br","bl"],overflow:H,offset:[-4,0],targetOffset:he}},_e=oe},"8EBN":function(nt,Ge,v){(function(H){H(v("VrN/"))})(function(H){"use strict";H.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 he=0;he<H.modeInfo.length;he++){var oe=H.modeInfo[he];oe.mimes&&(oe.mime=oe.mimes[0])}H.findModeByMIME=function(_e){_e=_e.toLowerCase();for(var le=0;le<H.modeInfo.length;le++){var V=H.modeInfo[le];if(V.mime==_e)return V;if(V.mimes){for(var O=0;O<V.mimes.length;O++)if(V.mimes[O]==_e)return V}}if(/\+xml$/.test(_e))return H.findModeByMIME("application/xml");if(/\+json$/.test(_e))return H.findModeByMIME("application/json")},H.findModeByExtension=function(_e){_e=_e.toLowerCase();for(var le=0;le<H.modeInfo.length;le++){var V=H.modeInfo[le];if(V.ext){for(var O=0;O<V.ext.length;O++)if(V.ext[O]==_e)return V}}},H.findModeByFileName=function(_e){for(var le=0;le<H.modeInfo.length;le++){var V=H.modeInfo[le];if(V.file&&V.file.test(_e))return V}var O=_e.lastIndexOf("."),I=O>-1&&_e.substring(O+1,_e.length);if(I)return H.findModeByExtension(I)},H.findModeByName=function(_e){_e=_e.toLowerCase();for(var le=0;le<H.modeInfo.length;le++){var V=H.modeInfo[le];if(V.name.toLowerCase()==_e)return V;if(V.alias){for(var O=0;O<V.alias.length;O++)if(V.alias[O].toLowerCase()==_e)return V}}}})},"8hTe":function(nt,Ge,v){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,Ge,v){"use strict";var H=v("DYRE"),he=v("zeV3"),oe=v("+L6B"),_e=v("2/Rp"),le=v("k1fw"),V=v("9og8"),O=v("tJVT"),I=v("WmNS"),R=v.n(I),A=v("q1tI"),S=v.n(A),T=v("vg9a"),$=v("DlQD"),z=v.n($),N=v("rUJ1");function J(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(g){var h=g.match(/^\s+/);if(h===null)return g;var Z=Object(O.a)(h,1),We=Z[0];return We.length>=u.length?g.slice(u.length):g}).join(`
`)}var K=[],Q=["<ul>"],de=new z.a.Renderer,Ne=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Xe(){K.length=0,Q=["<ul>"]}var ke={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function be(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var g=c[o];u.push("<li><a href='#"+g.anchor+"'>"+g.text+"</a>"),o++;var h=[];return o=be(c,o,g.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(Z){u.push(Z)}),u.push("</ul>")),u.push("</li>"),o=be(c,o,a,u),o}function Fe(){return be(K,0,0,Q),Q.push("</ul>"),Q.join("")}var me={heading:function(o){var a=Ne.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],g=J(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var Z=xe(),We=g;g=Z,L[Z]={type:"block",expression:We}}return{type:"code",raw:u,lang:h,text:g}}}},Se=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Pe=0,xe=function(){return"__special_katext_id_".concat(Pe++,"__")},L={};function ue(){return L}function Y(){Pe=0,L={}}function x(c){return c=c.replace(Se,function(o,a){var u=xe();return L[u]={type:"inline",expression:a},u}),c}var j=de.listitem;de.listitem=function(c){return j(x(c))};var D=de.paragraph;de.paragraph=function(c){return D(x(c))};var _=de.tablecell;de.tablecell=function(c,o){return _(x(c),o)},de.code=function(c,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(c,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?c:Object(N.escape)(c,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(N.escape)(c,!0))+"</code></pre>"},de.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return K.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},z.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),z.a.use({tokenizer:me,renderer:de});var k=z.a,p=v("SJMd"),d=v("ulZh"),w=v.n(d),F=v("m3rI"),te=v("Oy/b"),Ee=v("p5ED"),Le=v("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 pe=function(c,o){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&(a[g]=u[g])})(c,o)};function fe(c,o){function a(){this.constructor=c}pe(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function re(c,o,a,u){return new(a||(a=Promise))(function(g,h){function Z(ct){try{Ce(u.next(ct))}catch(He){h(He)}}function We(ct){try{Ce(u.throw(ct))}catch(He){h(He)}}function Ce(ct){var He;ct.done?g(ct.value):(He=ct.value,He instanceof a?He:new a(function(_t){_t(He)})).then(Z,We)}Ce((u=u.apply(c,o||[])).next())})}function se(c,o){var a,u,g,h,Z={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return h={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function We(Ce){return function(ct){return function(He){if(a)throw new TypeError("Generator is already executing.");for(;Z;)try{if(a=1,u&&(g=2&He[0]?u.return:He[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,He[1])).done)return g;switch(u=0,g&&(He=[2&He[0],g.value]),He[0]){case 0:case 1:g=He;break;case 4:return Z.label++,{value:He[1],done:!1};case 5:Z.label++,u=He[1],He=[0];continue;case 7:He=Z.ops.pop(),Z.trys.pop();continue;default:if(!(g=Z.trys,(g=g.length>0&&g[g.length-1])||He[0]!==6&&He[0]!==2)){Z=0;continue}if(He[0]===3&&(!g||He[1]>g[0]&&He[1]<g[3])){Z.label=He[1];break}if(He[0]===6&&Z.label<g[1]){Z.label=g[1],g=He;break}if(g&&Z.label<g[2]){Z.label=g[2],Z.ops.push(He);break}g[2]&&Z.ops.pop(),Z.trys.pop();continue}He=o.call(c,Z)}catch(_t){He=[6,_t],u=0}finally{a=g=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([Ce,ct])}}}function ee(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),g=0;for(o=0;o<a;o++)for(var h=arguments[o],Z=0,We=h.length;Z<We;Z++,g++)u[g]=h[Z];return u}var B=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,g=a;u<g.length;u++){var h=g[u],Z=h[0],We=h[1];o.setAttribute(Z,We)}},c.createRect=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","rect");return g.setAttribute("width",o.toString()),g.setAttribute("height",a.toString()),u&&c.setAttributes(g,u),g},c.createLine=function(o,a,u,g,h){var Z=document.createElementNS("http://www.w3.org/2000/svg","line");return Z.setAttribute("x1",o.toString()),Z.setAttribute("y1",a.toString()),Z.setAttribute("x2",u.toString()),Z.setAttribute("y2",g.toString()),h&&c.setAttributes(Z,h),Z},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return g.setAttribute("cx",(o/2).toString()),g.setAttribute("cy",(a/2).toString()),g.setAttribute("rx",(o/2).toString()),g.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(g,u),g},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,g,h,Z,We){var Ce=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(Ce,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",g.toString()],["refX",h.toString()],["refY",Z.toString()]]),Ce.appendChild(We),Ce},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c}(),b=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),G=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var g=this;return new Promise(function(h){var Z=u!==void 0?u:document.createElement("canvas");o===null&&(g.markersOnly=!0,g.naturalSize=!1);var We=document.createElementNS("http://www.w3.org/2000/svg","svg");We.setAttribute("xmlns","http://www.w3.org/2000/svg"),We.setAttribute("width",a.width.baseVal.valueAsString),We.setAttribute("height",a.height.baseVal.valueAsString),We.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),We.innerHTML=a.innerHTML,g.naturalSize===!0?(We.width.baseVal.value=o.naturalWidth,We.height.baseVal.value=o.naturalHeight):g.width!==void 0&&g.height!==void 0&&(We.width.baseVal.value=g.width,We.height.baseVal.value=g.height),Z.width=We.width.baseVal.value,Z.height=We.height.baseVal.value;var Ce=We.outerHTML,ct=Z.getContext("2d");g.markersOnly!==!0&&ct.drawImage(o,0,0,Z.width,Z.height);var He=window.URL,_t=new Image(Z.width,Z.height);_t.setAttribute("crossOrigin","anonymous");var Pt=new Blob([Ce],{type:"image/svg+xml"}),Wt=He.createObjectURL(Pt);_t.onload=function(){ct.drawImage(_t,0,0),He.revokeObjectURL(Wt);var Wn=Z.toDataURL(g.imageType,g.imageQuality);h(Wn)},_t.src=Wt})},c}(),M=function(){},ge=function(){function c(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),c.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},c.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},c.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new we("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new we("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new we("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ne("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ne("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),we=function(c,o){this.selector=c,this.style=o},ne=function(c,o){this.localName=c,this.style=o},Te=function(){function c(o,a,u,g,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=g,this.styles=h,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return c.prototype.show=function(o){var a=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(h){var Z=document.createElement("div");Z.className=""+a.toolbarButtonStyleClass.name,Z.setAttribute("data-type-name",h.typeName),Z.innerHTML=h.icon,Z.addEventListener("click",function(){a.markerToolbarButtonClicked(Z,h)}),a.buttons.push(Z),a.markerButtons.push(Z)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var g=document.createElement("div");g.className=this.toolbarBlockStyleClass.name,g.style.whiteSpace="nowrap",g.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(g),this.addActionButton(g,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(g,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},c.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},c.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},c.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},c.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var o=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var a=0;a<this.markerButtons.length;a++)a<o||a===o&&this.markerButtons.length-1===o?this.markerButtonBlock.appendChild(this.markerButtons[a]):(a===o&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[a]))}},c.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},c.prototype.resetButtonStyles=function(){var o=this;this.buttons.forEach(function(a){a.className=a.className.replace(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name,"").trim(),a.className=a.className.replace(o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?o.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:o.toolbarActiveButtonStyleColorsClass.name,"").trim(),a.className+=" "+(o.uiStyleSettings.toolbarButtonStyleColorsClassName?o.uiStyleSettings.toolbarButtonStyleColorsClassName:o.toolbarButtonStyleColorsClass.name)})},c.prototype.addActionButton=function(o,a,u){var g=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){g.actionToolbarButtonClicked(h,u)}),u){case"select":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":h.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":h.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":h.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(h),this.buttons.push(h)},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ne("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ne("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ne("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ne("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new ne("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ne("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
padding: `+o+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ne("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new we("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new we("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},c.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},c.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},c.prototype.setActiveButton=function(o){this.resetButtonStyles(),o.className=o.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),o.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},c.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},c.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},c}(),Ie=function(){function c(o,a,u,g){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=g,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new ne("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 ne("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ne("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ne("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ne("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 ne("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ne("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
padding: `+a+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ne("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new we("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new we("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},c.prototype.show=function(o){var a;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolboxStyleClass.name+" "+((a=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},c.prototype.setPanelButtons=function(o){var a,u,g=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(h){var Z;h.uiStyleSettings=g.uiStyleSettings;var We=document.createElement("div");We.className=g.toolboxButtonStyleClass.name+" "+((Z=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Z!==void 0?Z:g.toolboxButtonStyleColorsClass.name),We.innerHTML=h.icon,We.title=h.title,We.addEventListener("click",function(){g.panelButtonClick(h)}),g.panelButtons.push(We),g.buttonRow.appendChild(We)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},c.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var g=o.getUi();g.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(g),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(h,Z){var We,Ce;h.className=a.toolboxButtonStyleClass.name+" "+(Z===u?""+((We=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&We!==void 0?We:a.toolboxActiveButtonStyleColorsClass.name):""+((Ce=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ce!==void 0?Ce:a.toolboxButtonStyleColorsClass.name))})},c}(),De=function(c,o){this.title=c,this.icon=o},Ae=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Z.colors=[],Z.addTransparent=!1,Z.colorBoxes=[],Z.colors=u,Z.currentColor=g,Z.setCurrentColor=Z.setCurrentColor.bind(Z),Z.getColorBox=Z.getColorBox.bind(Z),Z}return fe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(g){var h=a.getColorBox(g);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,g=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-g,Z=document.createElement("div");Z.style.display="inline-block",Z.style.boxSizing="content-box",Z.style.width=h-2+"px",Z.style.height=h-2+"px",Z.style.padding="1px",Z.style.marginRight="2px",Z.style.marginBottom="2px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderRadius=(h+2)/2+"px",Z.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){u.setCurrentColor(a,Z)});var We=document.createElement("div");return We.style.display="inline-block",We.style.width=h-2+"px",We.style.height=h-2+"px",We.style.backgroundColor=a,We.style.borderRadius=h/2+"px",a==="transparent"&&(We.style.fill=this.uiStyleSettings.toolboxAccentColor,We.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Z.appendChild(We),Z},o.prototype.setCurrentColor=function(a,u){var g=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(De),Me=function(){function c(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(c.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),c.prototype.ownsTarget=function(o){return!1},Object.defineProperty(c.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),c.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},c.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},c.prototype.pointerDown=function(o,a){},c.prototype.dblClick=function(o,a){},c.prototype.manipulate=function(o){},c.prototype.pointerUp=function(o){this.stateChanged()},c.prototype.dispose=function(){},c.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},c.prototype.getState=function(){return{typeName:c.typeName,state:this.state,notes:this.notes}},c.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},c.prototype.scale=function(o,a){},c.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},c.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},c.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var o=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),o.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(o)&&this.onStateChanged(this)}},c.typeName="MarkerBase",c}(),Ue=function(){function c(){this.findGripByVisual=this.findGripByVisual.bind(this)}return c.prototype.findGripByVisual=function(o){return this.topLeft.ownsTarget(o)?this.topLeft:this.topCenter.ownsTarget(o)?this.topCenter:this.topRight.ownsTarget(o)?this.topRight:this.centerLeft.ownsTarget(o)?this.centerLeft:this.centerRight.ownsTarget(o)?this.centerRight:this.bottomLeft.ownsTarget(o)?this.bottomLeft:this.bottomCenter.ownsTarget(o)?this.bottomCenter:this.bottomRight.ownsTarget(o)?this.bottomRight:void 0},c}(),et=function(){function c(){this.GRIP_SIZE=10,this.visual=B.createGroup(),this.visual.appendChild(B.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(B.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c}(),Ve=function(){function c(){}return c.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},c.toSVGMatrix=function(o,a){return o.a=a.a,o.b=a.b,o.c=a.c,o.d=a.d,o.e=a.e,o.f=a.f,o},c}(),Ze=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(B.createTransform()),h.setupControlBox(),h}return fe(o,c),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=B.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var g=this.unrotatePoint(a);if(this.manipulationStartX=g.x,this.manipulationStartY=g.y,this.offsetX=g.x-this.left,this.offsetY=g.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Z=this.container.transform.baseVal.getItem(0);Z.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Z,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,g=this.manipulationStartWidth,h=this.manipulationStartTop,Z=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,g=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:g=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:h=this.manipulationStartTop+a.y-this.manipulationStartY,Z=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Z=this.manipulationStartHeight+a.y-this.manipulationStartY}g>=0?(this.left=u,this.width=g):(this.left=u+g,this.width=-g),Z>=0?(this.top=h,this.height=Z):(this.top=h+Z,this.height=-Z),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),g=B.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var g=B.createPoint(a.x,a.y);return{x:(g=g.matrixTransform(u)).x,y:g.y}},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=B.createGroup();var a=B.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=B.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=B.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ue,this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){var a=this.controlBox.transform.baseVal.getItem(0);a.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(a,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},o.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},o.prototype.createGrip=function(){var a=new et;return a.visual.transform.baseVal.appendItem(B.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,g=u,h=(this.width+this.CB_DISTANCE)/2-a/2,Z=(this.height+this.CB_DISTANCE)/2-a/2,We=this.height+this.CB_DISTANCE-a/2,Ce=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,g),this.positionGrip(this.controlGrips.topCenter.visual,h,g),this.positionGrip(this.controlGrips.topRight.visual,Ce,g),this.positionGrip(this.controlGrips.centerLeft.visual,u,Z),this.positionGrip(this.controlGrips.centerRight.visual,Ce,Z),this.positionGrip(this.controlGrips.bottomLeft.visual,u,We),this.positionGrip(this.controlGrips.bottomCenter.visual,h,We),this.positionGrip(this.controlGrips.bottomRight.visual,Ce,We),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,g-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,g){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,g),a.transform.baseVal.replaceItem(h,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Ve.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Ve.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Ve.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var g=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:g.x*a,y:g.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Me),Qe=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=B.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),B.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&B.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&B.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&B.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&B.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(Ze),at=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Z.widths=[],Z.widthBoxes=[],Z.widths=u,Z.currentWidth=g,Z.setCurrentWidth=Z.setCurrentWidth.bind(Z),Z}return fe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(g){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=g===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(g,h)}),u.appendChild(h);var Z=document.createElement("div");Z.innerText=g.toString(),Z.style.marginRight="5px",h.appendChild(Z);var We=document.createElement("div");We.style.minHeight="20px",We.style.flexGrow="2",We.style.display="flex",We.style.alignItems="center";var Ce=document.createElement("hr");Ce.style.minWidth="20px",Ce.style.border="0px",Ce.style.borderTop=g+"px solid "+a.uiStyleSettings.toolboxColor,Ce.style.flexGrow="2",We.appendChild(Ce),h.appendChild(We),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var g=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(De),tt=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Z.styles=[],Z.styleBoxes=[],Z.styles=u,Z.currentStyle=g,Z.setCurrentStyle=Z.setCurrentStyle.bind(Z),Z}return fe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(g){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=g===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(g,h)}),u.appendChild(h);var Z=document.createElement("div");Z.style.minHeight="20px",Z.style.flexGrow="2",Z.style.overflow="hidden";var We=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(g!==""?'stroke-dasharray="'+g+'"':"")+` />
</svg>`;Z.innerHTML=We,h.appendChild(Z),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var g=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(De),st=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ae("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new tt("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return fe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(Qe),Re=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},vt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return fe(o,c),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=B.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},o.prototype.adjustControlBox=function(){this.positionGrips()},o.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},o.prototype.createGrip=function(){var a=new et;return a.visual.transform.baseVal.appendItem(B.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,g){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,g),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},c.prototype.getState.call(this))},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Me),ut=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ae("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new tt("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=B.createGroup(),this.selectorLine=B.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=B.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),B.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),B.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),B.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(vt),Be=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Z.fonts=[],Z.fontBoxes=[],Z.fonts=u,Z.currentFont=g,Z.setCurrentFont=Z.setCurrentFont.bind(Z),Z}return fe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(g){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=g===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(g,h)}),u.appendChild(h);var Z=document.createElement("div");Z.style.display="flex",Z.style.minHeight="20px",Z.style.flexGrow="2",Z.style.fontFamily=g,Z.style.overflow="hidden";var We=document.createElement("div");We.style.whiteSpace="nowrap",We.style.overflow="hidden",We.style.textOverflow="ellipsis",We.innerHTML="The quick brown fox jumps over the lazy dog",Z.appendChild(We),h.appendChild(Z),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var g=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(De),Ye=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=g.defaultColor,h.fontFamily=g.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new Ae("Color",g.defaultColorSet,g.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Be("Font",g.defaultFontFamilies,g.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return fe(o,c),o.prototype.ownsTarget=function(a){if(c.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(g){g===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=B.createGroup(),this.bgRectangle=B.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=B.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(B.createTransform()),this.textElement.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){a.textElement.appendChild(B.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var g=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(g,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),g=0,h=0;return u.width>0&&u.height>0&&(g=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:g,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),g=this.getTextPosition(u);g.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+g.x+"px, "+g.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(g.x,g.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(a.x-this.pointerDownPoint.x)>5||Math.abs(a.y-this.pointerDownPoint.y)>5)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){c.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(B.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),c.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var g=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(g)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),g=this.textElement.getBBox(),h={x:g.width*a,y:g.height*a};u.x-=h.x/2,u.y-=h.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){c.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),c.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){c.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&B.setAttributes(this.textElement,[["fill",a]]),this.color=a,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(a)},o.prototype.setFont=function(a){this.textElement&&B.setAttributes(this.textElement,[["font-family",a]]),this.fontFamily=a,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},o.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},o.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(Ze),ae=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=g.defaultColor,h.lineWidth=g.defaultStrokeWidth,h.pixelRatio=g.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new Ae("Color",g.defaultColorSet,g.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=B.createGroup(),this.drawingImage=B.createImage(),this.visual.appendChild(this.drawingImage);var a=B.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(a.x,a.y),this.drawing=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),B.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):c.prototype.pointerUp.call(this,a)},o.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},o.prototype.select=function(){this.state==="creating"&&this.finishCreation(),c.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),c.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],g=u[0],h=u[1],Z=u[2],We=u[3],Ce=!1,ct=0;ct<this.canvasElement.height;ct++)for(var He=0;He<this.canvasElement.width;He++)a.data[ct*this.canvasElement.width*4+4*He+3]>0&&(Ce=!0,ct<h&&(h=ct),He<g&&(g=He),ct>We&&(We=ct),He>Z&&(Z=He));if(Ce){this.left=g/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(Z-g)/this.pixelRatio,this.height=(We-h)/this.pixelRatio;var _t=document.createElement("canvas");_t.width=Z-g,_t.height=We-h,_t.getContext("2d").putImageData(this.canvasContext.getImageData(g,h,Z-g,We-h),0,0),this.drawingImgUrl=_t.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){B.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),B.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},o.prototype.setColor=function(a){this.color=a,this.colorChanged(a)},o.prototype.setLineWidth=function(a){this.lineWidth=a},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({drawingImgUrl:this.drawingImgUrl},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),c.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(Ze),q=function(c){function o(a,u,g){var h=c.call(this,a,g||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return fe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var g=function(We){var Ce="both";switch(We){case 0:Ce="both";break;case 1:Ce="start";break;case 2:Ce="end";break;case 3:Ce="none"}var ct=document.createElement("div");if(ct.style.display="flex",ct.style.flexGrow="2",ct.style.alignItems="center",ct.style.justifyContent="space-between",ct.style.padding="5px",ct.style.borderWidth="2px",ct.style.borderStyle="solid",ct.style.borderColor=Ce===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",ct.addEventListener("click",function(){a.setCurrentType(Ce,ct)}),u.appendChild(ct),Ce==="both"||Ce==="start"){var He=document.createElement("div");He.style.display="flex",He.style.alignItems="center",He.style.minHeight="20px",He.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,He.style.marginLeft="5px",ct.appendChild(He)}var _t=document.createElement("div");_t.style.display="flex",_t.style.alignItems="center",_t.style.minHeight="20px",_t.style.flexGrow="2";var Pt=document.createElement("hr");if(Pt.style.minWidth="20px",Pt.style.border="0px",Pt.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),Pt.style.flexGrow="2",_t.appendChild(Pt),ct.appendChild(_t),Ce==="both"||Ce==="end"){var Wt=document.createElement("div");Wt.style.display="flex",Wt.style.alignItems="center",Wt.style.minHeight="20px",Wt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Wt.style.marginRight="5px",ct.appendChild(Wt)}h.typeBoxes.push(ct)},h=this,Z=0;Z<4;Z++)g(Z);return u},o.prototype.setCurrentType=function(a,u){var g=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings!==void 0?g.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(De),ie=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new q("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var g=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-g/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+g/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=B.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=B.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(B.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",B.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),B.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var g=this.arrow2.transform.baseVal.getItem(0);g.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(g,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(ut),C=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor=g.defaultFillColor,h.strokeWidth=0,h.fillPanel=new Ae("Color",g.defaultColorSet,g.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return fe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(Qe),E=function(c){function o(a,u,g,h){var Z=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Z.opacities=[],Z.opacityBoxes=[],Z.opacities=u,Z.currentOpacity=g,Z.setCurrentOpacity=Z.setCurrentOpacity.bind(Z),Z}return fe(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(g){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=g===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(g,h)}),u.appendChild(h);var Z=document.createElement("div");Z.innerText=100*g+"%",h.appendChild(Z),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var g=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?g.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(De),P=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=g.defaultHighlightColor,h.strokeWidth=0,h.opacity=g.defaultHighlightOpacity,h.fillPanel=new Ae("Color",g.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new E("Opacity",g.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return fe(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&B.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="HighlightMarker",o.title="Highlight marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',o}(C),U='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',ye=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=g.defaultStrokeColor,h.bgColor=g.defaultFillColor,h.fontFamily=g.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new Ae("Text color",g.defaultColorSet,h.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new Ae("Fill color",g.defaultColorSet,h.bgColor,U),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Be("Font",g.defaultFontFamilies,g.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new et,h.tipGrip.visual.transform.baseVal.appendItem(B.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return fe(o,c),o.prototype.ownsTarget=function(a){return c.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){B.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=B.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&c.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):c.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,c.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";c.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else c.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(B.setAttributes(this.bgRectangle,[["fill",a]]),B.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),g=this.height/5;a&&(this.tipPosition={x:u+g/2,y:this.height+20});var h=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+g,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+g}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-g,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+g}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?h<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-g,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-g},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(g=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+g,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-g})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){B.setAttributes(this.tip,[["points",this.getTipPoints()]]);var a=this.tipGrip.visual.transform.baseVal.getItem(0);a.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(a,0)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),o.prototype.select=function(){this.positionTip(),c.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,c.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(Ye),Oe=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.fillColor=g.defaultFillColor,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.setOpacity=h.setOpacity.bind(h),h.createVisual=h.createVisual.bind(h),h.strokePanel=new Ae("Line color",ee(g.defaultColorSet,["transparent"]),g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new Ae("Fill color",ee(g.defaultColorSet,["transparent"]),h.fillColor,U),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new tt("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new E("Opacity",g.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=B.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){c.prototype.setSize.call(this),B.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},o.prototype.pointerUp=function(a){c.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&B.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&B.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&B.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&B.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&B.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),c.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(Ze),Je=function(c){function o(a,u,g){return c.call(this,a,u,g)||this}return fe(o,c),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=B.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(B.createTransform()),this.visual.appendChild(this.tip1),this.tip2=B.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(B.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(c.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(B.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()]]),B.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var g=this.tip2.transform.baseVal.getItem(0);g.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(g,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(ut),yt=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokePanel.colors=g.defaultColorSet,h.fillColor="transparent",h}return fe(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(Oe),kt=function(){function c(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),c.prototype.addUndoStep=function(o){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(o)||(this.undoStack.push(o),JSON.stringify(this.lastRedoStep)!==JSON.stringify(o)&&this.redoStack.splice(0,this.redoStack.length))},c.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},c.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},c.prototype.undo=function(){if(this.undoStack.length>1){var o=this.undoStack.pop();return o!==void 0&&this.redoStack.push(o),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},c.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},c}(),Ke=function(c){function o(a,u,g){var h=c.call(this,a,u,g)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=g.defaultColor,h.strokeWidth=g.defaultStrokeWidth,h.strokeDasharray=g.defaultStrokeDasharray,h.strokePanel=new Ae("Line color",g.defaultColorSet,g.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new at("Line width",g.defaultStrokeWidths,g.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new tt("Line style",g.defaultStrokeDasharrays,g.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return fe(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=B.createGroup(),this.selectorCurve=B.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=B.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),B.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),B.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),B.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=B.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=B.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},o.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,c.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){c.prototype.positionGrips.call(this);var a=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-a/2,this.curveY-a/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},o.prototype.manipulate=function(a){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+a.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+a.y-this.manipulationStartY),c.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),c.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,c.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},c.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){c.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(vt),wt=function(){function c(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(c.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),c.prototype.preventDefault=function(){this._defaultPrevented=!0},c}(),mt=function(c){function o(a,u,g){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=g,h}return fe(o,c),o}(wt),ot=function(c){function o(a,u,g){g===void 0&&(g=!1);var h=c.call(this,a,g)||this;return h.marker=u,h}return fe(o,c),o}(wt),Dt=function(){function c(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return c.prototype.addEventListener=function(o,a){this[o].push(a)},c.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},c}(),At=function(){function c(o){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Re,this._isOpen=!1,this.undoRedoManager=new kt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Dt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new ge(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=o,this.targetRoot=document.body,this.width=o.clientWidth,this.height=o.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(c.prototype,"ALL_MARKER_TYPES",{get:function(){return[st,ae,ie,Ye,yt,Oe,P,ye,Je,C,ut,Ke]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[st,ae,ie,Ye,Oe,P,ye]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[st,ae,ie,Ye,P]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var g=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});g!==void 0&&a._availableMarkerTypes.push(g)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(o){this._zoomLevel=o,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),b.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},c.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&M.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=M.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new wt(o))})},c.prototype.render=function(){return re(this,void 0,void 0,function(){var o;return se(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new G).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.markersOnly=this.renderMarkersOnly,o.width=this.renderWidth,o.height=this.renderHeight,[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return a.sent(),[4,o.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,a.sent()]}})})},c.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(g){var h=new wt(a,!0);g(h),h.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(g){return g(new wt(a))}),this.detachEvents(),this._isOpen=!1)}},c.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},c.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},c.prototype.removeRenderEventListener=function(o){},c.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},c.prototype.removeCloseEventListener=function(o){},c.prototype.setupResizeObserver=function(){var o=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return o.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,g=a/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,g),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,g=this;this._currentMarker&&this._currentMarker instanceof Ye?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==g._currentMarker&&h.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},c.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},c.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},c.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},c.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=B.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},c.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},c.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},c.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},c.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},c.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},c.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},c.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},c.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var o=document.createElement("a");o.href="https://markerjs.com/",o.target="_blank",o.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',o.title="Powered by marker.js",o.style.display="grid",o.style.alignItems="center",o.style.justifyItems="center",o.style.padding="3px",o.style.width="20px",o.style.height="20px",this.logoUI.appendChild(o),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},c.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Te(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Ie(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},c.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},c.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},c.prototype.toolbarButtonClicked=function(o,a){if(o==="marker"&&a!==void 0)this.createNewMarker(a);else if(o==="action")switch(a){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},c.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(g){var h=new ot(o,o._currentMarker,!0);g(h),h.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(g){return g(new ot(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Z){var We=new ot(o,void 0,!0);Z(We),We.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(Z){var We=g.markers[Z];g.setCurrentMarker(g.markers[Z]),g._currentMarker.dispose(),g.markerImage.removeChild(g._currentMarker.container),g.markers.splice(g.markers.indexOf(g._currentMarker),1),g.eventListeners.markerdelete.forEach(function(Ce){return Ce(new ot(o,We))})},g=this,h=this.markers.length-1;h>=0;h--)u(h);this.addUndoStep()}},Object.defineProperty(c.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),c.prototype.showNotesEditor=function(){var o;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(o=this._currentMarker.notes)!==null&&o!==void 0?o:"",this.overlayContainer.appendChild(this.notesArea))},c.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},c.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},c.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var g=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),g<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new wt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new wt(o))})}},c.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},c.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new wt(o))}))},c.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},c.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new wt(o))}))},c.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},c.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},c.prototype.startRenderAndClose=function(){return re(this,void 0,void 0,function(){var o,a,u=this;return se(this,function(g){switch(g.label){case 0:return[4,this.render()];case 1:return o=g.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new mt(u,o,a))}),this.close(!0),[2]}})})},c.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},c.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var g=a._availableMarkerTypes.find(function(Z){return Z.typeName===u.typeName});if(g!==void 0){var h=a.addNewMarker(g);h.restoreState(u),a.markers.push(h)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new wt(a))})},c.prototype.addNewMarker=function(o){var a=B.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},c.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(g){return g.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(a),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(a.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(g){return g(new ot(u,u._currentMarker))}))},c.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new ot(a,a._currentMarker))})},c.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},c.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},c.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new ot(a,o))})},c.prototype.setCurrentMarker=function(o){var a=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new ot(a,a._currentMarker))})),this._currentMarker=o,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new ot(a,a._currentMarker))}))},c.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},c.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},c.prototype.onPointerMove=function(o){this.touchPoints!==1&&o.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||o.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(o.clientX,o.clientY)):this.zoomLevel>1&&this.panTo({x:o.clientX,y:o.clientY}))},c.prototype.onPointerUp=function(o){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(o.clientX,o.clientY)),this.isDragging=!1,this.addUndoStep()},c.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},c.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var o=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},c.prototype.addLicenseKey=function(o){b.addKey(o)},c.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},c.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},c.prototype.renderState=function(o){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(o),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(c.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),c.prototype.focus=function(){var o=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(a){return a(new wt(o))}))},c.prototype.blur=function(){var o=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(a){return a(new wt(o))}))},c.instanceCounter=0,c}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Vt=function(c,o){return(Vt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var g in u)Object.prototype.hasOwnProperty.call(u,g)&&(a[g]=u[g])})(c,o)};function jt(c,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");function a(){this.constructor=c}Vt(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function St(c,o,a,u){return new(a||(a=Promise))(function(g,h){function Z(ct){try{Ce(u.next(ct))}catch(He){h(He)}}function We(ct){try{Ce(u.throw(ct))}catch(He){h(He)}}function Ce(ct){var He;ct.done?g(ct.value):(He=ct.value,He instanceof a?He:new a(function(_t){_t(He)})).then(Z,We)}Ce((u=u.apply(c,o||[])).next())})}function mn(c,o){var a,u,g,h,Z={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return h={next:We(0),throw:We(1),return:We(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function We(Ce){return function(ct){return function(He){if(a)throw new TypeError("Generator is already executing.");for(;Z;)try{if(a=1,u&&(g=2&He[0]?u.return:He[0]?u.throw||((g=u.return)&&g.call(u),0):u.next)&&!(g=g.call(u,He[1])).done)return g;switch(u=0,g&&(He=[2&He[0],g.value]),He[0]){case 0:case 1:g=He;break;case 4:return Z.label++,{value:He[1],done:!1};case 5:Z.label++,u=He[1],He=[0];continue;case 7:He=Z.ops.pop(),Z.trys.pop();continue;default:if(!(g=Z.trys,(g=g.length>0&&g[g.length-1])||He[0]!==6&&He[0]!==2)){Z=0;continue}if(He[0]===3&&(!g||He[1]>g[0]&&He[1]<g[3])){Z.label=He[1];break}if(He[0]===6&&Z.label<g[1]){Z.label=g[1],g=He;break}if(g&&Z.label<g[2]){Z.label=g[2],Z.ops.push(He);break}g[2]&&Z.ops.pop(),Z.trys.pop();continue}He=o.call(c,Z)}catch(_t){He=[6,_t],u=0}finally{a=g=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([Ce,ct])}}}var sn=function(){function c(){}return c.addKey=function(o){c.key=o},Object.defineProperty(c,"isLicensed",{get:function(){return!!c.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(c.key)},enumerable:!1,configurable:!0}),c}(),pt=function(){function c(){}return c.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},c.setAttributes=function(o,a){for(var u=0,g=a;u<g.length;u++){var h=g[u],Z=h[0],We=h[1];o.setAttribute(Z,We)}},c.createRect=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","rect");return g.setAttribute("width",o.toString()),g.setAttribute("height",a.toString()),u&&c.setAttributes(g,u),g},c.createLine=function(o,a,u,g,h){var Z=document.createElementNS("http://www.w3.org/2000/svg","line");return Z.setAttribute("x1",o.toString()),Z.setAttribute("y1",a.toString()),Z.setAttribute("x2",u.toString()),Z.setAttribute("y2",g.toString()),h&&c.setAttributes(Z,h),Z},c.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&c.setAttributes(u,a),u},c.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&c.setAttributes(u,a),u},c.createEllipse=function(o,a,u){var g=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return g.setAttribute("cx",(o/2).toString()),g.setAttribute("cy",(a/2).toString()),g.setAttribute("rx",(o/2).toString()),g.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(g,u),g},c.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&c.setAttributes(a,o),a},c.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},c.createMarker=function(o,a,u,g,h,Z,We){var Ce=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(Ce,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",g.toString()],["refX",h.toString()],["refY",Z.toString()]]),Ce.appendChild(We),Ce},c.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&c.setAttributes(a,o),a},c.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&c.setAttributes(u,a),u},c.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&c.setAttributes(a,o),a},c.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},c.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&c.setAttributes(u,a),u},c.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&c.setAttributes(u,a),u},c.getHollowRectanglePath=function(o,a,u,g,h,Z,We,Ce){return"M"+o+","+a+"V"+(a+g)+"H"+(o+u)+"V"+a+"H"+h+"V"+Z+"H"+(h+We)+"V"+(Z+Ce)+"H"+h+"V"+a+"Z"},c}(),wn=function(){function c(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(c.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),c.prototype.addClass=function(o){return this.styleSheet===void 0&&this.addStyleSheet(),o.name=""+this.classNamePrefix+o.localName,this.classes.push(o),this.styleSheet.sheet.insertRule("."+o.name+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length),o},c.prototype.addRule=function(o){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(o),this.styleSheet.sheet.insertRule(o.selector+" {"+o.style+"}",this.styleSheet.sheet.cssRules.length)},c.prototype.addStyleSheet=function(){var o;this.styleSheet=document.createElement("style"),((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).appendChild(this.styleSheet),this.addRule(new ln("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ln("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new ln("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new gn("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new gn("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},c.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},c}(),ln=function(c,o){this.selector=c,this.style=o},gn=function(c,o){this.localName=c,this.style=o},kn=function(){function c(){this.blocks=[],this.display=""}return c.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},c.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},c.prototype.getUI=function(){var o=document.createElement("div");return o.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,o.style.display=this.display,this.blocks.forEach(function(a){return o.appendChild(a.getUI())}),o},c}(),li=function(){function c(){}return c.prototype.getUI=function(){var o=document.createElement("div");if(o.className=this.className,this.minWidth!==void 0&&(o.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":o.style.justifyContent="flex-start";break;case"center":o.style.justifyContent="center";break;case"end":o.style.justifyContent="flex-end"}return o.style.whiteSpace="nowrap",o},c}(),Kn=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.buttons=[],a}return jt(o,c),o.prototype.addButton=function(a){a.className=this.buttonClassName,a.colorsClassName=this.buttonColorsClassName,a.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(li),Nt=function(){function c(o,a){this._isActive=!1,this._isHidden=!1,this._icon=o,this.title=a,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(c.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){var o=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return o.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},c.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},c.prototype.hide=function(){this._isHidden=!0},c}(),dt=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.elements=[],a}return jt(o,c),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=c.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(li),Fn=function(){function c(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(c.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),c.prototype.getVerticalLength=function(o){return o/this.ratio},c.prototype.getHorizontalLength=function(o){return o*this.ratio},c}(),ui=function(){function c(){}return c.getIcon=function(o,a){if(o>0&&a>0){var u=new Fn(o,a),g=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),Z=document.createElementNS("http://www.w3.org/2000/svg","svg");Z.setAttribute("xmlns","http://www.w3.org/2000/svg"),Z.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Z);var We=pt.createDefs();Z.appendChild(We);var Ce=pt.createElement("clipPath",[["id","text-bg-clip"]]);We.appendChild(Ce);var ct=pt.createPath(pt.getHollowRectanglePath((24-g)/2,(24-h)/2,g,h,(24-g)/2+2,(24-h)/2+2,g-4,h-4));Z.appendChild(ct);var He=pt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);He.appendChild(pt.createTSpan(o+":"+a)),Z.appendChild(He);var _t=He.getBBox();pt.setAttributes(He,[["x",((24-_t.width)/2).toString()],["y",((24-_t.height)/2-_t.y).toString()]]);var Pt=pt.createPath(pt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(_t.width))/2,(24-Math.ceil(_t.height))/2,Math.ceil(_t.width),Math.ceil(_t.height)));return Ce.appendChild(Pt),pt.setAttributes(ct,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Z),Z.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},c}(),Tn=function(c){function o(a,u,g){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=g,h}return jt(o,c),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Nt),Mt=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=pt.createGroup(),this.visual.appendChild(pt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(pt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return c.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},c.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return pt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Xn=function(){function c(o,a,u,g){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=a,this.margin=u,this.container=g,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(c.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(o){this._aspectRatio=o,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&pt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),c.prototype.open=function(){var o=this;this.cropShadeElement=pt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=pt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(pt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(pt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.cropRectElement=pt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Mt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},c.prototype.setCropRectangle=function(o){this.cropRect=o;var a=Object.assign({},this.cropRect);this.zoomFactor!==1&&(a.width=this.cropRect.width*this.zoomFactor,a.height=this.cropRect.height*this.zoomFactor,a.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-a.width/2,a.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-a.height/2),pt.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(h,Z){var We=a.y+u*(Z+1);pt.setAttributes(h,[["x1",""+a.x],["y1",""+We],["x2",""+(a.x+a.width)],["y2",""+We]])});var g=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,Z){var We=a.x+g*(Z+1);pt.setAttributes(h,[["x1",""+We],["y1",""+a.y],["x2",""+We],["y2",""+(a.y+a.height)]])}),pt.setAttributes(this.cropShadeElement,[["d",pt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,a.x,a.y,a.width,a.height)]]),this.topLeftGrip.setCenter(a.x,a.y),this.topRightGrip.setCenter(a.x+a.width,a.y),this.bottomLeftGrip.setCenter(a.x,a.y+a.height),this.bottomRightGrip.setCenter(a.x+a.width,a.y+a.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},c.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},c.prototype.onPointerDown=function(o){this.container.setPointerCapture(o.pointerId),this.previousPoint=this.clientToLocalCoordinates(o.clientX,o.clientY),this.cropRectElement===o.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(o.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(o.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(o.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(o.target)&&(this.activeGrip=this.bottomRightGrip)},c.prototype.onPointerMove=function(o){if(this.isMoving)this.move(this.clientToLocalCoordinates(o.clientX,o.clientY));else if(this.activeGrip){var a=this.clientToLocalCoordinates(o.clientX,o.clientY);this.resize(a)}o.preventDefault()},c.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},c.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},c.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,g=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+u<this.margin&&(u=this.margin-a.x),a.x+=u,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=g,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=g}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},c.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),g=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<g/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=g,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},c.prototype.getRescaledRect=function(o,a,u,g,h,Z){var We=u/o,Ce=g/a;return{x:(h.x-Z)*We+Z,y:(h.y-Z)*Ce+Z,width:h.width*We,height:h.height*Ce}},c.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},c}(),hi=function(){function c(o){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=o,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(c.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),c.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},c.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},c.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},c.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},c.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();pt.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},c.prototype.positionScaleShape=function(){if(this.scaleShape){var o=this.scaleShape.transform.baseVal.getItem(0);o.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(o,0)}},c.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var g=u%5==0?this.height/3:this.height/6;a+="h4v"+-g+"h1v"+g}a+="v1H0Z",this.scaleShape=pt.createPath(a);var h=pt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=pt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=pt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Z=pt.createTSpan("");return Z.innerHTML="&deg;",this.angleLabelElement.appendChild(Z),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),vi=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,g,h,Z,We){var Ce=this;return new Promise(function(ct){var He=document.createElement("canvas");He.width=o.width.baseVal.value-2*g,He.height=o.height.baseVal.value-2*g;var _t=1,Pt=1;Ce.naturalSize===!0?(_t=a.naturalWidth/(o.width.baseVal.value-2*g)/Z,Pt=a.naturalHeight/(o.height.baseVal.value-2*g)/We,He.width=a.naturalWidth/Z,He.height=a.naturalHeight/We):Ce.width!==void 0&&Ce.height!==void 0&&(_t=Ce.width/u.width,Pt=Ce.height/u.height,He.width*=_t,He.height*=Pt);var Wt=He.getContext("2d");Wt.translate(He.width/2,He.height/2),Wt.rotate(h*Math.PI/180),Wt.scale(Z,We),Wt.translate(-He.width/2,-He.height/2),Wt.drawImage(a,0,0,He.width,He.height);var Wn=document.createElement("canvas");Wn.width=u.width*_t,Wn.height=u.height*Pt,Wn.getContext("2d").putImageData(Wt.getImageData((u.x-g)*_t,(u.y-g)*Pt,u.width*_t,u.height*Pt),0,0),ct(Wn.toDataURL(Ce.imageType,Ce.imageQuality))})},c}(),$e=function(){function c(o){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=c.instanceCounter++,this.styles=new wn(this.instanceNo),this.target=o,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(c.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"gridLines",{get:function(){return this._gridLines},set:function(o){this._gridLines=o,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(o){this._rotationAngle=o,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"aspectRatio",{get:function(){var o;return(o=this._aspectRatio)!==null&&o!==void 0?o:this.aspectRatios[0]},set:function(o){this._aspectRatio=o},enumerable:!1,configurable:!0}),c.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},c.prototype.show=function(){this.showUI(),this.open()},c.prototype.close=function(o){o===void 0&&(o=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),o||this.closeEventListeners.forEach(function(a){return a()}),this._isOpen=!1)},c.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},c.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},c.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},c.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},c.prototype.setupResizeObserver=function(){var o=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){o.resize(o.target.clientWidth,o.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},c.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},c.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},c.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",pt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},c.prototype.resize=function(o,a){this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},c.prototype.setEditingTarget=function(){var o=document.createElement("canvas");o.width=this.target.naturalWidth,o.height=this.target.naturalHeight,o.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var a=o.toDataURL();pt.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},c.prototype.setTopLeft=function(){var o=this.target.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left-this.CANVAS_MARGIN,this.top=o.top-a.top-this.CANVAS_MARGIN},c.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=pt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=pt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=pt.createGroup(),this.editingTargetRotationScaleContainer=pt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=pt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=pt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=pt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},c.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},c.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=pt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Xn(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},c.prototype.zoomToCrop=function(){if(this.cropRect){var o=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,a=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=o+"px "+a+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-o+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-a+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},c.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},c.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},c.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},c.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},c.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},c.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var o=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,a=this.target.offsetTop>o+this.CANVAS_MARGIN?this.target.offsetTop-(o+this.CANVAS_MARGIN):0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},c.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},c.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new kn,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new Kn;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Pt){var Wt=new Nt(ui.getIcon(Pt.horizontal,Pt.vertical),Pt.horizontal===0&&Pt.vertical===0?"FREE":Pt.horizontal+":"+Pt.vertical);Wt.onClick=function(){return o.ratioButtonClicked(Pt)},u.push(Wt)}),this.aspectRatioButton=new Tn(ui.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var g=new Nt('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");g.isActive=this.isGridVisible,g.onClick=function(){o.isGridVisible=!o.isGridVisible,g.isActive=o.isGridVisible},a.addButton(g);var h=new Nt('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!sn.isLicensed){var Z=new dt;this.topToolbar.addElementBlock(Z);var We=document.createElement("div");We.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var Ce=document.createElement("a");Ce.style.color="currentColor",Ce.href="https://markerjs.com/products/cropro",Ce.target="_blank",Ce.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',We.appendChild(Ce),Z.addElement(We)}var ct=new Kn;ct.minWidth=3*this.toolbarHeight+"px",ct.contentAlign="end",this.topToolbar.addButtonBlock(ct);var He=new Nt('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");He.onClick=this.startRenderAndClose,ct.addButton(He),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(He.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var _t=new Nt('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");_t.onClick=this.close,ct.addButton(_t),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(_t.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new kn,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var a=new Kn;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Nt('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var g=new Nt('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");g.onClick=this.rotateRightButtonClicked,a.addButton(g);var h=new dt;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new hi("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(ct){o.rotateBy(ct),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var Z=new Kn;Z.minWidth=2*this.toolbarHeight+"px",Z.contentAlign="end",this.bottomToolbar.addButtonBlock(Z);var We=new Nt('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");We.onClick=this.flipHorizontallyButtonClicked,Z.addButton(We);var Ce=new Nt('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");Ce.onClick=this.flipVerticallyButtonClicked,Z.addButton(Ce)},c.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},c.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=ui.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},c.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Fn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},c.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return St(this,void 0,void 0,function(){var o,a;return mn(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(g){return g(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return St(this,void 0,void 0,function(){var o;return mn(this,function(a){switch(a.label){case 0:return(o=new vi).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),pt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return a.sent(),[4,o.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,a.sent()]}})})},c.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new gn("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new gn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new gn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new gn("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*o)+`px;
height: `+(this.toolbarHeight-2*o)+`px;
padding: `+o+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new gn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new gn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new ln("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new ln("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new gn("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new gn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new gn("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new gn("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*o)+`px;
padding: `+o+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new gn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},c.instanceCounter=0,c}(),Ct=v("8hTe"),ti=v.n(Ct),ci=/<pre[^>]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Mi=Ge.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,g=u===void 0?!1:u,h=c.className,Z=c.showTextOnly,We=c.showLines,Ce=c.replaces,ct=c.zoomImg,He=c.hasMask,_t=c.style,Pt=_t===void 0?{}:_t,Wt=c.stylesPrev,Wn=Wt===void 0?{}:Wt,Hn=String(a),un=Object(A.useRef)(),$n=Object(A.useRef)(),Ki=Object(A.useState)(""),An=Object(O.a)(Ki,2),On=An[0],ni=An[1],yi=Object(A.useState)("office"),Jn=Object(O.a)(yi,2),ii=Jn[0],zn=Jn[1],fr=function(){var Bt=new $e($n.current);Bt.displayMode="popup",Bt.addRenderEventListener(function(){var vn=Object(V.a)(R.a.mark(function Ut(yn){var Xt;return R.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return un.current.style.display="none",rn.next=3,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yn}});case 3:Xt=rn.sent,Xt!=null&&Xt.id&&Ce($n.current.getAttribute("src").replace(F.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 5:case"end":return rn.stop()}},Ut)}));return function(Ut){return vn.apply(this,arguments)}}()),Bt.show()},Xi=function(){var Bt=new At($n.current);Bt.settings.displayMode="popup",Bt.addEventListener("render",function(){var vn=Object(V.a)(R.a.mark(function Ut(yn){var Xt;return R.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:if(un.current.style.display="none",!$n.current){rn.next=6;break}return rn.next=4,Object(Le.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:yn.dataUrl}});case 4:Xt=rn.sent,Xt!=null&&Xt.id&&Ce($n.current.getAttribute("src").replace(F.a.API_SERVER,""),"/api/attachments/".concat(Xt==null?void 0:Xt.id,"?type=").concat(Xt.content_type));case 6:case"end":return rn.stop()}},Ut)}));return function(Ut){return vn.apply(this,arguments)}}()),Bt.show(),window.markerArea=Bt},Nn=Object(A.useMemo)(function(){try{var qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Bt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,vn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hn=Hn.replace(qt,"("+F.a.API_SERVER+"/api/attachments/").replace(Bt,'"'+F.a.API_SERVER+"/api/attachments/").replace(vn,'"'+F.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Hn=Hn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(bi){}var Ut=k(Hn),yn=ue();if(Hn.match(/\[TOC\]/)&&(Ut=Ut.replace("<p>[TOC]</p>",Fe()),Xe()),Ut=Ut.replace(/(__special_katext_id_\d+__)/g,function(bi,rn){var on=yn[rn],ri=on.type,xi=on.expression;return Object(te.renderToString)(di(xi)||"",{displayMode:ri==="block",throwOnError:!1,output:"html"})}),Ut=Ut.replace(/▁/g,"\u2581\u2581\u2581"),Y(),Z){var Xt=document.createElement("div");return Xt.innerHTML=Ut,Xt.innerText}return setTimeout(function(){return Di()},500),Ut},[Hn]),In=Object(A.useRef)();ke.WebkitLineClamp=We,We&&(Pt=Object(le.a)(Object(le.a)({},Pt),ke));function Ri(qt){var Bt=qt.target;if(Bt.tagName.toUpperCase()==="IMG"){if(ct){var vn=Bt.getAttribute("src");ni(vn),zn("image")}}else if(Bt.tagName.toUpperCase()==="A"){var Ut=Bt.getAttribute("href");if(Ut.indexOf("office")>-1)qt.preventDefault(),ni(Ut),zn("office");else if(Ut.indexOf("application/pdf")>-1)qt.preventDefault(),ni(Ut),zn("pdf");else if(Ut.indexOf("type=text")>-1)qt.preventDefault(),ni(Ut),zn("html");else if(Ut.startsWith("#")){qt.preventDefault();var yn=document.getElementById(Ut.replace("#",""));yn&&yn.scrollIntoView(!0)}}}var Di=function(){var Bt,vn=(Bt=In.current)===null||Bt===void 0?void 0:Bt.querySelectorAll("video");vn==null||vn.forEach(function(Ut){if(Ut.oncontextmenu=function(){return!1},Ut.src.indexOf(".m3u8")>-1&&!Ut.canPlayType("application/vnd.apple.mpegurl")){if(w.a.isSupported()){var yn=new w.a;yn.loadSource(Ut.src),yn.attachMedia(Ut)}}})};Object(A.useEffect)(function(){if(In.current&&Nn&&(Nn.match(ci)&&window.PR.prettyPrint()),In.current)return In.current.addEventListener("click",Ri),function(){In.current.removeEventListener("click",Ri),Y(),Xe()}},[Nn,In.current,Ri]);var Pi=function(Bt){if(!g)return;Bt.target.nodeName==="IMG"?(un.current.style.display="flex",un.current.style.width=Bt.target.clientWidth+"px",un.current.style.height=Bt.target.clientHeight+"px",un.current.style.top=Bt.target.offsetTop+"px",un.current.style.left=Bt.target.offsetLeft+"px",$n.current.src=Bt.target.getAttribute("src")):un.current.style.display="none"};return S.a.createElement("div",{style:{position:"relative"}},S.a.createElement("div",{ref:In,style:Object(le.a)({},Pt),className:"".concat(h||""," markdown-body ").concat(ti.a.mdBody),onMouseOver:Pi,dangerouslySetInnerHTML:{__html:Nn}}),S.a.createElement("div",{ref:un,className:ti.a.button},S.a.createElement(he.a,null,S.a.createElement(_e.a,{onClick:function(){return fr()}},"\u88C1\u526A"),S.a.createElement(_e.a,{onClick:function(){return Xi()}},"\u7F16\u8F91"))),S.a.createElement("img",{ref:$n,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),S.a.createElement(Ee.a,{close:!0,data:On,hasMask:He,type:On!=null&&On.length?ii:"",style:Object(le.a)({},Wn),onClose:function(){return ni("")}}))}},"9VGf":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return oe});var H=v("q1tI"),he=v.n(H);function oe(_e,le){var V=Object(H.useRef)();Object(H.useEffect)(function(){V.current=_e}),Object(H.useEffect)(function(){function O(){V.current()}if(le!==null){var I=setInterval(O,le);return function(){return clearInterval(I)}}},[le])}},Bd2K:function(nt,Ge,v){(function(H){H(v("VrN/"),v("osHv"))})(function(H){H.defineOption("autoCloseTags",!1,function(R,A,S){if(S!=H.Init&&S&&R.removeKeyMap("autoCloseTags"),!A)return;var T={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(T["'/'"]=function($){return V($)}),(typeof A!="object"||A.whenOpening!==!1)&&(T["'>'"]=function($){return _e($)}),R.addKeyMap(T)});var he=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],oe=["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 _e(R){if(R.getOption("disableInput"))return H.Pass;for(var A=R.listSelections(),S=[],T=R.getOption("autoCloseTags"),$=0;$<A.length;$++){if(!A[$].empty())return H.Pass;var z=A[$].head,N=R.getTokenAt(z),J=H.innerMode(R.getMode(),N.state),K=J.state,Q=J.mode.xmlCurrentTag&&J.mode.xmlCurrentTag(K),de=Q&&Q.name;if(!de)return H.Pass;var Ne=J.mode.configuration=="html",Xe=typeof T=="object"&&T.dontCloseTags||Ne&&he,ke=typeof T=="object"&&T.indentTags||Ne&&oe;N.end>z.ch&&(de=de.slice(0,de.length-N.end+z.ch));var be=de.toLowerCase();if(!de||N.type=="string"&&(N.end!=z.ch||!/[\"\']/.test(N.string.charAt(N.string.length-1))||N.string.length==1)||N.type=="tag"&&Q.close||N.string.indexOf("/")==z.ch-N.start-1||Xe&&O(Xe,be)>-1||I(R,J.mode.xmlCurrentContext&&J.mode.xmlCurrentContext(K)||[],de,z,!0))return H.Pass;var Fe=typeof T=="object"&&T.emptyTags;if(Fe&&O(Fe,de)>-1){S[$]={text:"/>",newPos:H.Pos(z.line,z.ch+2)};continue}var me=ke&&O(ke,be)>-1;S[$]={indent:me,text:">"+(me?`
`:"")+"</"+de+">",newPos:me?H.Pos(z.line+1,0):H.Pos(z.line,z.ch+1)}}for(var Se=typeof T=="object"&&T.dontIndentOnAutoClose,$=A.length-1;$>=0;$--){var Pe=S[$];R.replaceRange(Pe.text,A[$].head,A[$].anchor,"+insert");var xe=R.listSelections().slice(0);xe[$]={head:Pe.newPos,anchor:Pe.newPos},R.setSelections(xe),!Se&&Pe.indent&&(R.indentLine(Pe.newPos.line,null,!0),R.indentLine(Pe.newPos.line+1,null,!0))}}function le(R,A){for(var S=R.listSelections(),T=[],$=A?"/":"</",z=R.getOption("autoCloseTags"),N=typeof z=="object"&&z.dontIndentOnSlash,J=0;J<S.length;J++){if(!S[J].empty())return H.Pass;var K=S[J].head,Q=R.getTokenAt(K),de=H.innerMode(R.getMode(),Q.state),Ne=de.state;if(A&&(Q.type=="string"||Q.string.charAt(0)!="<"||Q.start!=K.ch-1))return H.Pass;var Xe,ke=de.mode.name!="xml"&&R.getMode().name=="htmlmixed";if(ke&&de.mode.name=="javascript")Xe=$+"script";else if(ke&&de.mode.name=="css")Xe=$+"style";else{var be=de.mode.xmlCurrentContext&&de.mode.xmlCurrentContext(Ne);if(!be||be.length&&I(R,be,be[be.length-1],K))return H.Pass;Xe=$+be[be.length-1]}R.getLine(K.line).charAt(Q.end)!=">"&&(Xe+=">"),T[J]=Xe}if(R.replaceSelections(T),S=R.listSelections(),!N)for(var J=0;J<S.length;J++)(J==S.length-1||S[J].head.line<S[J+1].head.line)&&R.indentLine(S[J].head.line)}function V(R){return R.getOption("disableInput")?H.Pass:le(R,!0)}H.commands.closeTag=function(R){return le(R)};function O(R,A){if(R.indexOf)return R.indexOf(A);for(var S=0,T=R.length;S<T;++S)if(R[S]==A)return S;return-1}function I(R,A,S,T,$){if(!H.scanForClosingTag)return!1;var z=Math.min(R.lastLine()+1,T.line+500),N=H.scanForClosingTag(R,T,null,z);if(!N||N.tag!=S)return!1;for(var J=$?1:0,K=A.length-1;K>=0&&A[K]==S;K--)++J;T=N.to;for(var K=1;K<J;K++){var Q=H.scanForClosingTag(R,T,null,z);if(!Q||Q.tag!=S)return!1;T=Q.to}return!0}})},BjJ7:function(nt,Ge,v){"use strict";v.d(Ge,"d",function(){return he}),v.d(Ge,"c",function(){return oe}),v.d(Ge,"e",function(){return _e}),v.d(Ge,"b",function(){return le}),v.d(Ge,"a",function(){return O});var H=v("m3rI");function he(I){var R=!0;if(I.length>0){for(var A=0;A<I.length;A++)if(I[A].compile_success==0||!I[A].compile_success){R=!1;break}}else R=!1;return R}function oe(I){for(var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",A=[],S=0;S<I.length;S++){var T=I[S],$=R?"".concat(R,"/").concat(T.name):"".concat(T.name);A.push({title:T.name,isLeaf:!(T.type==="tree"),key:$})}return A}function _e(I,R,A){for(var S=0;S<I.length;S++){var T=I[S];if(T.key===R){T.children=A;break}T.children&&_e(T.children,R,A)}return I}function le(I,R,A){var S;return function(){var T=this,$=arguments,z=function(){S=null,A||I.apply(T,$)},N=A&&!S;clearTimeout(S),S=setTimeout(z,R),N&&I.apply(T,$)}}var V=!0,O=H.a.API_SERVER},"C+DQ":function(nt,Ge,v){},D1Df:function(nt,Ge,v){"use strict";function H(x){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?H=function(D){return typeof D}:H=function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},H(x)}function he(){return he=Object.assign||function(x){for(var j=1;j<arguments.length;j++){var D=arguments[j];for(var _ in D)Object.prototype.hasOwnProperty.call(D,_)&&(x[_]=D[_])}return x},he.apply(this,arguments)}function oe(x,j){var D=Object.keys(x);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(x);j&&(_=_.filter(function(k){return Object.getOwnPropertyDescriptor(x,k).enumerable})),D.push.apply(D,_)}return D}function _e(x){for(var j=1;j<arguments.length;j++){var D=arguments[j]!=null?arguments[j]:{};j%2?oe(D,!0).forEach(function(_){N(x,_,D[_])}):Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(D)):oe(D).forEach(function(_){Object.defineProperty(x,_,Object.getOwnPropertyDescriptor(D,_))})}return x}function le(x,j){if(x==null)return{};var D=V(x,j),_,k;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(x);for(k=0;k<p.length;k++){if(_=p[k],j.indexOf(_)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(x,_))continue;D[_]=x[_]}}return D}function V(x,j){if(x==null)return{};var D={},_=Object.keys(x),k,p;for(p=0;p<_.length;p++){if(k=_[p],j.indexOf(k)>=0)continue;D[k]=x[k]}return D}function O(x,j){if(!(x instanceof j))throw new TypeError("Cannot call a class as a function")}function I(x,j){for(var D=0;D<j.length;D++){var _=j[D];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(x,_.key,_)}}function R(x,j,D){return j&&I(x.prototype,j),D&&I(x,D),x}function A(x,j){return j&&(H(j)==="object"||typeof j=="function")?j:T(x)}function S(x){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(D){return D.__proto__||Object.getPrototypeOf(D)},S(x)}function T(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function $(x,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function");x.prototype=Object.create(j&&j.prototype,{constructor:{value:x,writable:!0,configurable:!0}}),j&&z(x,j)}function z(x,j){return z=Object.setPrototypeOf||function(_,k){return _.__proto__=k,_},z(x,j)}function N(x,j,D){return j in x?Object.defineProperty(x,j,{value:D,enumerable:!0,configurable:!0,writable:!0}):x[j]=D,x}var J=v("q1tI"),K=v("17x9"),Q=v("H38U"),de=v("aRTE");function Ne(x){for(var j="",D=0;D<x.length;D++){var _=x.charCodeAt(D);_<128?j+=String.fromCharCode(_):_<2048?(j+=String.fromCharCode(192|_>>6),j+=String.fromCharCode(128|_&63)):_<55296||_>=57344?(j+=String.fromCharCode(224|_>>12),j+=String.fromCharCode(128|_>>6&63),j+=String.fromCharCode(128|_&63)):(D++,_=65536+((_&1023)<<10|x.charCodeAt(D)&1023),j+=String.fromCharCode(240|_>>18),j+=String.fromCharCode(128|_>>12&63),j+=String.fromCharCode(128|_>>6&63),j+=String.fromCharCode(128|_&63))}return j}var Xe={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},ke={},be=4,Fe=.1;function me(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,D=[];return x.forEach(function(_,k){var p=null;_.forEach(function(d,w){if(!d&&p!==null){D.push("M".concat(p+j," ").concat(k+j,"h").concat(w-p,"v1H").concat(p+j,"z")),p=null;return}if(w===_.length-1){if(!d)return;p===null?D.push("M".concat(w+j,",").concat(k+j," h1v1H").concat(w+j,"z")):D.push("M".concat(p+j,",").concat(k+j," h").concat(w+1-p,"v1H").concat(p+j,"z"));return}d&&p===null&&(p=w)})}),D.join("")}function Se(x,j){return x.slice().map(function(D,_){return _<j.y||_>=j.y+j.h?D:D.map(function(k,p){return p<j.x||p>=j.x+j.w?k:!1})})}function Pe(x,j){var D=x.imageSettings,_=x.size,k=x.includeMargin;if(D==null)return null;var p=k?be:0,d=j.length+p*2,w=Math.floor(_*Fe),F=d/_,te=(D.width||w)*F,Ee=(D.height||w)*F,Le=D.x==null?j.length/2-te/2:D.x*F,pe=D.y==null?j.length/2-Ee/2:D.y*F,fe=null;if(D.excavate){var re=Math.floor(Le),se=Math.floor(pe),ee=Math.ceil(te+Le-re),B=Math.ceil(Ee+pe-se);fe={x:re,y:se,w:ee,h:B}}return{x:Le,y:pe,h:Ee,w:te,excavation:fe}}var xe=function(){try{new Path2D().addPath(new Path2D)}catch(x){return!1}return!0}(),L=function(x){$(j,x);function j(){var D,_;O(this,j);for(var k=arguments.length,p=new Array(k),d=0;d<k;d++)p[d]=arguments[d];return _=A(this,(D=S(j)).call.apply(D,[this].concat(p))),N(T(_),"_canvas",void 0),N(T(_),"_image",void 0),N(T(_),"state",{imgLoaded:!1}),N(T(_),"handleImageLoad",function(){_.setState({imgLoaded:!0})}),_}return R(j,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var _=this.props,k=_.value,p=_.size,d=_.level,w=_.bgColor,F=_.fgColor,te=_.includeMargin,Ee=_.imageSettings,Le=new Q(-1,de[d]);if(Le.addData(Ne(k)),Le.make(),this._canvas!=null){var pe=this._canvas,fe=pe.getContext("2d");if(!fe)return;var re=Le.modules;if(re===null)return;var se=te?be:0,ee=re.length+se*2,B=Pe(this.props,re);Ee!=null&&B!=null&&(B.excavation!=null&&(re=Se(re,B.excavation)));var b=window.devicePixelRatio||1;pe.height=pe.width=p*b;var G=p/ee*b;fe.scale(G,G),fe.fillStyle=w,fe.fillRect(0,0,ee,ee),fe.fillStyle=F,xe?fe.fill(new Path2D(me(re,se))):re.forEach(function(M,ge){M.forEach(function(we,ne){we&&fe.fillRect(ne+se,ge+se,1,1)})}),this.state.imgLoaded&&this._image&&B!=null&&fe.drawImage(this._image,B.x+se,B.y+se,B.w,B.h)}}},{key:"render",value:function(){var _=this,k=this.props,p=k.value,d=k.size,w=k.level,F=k.bgColor,te=k.fgColor,Ee=k.style,Le=k.includeMargin,pe=k.imageSettings,fe=le(k,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),re=_e({height:d,width:d},Ee),se=null,ee=pe&&pe.src;return pe!=null&&ee!=null&&(se=J.createElement("img",{src:ee,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(b){return _._image=b}})),J.createElement(J.Fragment,null,J.createElement("canvas",he({style:re,height:d,width:d,ref:function(b){return _._canvas=b}},fe)),se)}}]),j}(J.PureComponent);N(L,"defaultProps",Xe);var ue=function(x){$(j,x);function j(){return O(this,j),A(this,S(j).apply(this,arguments))}return R(j,[{key:"render",value:function(){var _=this.props,k=_.value,p=_.size,d=_.level,w=_.bgColor,F=_.fgColor,te=_.includeMargin,Ee=_.imageSettings,Le=le(_,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),pe=new Q(-1,de[d]);pe.addData(Ne(k)),pe.make();var fe=pe.modules;if(fe===null)return null;var re=te?be:0,se=fe.length+re*2,ee=Pe(this.props,fe),B=null;Ee!=null&&ee!=null&&(ee.excavation!=null&&(fe=Se(fe,ee.excavation)),B=J.createElement("image",{xlinkHref:Ee.src,height:ee.h,width:ee.w,x:ee.x+re,y:ee.y+re,preserveAspectRatio:"none"}));var b=me(fe,re);return J.createElement("svg",he({shapeRendering:"crispEdges",height:p,width:p,viewBox:"0 0 ".concat(se," ").concat(se)},Le),J.createElement("path",{fill:w,d:"M0,0 h".concat(se,"v").concat(se,"H0z")}),J.createElement("path",{fill:F,d:b}),B)}}]),j}(J.PureComponent);N(ue,"defaultProps",Xe);var Y=function(j){var D=j.renderAs,_=le(j,["renderAs"]),k=D==="svg"?ue:L;return J.createElement(k,_)};Y.defaultProps=_e({renderAs:"canvas"},Xe),nt.exports=Y},DlQD:function(nt,Ge,v){(function(H,he){nt.exports=he()})(this,function(){"use strict";function H(ae,q){for(var ie=0;ie<q.length;ie++){var C=q[ie];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(ae,C.key,C)}}function he(ae,q,ie){return q&&H(ae.prototype,q),ie&&H(ae,ie),ae}function oe(ae,q){if(!ae)return;if(typeof ae=="string")return _e(ae,q);var ie=Object.prototype.toString.call(ae).slice(8,-1);if(ie==="Object"&&ae.constructor&&(ie=ae.constructor.name),ie==="Map"||ie==="Set")return Array.from(ae);if(ie==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ie))return _e(ae,q)}function _e(ae,q){(q==null||q>ae.length)&&(q=ae.length);for(var ie=0,C=new Array(q);ie<q;ie++)C[ie]=ae[ie];return C}function le(ae,q){var ie;if(typeof Symbol=="undefined"||ae[Symbol.iterator]==null){if(Array.isArray(ae)||(ie=oe(ae))||q&&ae&&typeof ae.length=="number"){ie&&(ae=ie);var C=0;return function(){return C>=ae.length?{done:!0}:{done:!1,value:ae[C++]}}}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 ie=ae[Symbol.iterator](),ie.next.bind(ie)}function V(ae,q){return q={exports:{}},ae(q,q.exports),q.exports}var O=V(function(ae){function q(){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 ie(C){ae.exports.defaults=C}ae.exports={defaults:q(),getDefaults:q,changeDefaults:ie}}),I=O.defaults,R=O.getDefaults,A=O.changeDefaults,S=/[&<>"']/,T=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,z=/[<>"']|&(?!#?\w+;)/g,N={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},J=function(q){return N[q]};function K(ae,q){if(q){if(S.test(ae))return ae.replace(T,J)}else if($.test(ae))return ae.replace(z,J);return ae}var Q=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function de(ae){return ae.replace(Q,function(q,ie){return ie=ie.toLowerCase(),ie==="colon"?":":ie.charAt(0)==="#"?ie.charAt(1)==="x"?String.fromCharCode(parseInt(ie.substring(2),16)):String.fromCharCode(+ie.substring(1)):""})}var Ne=/(^|[^\[])\^/g;function Xe(ae,q){ae=ae.source||ae,q=q||"";var ie={replace:function(E,P){return P=P.source||P,P=P.replace(Ne,"$1"),ae=ae.replace(E,P),ie},getRegex:function(){return new RegExp(ae,q)}};return ie}var ke=/[^\w:]/g,be=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Fe(ae,q,ie){if(ae){var C;try{C=decodeURIComponent(de(ie)).replace(ke,"").toLowerCase()}catch(E){return null}if(C.indexOf("javascript:")===0||C.indexOf("vbscript:")===0||C.indexOf("data:")===0)return null}q&&!be.test(ie)&&(ie=L(q,ie));try{ie=encodeURI(ie).replace(/%25/g,"%")}catch(E){return null}return ie}var me={},Se=/^[^:]+:\/*[^/]*$/,Pe=/^([^:]+:)[\s\S]*$/,xe=/^([^:]+:\/*[^/]*)[\s\S]*$/;function L(ae,q){me[" "+ae]||(Se.test(ae)?me[" "+ae]=ae+"/":me[" "+ae]=j(ae,"/",!0)),ae=me[" "+ae];var ie=ae.indexOf(":")===-1;return q.substring(0,2)==="//"?ie?q:ae.replace(Pe,"$1")+q:q.charAt(0)==="/"?ie?q:ae.replace(xe,"$1")+q:ae+q}var ue={exec:function(){}};function Y(ae){for(var q=1,ie,C;q<arguments.length;q++){ie=arguments[q];for(C in ie)Object.prototype.hasOwnProperty.call(ie,C)&&(ae[C]=ie[C])}return ae}function x(ae,q){var ie=ae.replace(/\|/g,function(P,U,ye){for(var Oe=!1,Je=U;--Je>=0&&ye[Je]==="\\";)Oe=!Oe;return Oe?"|":" |"}),C=ie.split(/ \|/),E=0;if(C.length>q)C.splice(q);else for(;C.length<q;)C.push("");for(;E<C.length;E++)C[E]=C[E].trim().replace(/\\\|/g,"|");return C}function j(ae,q,ie){var C=ae.length;if(C===0)return"";for(var E=0;E<C;){var P=ae.charAt(C-E-1);if(P===q&&!ie)E++;else if(P!==q&&ie)E++;else break}return ae.substr(0,C-E)}function D(ae,q){if(ae.indexOf(q[1])===-1)return-1;for(var ie=ae.length,C=0,E=0;E<ie;E++)if(ae[E]==="\\")E++;else if(ae[E]===q[0])C++;else if(ae[E]===q[1]&&(C--,C<0))return E;return-1}function _(ae){ae&&ae.sanitize&&!ae.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var k={escape:K,unescape:de,edit:Xe,cleanUrl:Fe,resolveUrl:L,noopTest:ue,merge:Y,splitCells:x,rtrim:j,findClosingBracket:D,checkSanitizeDeprecation:_},p=O.defaults,d=k.rtrim,w=k.splitCells,F=k.escape,te=k.findClosingBracket;function Ee(ae,q,ie){var C=q.href,E=q.title?F(q.title):null,P=ae[1].replace(/\\([\[\]])/g,"$1");return ae[0].charAt(0)!=="!"?{type:"link",raw:ie,href:C,title:E,text:P}:{type:"image",raw:ie,href:C,title:E,text:F(P)}}function Le(ae,q){var ie=ae.match(/^(\s+)(?:```)/);if(ie===null)return q;var C=ie[1];return q.split(`
`).map(function(E){var P=E.match(/^\s+/);if(P===null)return E;var U=P[0];return U.length>=C.length?E.slice(C.length):E}).join(`
`)}var pe=function(){function ae(ie){this.options=ie||p}var q=ae.prototype;return q.space=function(C){var E=this.rules.block.newline.exec(C);if(E)return E[0].length>1?{type:"space",raw:E[0]}:{raw:`
`}},q.code=function(C,E){var P=this.rules.block.code.exec(C);if(P){var U=E[E.length-1];if(U&&U.type==="paragraph")return{raw:P[0],text:P[0].trimRight()};var ye=P[0].replace(/^ {4}/gm,"");return{type:"code",raw:P[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:d(ye,`
`)}}},q.fences=function(C){var E=this.rules.block.fences.exec(C);if(E){var P=E[0],U=Le(P,E[3]||"");return{type:"code",raw:P,lang:E[2]?E[2].trim():E[2],text:U}}},q.heading=function(C){var E=this.rules.block.heading.exec(C);if(E)return{type:"heading",raw:E[0],depth:E[1].length,text:E[2]}},q.nptable=function(C){var E=this.rules.block.nptable.exec(C);if(E){var P={type:"table",header:w(E[1].replace(/^ *| *\| *$/g,"")),align:E[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:E[3]?E[3].replace(/\n$/,"").split(`
`):[],raw:E[0]};if(P.header.length===P.align.length){var U=P.align.length,ye;for(ye=0;ye<U;ye++)/^ *-+: *$/.test(P.align[ye])?P.align[ye]="right":/^ *:-+: *$/.test(P.align[ye])?P.align[ye]="center":/^ *:-+ *$/.test(P.align[ye])?P.align[ye]="left":P.align[ye]=null;for(U=P.cells.length,ye=0;ye<U;ye++)P.cells[ye]=w(P.cells[ye],P.header.length);return P}}},q.hr=function(C){var E=this.rules.block.hr.exec(C);if(E)return{type:"hr",raw:E[0]}},q.blockquote=function(C){var E=this.rules.block.blockquote.exec(C);if(E){var P=E[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:E[0],text:P}}},q.list=function(C){var E=this.rules.block.list.exec(C);if(E){for(var P=E[0],U=E[2],ye=U.length>1,Oe=U[U.length-1]===")",Je={type:"list",raw:P,ordered:ye,start:ye?+U.slice(0,-1):"",loose:!1,items:[]},yt=E[0].match(this.rules.block.item),kt=!1,Ke,wt,mt,ot,Dt,At,Vt,jt=yt.length,St=0;St<jt;St++)Ke=yt[St],P=Ke,wt=Ke.length,Ke=Ke.replace(/^ *([*+-]|\d+[.)]) */,""),~Ke.indexOf(`
`)&&(wt-=Ke.length,Ke=this.options.pedantic?Ke.replace(/^ {1,4}/gm,""):Ke.replace(new RegExp("^ {1,"+wt+"}","gm"),"")),St!==jt-1&&(mt=this.rules.block.bullet.exec(yt[St+1])[0],(ye?mt.length===1||!Oe&&mt[mt.length-1]===")":mt.length>1||this.options.smartLists&&mt!==U)&&(ot=yt.slice(St+1).join(`
`),Je.raw=Je.raw.substring(0,Je.raw.length-ot.length),St=jt-1)),Dt=kt||/\n\n(?!\s*$)/.test(Ke),St!==jt-1&&(kt=Ke.charAt(Ke.length-1)===`
`,Dt||(Dt=kt)),Dt&&(Je.loose=!0),At=/^\[[ xX]\] /.test(Ke),Vt=void 0,At&&(Vt=Ke[1]!==" ",Ke=Ke.replace(/^\[[ xX]\] +/,"")),Je.items.push({type:"list_item",raw:P,task:At,checked:Vt,loose:Dt,text:Ke});return Je}},q.html=function(C){var E=this.rules.block.html.exec(C);if(E)return{type:this.options.sanitize?"paragraph":"html",raw:E[0],pre:!this.options.sanitizer&&(E[1]==="pre"||E[1]==="script"||E[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(E[0]):F(E[0]):E[0]}},q.def=function(C){var E=this.rules.block.def.exec(C);if(E){E[3]&&(E[3]=E[3].substring(1,E[3].length-1));var P=E[1].toLowerCase().replace(/\s+/g," ");return{tag:P,raw:E[0],href:E[2],title:E[3]}}},q.table=function(C){var E=this.rules.block.table.exec(C);if(E){var P={type:"table",header:w(E[1].replace(/^ *| *\| *$/g,"")),align:E[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:E[3]?E[3].replace(/\n$/,"").split(`
`):[]};if(P.header.length===P.align.length){P.raw=E[0];var U=P.align.length,ye;for(ye=0;ye<U;ye++)/^ *-+: *$/.test(P.align[ye])?P.align[ye]="right":/^ *:-+: *$/.test(P.align[ye])?P.align[ye]="center":/^ *:-+ *$/.test(P.align[ye])?P.align[ye]="left":P.align[ye]=null;for(U=P.cells.length,ye=0;ye<U;ye++)P.cells[ye]=w(P.cells[ye].replace(/^ *\| *| *\| *$/g,""),P.header.length);return P}}},q.lheading=function(C){var E=this.rules.block.lheading.exec(C);if(E)return{type:"heading",raw:E[0],depth:E[2].charAt(0)==="="?1:2,text:E[1]}},q.paragraph=function(C){var E=this.rules.block.paragraph.exec(C);if(E)return{type:"paragraph",raw:E[0],text:E[1].charAt(E[1].length-1)===`
`?E[1].slice(0,-1):E[1]}},q.text=function(C,E){var P=this.rules.block.text.exec(C);if(P){var U=E[E.length-1];return U&&U.type==="text"?{raw:P[0],text:P[0]}:{type:"text",raw:P[0],text:P[0]}}},q.escape=function(C){var E=this.rules.inline.escape.exec(C);if(E)return{type:"escape",raw:E[0],text:F(E[1])}},q.tag=function(C,E,P){var U=this.rules.inline.tag.exec(C);if(U)return!E&&/^<a /i.test(U[0])?E=!0:E&&/^<\/a>/i.test(U[0])&&(E=!1),!P&&/^<(pre|code|kbd|script)(\s|>)/i.test(U[0])?P=!0:P&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(U[0])&&(P=!1),{type:this.options.sanitize?"text":"html",raw:U[0],inLink:E,inRawBlock:P,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(U[0]):F(U[0]):U[0]}},q.link=function(C){var E=this.rules.inline.link.exec(C);if(E){var P=te(E[2],"()");if(P>-1){var U=E[0].indexOf("!")===0?5:4,ye=U+E[1].length+P;E[2]=E[2].substring(0,P),E[0]=E[0].substring(0,ye).trim(),E[3]=""}var Oe=E[2],Je="";if(this.options.pedantic){var yt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Oe);yt?(Oe=yt[1],Je=yt[3]):Je=""}else Je=E[3]?E[3].slice(1,-1):"";Oe=Oe.trim().replace(/^<([\s\S]*)>$/,"$1");var kt=Ee(E,{href:Oe&&Oe.replace(this.rules.inline._escapes,"$1"),title:Je&&Je.replace(this.rules.inline._escapes,"$1")},E[0]);return kt}},q.reflink=function(C,E){var P;if((P=this.rules.inline.reflink.exec(C))||(P=this.rules.inline.nolink.exec(C))){var U=(P[2]||P[1]).replace(/\s+/g," ");if(U=E[U.toLowerCase()],!U||!U.href){var ye=P[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Oe=Ee(P,U,P[0]);return Oe}},q.strong=function(C,E,P){P===void 0&&(P="");var U=this.rules.inline.strong.start.exec(C);if(U&&(!U[1]||U[1]&&(P===""||this.rules.inline.punctuation.exec(P)))){E=E.slice(-1*C.length);var ye=U[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Oe;(U=ye.exec(E))!=null;)if(Oe=this.rules.inline.strong.middle.exec(E.slice(0,U.index+3)),Oe)return{type:"strong",raw:C.slice(0,Oe[0].length),text:C.slice(2,Oe[0].length-2)}}},q.em=function(C,E,P){P===void 0&&(P="");var U=this.rules.inline.em.start.exec(C);if(U&&(!U[1]||U[1]&&(P===""||this.rules.inline.punctuation.exec(P)))){E=E.slice(-1*C.length);var ye=U[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Oe;(U=ye.exec(E))!=null;)if(Oe=this.rules.inline.em.middle.exec(E.slice(0,U.index+2)),Oe)return{type:"em",raw:C.slice(0,Oe[0].length),text:C.slice(1,Oe[0].length-1)}}},q.codespan=function(C){var E=this.rules.inline.code.exec(C);if(E){var P=E[2].replace(/\n/g," "),U=/[^ ]/.test(P),ye=P.startsWith(" ")&&P.endsWith(" ");return U&&ye&&(P=P.substring(1,P.length-1)),P=F(P,!0),{type:"codespan",raw:E[0],text:P}}},q.br=function(C){var E=this.rules.inline.br.exec(C);if(E)return{type:"br",raw:E[0]}},q.del=function(C){var E=this.rules.inline.del.exec(C);if(E)return{type:"del",raw:E[0],text:E[1]}},q.autolink=function(C,E){var P=this.rules.inline.autolink.exec(C);if(P){var U,ye;return P[2]==="@"?(U=F(this.options.mangle?E(P[1]):P[1]),ye="mailto:"+U):(U=F(P[1]),ye=U),{type:"link",raw:P[0],text:U,href:ye,tokens:[{type:"text",raw:U,text:U}]}}},q.url=function(C,E){var P;if(P=this.rules.inline.url.exec(C)){var U,ye;if(P[2]==="@")U=F(this.options.mangle?E(P[0]):P[0]),ye="mailto:"+U;else{var Oe;do Oe=P[0],P[0]=this.rules.inline._backpedal.exec(P[0])[0];while(Oe!==P[0]);U=F(P[0]),P[1]==="www."?ye="http://"+U:ye=U}return{type:"link",raw:P[0],text:U,href:ye,tokens:[{type:"text",raw:U,text:U}]}}},q.inlineText=function(C,E,P){var U=this.rules.inline.text.exec(C);if(U){var ye;return E?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(U[0]):F(U[0]):U[0]:ye=F(this.options.smartypants?P(U[0]):U[0]),{type:"text",raw:U[0],text:ye}}},ae}(),fe=k.noopTest,re=k.edit,se=k.merge,ee={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:fe,table:fe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ee._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ee._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ee.def=re(ee.def).replace("label",ee._label).replace("title",ee._title).getRegex(),ee.bullet=/(?:[*+-]|\d{1,9}[.)])/,ee.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ee.item=re(ee.item,"gm").replace(/bull/g,ee.bullet).getRegex(),ee.list=re(ee.list).replace(/bull/g,ee.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ee.def.source+")").getRegex(),ee._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",ee._comment=/<!--(?!-?>)[\s\S]*?-->/,ee.html=re(ee.html,"i").replace("comment",ee._comment).replace("tag",ee._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ee.paragraph=re(ee._paragraph).replace("hr",ee.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",ee._tag).getRegex(),ee.blockquote=re(ee.blockquote).replace("paragraph",ee.paragraph).getRegex(),ee.normal=se({},ee),ee.gfm=se({},ee.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*|$)"}),ee.gfm.nptable=re(ee.gfm.nptable).replace("hr",ee.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",ee._tag).getRegex(),ee.gfm.table=re(ee.gfm.table).replace("hr",ee.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",ee._tag).getRegex(),ee.pedantic=se({},ee.normal,{html:re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee._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:fe,paragraph:re(ee.normal._paragraph).replace("hr",ee.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ee.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var B={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:fe,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:fe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};B._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",B.punctuation=re(B.punctuation).replace(/punctuation/g,B._punctuation).getRegex(),B._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",B._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",B.em.start=re(B.em.start).replace(/punctuation/g,B._punctuation).getRegex(),B.em.middle=re(B.em.middle).replace(/punctuation/g,B._punctuation).replace(/overlapSkip/g,B._overlapSkip).getRegex(),B.em.endAst=re(B.em.endAst,"g").replace(/punctuation/g,B._punctuation).getRegex(),B.em.endUnd=re(B.em.endUnd,"g").replace(/punctuation/g,B._punctuation).getRegex(),B.strong.start=re(B.strong.start).replace(/punctuation/g,B._punctuation).getRegex(),B.strong.middle=re(B.strong.middle).replace(/punctuation/g,B._punctuation).replace(/blockSkip/g,B._blockSkip).getRegex(),B.strong.endAst=re(B.strong.endAst,"g").replace(/punctuation/g,B._punctuation).getRegex(),B.strong.endUnd=re(B.strong.endUnd,"g").replace(/punctuation/g,B._punctuation).getRegex(),B.blockSkip=re(B._blockSkip,"g").getRegex(),B.overlapSkip=re(B._overlapSkip,"g").getRegex(),B._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,B._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,B._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])?)+(?![-_])/,B.autolink=re(B.autolink).replace("scheme",B._scheme).replace("email",B._email).getRegex(),B._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,B.tag=re(B.tag).replace("comment",ee._comment).replace("attribute",B._attribute).getRegex(),B._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,B._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,B._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,B.link=re(B.link).replace("label",B._label).replace("href",B._href).replace("title",B._title).getRegex(),B.reflink=re(B.reflink).replace("label",B._label).getRegex(),B.reflinkSearch=re(B.reflinkSearch,"g").replace("reflink",B.reflink).replace("nolink",B.nolink).getRegex(),B.normal=se({},B),B.pedantic=se({},B.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:re(/^!?\[(label)\]\((.*?)\)/).replace("label",B._label).getRegex(),reflink:re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B._label).getRegex()}),B.gfm=se({},B.normal,{escape:re(B.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),B.gfm.url=re(B.gfm.url,"i").replace("email",B.gfm._extended_email).getRegex(),B.breaks=se({},B.gfm,{br:re(B.br).replace("{2,}","*").getRegex(),text:re(B.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:ee,inline:B},G=O.defaults,M=b.block,ge=b.inline;function we(ae){return ae.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ne(ae){var q="",ie,C,E=ae.length;for(ie=0;ie<E;ie++)C=ae.charCodeAt(ie),Math.random()>.5&&(C="x"+C.toString(16)),q+="&#"+C+";";return q}var Te=function(){function ae(ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=ie||G,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var C={block:M.normal,inline:ge.normal};this.options.pedantic?(C.block=M.pedantic,C.inline=ge.pedantic):this.options.gfm&&(C.block=M.gfm,this.options.breaks?C.inline=ge.breaks:C.inline=ge.gfm),this.tokenizer.rules=C}ae.lex=function(C,E){var P=new ae(E);return P.lex(C)};var q=ae.prototype;return q.lex=function(C){return C=C.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(C,this.tokens,!0),this.inline(this.tokens),this.tokens},q.blockTokens=function(C,E,P){E===void 0&&(E=[]),P===void 0&&(P=!0),C=C.replace(/^ +$/gm,"");for(var U,ye,Oe,Je;C;){if(U=this.tokenizer.space(C)){C=C.substring(U.raw.length),U.type&&E.push(U);continue}if(U=this.tokenizer.code(C,E)){C=C.substring(U.raw.length),U.type?E.push(U):(Je=E[E.length-1],Je.raw+=`
`+U.raw,Je.text+=`
`+U.text);continue}if(U=this.tokenizer.fences(C)){C=C.substring(U.raw.length),E.push(U);continue}if(U=this.tokenizer.heading(C)){C=C.substring(U.raw.length),E.push(U);continue}if(U=this.tokenizer.nptable(C)){C=C.substring(U.raw.length),E.push(U);continue}if(U=this.tokenizer.hr(C)){C=C.substring(U.raw.length),E.push(U);continue}if(U=this.tokenizer.blockquote(C)){C=C.substring(U.raw.length),U.tokens=this.blockTokens(U.text,[],P),E.push(U);continue}if(U=this.tokenizer.list(C)){for(C=C.substring(U.raw.length),Oe=U.items.length,ye=0;ye<Oe;ye++)U.items[ye].tokens=this.blockTokens(U.items[ye].text,[],!1);E.push(U);continue}if(U=this.tokenizer.html(C)){C=C.substring(U.raw.length),E.push(U);continue}if(P&&(U=this.tokenizer.def(C))){C=C.substring(U.raw.length),this.tokens.links[U.tag]||(this.tokens.links[U.tag]={href:U.href,title:U.title});continue}if(U=this.tokenizer.table(C)){C=C.substring(U.raw.length),E.push(U);continue}if(U=this.tokenizer.lheading(C)){C=C.substring(U.raw.length),E.push(U);continue}if(P&&(U=this.tokenizer.paragraph(C))){C=C.substring(U.raw.length),E.push(U);continue}if(U=this.tokenizer.text(C,E)){C=C.substring(U.raw.length),U.type?E.push(U):(Je=E[E.length-1],Je.raw+=`
`+U.raw,Je.text+=`
`+U.text);continue}if(C){var yt="Infinite loop on byte: "+C.charCodeAt(0);if(this.options.silent){console.error(yt);break}else throw new Error(yt)}}return E},q.inline=function(C){var E,P,U,ye,Oe,Je,yt=C.length;for(E=0;E<yt;E++){Je=C[E];switch(Je.type){case"paragraph":case"text":case"heading":{Je.tokens=[],this.inlineTokens(Je.text,Je.tokens);break}case"table":{for(Je.tokens={header:[],cells:[]},ye=Je.header.length,P=0;P<ye;P++)Je.tokens.header[P]=[],this.inlineTokens(Je.header[P],Je.tokens.header[P]);for(ye=Je.cells.length,P=0;P<ye;P++)for(Oe=Je.cells[P],Je.tokens.cells[P]=[],U=0;U<Oe.length;U++)Je.tokens.cells[P][U]=[],this.inlineTokens(Oe[U],Je.tokens.cells[P][U]);break}case"blockquote":{this.inline(Je.tokens);break}case"list":{for(ye=Je.items.length,P=0;P<ye;P++)this.inline(Je.items[P].tokens);break}}}return C},q.inlineTokens=function(C,E,P,U,ye){E===void 0&&(E=[]),P===void 0&&(P=!1),U===void 0&&(U=!1),ye===void 0&&(ye="");var Oe,Je=C,yt;if(this.tokens.links){var kt=Object.keys(this.tokens.links);if(kt.length>0)for(;(yt=this.tokenizer.rules.inline.reflinkSearch.exec(Je))!=null;)kt.includes(yt[0].slice(yt[0].lastIndexOf("[")+1,-1))&&(Je=Je.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Je.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(yt=this.tokenizer.rules.inline.blockSkip.exec(Je))!=null;)Je=Je.slice(0,yt.index)+"["+"a".repeat(yt[0].length-2)+"]"+Je.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;C;){if(Oe=this.tokenizer.escape(C)){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(Oe=this.tokenizer.tag(C,P,U)){C=C.substring(Oe.raw.length),P=Oe.inLink,U=Oe.inRawBlock,E.push(Oe);continue}if(Oe=this.tokenizer.link(C)){C=C.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,U)),E.push(Oe);continue}if(Oe=this.tokenizer.reflink(C,this.tokens.links)){C=C.substring(Oe.raw.length),Oe.type==="link"&&(Oe.tokens=this.inlineTokens(Oe.text,[],!0,U)),E.push(Oe);continue}if(Oe=this.tokenizer.strong(C,Je,ye)){C=C.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],P,U),E.push(Oe);continue}if(Oe=this.tokenizer.em(C,Je,ye)){C=C.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],P,U),E.push(Oe);continue}if(Oe=this.tokenizer.codespan(C)){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(Oe=this.tokenizer.br(C)){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(Oe=this.tokenizer.del(C)){C=C.substring(Oe.raw.length),Oe.tokens=this.inlineTokens(Oe.text,[],P,U),E.push(Oe);continue}if(Oe=this.tokenizer.autolink(C,ne)){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(!P&&(Oe=this.tokenizer.url(C,ne))){C=C.substring(Oe.raw.length),E.push(Oe);continue}if(Oe=this.tokenizer.inlineText(C,U,we)){C=C.substring(Oe.raw.length),ye=Oe.raw.slice(-1),E.push(Oe);continue}if(C){var Ke="Infinite loop on byte: "+C.charCodeAt(0);if(this.options.silent){console.error(Ke);break}else throw new Error(Ke)}}return E},he(ae,null,[{key:"rules",get:function(){return{block:M,inline:ge}}}]),ae}(),Ie=O.defaults,De=k.cleanUrl,Ae=k.escape,Me=function(){function ae(ie){this.options=ie||Ie}var q=ae.prototype;return q.code=function(C,E,P){var U=(E||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(C,U);ye!=null&&ye!==C&&(P=!0,C=ye)}return U?'<pre><code class="'+this.options.langPrefix+Ae(U,!0)+'">'+(P?C:Ae(C,!0))+`</code></pre>
`:"<pre><code>"+(P?C:Ae(C,!0))+`</code></pre>
`},q.blockquote=function(C){return`<blockquote>
`+C+`</blockquote>
`},q.html=function(C){return C},q.heading=function(C,E,P,U){return this.options.headerIds?"<h"+E+' id="'+this.options.headerPrefix+U.slug(P)+'">'+C+"</h"+E+`>
`:"<h"+E+">"+C+"</h"+E+`>
`},q.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},q.list=function(C,E,P){var U=E?"ol":"ul",ye=E&&P!==1?' start="'+P+'"':"";return"<"+U+ye+`>
`+C+"</"+U+`>
`},q.listitem=function(C){return"<li>"+C+`</li>
`},q.checkbox=function(C){return"<input "+(C?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},q.paragraph=function(C){return"<p>"+C+`</p>
`},q.table=function(C,E){return E&&(E="<tbody>"+E+"</tbody>"),`<table>
<thead>
`+C+`</thead>
`+E+`</table>
`},q.tablerow=function(C){return`<tr>
`+C+`</tr>
`},q.tablecell=function(C,E){var P=E.header?"th":"td",U=E.align?"<"+P+' align="'+E.align+'">':"<"+P+">";return U+C+"</"+P+`>
`},q.strong=function(C){return"<strong>"+C+"</strong>"},q.em=function(C){return"<em>"+C+"</em>"},q.codespan=function(C){return"<code>"+C+"</code>"},q.br=function(){return this.options.xhtml?"<br/>":"<br>"},q.del=function(C){return"<del>"+C+"</del>"},q.link=function(C,E,P){if(C=De(this.options.sanitize,this.options.baseUrl,C),C===null)return P;var U='<a href="'+Ae(C)+'"';return E&&(U+=' title="'+E+'"'),U+=">"+P+"</a>",U},q.image=function(C,E,P){if(C=De(this.options.sanitize,this.options.baseUrl,C),C===null)return P;var U='<img src="'+C+'" alt="'+P+'"';return E&&(U+=' title="'+E+'"'),U+=this.options.xhtml?"/>":">",U},q.text=function(C){return C},ae}(),Ue=function(){function ae(){}var q=ae.prototype;return q.strong=function(C){return C},q.em=function(C){return C},q.codespan=function(C){return C},q.del=function(C){return C},q.html=function(C){return C},q.text=function(C){return C},q.link=function(C,E,P){return""+P},q.image=function(C,E,P){return""+P},q.br=function(){return""},ae}(),et=function(){function ae(){this.seen={}}var q=ae.prototype;return q.slug=function(C){var E=C.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(E)){var P=E;do this.seen[P]++,E=P+"-"+this.seen[P];while(this.seen.hasOwnProperty(E))}return this.seen[E]=0,E},ae}(),Ve=O.defaults,Ze=k.unescape,Qe=function(){function ae(ie){this.options=ie||Ve,this.options.renderer=this.options.renderer||new Me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ue,this.slugger=new et}ae.parse=function(C,E){var P=new ae(E);return P.parse(C)};var q=ae.prototype;return q.parse=function(C,E){E===void 0&&(E=!0);var P="",U,ye,Oe,Je,yt,kt,Ke,wt,mt,ot,Dt,At,Vt,jt,St,mn,sn,pt,wn=C.length;for(U=0;U<wn;U++){ot=C[U];switch(ot.type){case"space":continue;case"hr":{P+=this.renderer.hr();continue}case"heading":{P+=this.renderer.heading(this.parseInline(ot.tokens),ot.depth,Ze(this.parseInline(ot.tokens,this.textRenderer)),this.slugger);continue}case"code":{P+=this.renderer.code(ot.text,ot.lang,ot.escaped);continue}case"table":{for(wt="",Ke="",Je=ot.header.length,ye=0;ye<Je;ye++)Ke+=this.renderer.tablecell(this.parseInline(ot.tokens.header[ye]),{header:!0,align:ot.align[ye]});for(wt+=this.renderer.tablerow(Ke),mt="",Je=ot.cells.length,ye=0;ye<Je;ye++){for(kt=ot.tokens.cells[ye],Ke="",yt=kt.length,Oe=0;Oe<yt;Oe++)Ke+=this.renderer.tablecell(this.parseInline(kt[Oe]),{header:!1,align:ot.align[Oe]});mt+=this.renderer.tablerow(Ke)}P+=this.renderer.table(wt,mt);continue}case"blockquote":{mt=this.parse(ot.tokens),P+=this.renderer.blockquote(mt);continue}case"list":{for(Dt=ot.ordered,At=ot.start,Vt=ot.loose,Je=ot.items.length,mt="",ye=0;ye<Je;ye++)St=ot.items[ye],mn=St.checked,sn=St.task,jt="",St.task&&(pt=this.renderer.checkbox(mn),Vt?St.tokens.length>0&&St.tokens[0].type==="text"?(St.tokens[0].text=pt+" "+St.tokens[0].text,St.tokens[0].tokens&&St.tokens[0].tokens.length>0&&St.tokens[0].tokens[0].type==="text"&&(St.tokens[0].tokens[0].text=pt+" "+St.tokens[0].tokens[0].text)):St.tokens.unshift({type:"text",text:pt}):jt+=pt),jt+=this.parse(St.tokens,Vt),mt+=this.renderer.listitem(jt,sn,mn);P+=this.renderer.list(mt,Dt,At);continue}case"html":{P+=this.renderer.html(ot.text);continue}case"paragraph":{P+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(mt=ot.tokens?this.parseInline(ot.tokens):ot.text;U+1<wn&&C[U+1].type==="text";)ot=C[++U],mt+=`
`+(ot.tokens?this.parseInline(ot.tokens):ot.text);P+=E?this.renderer.paragraph(mt):mt;continue}default:{var ln='Token with "'+ot.type+'" type was not found.';if(this.options.silent){console.error(ln);return}else throw new Error(ln)}}}return P},q.parseInline=function(C,E){E=E||this.renderer;var P="",U,ye,Oe=C.length;for(U=0;U<Oe;U++){ye=C[U];switch(ye.type){case"escape":{P+=E.text(ye.text);break}case"html":{P+=E.html(ye.text);break}case"link":{P+=E.link(ye.href,ye.title,this.parseInline(ye.tokens,E));break}case"image":{P+=E.image(ye.href,ye.title,ye.text);break}case"strong":{P+=E.strong(this.parseInline(ye.tokens,E));break}case"em":{P+=E.em(this.parseInline(ye.tokens,E));break}case"codespan":{P+=E.codespan(ye.text);break}case"br":{P+=E.br();break}case"del":{P+=E.del(this.parseInline(ye.tokens,E));break}case"text":{P+=E.text(ye.text);break}default:{var Je='Token with "'+ye.type+'" type was not found.';if(this.options.silent){console.error(Je);return}else throw new Error(Je)}}}return P},ae}(),at=k.merge,tt=k.checkSanitizeDeprecation,st=k.escape,Re=O.getDefaults,vt=O.changeDefaults,ut=O.defaults;function Be(ae,q,ie){if(typeof ae=="undefined"||ae===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ae!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ae)+", string expected");if(typeof q=="function"&&(ie=q,q=null),q=at({},Be.defaults,q||{}),tt(q),ie){var C=q.highlight,E;try{E=Te.lex(ae,q)}catch(Oe){return ie(Oe)}var P=function(Je){var yt;if(!Je)try{yt=Qe.parse(E,q)}catch(kt){Je=kt}return q.highlight=C,Je?ie(Je):ie(null,yt)};if(!C||C.length<3)return P();if(delete q.highlight,!E.length)return P();var U=0;Be.walkTokens(E,function(Oe){Oe.type==="code"&&(U++,setTimeout(function(){C(Oe.text,Oe.lang,function(Je,yt){if(Je)return P(Je);yt!=null&&yt!==Oe.text&&(Oe.text=yt,Oe.escaped=!0),U--,U===0&&P()})},0))}),U===0&&P();return}try{var ye=Te.lex(ae,q);return q.walkTokens&&Be.walkTokens(ye,q.walkTokens),Qe.parse(ye,q)}catch(Oe){if(Oe.message+=`
Please report this to https://github.com/markedjs/marked.`,q.silent)return"<p>An error occurred:</p><pre>"+st(Oe.message+"",!0)+"</pre>";throw Oe}}Be.options=Be.setOptions=function(ae){return at(Be.defaults,ae),vt(Be.defaults),Be},Be.getDefaults=Re,Be.defaults=ut,Be.use=function(ae){var q=at({},ae);if(ae.renderer&&function(){var C=Be.defaults.renderer||new Me,E=function(ye){var Oe=C[ye];C[ye]=function(){for(var Je=arguments.length,yt=new Array(Je),kt=0;kt<Je;kt++)yt[kt]=arguments[kt];var Ke=ae.renderer[ye].apply(C,yt);return Ke===!1&&(Ke=Oe.apply(C,yt)),Ke}};for(var P in ae.renderer)E(P);q.renderer=C}(),ae.tokenizer&&function(){var C=Be.defaults.tokenizer||new pe,E=function(ye){var Oe=C[ye];C[ye]=function(){for(var Je=arguments.length,yt=new Array(Je),kt=0;kt<Je;kt++)yt[kt]=arguments[kt];var Ke=ae.tokenizer[ye].apply(C,yt);return Ke===!1&&(Ke=Oe.apply(C,yt)),Ke}};for(var P in ae.tokenizer)E(P);q.tokenizer=C}(),ae.walkTokens){var ie=Be.defaults.walkTokens;q.walkTokens=function(C){ae.walkTokens(C),ie&&ie(C)}}Be.setOptions(q)},Be.walkTokens=function(ae,q){for(var ie=le(ae),C;!(C=ie()).done;){var E=C.value;q(E);switch(E.type){case"table":{for(var P=le(E.tokens.header),U;!(U=P()).done;){var ye=U.value;Be.walkTokens(ye,q)}for(var Oe=le(E.tokens.cells),Je;!(Je=Oe()).done;)for(var yt=Je.value,kt=le(yt),Ke;!(Ke=kt()).done;){var wt=Ke.value;Be.walkTokens(wt,q)}break}case"list":{Be.walkTokens(E.items,q);break}default:E.tokens&&Be.walkTokens(E.tokens,q)}}},Be.Parser=Qe,Be.parser=Qe.parse,Be.Renderer=Me,Be.TextRenderer=Ue,Be.Lexer=Te,Be.lexer=Te.lex,Be.Tokenizer=pe,Be.Slugger=et,Be.parse=Be;var Ye=Be;return Ye})},ELLl:function(nt,Ge,v){(function(H){H(v("VrN/"))})(function(H){var he={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},oe=H.Pos;H.defineOption("autoCloseBrackets",!1,function(N,J,K){K&&K!=H.Init&&(N.removeKeyMap(le),N.state.closeBrackets=null),J&&(V(_e(J,"pairs")),N.state.closeBrackets=J,N.addKeyMap(le))});function _e(N,J){return J=="pairs"&&typeof N=="string"?N:typeof N=="object"&&N[J]!=null?N[J]:he[J]}var le={Backspace:R,Enter:A};function V(N){for(var J=0;J<N.length;J++){var K=N.charAt(J),Q="'"+K+"'";le[Q]||(le[Q]=O(K))}}V(he.pairs+"`");function O(N){return function(J){return T(J,N)}}function I(N){var J=N.state.closeBrackets;if(!J||J.override)return J;var K=N.getModeAt(N.getCursor());return K.closeBrackets||J}function R(N){var J=I(N);if(!J||N.getOption("disableInput"))return H.Pass;for(var K=_e(J,"pairs"),Q=N.listSelections(),de=0;de<Q.length;de++){if(!Q[de].empty())return H.Pass;var Ne=$(N,Q[de].head);if(!Ne||K.indexOf(Ne)%2!=0)return H.Pass}for(var de=Q.length-1;de>=0;de--){var Xe=Q[de].head;N.replaceRange("",oe(Xe.line,Xe.ch-1),oe(Xe.line,Xe.ch+1),"+delete")}}function A(N){var J=I(N),K=J&&_e(J,"explode");if(!K||N.getOption("disableInput"))return H.Pass;for(var Q=N.listSelections(),de=0;de<Q.length;de++){if(!Q[de].empty())return H.Pass;var Ne=$(N,Q[de].head);if(!Ne||K.indexOf(Ne)%2!=0)return H.Pass}N.operation(function(){var Xe=N.lineSeparator()||`
`;N.replaceSelection(Xe+Xe,null),N.execCommand("goCharLeft"),Q=N.listSelections();for(var ke=0;ke<Q.length;ke++){var be=Q[ke].head.line;N.indentLine(be,null,!0),N.indentLine(be+1,null,!0)}})}function S(N){var J=H.cmpPos(N.anchor,N.head)>0;return{anchor:new oe(N.anchor.line,N.anchor.ch+(J?-1:1)),head:new oe(N.head.line,N.head.ch+(J?1:-1))}}function T(N,J){var K=I(N);if(!K||N.getOption("disableInput"))return H.Pass;var Q=_e(K,"pairs"),de=Q.indexOf(J);if(de==-1)return H.Pass;for(var Ne=_e(K,"closeBefore"),Xe=_e(K,"triples"),ke=Q.charAt(de+1)==J,be=N.listSelections(),Fe=de%2==0,me,Se=0;Se<be.length;Se++){var Pe=be[Se],xe=Pe.head,L,ue=N.getRange(xe,oe(xe.line,xe.ch+1));if(Fe&&!Pe.empty())L="surround";else if((ke||!Fe)&&ue==J)ke&&z(N,xe)?L="both":Xe.indexOf(J)>=0&&N.getRange(xe,oe(xe.line,xe.ch+3))==J+J+J?L="skipThree":L="skip";else if(ke&&xe.ch>1&&Xe.indexOf(J)>=0&&N.getRange(oe(xe.line,xe.ch-2),xe)==J+J){if(xe.ch>2&&/\bstring/.test(N.getTokenTypeAt(oe(xe.line,xe.ch-2))))return H.Pass;L="addFour"}else if(ke){var Y=xe.ch==0?" ":N.getRange(oe(xe.line,xe.ch-1),xe);if(!H.isWordChar(ue)&&Y!=J&&!H.isWordChar(Y))L="both";else return H.Pass}else if(Fe&&(ue.length===0||/\s/.test(ue)||Ne.indexOf(ue)>-1))L="both";else return H.Pass;if(!me)me=L;else if(me!=L)return H.Pass}var x=de%2?Q.charAt(de-1):J,j=de%2?J:Q.charAt(de+1);N.operation(function(){if(me=="skip")N.execCommand("goCharRight");else if(me=="skipThree")for(var D=0;D<3;D++)N.execCommand("goCharRight");else if(me=="surround"){for(var _=N.getSelections(),D=0;D<_.length;D++)_[D]=x+_[D]+j;N.replaceSelections(_,"around"),_=N.listSelections().slice();for(var D=0;D<_.length;D++)_[D]=S(_[D]);N.setSelections(_)}else me=="both"?(N.replaceSelection(x+j,null),N.triggerElectric(x+j),N.execCommand("goCharLeft")):me=="addFour"&&(N.replaceSelection(x+x+x+x,"before"),N.execCommand("goCharRight"))})}function $(N,J){var K=N.getRange(oe(J.line,J.ch-1),oe(J.line,J.ch+1));return K.length==2?K:null}function z(N,J){var K=N.getTokenAt(oe(J.line,J.ch+1));return/\bstring/.test(K.type)&&K.start==J.ch&&(J.ch==0||!/\bstring/.test(N.getTokenTypeAt(J)))}})},GfqC:function(nt,Ge,v){"use strict";var H=v("q1tI"),he=v.n(H),oe=v("TSYQ"),_e=v.n(oe);function le(k,p){var d="cannot "+k.method+" "+k.action+" "+p.status+"'",w=new Error(d);return w.status=p.status,w.method=k.method,w.url=k.action,w}function V(k){var p=k.responseText||k.response;if(!p)return p;try{return JSON.parse(p)}catch(d){return p}}function O(k){var p=new XMLHttpRequest;k.onProgress&&p.upload&&(p.upload.onprogress=function(te){te.total>0&&(te.percent=te.loaded/te.total*100),k.onProgress(te)});var d=new FormData;k.data&&Object.keys(k.data).forEach(function(F){var te=k.data[F];if(Array.isArray(te)){te.forEach(function(Ee){d.append(F+"[]",Ee)});return}d.append(F,k.data[F])}),k.file instanceof Blob?d.append(k.filename,k.file,k.file.name):d.append(k.filename,k.file),p.onerror=function(te){k.onError(te)},p.onload=function(){return p.status<200||p.status>=300?k.onError(le(k,p),V(p)):k.onSuccess(V(p),p)},p.open(k.method,k.action,!0),k.withCredentials&&"withCredentials"in p&&(p.withCredentials=!0);var w=k.headers||{};return w["X-Requested-With"]!==null&&p.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(w).forEach(function(F){w[F]!==null&&p.setRequestHeader(F,w[F])}),p.send(d),{abort:function(){p.abort()}}}var I=+new Date,R=0;function A(){return"rc-upload-"+I+"-"+ ++R}function S(k,p){return k.indexOf(p,k.length-p.length)!==-1}var T=function(k,p){if(k&&p){var d=Array.isArray(p)?p:p.split(","),w=k.name||"",F=k.type||"",te=F.replace(/\/.*$/,"");return d.some(function(Ee){var Le=Ee.trim();return Le.charAt(0)==="."?S(w.toLowerCase(),Le.toLowerCase()):/\/\*$/.test(Le)?te===Le.replace(/\/.*$/,""):F===Le})}return!0};function $(k,p){var d=k.createReader(),w=[];function F(){d.readEntries(function(te){var Ee=Array.prototype.slice.apply(te);w=w.concat(Ee);var Le=!Ee.length;Le?p(w):F()})}F()}var z=function(p,d,w){var F=function te(Ee,Le){Le=Le||"",Ee.isFile?Ee.file(function(pe){w(pe)&&(Ee.fullPath&&!pe.webkitRelativePath&&(Object.defineProperties(pe,{webkitRelativePath:{writable:!0}}),pe.webkitRelativePath=Ee.fullPath.replace(/^\//,""),Object.defineProperties(pe,{webkitRelativePath:{writable:!1}})),d([pe]))}):Ee.isDirectory&&$(Ee,function(pe){pe.forEach(function(fe){te(fe,""+Le+Ee.name+"/")})})};p.forEach(function(te){F(te.webkitGetAsEntry())})},N=z,J=Object.assign||function(k){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var w in d)Object.prototype.hasOwnProperty.call(d,w)&&(k[w]=d[w])}return k},K=function(){function k(p,d){var w=[],F=!0,te=!1,Ee=void 0;try{for(var Le=p[Symbol.iterator](),pe;!(F=(pe=Le.next()).done)&&!(w.push(pe.value),d&&w.length===d);F=!0);}catch(fe){te=!0,Ee=fe}finally{try{!F&&Le.return&&Le.return()}finally{if(te)throw Ee}}return w}return function(p,d){if(Array.isArray(p))return p;if(Symbol.iterator in Object(p))return k(p,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Q=function(){function k(p,d){for(var w=0;w<d.length;w++){var F=d[w];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}return function(p,d,w){return d&&k(p.prototype,d),w&&k(p,w),p}}();function de(k,p,d){return p in k?Object.defineProperty(k,p,{value:d,enumerable:!0,configurable:!0,writable:!0}):k[p]=d,k}function Ne(k,p){var d={};for(var w in k){if(p.indexOf(w)>=0)continue;if(!Object.prototype.hasOwnProperty.call(k,w))continue;d[w]=k[w]}return d}function Xe(k,p){if(!(k instanceof p))throw new TypeError("Cannot call a class as a function")}function ke(k,p){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:k}function be(k,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);k.prototype=Object.create(p&&p.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(k,p):k.__proto__=p)}var Fe=function(p){return Object.keys(p).reduce(function(d,w){return(w.substr(0,5)==="data-"||w.substr(0,5)==="aria-"||w==="role")&&(d[w]=p[w]),d},{})},me=function(k){be(p,k);function p(){var d,w,F,te;Xe(this,p);for(var Ee=arguments.length,Le=Array(Ee),pe=0;pe<Ee;pe++)Le[pe]=arguments[pe];return te=(w=(F=ke(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Le))),F),F.state={uid:A()},F.reqs={},F.onChange=function(fe){var re=fe.target.files;F.uploadFiles(re),F.reset()},F.onClick=function(fe){var re=F.fileInput;if(!re)return;var se=F.props,ee=se.children,B=se.onClick;ee&&ee.type==="button"&&(re.parentNode.focus(),re.parentNode.querySelector("button").blur()),re.click(),B&&B(fe)},F.onKeyDown=function(fe){fe.key==="Enter"&&F.onClick()},F.onFileDrop=function(fe){var re=F.props.multiple;if(fe.preventDefault(),fe.type==="dragover")return;if(F.props.directory)N(Array.prototype.slice.call(fe.dataTransfer.items),F.uploadFiles,function(ee){return T(ee,F.props.accept)});else{var se=Array.prototype.slice.call(fe.dataTransfer.files).filter(function(ee){return T(ee,F.props.accept)});re===!1&&(se=se.slice(0,1)),F.uploadFiles(se)}},F.uploadFiles=function(fe){var re=Array.prototype.slice.call(fe);re.map(function(se){return se.uid=A(),se}).forEach(function(se){F.upload(se,re)})},F.saveFileInput=function(fe){F.fileInput=fe},w),ke(F,te)}return Q(p,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(w,F){var te=this,Ee=this.props;if(!Ee.beforeUpload)return setTimeout(function(){return te.post(w)},0);var Le=Ee.beforeUpload(w,F);Le&&Le.then?Le.then(function(pe){var fe=Object.prototype.toString.call(pe);return fe==="[object File]"||fe==="[object Blob]"?te.post(pe):te.post(w)}).catch(function(pe){console.log(pe)}):Le!==!1&&setTimeout(function(){return te.post(w)},0);return}},{key:"post",value:function(w){var F=this;if(!this._isMounted)return;var te=this.props,Ee=te.onStart,Le=te.onProgress,pe=te.transformFile,fe=pe===void 0?function(re){return re}:pe;new Promise(function(re){var se=te.action;return typeof se=="function"&&(se=se(w)),re(se)}).then(function(re){var se=w.uid,ee=te.customRequest||O,B=Promise.resolve(fe(w)).then(function(b){var G=te.data;return typeof G=="function"&&(G=G(b)),Promise.all([b,G])}).catch(function(b){console.error(b)});B.then(function(b){var G=K(b,2),M=G[0],ge=G[1],we={action:re,filename:te.name,data:ge,file:M,headers:te.headers,withCredentials:te.withCredentials,method:te.method||"post",onProgress:Le?function(ne){Le(ne,w)}:null,onSuccess:function(Te,Ie){delete F.reqs[se],te.onSuccess(Te,w,Ie)},onError:function(Te,Ie){delete F.reqs[se],te.onError(Te,Ie,w)}};Ee(w),F.reqs[se]=ee(we)})})}},{key:"reset",value:function(){this.setState({uid:A()})}},{key:"abort",value:function(w){var F=this.reqs;if(w){var te=w;w&&w.uid&&(te=w.uid),F[te]&&F[te].abort&&F[te].abort(),delete F[te]}else Object.keys(F).forEach(function(Ee){F[Ee]&&F[Ee].abort&&F[Ee].abort(),delete F[Ee]})}},{key:"render",value:function(){var w,F=this.props,te=F.component,Ee=F.prefixCls,Le=F.className,pe=F.disabled,fe=F.id,re=F.style,se=F.multiple,ee=F.accept,B=F.children,b=F.directory,G=F.openFileDialogOnClick,M=F.onMouseEnter,ge=F.onMouseLeave,we=Ne(F,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),ne=_e()((w={},de(w,Ee,!0),de(w,Ee+"-disabled",pe),de(w,Le,Le),w)),Te=pe?{}:{onClick:G?this.onClick:function(){},onKeyDown:G?this.onKeyDown:function(){},onMouseEnter:M,onMouseLeave:ge,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return he.a.createElement(te,J({},Te,{className:ne,role:"button",style:re}),he.a.createElement("input",J({},Fe(we),{id:fe,type:"file",ref:this.saveFileInput,onClick:function(De){return De.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ee,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:se,onChange:this.onChange})),B)}}]),p}(H.Component),Se=me,Pe=Object.assign||function(k){for(var p=1;p<arguments.length;p++){var d=arguments[p];for(var w in d)Object.prototype.hasOwnProperty.call(d,w)&&(k[w]=d[w])}return k},xe=function(){function k(p,d){for(var w=0;w<d.length;w++){var F=d[w];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(p,F.key,F)}}return function(p,d,w){return d&&k(p.prototype,d),w&&k(p,w),p}}();function L(k,p){if(!(k instanceof p))throw new TypeError("Cannot call a class as a function")}function ue(k,p){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:k}function Y(k,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);k.prototype=Object.create(p&&p.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(k,p):k.__proto__=p)}function x(){}var j=function(k){Y(p,k);function p(){var d,w,F,te;L(this,p);for(var Ee=arguments.length,Le=Array(Ee),pe=0;pe<Ee;pe++)Le[pe]=arguments[pe];return te=(w=(F=ue(this,(d=p.__proto__||Object.getPrototypeOf(p)).call.apply(d,[this].concat(Le))),F),F.saveUploader=function(fe){F.uploader=fe},w),ue(F,te)}return xe(p,[{key:"abort",value:function(w){this.uploader.abort(w)}},{key:"render",value:function(){return he.a.createElement(Se,Pe({},this.props,{ref:this.saveUploader}))}}]),p}(H.Component);j.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:x,onError:x,onSuccess:x,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var D=j,_=Ge.a=D},Gytx:function(nt,Ge){nt.exports=function(H,he,oe,_e){var le=oe?oe.call(_e,H,he):void 0;if(le!==void 0)return!!le;if(H===he)return!0;if(typeof H!="object"||!H||typeof he!="object"||!he)return!1;var V=Object.keys(H),O=Object.keys(he);if(V.length!==O.length)return!1;for(var I=Object.prototype.hasOwnProperty.bind(he),R=0;R<V.length;R++){var A=V[R];if(!I(A))return!1;var S=H[A],T=he[A];if(le=oe?oe.call(_e,S,T,A):void 0,le===!1||le===void 0&&S!==T)return!1}return!0}},H38U:function(nt,Ge,v){var H=v("f4xo"),he=v("rcnY"),oe=v("wU8J"),_e=v("Iq15"),le=v("dWSS");function V(I,R){this.typeNumber=I,this.errorCorrectLevel=R,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var O=V.prototype;O.addData=function(I){var R=new H(I);this.dataList.push(R),this.dataCache=null},O.isDark=function(I,R){if(I<0||this.moduleCount<=I||R<0||this.moduleCount<=R)throw new Error(I+","+R);return this.modules[I][R]},O.getModuleCount=function(){return this.moduleCount},O.make=function(){if(this.typeNumber<1){var I=1;for(I=1;I<40;I++){for(var R=he.getRSBlocks(I,this.errorCorrectLevel),A=new oe,S=0,T=0;T<R.length;T++)S+=R[T].dataCount;for(var T=0;T<this.dataList.length;T++){var $=this.dataList[T];A.put($.mode,4),A.put($.getLength(),_e.getLengthInBits($.mode,I)),$.write(A)}if(A.getLengthInBits()<=S*8)break}this.typeNumber=I}this.makeImpl(!1,this.getBestMaskPattern())},O.makeImpl=function(I,R){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var A=0;A<this.moduleCount;A++){this.modules[A]=new Array(this.moduleCount);for(var S=0;S<this.moduleCount;S++)this.modules[A][S]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(I,R),this.typeNumber>=7&&this.setupTypeNumber(I),this.dataCache==null&&(this.dataCache=V.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,R)},O.setupPositionProbePattern=function(I,R){for(var A=-1;A<=7;A++){if(I+A<=-1||this.moduleCount<=I+A)continue;for(var S=-1;S<=7;S++){if(R+S<=-1||this.moduleCount<=R+S)continue;0<=A&&A<=6&&(S==0||S==6)||0<=S&&S<=6&&(A==0||A==6)||2<=A&&A<=4&&2<=S&&S<=4?this.modules[I+A][R+S]=!0:this.modules[I+A][R+S]=!1}}},O.getBestMaskPattern=function(){for(var I=0,R=0,A=0;A<8;A++){this.makeImpl(!0,A);var S=_e.getLostPoint(this);(A==0||I>S)&&(I=S,R=A)}return R},O.createMovieClip=function(I,R,A){var S=I.createEmptyMovieClip(R,A),T=1;this.make();for(var $=0;$<this.modules.length;$++)for(var z=$*T,N=0;N<this.modules[$].length;N++){var J=N*T,K=this.modules[$][N];K&&(S.beginFill(0,100),S.moveTo(J,z),S.lineTo(J+T,z),S.lineTo(J+T,z+T),S.lineTo(J,z+T),S.endFill())}return S},O.setupTimingPattern=function(){for(var I=8;I<this.moduleCount-8;I++){if(this.modules[I][6]!=null)continue;this.modules[I][6]=I%2==0}for(var R=8;R<this.moduleCount-8;R++){if(this.modules[6][R]!=null)continue;this.modules[6][R]=R%2==0}},O.setupPositionAdjustPattern=function(){for(var I=_e.getPatternPosition(this.typeNumber),R=0;R<I.length;R++)for(var A=0;A<I.length;A++){var S=I[R],T=I[A];if(this.modules[S][T]!=null)continue;for(var $=-2;$<=2;$++)for(var z=-2;z<=2;z++)$==-2||$==2||z==-2||z==2||$==0&&z==0?this.modules[S+$][T+z]=!0:this.modules[S+$][T+z]=!1}},O.setupTypeNumber=function(I){for(var R=_e.getBCHTypeNumber(this.typeNumber),A=0;A<18;A++){var S=!I&&(R>>A&1)==1;this.modules[Math.floor(A/3)][A%3+this.moduleCount-8-3]=S}for(var A=0;A<18;A++){var S=!I&&(R>>A&1)==1;this.modules[A%3+this.moduleCount-8-3][Math.floor(A/3)]=S}},O.setupTypeInfo=function(I,R){for(var A=this.errorCorrectLevel<<3|R,S=_e.getBCHTypeInfo(A),T=0;T<15;T++){var $=!I&&(S>>T&1)==1;T<6?this.modules[T][8]=$:T<8?this.modules[T+1][8]=$:this.modules[this.moduleCount-15+T][8]=$}for(var T=0;T<15;T++){var $=!I&&(S>>T&1)==1;T<8?this.modules[8][this.moduleCount-T-1]=$:T<9?this.modules[8][15-T-1+1]=$:this.modules[8][15-T-1]=$}this.modules[this.moduleCount-8][8]=!I},O.mapData=function(I,R){for(var A=-1,S=this.moduleCount-1,T=7,$=0,z=this.moduleCount-1;z>0;z-=2)for(z==6&&z--;;){for(var N=0;N<2;N++)if(this.modules[S][z-N]==null){var J=!1;$<I.length&&(J=(I[$]>>>T&1)==1);var K=_e.getMask(R,S,z-N);K&&(J=!J),this.modules[S][z-N]=J,T--,T==-1&&($++,T=7)}if(S+=A,S<0||this.moduleCount<=S){S-=A,A=-A;break}}},V.PAD0=236,V.PAD1=17,V.createData=function(I,R,A){for(var S=he.getRSBlocks(I,R),T=new oe,$=0;$<A.length;$++){var z=A[$];T.put(z.mode,4),T.put(z.getLength(),_e.getLengthInBits(z.mode,I)),z.write(T)}for(var N=0,$=0;$<S.length;$++)N+=S[$].dataCount;if(T.getLengthInBits()>N*8)throw new Error("code length overflow. ("+T.getLengthInBits()+">"+N*8+")");for(T.getLengthInBits()+4<=N*8&&T.put(0,4);T.getLengthInBits()%8!=0;)T.putBit(!1);for(;!(T.getLengthInBits()>=N*8);){if(T.put(V.PAD0,8),T.getLengthInBits()>=N*8)break;T.put(V.PAD1,8)}return V.createBytes(T,S)},V.createBytes=function(I,R){for(var A=0,S=0,T=0,$=new Array(R.length),z=new Array(R.length),N=0;N<R.length;N++){var J=R[N].dataCount,K=R[N].totalCount-J;S=Math.max(S,J),T=Math.max(T,K),$[N]=new Array(J);for(var Q=0;Q<$[N].length;Q++)$[N][Q]=255&I.buffer[Q+A];A+=J;var de=_e.getErrorCorrectPolynomial(K),Ne=new le($[N],de.getLength()-1),Xe=Ne.mod(de);z[N]=new Array(de.getLength()-1);for(var Q=0;Q<z[N].length;Q++){var ke=Q+Xe.getLength()-z[N].length;z[N][Q]=ke>=0?Xe.get(ke):0}}for(var be=0,Q=0;Q<R.length;Q++)be+=R[Q].totalCount;for(var Fe=new Array(be),me=0,Q=0;Q<S;Q++)for(var N=0;N<R.length;N++)Q<$[N].length&&(Fe[me++]=$[N][Q]);for(var Q=0;Q<T;Q++)for(var N=0;N<R.length;N++)Q<z[N].length&&(Fe[me++]=z[N][Q]);return Fe},nt.exports=V},HmJG:function(nt,Ge,v){},IE1O:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return Fe});var H=v("2qtc"),he=v("kLXV"),oe=v("DZo9"),_e=v("8z0m"),le=v("+L6B"),V=v("2/Rp"),O=v("5NDa"),I=v("5rEg"),R=v("miYZ"),A=v("tsqr"),S=v("9og8"),T=v("y8nQ"),$=v("Vl3Y"),z=v("tJVT"),N=v("WmNS"),J=v.n(N),K=v("q1tI"),Q=v.n(K),de=v("KeLC"),Ne=v.n(de),Xe=v("m3rI"),ke=v("jN4g"),be=function(Se){var Pe,xe,L,ue,Y=Se.visible,x=Se.onOk,j=Se.onCancel,D=Se.title,_=D===void 0?"\u9009\u62E9\u8BA4\u8BC1\u56E2\u961F\u6559\u5E08":D,k=$.a.useForm(),p=Object(z.a)(k,1),d=p[0],w=Object(K.useState)(!1),F=Object(z.a)(w,2),te=F[0],Ee=F[1],Le=Object(K.useState)([]),pe=Object(z.a)(Le,2),fe=pe[0],re=pe[1],se=Object(K.useState)([]),ee=Object(z.a)(se,2),B=ee[0],b=ee[1],G=Object(K.useState)(!1),M=Object(z.a)(G,2),ge=M[0],we=M[1];Object(K.useEffect)(function(){if(Y!=null&&Y.name){var et,Ve,Ze,Qe;d.setFieldsValue({name:Y==null?void 0:Y.name});var at=Y!=null&&(et=Y.cover_url)!==null&&et!==void 0&&et.includes("attachments")?[{response:{id:Y==null||((Ve=Y.cover_url)===null||Ve===void 0)?void 0:Ve.split("/")[3]}}]:[],tt=Y!=null&&(Ze=Y.backbground_image_url)!==null&&Ze!==void 0&&Ze.includes("attachments")?[{response:{id:Y==null||((Qe=Y.backbground_image_url)===null||Qe===void 0)?void 0:Qe.split("/")[3]}}]:[];re(at),b(tt)}},[Y]);var ne=function(){d.submit()},Te=function(){j()},Ie=function(){var et=Object(S.a)(J.a.mark(function Ve(Ze){var Qe,at,tt,st,Re;return J.a.wrap(function(ut){for(;;)switch(ut.prev=ut.next){case 0:Ee(!0),console.log(fe,B,3333),Re={name:Ze==null?void 0:Ze.name,cover_id:(fe==null||((Qe=fe[0])===null||Qe===void 0||((at=Qe.response)===null||at===void 0))?void 0:at.id)||"",backbground_image_id:(B==null||((tt=B[0])===null||tt===void 0||((st=tt.response)===null||st===void 0))?void 0:st.id)||""},x(Re);case 4:case"end":return ut.stop()}},Ve)}));return function(Ze){return et.apply(this,arguments)}}(),De=function(Ve,Ze){var Qe=["uploading","done","removed"];Qe.includes(Ve.file.status)&&(Ve.file.status==="uploading"&&we(!0),Ve.file.status==="done"&&we(!1),Ze===1?re(Ve.fileList):b(Ve.fileList))},Ae=function(Ve,Ze){Ze===1?re([]):b([])},Me=function(Ve,Ze){var Qe=Ve.type==="image/jpeg"||Ve.type==="image/png";if(!Qe)return A.b.error("\u8BF7\u4E0A\u4F20jpg\u6216png\u7684\u56FE\u7247!"),!1;var at=Ve.size/1024/1024>2;return at?(A.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E2MB"),!1):(Ze===1?re([]):b([]),!0)},Ue=function(Ve){var Ze,Qe,at,tt;return Q.a.createElement("div",{className:Ne.a.img},Q.a.createElement("img",{src:Xe.a.API_SERVER+"/api/attachments/"+(Ve===1?fe==null||((Ze=fe[0])===null||Ze===void 0||((Qe=Ze.response)===null||Qe===void 0))?void 0:Qe.id:B==null||((at=B[0])===null||at===void 0||((tt=at.response)===null||tt===void 0))?void 0:tt.id),alt:"avatar",style:{width:"100%"}}),Q.a.createElement("div",null,Q.a.createElement(ke.a,{onClick:function(){Ve===1?re([]):b([])},style:{fontSize:"16px",color:"red"}})))};return Q.a.createElement(he.a,{title:_,visible:Y,onOk:ne,centered:!0,onCancel:Te,confirmLoading:te,okButtonProps:{disabled:ge},width:686,afterClose:function(){Ee(!1),re([]),b([]),d.resetFields()},okText:Y!=null&&Y.name?"\u786E\u8BA4":"\u786E\u8BA4\u65B0\u5EFA",cancelText:"\u53D6\u6D88"},Q.a.createElement($.a,{form:d,colon:!1,onFinish:Ie,labelCol:{span:4},wrapperCol:{span:18},className:Ne.a.form},Q.a.createElement($.a.Item,{label:"\u793E\u533A\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"},{whitespace:!0,message:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"},{max:60,message:"\u53EA\u80FD\u8F93\u516560\u4E2A\u5B57\u7B26"}]},Q.a.createElement(I.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"})),Q.a.createElement($.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",valuePropName:"fileList"},Q.a.createElement("div",{className:Ne.a.upload},fe!=null&&(Pe=fe[0])!==null&&Pe!==void 0&&(xe=Pe.response)!==null&&xe!==void 0&&xe.id?Ue(1):Q.a.createElement(_e.a,{fileList:fe,action:"".concat(Xe.a.API_SERVER,"/api/attachments.json"),onChange:function(Ve){return De(Ve,1)},onRemove:function(Ve){return Ae(Ve,1)},beforeUpload:function(Ve){return Me(Ve,1)},withCredentials:!0,accept:"image/*"},Q.a.createElement(V.a,null,Q.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Q.a.createElement("aside",null,"\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528278*225\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"))),Q.a.createElement($.a.Item,{name:"backbground_image_id",label:"\u8BE6\u60C5\u9876\u90E8\u80CC\u666F",valuePropName:"fileList"},Q.a.createElement("div",{className:Ne.a.upload},B!=null&&(L=B[0])!==null&&L!==void 0&&(ue=L.response)!==null&&ue!==void 0&&ue.id?Ue(2):Q.a.createElement(_e.a,{fileList:B,action:"".concat(Xe.a.API_SERVER,"/api/attachments.json"),onChange:function(Ve){return De(Ve,2)},onRemove:function(Ve){return Ae(Ve,2)},beforeUpload:function(Ve){return Me(Ve,2)},withCredentials:!0,accept:"image/*"},Q.a.createElement(V.a,null,Q.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Q.a.createElement("aside",null,"\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u75281920*220\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002")))))},Fe=function(Se){var Pe,xe,L,ue,Y=Se.data,x=Se.onOk,j=$.a.useForm(),D=Object(z.a)(j,1),_=D[0],k=Object(K.useState)(!1),p=Object(z.a)(k,2),d=p[0],w=p[1],F=Object(K.useState)([]),te=Object(z.a)(F,2),Ee=te[0],Le=te[1],pe=Object(K.useState)([]),fe=Object(z.a)(pe,2),re=fe[0],se=fe[1],ee=Object(K.useState)(!1),B=Object(z.a)(ee,2),b=B[0],G=B[1];Object(K.useEffect)(function(){if(Y!=null&&Y.name){var De,Ae,Me,Ue;_.setFieldsValue({name:Y==null?void 0:Y.name});var et=Y!=null&&(De=Y.cover_url)!==null&&De!==void 0&&De.includes("attachments")?[{response:{id:Y==null||((Ae=Y.cover_url)===null||Ae===void 0)?void 0:Ae.split("/")[3]}}]:[],Ve=Y!=null&&(Me=Y.backbground_image_url)!==null&&Me!==void 0&&Me.includes("attachments")?[{response:{id:Y==null||((Ue=Y.backbground_image_url)===null||Ue===void 0)?void 0:Ue.split("/")[3]}}]:[];Le(et),se(Ve)}},[Y]);var M=function(){_.submit()},ge=function(){var De=Object(S.a)(J.a.mark(function Ae(Me){var Ue,et,Ve,Ze,Qe;return J.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:w(!0),Qe={name:Me==null?void 0:Me.name,cover_id:(Ee==null||((Ue=Ee[0])===null||Ue===void 0||((et=Ue.response)===null||et===void 0))?void 0:et.id)||"",backbground_image_id:(re==null||((Ve=re[0])===null||Ve===void 0||((Ze=Ve.response)===null||Ze===void 0))?void 0:Ze.id)||""},x(Qe,function(){w(!1)});case 3:case"end":return tt.stop()}},Ae)}));return function(Me){return De.apply(this,arguments)}}(),we=function(Ae,Me){var Ue=["uploading","done","removed"];Ue.includes(Ae.file.status)&&(Ae.file.status==="uploading"&&G(!0),Ae.file.status==="done"&&G(!1),Me===1?Le(Ae.fileList):se(Ae.fileList))},ne=function(Ae,Me){Me===1?Le([]):se([])},Te=function(Ae,Me){var Ue=Ae.type==="image/jpeg"||Ae.type==="image/png";if(!Ue)return A.b.error("\u8BF7\u4E0A\u4F20jpg\u6216png\u7684\u56FE\u7247!"),!1;var et=Ae.size/1024/1024>2;return et?(A.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E2MB"),!1):(Me===1?Le([]):se([]),!0)},Ie=function(Ae){var Me,Ue,et,Ve;return Q.a.createElement("div",{className:Ne.a.img},Q.a.createElement("img",{src:Xe.a.API_SERVER+"/api/attachments/"+(Ae===1?Ee==null||((Me=Ee[0])===null||Me===void 0||((Ue=Me.response)===null||Ue===void 0))?void 0:Ue.id:re==null||((et=re[0])===null||et===void 0||((Ve=et.response)===null||Ve===void 0))?void 0:Ve.id),alt:"avatar",style:{width:"100%"}}),Q.a.createElement("div",null,Q.a.createElement(ke.a,{onClick:function(){Ae===1?Le([]):se([])},style:{fontSize:"16px",color:"red"}})))};return Q.a.createElement($.a,{form:_,colon:!1,onFinish:ge,labelCol:{span:3},wrapperCol:{span:19},className:Ne.a.form},Q.a.createElement($.a.Item,{label:"\u793E\u533A\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"},{whitespace:!0,message:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"},{max:60,message:"\u53EA\u80FD\u8F93\u516560\u4E2A\u5B57\u7B26"}]},Q.a.createElement(I.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"})),Q.a.createElement($.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",valuePropName:"fileList"},Q.a.createElement("div",{className:Ne.a.upload},Ee!=null&&(Pe=Ee[0])!==null&&Pe!==void 0&&(xe=Pe.response)!==null&&xe!==void 0&&xe.id?Ie(1):Q.a.createElement(_e.a,{fileList:Ee,action:"".concat(Xe.a.API_SERVER,"/api/attachments.json"),onChange:function(Ae){return we(Ae,1)},onRemove:function(Ae){return ne(Ae,1)},beforeUpload:function(Ae){return Te(Ae,1)},withCredentials:!0,accept:"image/*"},Q.a.createElement(V.a,null,Q.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Q.a.createElement("aside",null,"\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u7528278*225\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"))),Q.a.createElement($.a.Item,{name:"backbground_image_id",label:"\u8BE6\u60C5\u9876\u90E8\u80CC\u666F",valuePropName:"fileList"},Q.a.createElement("div",{className:Ne.a.upload},re!=null&&(L=re[0])!==null&&L!==void 0&&(ue=L.response)!==null&&ue!==void 0&&ue.id?Ie(2):Q.a.createElement(_e.a,{fileList:re,action:"".concat(Xe.a.API_SERVER,"/api/attachments.json"),onChange:function(Ae){return we(Ae,2)},onRemove:function(Ae){return ne(Ae,2)},beforeUpload:function(Ae){return Te(Ae,2)},withCredentials:!0,accept:"image/*"},Q.a.createElement(V.a,null,Q.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Q.a.createElement("aside",null,"\u4EC5\u652F\u6301\u4E0A\u4F20jpg/png\u7B49\u683C\u5F0F\u6587\u4EF6\uFF0C\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC72M,\u5EFA\u8BAE\u4F7F\u75281920*220\u50CF\u7D20\uFF1B\u5982\u4E0D\u4E0A\u4F20\uFF0C\u9ED8\u8BA4\u4F7F\u7528\u7CFB\u7EDF\u56FE\u7247\u3002"))),Q.a.createElement(V.a,{disabled:b,loading:d,type:"primary",onClick:M,style:{marginLeft:120}},"\u786E\u8BA4"))};Ge.b=be},Iq15:function(nt,Ge,v){var H=v("nVVt"),he=v("dWSS"),oe=v("dQei"),_e={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},le={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(V){for(var O=V<<10;le.getBCHDigit(O)-le.getBCHDigit(le.G15)>=0;)O^=le.G15<<le.getBCHDigit(O)-le.getBCHDigit(le.G15);return(V<<10|O)^le.G15_MASK},getBCHTypeNumber:function(V){for(var O=V<<12;le.getBCHDigit(O)-le.getBCHDigit(le.G18)>=0;)O^=le.G18<<le.getBCHDigit(O)-le.getBCHDigit(le.G18);return V<<12|O},getBCHDigit:function(V){for(var O=0;V!=0;)O++,V>>>=1;return O},getPatternPosition:function(V){return le.PATTERN_POSITION_TABLE[V-1]},getMask:function(V,O,I){switch(V){case _e.PATTERN000:return(O+I)%2==0;case _e.PATTERN001:return O%2==0;case _e.PATTERN010:return I%3==0;case _e.PATTERN011:return(O+I)%3==0;case _e.PATTERN100:return(Math.floor(O/2)+Math.floor(I/3))%2==0;case _e.PATTERN101:return O*I%2+O*I%3==0;case _e.PATTERN110:return(O*I%2+O*I%3)%2==0;case _e.PATTERN111:return(O*I%3+(O+I)%2)%2==0;default:throw new Error("bad maskPattern:"+V)}},getErrorCorrectPolynomial:function(V){for(var O=new he([1],0),I=0;I<V;I++)O=O.multiply(new he([1,oe.gexp(I)],0));return O},getLengthInBits:function(V,O){if(1<=O&&O<10)switch(V){case H.MODE_NUMBER:return 10;case H.MODE_ALPHA_NUM:return 9;case H.MODE_8BIT_BYTE:return 8;case H.MODE_KANJI:return 8;default:throw new Error("mode:"+V)}else if(O<27)switch(V){case H.MODE_NUMBER:return 12;case H.MODE_ALPHA_NUM:return 11;case H.MODE_8BIT_BYTE:return 16;case H.MODE_KANJI:return 10;default:throw new Error("mode:"+V)}else if(O<41)switch(V){case H.MODE_NUMBER:return 14;case H.MODE_ALPHA_NUM:return 13;case H.MODE_8BIT_BYTE:return 16;case H.MODE_KANJI:return 12;default:throw new Error("mode:"+V)}else throw new Error("type:"+O)},getLostPoint:function(V){for(var O=V.getModuleCount(),I=0,R=0;R<O;R++)for(var A=0;A<O;A++){for(var S=0,T=V.isDark(R,A),$=-1;$<=1;$++){if(R+$<0||O<=R+$)continue;for(var z=-1;z<=1;z++){if(A+z<0||O<=A+z)continue;if($==0&&z==0)continue;T==V.isDark(R+$,A+z)&&S++}}S>5&&(I+=3+S-5)}for(var R=0;R<O-1;R++)for(var A=0;A<O-1;A++){var N=0;V.isDark(R,A)&&N++,V.isDark(R+1,A)&&N++,V.isDark(R,A+1)&&N++,V.isDark(R+1,A+1)&&N++,(N==0||N==4)&&(I+=3)}for(var R=0;R<O;R++)for(var A=0;A<O-6;A++)V.isDark(R,A)&&!V.isDark(R,A+1)&&V.isDark(R,A+2)&&V.isDark(R,A+3)&&V.isDark(R,A+4)&&!V.isDark(R,A+5)&&V.isDark(R,A+6)&&(I+=40);for(var A=0;A<O;A++)for(var R=0;R<O-6;R++)V.isDark(R,A)&&!V.isDark(R+1,A)&&V.isDark(R+2,A)&&V.isDark(R+3,A)&&V.isDark(R+4,A)&&!V.isDark(R+5,A)&&V.isDark(R+6,A)&&(I+=40);for(var J=0,A=0;A<O;A++)for(var R=0;R<O;R++)V.isDark(R,A)&&J++;var K=Math.abs(100*J/O/O-50)/5;return I+=K*10,I}};nt.exports=le},KeLC:function(nt,Ge,v){nt.exports={flex_box_center:"flex_box_center___WC8D3",flex_space_between:"flex_space_between___1oJuS",flex_box_vertical_center:"flex_box_vertical_center___wHVAB",flex_box_center_end:"flex_box_center_end___2rX0l",flex_box_column:"flex_box_column___Iu_rf",form:"form___RRVwq",upload:"upload___2PzlY",img:"img___qC8f0"}},LdHM:function(nt,Ge,v){"use strict";v.d(Ge,"b",function(){return Ne}),v.d(Ge,"a",function(){return ke});var H=v("1OyB"),he=v("vuIU"),oe=v("Ji7U"),_e=v("LK+K"),le=v("q1tI"),V=v("rePB"),O=v("Ff2n"),I=v("ODXe"),R=v("4IlW"),A=v("bX4T"),S=v("YrtM"),T=v("TSYQ"),$=v.n(T),z=v("+nKL"),N=v("8OUc"),J=function(w,F){var te=w.prefixCls,Ee=w.id,Le=w.flattenOptions,pe=w.childrenAsData,fe=w.values,re=w.searchValue,se=w.multiple,ee=w.defaultActiveFirstOption,B=w.height,b=w.itemHeight,G=w.notFoundContent,M=w.open,ge=w.menuItemSelectedIcon,we=w.virtual,ne=w.onSelect,Te=w.onToggleOpen,Ie=w.onActiveValue,De=w.onScroll,Ae=w.onMouseEnter,Me="".concat(te,"-item"),Ue=Object(S.a)(function(){return Le},[M,Le],function(Ye,ae){return ae[0]&&Ye[1]!==ae[1]}),et=le.useRef(null),Ve=function(ae){ae.preventDefault()},Ze=function(ae){et.current&&et.current.scrollTo({index:ae})},Qe=function(ae){for(var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ie=Ue.length,C=0;C<ie;C+=1){var E=(ae+C*q+ie)%ie,P=Ue[E],U=P.group,ye=P.data;if(!U&&!ye.disabled)return E}return-1},at=le.useState(function(){return Qe(0)}),tt=Object(I.a)(at,2),st=tt[0],Re=tt[1],vt=function(ae){Re(ae);var q=Ue[ae];if(!q){Ie(null,-1);return}Ie(q.data.value,ae)};le.useEffect(function(){vt(ee!==!1?Qe(0):-1)},[Ue.length,re]),le.useEffect(function(){var Ye=setTimeout(function(){if(!se&&M&&fe.size===1){var ae=Array.from(fe)[0],q=Ue.findIndex(function(ie){var C=ie.data;return C.value===ae});vt(q),Ze(q)}});return function(){return clearTimeout(Ye)}},[M]);var ut=function(ae){ae!==void 0&&ne(ae,{selected:!fe.has(ae)}),se||Te(!1)};if(le.useImperativeHandle(F,function(){return{onKeyDown:function(ae){var q=ae.which;switch(q){case R.a.UP:case R.a.DOWN:{var ie=0;if(q===R.a.UP?ie=-1:q===R.a.DOWN&&(ie=1),ie!==0){var C=Qe(st+ie,ie);Ze(C),vt(C)}break}case R.a.ENTER:{var E=Ue[st];E&&!E.data.disabled?ut(E.data.value):ut(void 0),M&&ae.preventDefault();break}case R.a.ESC:Te(!1)}},onKeyUp:function(){},scrollTo:function(ae){Ze(ae)}}}),Ue.length===0)return le.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),className:"".concat(Me,"-empty"),onMouseDown:Ve},G);function Be(Ye){var ae=Ue[Ye];if(!ae)return null;var q=ae.data||{},ie=q.value,C=q.label,E=q.children,P=Object(A.a)(q,!0),U=pe?E:C;return ae?le.createElement("div",Object.assign({"aria-label":typeof U=="string"?U:null},P,{key:Ye,role:"option",id:"".concat(Ee,"_list_").concat(Ye),"aria-selected":fe.has(ie)}),ie):null}return le.createElement(le.Fragment,null,le.createElement("div",{role:"listbox",id:"".concat(Ee,"_list"),style:{height:0,width:0,overflow:"hidden"}},Be(st-1),Be(st),Be(st+1)),le.createElement(z.a,{itemKey:"key",ref:et,data:Ue,height:B,itemHeight:b,fullHeight:!1,onMouseDown:Ve,onScroll:De,virtual:we,onMouseEnter:Ae},function(Ye,ae){var q,ie=Ye.group,C=Ye.groupOption,E=Ye.data,P=E.label,U=E.key;if(ie)return le.createElement("div",{className:$()(Me,"".concat(Me,"-group"))},P!==void 0?P:U);var ye=E.disabled,Oe=E.value,Je=E.title,yt=E.children,kt=E.style,Ke=E.className,wt=Object(O.a)(E,["disabled","value","title","children","style","className"]),mt=fe.has(Oe),ot="".concat(Me,"-option"),Dt=$()(Me,ot,Ke,(q={},Object(V.a)(q,"".concat(ot,"-grouped"),C),Object(V.a)(q,"".concat(ot,"-active"),st===ae&&!ye),Object(V.a)(q,"".concat(ot,"-disabled"),ye),Object(V.a)(q,"".concat(ot,"-selected"),mt),q)),At=pe?yt:P,Vt=!ge||typeof ge=="function"||mt;return le.createElement("div",Object.assign({},wt,{"aria-selected":mt,className:Dt,title:Je,onMouseMove:function(){if(st===ae||ye)return;vt(ae)},onClick:function(){ye||ut(Oe)},style:kt}),le.createElement("div",{className:"".concat(ot,"-content")},At||Oe),le.isValidElement(ge)||mt,Vt&&le.createElement(N.a,{className:"".concat(Me,"-option-state"),customizeIcon:ge,customizeIconProps:{isSelected:mt}},mt?"\u2713":null))}))},K=le.forwardRef(J);K.displayName="OptionList";var Q=K,de=function(){return null};de.isSelectOption=!0;var Ne=de,Xe=function(){return null};Xe.isSelectOptGroup=!0;var ke=Xe,be=v("VTBJ"),Fe=v("Zm9Q");function me(d){var w=d.key,F=d.props,te=F.children,Ee=F.value,Le=Object(O.a)(F,["children","value"]);return Object(be.a)({key:w,value:Ee!==void 0?Ee:w,children:te},Le)}function Se(d){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Fe.a)(d).map(function(F,te){if(!le.isValidElement(F)||!F.type)return null;var Ee=F.type.isSelectOptGroup,Le=F.key,pe=F.props,fe=pe.children,re=Object(O.a)(pe,["children"]);return w||!Ee?me(F):Object(be.a)(Object(be.a)({key:"__RC_SELECT_GRP__".concat(Le===null?te:Le,"__"),label:Le},re),{},{options:Se(fe)})}).filter(function(F){return F})}var Pe=v("2Qr1"),xe=v("qNPg"),L=v("U8pU"),ue=v("Kwbf"),Y=v("WKfj");function x(d){var w=d.mode,F=d.options,te=d.children,Ee=d.backfill,Le=d.allowClear,pe=d.placeholder,fe=d.getInputElement,re=d.showSearch,se=d.onSearch,ee=d.defaultOpen,B=d.autoFocus,b=d.labelInValue,G=d.value,M=d.inputValue,ge=d.optionLabelProp,we=w==="multiple"||w==="tags",ne=re!==void 0?re:we||w==="combobox",Te=F||Se(te);if(Object(ue.a)(w!=="tags"||Te.every(function(Me){return!Me.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),w==="tags"||w==="combobox"){var Ie=Te.some(function(Me){return Me.options?Me.options.some(function(Ue){return typeof("value"in Ue?Ue.value:Ue.key)=="number"}):typeof("value"in Me?Me.value:Me.key)=="number"});Object(ue.a)(!Ie,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ue.a)(w!=="combobox"||!ge,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ue.a)(w==="combobox"||!Ee,"`backfill` only works with `combobox` mode."),Object(ue.a)(w==="combobox"||!fe,"`getInputElement` only work with `combobox` mode."),Object(ue.b)(w!=="combobox"||!fe||!Le||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),se&&!ne&&w!=="combobox"&&w!=="tags"&&Object(ue.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ue.b)(!ee||B,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),G!=null){var De=Object(Y.d)(G);Object(ue.a)(!b||De.every(function(Me){return Object(L.a)(Me)==="object"&&("key"in Me||"value"in Me)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ue.a)(!we||Array.isArray(G),"`value` should be array when `mode` is `multiple` or `tags`")}if(te){var Ae=null;Object(Fe.a)(te).some(function(Me){if(!le.isValidElement(Me)||!Me.type)return!1;var Ue=Me.type;if(Ue.isSelectOption)return!1;if(Ue.isSelectOptGroup){var et=Object(Fe.a)(Me.props.children).every(function(Ve){return!le.isValidElement(Ve)||!Me.type||Ve.type.isSelectOption?!0:(Ae=Ve.type,!1)});return!et}return Ae=Ue,!0}),Ae&&Object(ue.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ae.displayName||Ae.name||Ae,"`.")),Object(ue.a)(M===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=x,D=Object(xe.a)({prefixCls:"rc-select",components:{optionList:Q},convertChildrenToData:Se,flattenOptions:Pe.d,getLabeledValue:Pe.e,filterOptions:Pe.b,isValueDisabled:Pe.g,findValueOption:Pe.c,warningProps:j,fillOptionsWithMissingValue:Pe.a}),_=function(d){Object(oe.a)(F,d);var w=Object(_e.a)(F);function F(){var te;return Object(H.a)(this,F),te=w.apply(this,arguments),te.selectRef=le.createRef(),te.focus=function(){te.selectRef.current.focus()},te.blur=function(){te.selectRef.current.blur()},te}return Object(he.a)(F,[{key:"render",value:function(){return le.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),F}(le.Component);_.Option=Ne,_.OptGroup=ke;var k=_,p=Ge.c=k},M8RZ:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return R});var H=v("fWQN"),he=v("mtLc"),oe=v("yKVA"),_e=v("879j"),le=v("q1tI"),V=v.n(le),O=v("i8i4"),I=v.n(O),R=function(A){Object(oe.a)(T,A);var S=Object(_e.a)(T);function T($){var z;Object(H.a)(this,T),z=S.call(this,$);var N=window.document;return z.node=N.createElement("div"),N.body.appendChild(z.node),z}return Object(he.a)(T,[{key:"render",value:function(){var z=this.props.children;return Object(O.createPortal)(z,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),T}(V.a.Component)},NLgs:function(nt,Ge,v){"use strict";v.d(Ge,"e",function(){return Xe}),v.d(Ge,"f",function(){return ke}),v.d(Ge,"d",function(){return Fe}),v.d(Ge,"c",function(){return me}),v.d(Ge,"a",function(){return Se}),v.d(Ge,"b",function(){return Pe});var H=v("miYZ"),he=v("tsqr"),oe=v("9og8"),_e=v("2qtc"),le=v("kLXV"),V=v("WmNS"),O=v.n(V),I=v("q1tI"),R=v.n(I),A=v("9kvl"),S=v("xKgJ"),T=v("1vsH"),$=v("RCxd"),z=v("mOS8"),N=v.n(z),J=v("1ZF9"),K=v.n(J),Q=v("WdTA"),de=v.n(Q),Ne=v("m3rI"),Xe=function(L){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(ke(L)&&be(ue))},ke=function(L){return Object(S.p)()?!0:(L({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},be=function(){var L,ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Y=Object(A.c)()._store.getState(),x=Y.user;return(L=x.userInfo)!==null&&L!==void 0&&L.profile_completed?!0:(le.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:ue?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){A.d.push("/account/profile/edit")}}),!1)},Fe=function(){var L,ue=Object(A.c)()._store.getState(),Y=ue.user;return(L=Y.userInfo)!==null&&L!==void 0&&L.professional_certification?!0:(le.a.confirm({title:"\u63D0\u793A",centered:!0,content:R.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(T.Q)("/account/certification")}}),!1)},me=function(){return Object(S.a)()?!0:(le.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:R.a.createElement("div",{className:"tc",style:{marginLeft:-38}},R.a.createElement("p",null,"\u60A8\u53EF\u4EE5\u626B\u7801\u52A0\u7FA4@\u7FA4\u7BA1\u7406\u5458\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650\u54E6\uFF01"),R.a.createElement("img",{src:Object(S.t)()?de.a:"".concat(Ne.a.IMG_SERVER,"/images/educoder/qqqun20191230.png"),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},Se=function(L,ue){return L?!0:(le.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:R.a.createElement("div",null,R.a.createElement("p",null,ue||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),R.a.createElement("div",{style:{marginLeft:"110px"}},R.a.createElement("img",{src:K.a,width:200}),R.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(T.Q)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},Pe=function(L){var ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",Y=Object(A.c)()._store.getState(),x=Y.shixunsDetail.detail;return(x==null?void 0:x.public)===2||(x==null?void 0:x.public)===1||(x==null?void 0:x.shixun_status)===3?(le.a.info({centered:!0,icon:R.a.createElement($.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:R.a.createElement("div",{className:"tc",style:{marginLeft:-38}},R.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},R.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(x==null?void 0:x.public)===2?"\u5DF2\u516C\u5F00":(x==null?void 0:x.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",ue,"\u3002"),R.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),R.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:N.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(x==null?void 0:x.shixun_status)===2?(le.a.confirm({centered:!0,icon:R.a.createElement($.a,null),title:"\u63D0\u793A",content:R.a.createElement("div",null,R.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",ue,"\u3002"),R.a.createElement("br",null),R.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){le.a.confirm({width:440,centered:!0,icon:R.a.createElement($.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var D=Object(oe.a)(O.a.mark(function k(){var p;return O.a.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,L({type:"shixunsDetail/cancelRelease",payload:{id:x==null?void 0:x.identifier}});case 2:p=w.sent,p.status!==401&&(he.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),L({type:"shixunsDetail/getShixunsDetail",payload:{id:x==null?void 0:x.identifier}}),L({type:"practiceSetting/getCommonData",payload:{id:x==null?void 0:x.identifier}}));case 4:case"end":return w.stop()}},k)}));function _(){return D.apply(this,arguments)}return _}()})}}),!0):!1}},OLES:function(nt,Ge,v){"use strict";var H=v("U8pU"),he=v("VTBJ"),oe=v("Ff2n"),_e=v("q1tI"),le=v("uciX"),V=v("7ixt"),O=function($){var z=$.overlay,N=$.prefixCls,J=$.id,K=$.overlayInnerStyle;return _e.createElement("div",{className:"".concat(N,"-inner"),id:J,role:"tooltip",style:K},typeof z=="function"?z():z)},I=O,R=function($,z){var N=$.overlayClassName,J=$.trigger,K=J===void 0?["hover"]:J,Q=$.mouseEnterDelay,de=Q===void 0?0:Q,Ne=$.mouseLeaveDelay,Xe=Ne===void 0?.1:Ne,ke=$.overlayStyle,be=$.prefixCls,Fe=be===void 0?"rc-tooltip":be,me=$.children,Se=$.onVisibleChange,Pe=$.afterVisibleChange,xe=$.transitionName,L=$.animation,ue=$.placement,Y=ue===void 0?"right":ue,x=$.align,j=x===void 0?{}:x,D=$.destroyTooltipOnHide,_=D===void 0?!1:D,k=$.defaultVisible,p=$.getTooltipContainer,d=$.overlayInnerStyle,w=Object(oe.a)($,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),F=Object(_e.useRef)(null);Object(_e.useImperativeHandle)(z,function(){return F.current});var te=Object(he.a)({},w);"visible"in $&&(te.popupVisible=$.visible);var Ee=function(){var se=$.arrowContent,ee=se===void 0?null:se,B=$.overlay,b=$.id;return[_e.createElement("div",{className:"".concat(Fe,"-arrow"),key:"arrow"},ee),_e.createElement(I,{key:"content",prefixCls:Fe,id:b,overlay:B,overlayInnerStyle:d})]},Le=!1,pe=!1;if(typeof _=="boolean")Le=_;else if(_&&Object(H.a)(_)==="object"){var fe=_.keepParent;Le=fe===!0,pe=fe===!1}return _e.createElement(le.a,Object.assign({popupClassName:N,prefixCls:Fe,popup:Ee,action:K,builtinPlacements:V.a,popupPlacement:Y,ref:F,popupAlign:j,getPopupContainer:p,onPopupVisibleChange:Se,afterPopupVisibleChange:Pe,popupTransitionName:xe,popupAnimation:L,defaultPopupVisible:k,destroyPopupOnHide:Le,autoDestroy:pe,mouseLeaveDelay:Xe,popupStyle:ke,mouseEnterDelay:de},te),me)},A=Object(_e.forwardRef)(R),S=Ge.a=A},Ot1p:function(nt,Ge,v){"use strict";var H=v("2qtc"),he=v("kLXV"),oe=v("rAM+"),_e=v("miYZ"),le=v("tsqr"),V=v("9og8"),O=v("tJVT"),I=v("jrin"),R=v("WmNS"),A=v.n(R),S=v("q1tI"),T=v.n(S),$=v("VrN/"),z=v.n($),N=v("bdgK"),J=v("p77/"),K=v("Bd2K"),Q=v("ELLl"),de=v("19Vz"),Ne=v("lZu9"),Xe=v("+NIl"),ke=v("kSUc"),be=v("9Bee"),Fe=function(Ke){var wt=Ke.value,mt=wt===void 0?"":wt,ot=Ke.className,Dt=Ke.showTextOnly,At=Ke.showLines,Vt=Ke.style,jt=Vt===void 0?{}:Vt,St=Object(S.useMemo)(function(){return""},[mt]);return T.a.createElement(T.a.Fragment,null,T.a.createElement("div",{dangerouslySetInnerHTML:{__html:St}}))},me=v("Q9mQ"),Se=v("diRs"),Pe=v("0Owb"),xe=v("dejd"),L=v("C+DQ"),ue=v("D1Df"),Y=v.n(ue),x=v("1vsH"),j=v("m3rI"),D=[{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 _(Ke){var wt=Ke.onActionCallback,mt=Ke.title,ot=Ke.icon,Dt=Ke.actionName,At=Ke.className,Vt=At===void 0?"":At,jt=Ke.children;function St(){wt(Dt)}return T.a.createElement("a",{title:mt,className:Vt,onClick:St},T.a.createElement("i",{className:"md-iconfont ".concat(ot)}),jt)}var k=function(Ke){var wt=Ke.watch,mt=Ke.showNullButton,ot=Ke.onActionCallback,Dt=Ke.fullScreen,At=Ke.insertTemp,Vt=Ke.hidetoolBar,jt=Ke.uuid,St=Ke.setOpenPhones,mn=Object(x.E)("_educoder_session_login"),sn=Object(x.E)("_educoder_session"),pt=[].concat(D,[{title:"".concat(wt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(wt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return T.a.createElement("ul",{className:"markdown-toolbar-container"},!Vt&&pt.map(function(wn,ln){return T.a.createElement("li",{key:ln},wn.actionName?T.a.createElement(_,Object(Pe.a)({},wn,{onActionCallback:ot})):T.a.createElement("span",{className:"v-line"}))}),mt?T.a.createElement("li",null,T.a.createElement(_,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ot},T.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,At&&T.a.createElement("li",null,T.a.createElement(_,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(At),onActionCallback:ot},T.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),T.a.createElement("li",null,T.a.createElement(Se.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:T.a.createElement("div",null,T.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+mn+"&_educoder_session="+sn+"&key="+jt+"&api="+encodeURIComponent(j.a.API_SERVER)),T.a.createElement(Y.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+mn+"&_educoder_session="+sn+"&key="+jt+"&api="+encodeURIComponent(j.a.API_SERVER)}))},T.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return St(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),T.a.createElement("li",{className:"btn-full-screen"},T.a.createElement(_,{icon:"".concat(Dt?"icon-shrink":"icon-enlarge"),title:Dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ot})))},p=v("M8RZ"),d=v("+L6B"),w=v("2/Rp"),F=v("y8nQ"),te=v("Vl3Y"),Ee=v("5NDa"),Le=v("5rEg"),pe={labelCol:{span:4},wrapperCol:{span:20}},fe=function(Ke){var wt=Ke.callback,mt=Ke.onCancel;function ot(Dt){wt(Dt)}return T.a.createElement(te.a,Object(Pe.a)({},pe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ot}),T.a.createElement(te.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},T.a.createElement(Le.a,null)),T.a.createElement(te.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},T.a.createElement(Le.a,null)),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(w.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},re=v("7ahc"),se=v("k1fw"),ee=v("HmJG"),B=v("BjJ7"),b=te.a.useForm,G={width:280,marginRight:10},M={labelCol:{span:5},wrapperCol:{span:19}},ge=function(Ke){var wt=Ke.callback,mt=Ke.onCancel,ot=b(),Dt=Object(O.a)(ot,1),At=Dt[0],Vt=Object(S.useRef)();function jt(sn){wt(Object(se.a)(Object(se.a)({},sn),{},{name:Vt.current}))}function St(sn,pt){At.setFieldsValue({src:"/api/attachments/".concat(sn.id,"?type=").concat(sn.content_type),type:pt.type})}function mn(sn){var pt=sn.target.files[0];Vt.current=pt.name,ne(pt,St)}return T.a.createElement(te.a,Object(Pe.a)({form:At},M,{className:"upload-image-panel",onFinish:jt}),T.a.createElement(te.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},T.a.createElement("div",{className:"flex-container"},T.a.createElement(te.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},T.a.createElement(Le.a,{style:G})),T.a.createElement(we,{onFileChange:mn}))),T.a.createElement(te.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},T.a.createElement(Le.a,{style:{width:264}})),T.a.createElement(te.a.Item,{style:{textAlign:"right"}},T.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(w.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))};function we(Ke){var wt=Ke.onFileChange;return T.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",T.a.createElement("input",{type:"file",onChange:wt}))}function ne(Ke,wt){if(!Ke)throw new String("\u6CA1\u6709\u6587\u4EF6");var mt=new FormData;mt.append("editormd-image-file",Ke),mt.append("file_param_name","editormd-image-file"),mt.append("byxhr","true");var ot=new window.XMLHttpRequest;ot.withCredentials=!0,ot.addEventListener("load",function(Dt){wt(JSON.parse(Dt.target.responseText),Ke)},!1),ot.addEventListener("error",function(Dt){console.error(Dt)},!1),ot.open("POST","".concat(B.a,"/api/attachments.json")),ot.send(mt)}var Te=v("giR+"),Ie=v("fyUT"),De=v("7Kak"),Ae=v("9yH6"),Me=Ae.a.Group,Ue={margin:"0 8px"},et=function(Ke){var wt=Ke.callback,mt=Ke.onCancel;function ot(Dt){wt(Dt)}return T.a.createElement(te.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ot},T.a.createElement("div",{className:"flex-container"},T.a.createElement("span",{style:Ue},"\u5355\u5143\u683C\u6570\uFF1A"),T.a.createElement("span",{style:Ue},"\u884C\u6570"),T.a.createElement(te.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},T.a.createElement(Ie.a,null)),T.a.createElement("span",{style:Ue},"\u5217\u6570"),T.a.createElement(te.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},T.a.createElement(Ie.a,null))),T.a.createElement("div",{className:"flex-container",style:{marginTop:12}},T.a.createElement("span",{style:Ue},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),T.a.createElement(te.a.Item,{name:"align"},T.a.createElement(Me,null,T.a.createElement(Ae.a,{value:"default"},T.a.createElement("i",{className:"fa fa-align-justify"})),T.a.createElement(Ae.a,{value:"left"},T.a.createElement("i",{className:"fa fa-align-left"})),T.a.createElement(Ae.a,{value:"center"},T.a.createElement("i",{className:"fa fa-align-center"})),T.a.createElement(Ae.a,{value:"right"},T.a.createElement("i",{className:"fa fa-align-right"}))))),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(w.a,{type:"ghost",onClick:mt},"\u53D6\u6D88")))},Ve=v("ErOA"),Ze=v("7Cbv"),Qe="link",at="upload-image",tt="code-block",st="add-table",Re="------------",vt={default:Re,left:":".concat(Re),center:":".concat(Re,":"),right:"".concat(Re,":")},ut=v("9VGf"),Be,Ye;function ae(){}var q=0,ie=1e4,C="\u2581",E=`
**\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 P(Ke){return/^\d+$/.test(Ke)?"".concat(Ke,"px"):Ke}var U=navigator.platform.toUpperCase().indexOf("MAC")>=0,ye=U?"Cmd":"Ctrl",Oe=["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"],Je=(Be={},Object(I.a)(Be,ye+"-B","bold"),Object(I.a)(Be,ye+"-I","italic"),Be),yt=(Ye={},Object(I.a)(Ye,Qe,"\u6DFB\u52A0\u94FE\u63A5"),Object(I.a)(Ye,tt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(I.a)(Ye,at,"\u6DFB\u52A0\u6587\u4EF6"),Object(I.a)(Ye,st,"\u6DFB\u52A0\u8868\u683C"),Ye),kt=Ge.a=function(Ke){var wt=Ke.defaultValue,mt=wt===void 0?"":wt,ot=Ke.onChange,Dt=Ke.width,At=Dt===void 0?"100%":Dt,Vt=Ke.height,jt=Vt===void 0?400:Vt,St=Ke.miniToolbar,mn=St===void 0?!1:St,sn=Ke.isFocus,pt=sn===void 0?!1:sn,wn=Ke.watch,ln=Ke.insertTemp,gn=Ke.mode,kn=gn===void 0?"markdown":gn,li=Ke.id,Kn=li===void 0?"markdown-editor-id":li,Nt=Ke.showResizeBar,dt=Nt===void 0?!1:Nt,Fn=Ke.noStorage,ui=Fn===void 0?!1:Fn,Tn=Ke.showNullButton,Mt=Tn===void 0?!1:Tn,Xn=Ke.hidetoolBar,hi=Xn===void 0?!1:Xn,vi=Ke.fullScreen,$e=vi===void 0?!1:vi,Ct=Ke.onBlur,ti=Ke.onCMBeforeChange,ci=Ke.onFullScreen,di=Ke.className,Mi=di===void 0?"":di,c=Ke.disablePaste,o=c===void 0?!1:c,a=Ke.placeholder,u=a===void 0?"":a,g=Ke.values,h=g===void 0?"":g,Z=Object(S.useState)(null),We=Object(O.a)(Z,2),Ce=We[0],ct=We[1],He=Object(S.useState)(mt),_t=Object(O.a)(He,2),Pt=_t[0],Wt=_t[1],Wn=Object(S.useState)(wn),Hn=Object(O.a)(Wn,2),un=Hn[0],$n=Hn[1],Ki=Object(S.useState)($e),An=Object(O.a)(Ki,2),On=An[0],ni=An[1],yi=Object(S.useState)(""),Jn=Object(O.a)(yi,2),ii=Jn[0],zn=Jn[1],fr=Object(S.useState)(0),Xi=Object(O.a)(fr,2),Nn=Xi[0],In=Xi[1],Ri=Object(S.useState)(jt),Di=Object(O.a)(Ri,2),Pi=Di[0],qt=Di[1],Bt=Object(S.useState)(!1),vn=Object(O.a)(Bt,2),Ut=vn[0],yn=vn[1],Xt=Object(S.useRef)(Object(Ze.a)()),bi=Object(S.useRef)(!1),rn=Object(S.useRef)(),on=Object(S.useRef)(),ri=Object(S.useRef)(),xi=Object(S.useRef)(),Ci=Object(S.useRef)(),Ur=function(){var ft=Object(V.a)(A.a.mark(function Et(){var bt,Ot;return A.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(Ve.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Xt.current}});case 2:Ot=Ht.sent,Ot!=null&&(bt=Ot.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",Ce,on),Ot.attachments.map(function(Rt){Rt.content_type.indexOf("image")>-1?Ce.replaceSelection("![,](/api/attachments/".concat(Rt.id,"?type=").concat(Rt.content_type,")")):Rt.content_type.indexOf("video")>-1?Ce.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Rt.content_type.indexOf("pdf")>-1?Ce.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,'&disposition=inline" target="_blank">').concat(Rt.name,"</a>")):Ce.replaceSelection("[".concat(Rt.name,"](").concat(j.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}));case 4:case"end":return Ht.stop()}},Et)}));return function(){return ft.apply(this,arguments)}}();Object(S.useEffect)(function(){Wt(h),Ce==null||Ce.setValue(h)},[h]),Object(S.useEffect)(function(){ci==null||ci(On)},[On]),Object(S.useEffect)(function(){if(on.current){var ft=z.a.fromTextArea(on.current,{mode:kn,lineNumbers:!mn,lineWrapping:!0,value:mt,autoCloseTags:!0,autoCloseBrackets:!0});pt&&ft.focus();function Et(bt,Ot){if(o){Ot.preventDefault();return}var It=Ot.clipboardData;if(It){var Ht=It.types.toString(),Rt=It.items;if(Ht==="Files"||It.types.indexOf("Files")>-1){if(Ot.preventDefault(),kn=="stex")return;try{var Jt,hn=Rt[1];((Jt=Rt[0])===null||Jt===void 0?void 0:Jt.kind)==="file"&&(hn=Rt[0]);var Lt=hn.getAsFile(),Ni=Lt.name.split(".").pop();ne(Lt,function(zt){if(zt.id){var bn,Kt,Yn;(Lt==null||((bn=Lt.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(Lt==null||((Kt=Lt.type)===null||Kt===void 0)?void 0:Kt.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(Lt==null||((Yn=Lt.type)===null||Yn===void 0)?void 0:Yn.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(Lt.type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):Oe.includes(Ni)?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):ft.replaceSelection("[".concat(Lt.name,"](").concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})}catch(zt){le.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return ft.on("paste",Et),ft.on("dragleave",function(bt,Ot){ri.current.classList.remove("mouse-hover-md")}),ft.on("dragover",function(bt,Ot){ri.current.classList.add("mouse-hover-md")}),ft.on("drop",function(bt,Ot){ri.current.classList.add("mouse-hover-md");var It;if(It=Ot.dataTransfer.files,It.length>0){Ot.preventDefault(),Ot.stopPropagation();for(var Ht=function(hn){var Lt=It[hn],Ni=Lt.name.split(".").pop();ne(Lt,function(zt){if(zt.id){var bn,Kt,Yn;(Lt==null||((bn=Lt.type)===null||bn===void 0)?void 0:bn.indexOf("image"))>-1?ft.replaceSelection("![,](/api/attachments/".concat(zt.id,"?type=").concat(zt.content_type,")")):(Lt==null||((Kt=Lt.type)===null||Kt===void 0)?void 0:Kt.indexOf("video"))>-1?ft.replaceSelection('<video width="100%" controls src="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,'"></video>')):(Lt==null||((Yn=Lt.type)===null||Yn===void 0)?void 0:Yn.indexOf("pdf"))>-1?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(Lt.type,'&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):Oe.includes(Ni)?ft.replaceSelection('<a href="'.concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,'?type=office&disposition=inline" target="_blank">').concat(Lt.name,"</a>")):ft.replaceSelection("[".concat(Lt.name,"](").concat(j.a.API_SERVER,"/api/attachments/").concat(zt.id,"?type=").concat(zt.content_type,")"))}else(zt==null?void 0:zt.status)===401&&(document.location.href="/user/login")})},Rt=0;Rt<It.length;Rt++)Ht(Rt)}}),ct(ft),function(){ft.off("paste",Et)}}},[]);var Zn=Object(S.useCallback)(function(){if(ri.current)try{}catch(ft){console.log(ft,"---- to set md editor body height")}},[Pi,ri,On]);Object(S.useEffect)(function(){function ft(){var bt=new N.default(function(Ot){var It=Object(oe.a)(Ot),Ht;try{for(It.s();!(Ht=It.n()).done;){var Rt=Ht.value;(Rt.target.offsetHeight>0||Rt.target.offsetWidth>0)&&(Zn(),Ce.setSize("100%","100%"),Ce.refresh())}}catch(Jt){It.e(Jt)}finally{It.f()}});return bt.observe(on.current.parentElement),bt}if(Ce){var Et=ft();return function(){Et.unobserve(on.current.parentElement)}}},[Ce,Zn]),Object(S.useEffect)(function(){if(Ce){for(var ft=[],Et=function(){var Rt=Ot[bt];It=Object(O.a)(Rt,2);var Jt=It[0],hn=It[1],Lt=Object(I.a)({},Jt,function(){$i(hn)});ft.push(Lt),Ce.addKeyMap(Lt)},bt=0,Ot=Object.entries(Je);bt<Ot.length;bt++){var It;Et()}return rn.current=setInterval(function(){bi.current&&Ur()},4e3),function(){clearInterval(rn.current);var Ht=Object(oe.a)(ft),Rt;try{for(Ht.s();!(Rt=Ht.n()).done;){var Jt=Rt.value;Ce.removeKeyMap(Jt)}}catch(hn){Ht.e(hn)}finally{Ht.f()}}}},[Ce]),Object(S.useEffect)(function(){$e!==On&&ni($e)},[$e]),Object(ut.a)(function(){if(!ui&&Nn>0){var ft=new Date().getTime(),Et=window.sessionStorage.getItem(Kn);ft>=Nn+ie&&(!Et||Et!==Pt)&&(window.sessionStorage.setItem(Kn,Pt),yn(!0))}},ie),Object(S.useEffect)(function(){$n(wn)},[Ce,wn]),Object(S.useEffect)(function(){Ce&&(pt&&Ce.focus())},[Ce,pt]),Object(S.useEffect)(function(){if(un&&Ce){var ft=Ce.getScrollerElement();function Et(bt){var Ot=bt.target;if(Ci.current){var It=Ot.scrollTop/Ot.scrollHeight;Ci.current.scrollTop=Ci.current.scrollHeight*It}}return ft.addEventListener("scroll",Et),function(){ft.removeEventListener("scroll",Et)}}},[Ce,un]),Object(S.useEffect)(function(){if(Ce&&ti){function ft(Et,bt){ti(Et,bt)}return Ce.on("beforeChange",ft),function(){Ce.off("beforeChange",ft)}}},[Ce,ti]),Object(S.useEffect)(function(){if(Ce&&Ct){function ft(){Ct(Ce.getValue())}return Ce.on("blur",ft),function(){Ce.off("blur",ft)}}},[Ce,Ct]),Object(S.useEffect)(function(){if(Ce){function ft(Et){var bt=Et.getValue();Wt(bt),In(new Date().getTime()),Et.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ot&&ot(bt)}return Ce.on("change",ft),function(){Ce.off("change",ft)}}},[Ce,ot]),Object(S.useEffect)(function(){Ce&&(mt==null?(Ce.setValue(""),Wt("")):mt!==Ce.getValue()&&(Ce.setValue(mt),Wt(mt),Ce.setCursor(Ce.lineCount(),0)))},[Ce,mt]);var $i=Object(S.useCallback)(function(ft){var Et=Ce.getCursor(),bt=Ce.getSelection(),Ot=bt.split(`
`);switch(ft){case"bold":return Ce.replaceSelection("**"+bt+"**"),bt===""&&Ce.setCursor(Et.line,Et.ch+2),Ce.focus();case"italic":return Ce.replaceSelection("*"+bt+"*"),bt===""&&Ce.setCursor(Et.line,Et.ch+1),Ce.focus();case"code":return Ce.replaceSelection("`"+bt+"`"),bt===""&&Ce.setCursor(Et.line,Et.ch+1),Ce.focus();case"inline-latex":return Ce.replaceSelection("`$$"+bt+"$$`"),bt===""&&Ce.setCursor(Et.line,Et.ch+3),Ce.focus();case"latex":return Ce.replaceSelection("```latex\n"+bt+"\n```"),Ce.setCursor(Et.line+1,bt.length+1),Ce.focus();case"line-break":return Ce.replaceSelection(`<br/>
`),Ce.focus();case"list-ul":return bt===""?Ce.replaceSelection("- "+bt):Ce.replaceSelection(Ot.map(function(It){return It===""?"":"- ".concat(It)}).join(`
`)),Ce.focus();case"list-ol":return bt===""?Ce.replaceSelection("1. "+bt):Ce.replaceSelection(Ot.map(function(It,Ht){return It===""?"":"".concat(Ht+1,". ").concat(It)}).join(`
`)),Ce.focus();case"add-null-ch":return bt===""&&Ce.setCursor(Et.line,Et.ch+1),Ce.replaceSelection(C),Ce.focus();case"inster-template-1":return bt===""&&Ce.setCursor(Et.line,Et.ch),Ce.replaceSelection(E),Ce.focus();case"eraser":return Ce.setValue(""),Ce.focus();case"trigger-watch":return $n(!un),Ce.focus();case"trigger-full-screen":return ni(!On),Ce.focus();case Qe:zn(Qe);return;case tt:zn(tt);return;case at:zn(at);return;case st:zn(st);return;default:throw new Error}},[Ce,un,On]),jn=Object(S.useCallback)(function(ft){zn("");switch(ii){case Qe:var Et=ft.title,bt=ft.link;return Ce.replaceSelection("[".concat(Et,"](").concat(bt,")")),Ce.focus();case tt:var Ot=ft.language,It=ft.content;return Ce.replaceSelection(["```"+Ot,It,"```"].join(`
`)),Ce.focus();case at:var Ht=ft.src,Rt=ft.alt,Jt=ft.name;return Ht.indexOf("type=image")>-1?Ce.replaceSelection("![ ".concat(Rt||""," ]( ").concat(Ht,' "').concat(Rt||"",'" )')):Ht.indexOf("type=application/pdf")>-1?Ce.replaceSelection('<a href="'.concat(Ht,'&disposition=inline" target="_blank">').concat(Jt,"</a>")):Ce.replaceSelection('<a href="'.concat(Ht,'" target="_blank">').concat(Jt,"</a>")),Ce.focus();case st:for(var hn=ft.row,Lt=ft.col,Ni=ft.align,zt=`
`,bn=0;bn<hn;bn++){for(var Kt=[],Yn=[],pr=0;pr<Lt;pr++)bn===1&&Yn.push(vt[Ni]),Kt.push(" ");bn===1&&(zt+="| ".concat(Yn.join(" | "),` |
`)),zt+="| ".concat(Kt.join(Lt===1?"":" | "),` |
`)}return Ce.replaceSelection(zt+`
`),Ce.focus();default:throw new Error}},[Ce,ii]),Yi=Object(S.useMemo)(function(){switch(ii){case Qe:return T.a.createElement(fe,{callback:jn,onCancel:fi});case tt:return T.a.createElement(re.b,{callback:jn,onCancel:fi});case at:return T.a.createElement(ge,{callback:jn,onCancel:fi});case st:return T.a.createElement(et,{callback:jn,onCancel:fi});default:return null}},[ii]);function fi(){zn("")}Object(S.useEffect)(function(){if(xi.current){var ft=xi.current,Et=!1,bt=0;function Ot(Rt){Et=!0,bt=Rt.pageY}function It(){Et=!1}function Ht(Rt){if(Et){var Jt=Rt.pageY-bt;Jt<0&&(Jt=0),Jt>300&&(Jt=300);var hn=jt+Jt+"px";qt(hn)}}return ft.addEventListener("mousedown",Ot),document.addEventListener("mousemove",Ht),document.addEventListener("mouseup",It),function(){ft.removeEventListener("mousedown",Ot),document.removeEventListener("mousemove",Ht),document.removeEventListener("mouseup",It)}}},[Ce,xi]),Object(S.useEffect)(function(){qt(jt)},[jt]);var _i=P(At),uo=P(Pi),ho={width:_i,height:uo},Zo=Object(S.useMemo)(function(){if(Nn){var ft=new Date(Nn),Et=ft.getHours(),bt=ft.getMinutes(),Ot=ft.getSeconds();return Et=Et<10?"0"+Et:Et,bt=bt<10?"0"+bt:bt,Ot=Ot<10?"0"+Ot:Ot,"".concat(Et,":").concat(bt,":").concat(Ot)}return 0},[Nn]);function Qo(){window.sessionStorage.removeItem(Kn),yn(!1),In(0)}function co(){yn(!1),In(0),Ce.setValue(window.sessionStorage.getItem(Kn))}function Fr(ft,Et){var bt=Ce.getValue();bt=bt.replace(ft,Et),Wt(bt),Ce==null||Ce.setValue(bt)}return T.a.createElement(S.Fragment,null,T.a.createElement("div",{className:"markdown-editor-wrapper",ref:ri},T.a.createElement("div",{className:"markdown-editor-container ".concat(Mi," ").concat(un?"on-preview":""," ").concat(mn?"mini":""," ").concat(On?"full-screen":""),style:ho},T.a.createElement(k,{insertTemp:ln,watch:un,fullScreen:On,showNullButton:Mt,onActionCallback:$i,hidetoolBar:hi,uuid:Xt.current,setOpenPhones:function(){bi.current=!0}}),T.a.createElement("div",{className:"markdown-editor-body"},T.a.createElement("div",{className:"codemirror-container"},T.a.createElement("textarea",{ref:on,placeholder:u})),un?T.a.createElement("div",{ref:Ci,className:"preview-container"},kn==="stex"&&T.a.createElement(Fe,{value:Pt}),kn!=="stex"&&T.a.createElement(be.a,{edit:!0,value:Pt,replaces:Fr})):null))),dt?T.a.createElement("a",{ref:xi,className:"editor-resize"}):null,T.a.createElement(p.a,null,yt[ii]?T.a.createElement(he.a,{centered:!0,title:yt[ii],visible:!0,onCancel:fi,footer:null},Yi):null))}},SJMd:function(nt,Ge){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var v,H,he,oe=!1,_e,le;window.PR_SHOULD_USE_CONTINUATION=!0;var V,O;(function(){var I=window,R=["break,continue,do,else,for,if,return,while"],A=[R,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],S=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],T=[S,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],$=[S,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],z=[S,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],N="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",J=[S,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],K="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",Q=[R,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],de=[R,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],Ne=[R,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Xe=[T,z,$,J,K,Q,de,Ne],ke=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,be="str",Fe="kwd",me="com",Se="typ",Pe="lit",xe="pun",L="pln",ue="tag",Y="dec",x="src",j="atn",D="atv",_="nocode",k="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function p(ne){for(var Te=0,Ie=!1,De=!1,Ae=0,Me=ne.length;Ae<Me;++Ae){var Ue=ne[Ae];if(Ue.ignoreCase)De=!0;else if(/[a-z]/i.test(Ue.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ie=!0,De=!1;break}}var et={b:8,t:9,n:10,v:11,f:12,r:13};function Ve(st){var Re=st.charCodeAt(0);if(Re!==92)return Re;var vt=st.charAt(1);return Re=et[vt],Re||("0"<=vt&&vt<="7"?parseInt(st.substring(1),8):vt==="u"||vt==="x"?parseInt(st.substring(2),16):st.charCodeAt(1))}function Ze(st){if(st<32)return(st<16?"\\x0":"\\x")+st.toString(16);var Re=String.fromCharCode(st);return Re==="\\"||Re==="-"||Re==="]"||Re==="^"?"\\"+Re:Re}function Qe(st){var Re=st.substring(1,st.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),vt=[],ut=Re[0]==="^",Be=["["];ut&&Be.push("^");for(var Ye=ut?1:0,ae=Re.length;Ye<ae;++Ye){var q=Re[Ye];if(/\\[bdsw]/i.test(q))Be.push(q);else{var ie=Ve(q),C;Ye+2<ae&&Re[Ye+1]==="-"?(C=Ve(Re[Ye+2]),Ye+=2):C=ie,vt.push([ie,C]),C<65||ie>122||(C<65||ie>90||vt.push([Math.max(65,ie)|32,Math.min(C,90)|32]),C<97||ie>122||vt.push([Math.max(97,ie)&~32,Math.min(C,122)&~32]))}}vt.sort(function(ye,Oe){return ye[0]-Oe[0]||Oe[1]-ye[1]});for(var E=[],P=[],Ye=0;Ye<vt.length;++Ye){var U=vt[Ye];U[0]<=P[1]+1?P[1]=Math.max(P[1],U[1]):E.push(P=U)}for(var Ye=0;Ye<E.length;++Ye){var U=E[Ye];Be.push(Ze(U[0])),U[1]>U[0]&&(U[1]+1>U[0]&&Be.push("-"),Be.push(Ze(U[1])))}return Be.push("]"),Be.join("")}function at(st){for(var Re=st.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),vt=Re.length,ut=[],Be=0,Ye=0;Be<vt;++Be){var ae=Re[Be];if(ae==="(")++Ye;else if(ae.charAt(0)==="\\"){var q=+ae.substring(1);q&&(q<=Ye?ut[q]=-1:Re[Be]=Ze(q))}}for(var Be=1;Be<ut.length;++Be)ut[Be]===-1&&(ut[Be]=++Te);for(var Be=0,Ye=0;Be<vt;++Be){var ae=Re[Be];if(ae==="(")++Ye,ut[Ye]||(Re[Be]="(?:");else if(ae.charAt(0)==="\\"){var q=+ae.substring(1);q&&q<=Ye&&(Re[Be]="\\"+ut[q])}}for(var Be=0;Be<vt;++Be)Re[Be]==="^"&&Re[Be+1]!=="^"&&(Re[Be]="");if(st.ignoreCase&&Ie)for(var Be=0;Be<vt;++Be){var ae=Re[Be],ie=ae.charAt(0);ae.length>=2&&ie==="["?Re[Be]=Qe(ae):ie!=="\\"&&(Re[Be]=ae.replace(/[a-zA-Z]/g,function(P){var U=P.charCodeAt(0);return"["+String.fromCharCode(U&~32,U|32)+"]"}))}return Re.join("")}for(var tt=[],Ae=0,Me=ne.length;Ae<Me;++Ae){var Ue=ne[Ae];if(Ue.global||Ue.multiline)throw new Error(""+Ue);tt.push("(?:"+at(Ue)+")")}return new RegExp(tt.join("|"),De?"gi":"g")}function d(ne,Te){var Ie=/(?:^|\s)nocode(?:\s|$)/,De=[],Ae=0,Me=[],Ue=0;function et(Ve){var Ze=Ve.nodeType;if(Ze==1){if(Ie.test(Ve.className))return;for(var Qe=Ve.firstChild;Qe;Qe=Qe.nextSibling)et(Qe);var at=Ve.nodeName.toLowerCase();(at==="br"||at==="li")&&(De[Ue]=`
`,Me[Ue<<1]=Ae++,Me[Ue++<<1|1]=Ve)}else if(Ze==3||Ze==4){var tt=Ve.nodeValue;tt.length&&(Te?tt=tt.replace(/\r\n?/g,`
`):tt=tt.replace(/[ \t\r\n]+/g," "),De[Ue]=tt,Me[Ue<<1]=Ae,Ae+=tt.length,Me[Ue++<<1|1]=Ve)}}return et(ne),{sourceCode:De.join("").replace(/\n$/,""),spans:Me}}function w(ne,Te,Ie,De,Ae){if(!Ie)return;var Me={sourceNode:ne,pre:1,langExtension:null,numberLines:null,sourceCode:Ie,spans:null,basePos:Te,decorations:null};De(Me),Ae.push.apply(Ae,Me.decorations)}var F=/\S/;function te(ne){for(var Te=void 0,Ie=ne.firstChild;Ie;Ie=Ie.nextSibling){var De=Ie.nodeType;Te=De===1?Te?ne:Ie:De===3&&F.test(Ie.nodeValue)?ne:Te}return Te===ne?void 0:Te}function Ee(ne,Te){var Ie={},De;(function(){for(var Ue=ne.concat(Te),et=[],Ve={},Ze=0,Qe=Ue.length;Ze<Qe;++Ze){var at=Ue[Ze],tt=at[3];if(tt)for(var st=tt.length;--st>=0;)Ie[tt.charAt(st)]=at;var Re=at[1],vt=""+Re;Ve.hasOwnProperty(vt)||(et.push(Re),Ve[vt]=null)}et.push(/[\0-\uffff]/),De=p(et)})();var Ae=Te.length,Me=function(Ue){for(var et=Ue.sourceCode,Ve=Ue.basePos,Ze=Ue.sourceNode,Qe=[Ve,L],at=0,tt=et.match(De)||[],st={},Re=0,vt=tt.length;Re<vt;++Re){var ut=tt[Re],Be=st[ut],Ye=void 0,ae;if(typeof Be=="string")ae=!1;else{var q=Ie[ut.charAt(0)];if(q)Ye=ut.match(q[1]),Be=q[0];else{for(var ie=0;ie<Ae;++ie)if(q=Te[ie],Ye=ut.match(q[1]),Ye){Be=q[0];break}Ye||(Be=L)}ae=Be.length>=5&&Be.substring(0,5)==="lang-",ae&&!(Ye&&typeof Ye[1]=="string")&&(ae=!1,Be=x),ae||(st[ut]=Be)}var C=at;if(at+=ut.length,!ae)Qe.push(Ve+C,Be);else{var E=Ye[1],P=ut.indexOf(E),U=P+E.length;Ye[2]&&(U=ut.length-Ye[2].length,P=U-E.length);var ye=Be.substring(5);w(Ze,Ve+C,ut.substring(0,P),Me,Qe),w(Ze,Ve+C+P,E,B(ye,E),Qe),w(Ze,Ve+C+U,ut.substring(U),Me,Qe)}}Ue.decorations=Qe};return Me}function Le(ne){var Te=[],Ie=[];ne.tripleQuotedStrings?Te.push([be,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ne.multiLineStrings?Te.push([be,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Te.push([be,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ne.verbatimStrings&&Ie.push([be,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var De=ne.hashComments;De&&(ne.cStyleComments?(De>1?Te.push([me,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Te.push([me,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ie.push([be,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Te.push([me,/^#[^\r\n]*/,null,"#"])),ne.cStyleComments&&(Ie.push([me,/^\/\/[^\r\n]*/,null]),Ie.push([me,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ae=ne.regexLiterals;if(Ae){var Me=Ae>1?"":`
\r`,Ue=Me?".":"[\\S\\s]",et="/(?=[^/*"+Me+"])(?:[^/\\x5B\\x5C"+Me+"]|\\x5C"+Ue+"|\\x5B(?:[^\\x5C\\x5D"+Me+"]|\\x5C"+Ue+")*(?:\\x5D|$))+/";Ie.push(["lang-regex",RegExp("^"+k+"("+et+")")])}var Ve=ne.types;Ve&&Ie.push([Se,Ve]);var Ze=(""+ne.keywords).replace(/^ | $/g,"");Ze.length&&Ie.push([Fe,new RegExp("^(?:"+Ze.replace(/[\s,]+/g,"|")+")\\b"),null]),Te.push([L,/^\s+/,null,` \r
\xA0`]);var Qe="^.[^\\s\\w.$@'\"`/\\\\]*";return ne.regexLiterals&&(Qe+="(?!s*/)"),Ie.push([Pe,/^@[a-z_$][a-z_$@0-9]*/i,null],[Se,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[L,/^[a-z_$][a-z_$@0-9]*/i,null],[Pe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[L,/^\\[\s\S]?/,null],[xe,new RegExp(Qe),null]),Ee(Te,Ie)}var pe=Le({keywords:Xe,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function fe(ne,Te,Ie){for(var De=/(?:^|\s)nocode(?:\s|$)/,Ae=/\r\n?|\n/,Me=ne.ownerDocument,Ue=Me.createElement("li");ne.firstChild;)Ue.appendChild(ne.firstChild);var et=[Ue];function Ve(Re){var vt=Re.nodeType;if(vt==1&&!De.test(Re.className))if(Re.nodeName==="br")Ze(Re),Re.parentNode&&Re.parentNode.removeChild(Re);else for(var ut=Re.firstChild;ut;ut=ut.nextSibling)Ve(ut);else if((vt==3||vt==4)&&Ie){var Be=Re.nodeValue,Ye=Be.match(Ae);if(Ye){var ae=Be.substring(0,Ye.index);Re.nodeValue=ae;var q=Be.substring(Ye.index+Ye[0].length);if(q){var ie=Re.parentNode;ie.insertBefore(Me.createTextNode(q),Re.nextSibling)}Ze(Re),ae||Re.parentNode.removeChild(Re)}}}function Ze(Re){for(;!Re.nextSibling;)if(Re=Re.parentNode,!Re)return;function vt(Ye,ae){var q=ae?Ye.cloneNode(!1):Ye,ie=Ye.parentNode;if(ie){var C=vt(ie,1),E=Ye.nextSibling;C.appendChild(q);for(var P=E;P;P=E)E=P.nextSibling,C.appendChild(P)}return q}for(var ut=vt(Re.nextSibling,0),Be;(Be=ut.parentNode)&&Be.nodeType===1;)ut=Be;et.push(ut)}for(var Qe=0;Qe<et.length;++Qe)Ve(et[Qe]);Te===(Te|0)&&et[0].setAttribute("value",Te);var at=Me.createElement("ol");at.className="linenums";for(var tt=Math.max(0,Te-1|0)||0,Qe=0,st=et.length;Qe<st;++Qe)Ue=et[Qe],Ue.className="L"+(Qe+tt)%10,Ue.firstChild||Ue.appendChild(Me.createTextNode("\xA0")),at.appendChild(Ue);ne.appendChild(at)}function re(ne){var Te=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Te=Te&&+Te[1]<=8;var Ie=/\n/g,De=ne.sourceCode,Ae=De.length,Me=0,Ue=ne.spans,et=Ue.length,Ve=0,Ze=ne.decorations,Qe=Ze.length,at=0;Ze[Qe]=Ae;var tt,st;for(st=tt=0;st<Qe;)Ze[st]!==Ze[st+2]?(Ze[tt++]=Ze[st++],Ze[tt++]=Ze[st++]):st+=2;for(Qe=tt,st=tt=0;st<Qe;){for(var Re=Ze[st],vt=Ze[st+1],ut=st+2;ut+2<=Qe&&Ze[ut+1]===vt;)ut+=2;Ze[tt++]=Re,Ze[tt++]=vt,st=ut}Qe=Ze.length=tt;var Be=ne.sourceNode,Ye="";Be&&(Ye=Be.style.display,Be.style.display="none");try{for(var ae=null;Ve<et;){var q=Ue[Ve],ie=Ue[Ve+2]||Ae,C=Ze[at+2]||Ae,ut=Math.min(ie,C),E=Ue[Ve+1],P;if(E.nodeType!==1&&(P=De.substring(Me,ut))){Te&&(P=P.replace(Ie,"\r")),E.nodeValue=P;var U=E.ownerDocument,ye=U.createElement("span");ye.className=Ze[at+1];var Oe=E.parentNode;Oe.replaceChild(ye,E),ye.appendChild(E),Me<ie&&(Ue[Ve+1]=E=U.createTextNode(De.substring(ut,ie)),Oe.insertBefore(E,ye.nextSibling))}Me=ut,Me>=ie&&(Ve+=2),Me>=C&&(at+=2)}}finally{Be&&(Be.style.display=Ye)}}var se={};function ee(ne,Te){for(var Ie=Te.length;--Ie>=0;){var De=Te[Ie];se.hasOwnProperty(De)?I.console&&console.warn("cannot override language handler %s",De):se[De]=ne}}function B(ne,Te){return ne&&se.hasOwnProperty(ne)||(ne=/^\s*</.test(Te)?"default-markup":"default-code"),se[ne]}ee(pe,["default-code"]),ee(Ee([],[[L,/^[^<?]+/],[Y,/^<!\w[^>]*(?:>|$)/],[me,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[xe,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),ee(Ee([[L,/^[\s]+/,null,` \r
`],[D,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ue,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[j,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[xe,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),ee(Ee([],[[D,/^[\s\S]+/]]),["uq.val"]),ee(Le({keywords:T,hashComments:!0,cStyleComments:!0,types:ke}),["c","cc","cpp","cxx","cyc","m"]),ee(Le({keywords:"null,true,false"}),["json"]),ee(Le({keywords:z,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:ke}),["cs"]),ee(Le({keywords:$,cStyleComments:!0}),["java"]),ee(Le({keywords:Ne,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ee(Le({keywords:Q,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ee(Le({keywords:K,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ee(Le({keywords:de,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ee(Le({keywords:J,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ee(Le({keywords:N,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ee(Ee([],[[be,/^[\s\S]+/]]),["regex"]);function b(ne){var Te=ne.langExtension;try{var Ie=d(ne.sourceNode,ne.pre),De=Ie.sourceCode;ne.sourceCode=De,ne.spans=Ie.spans,ne.basePos=0,B(Te,De)(ne),re(ne)}catch(Ae){I.console&&console.log(Ae&&Ae.stack||Ae)}}function G(ne,Te,Ie){var De=Ie||!1,Ae=Te||null,Me=document.createElement("div");Me.innerHTML="<pre>"+ne+"</pre>",Me=Me.firstChild,De&&fe(Me,De,!0);var Ue={langExtension:Ae,numberLines:De,sourceNode:Me,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Ue),Me.innerHTML}function M(ne,Te){var Ie=Te||document.body,De=Ie.ownerDocument||document;function Ae(q){return Ie.getElementsByTagName(q)}for(var Me=[Ae("pre"),Ae("code"),Ae("xmp")],Ue=[],et=0;et<Me.length;++et)for(var Ve=0,Ze=Me[et].length;Ve<Ze;++Ve)Ue.push(Me[et][Ve]);Me=null;var Qe=Date;Qe.now||(Qe={now:function(){return+new Date}});var at=0,tt=/\blang(?:uage)?-([\w.]+)(?!\S)/,st=/\bprettyprint\b/,Re=/\bprettyprinted\b/,vt=/pre|xmp/i,ut=/^code$/i,Be=/^(?:pre|code|xmp)$/i,Ye={};function ae(){for(var q=I.PR_SHOULD_USE_CONTINUATION?Qe.now()+250:Infinity;at<Ue.length&&Qe.now()<q;at++){for(var ie=Ue[at],C=Ye,E=ie;E=E.previousSibling;){var P=E.nodeType,U=(P===7||P===8)&&E.nodeValue;if(U?!/^\??prettify\b/.test(U):P!==3||/\S/.test(E.nodeValue))break;if(U){C={},U.replace(/\b(\w+)=([\w:.%+-]+)/g,function(jt,St,mn){C[St]=mn});break}}var ye=ie.className;if((C!==Ye||st.test(ye))&&!Re.test(ye)){for(var Oe=!1,Je=ie.parentNode;Je;Je=Je.parentNode){var yt=Je.tagName;if(Be.test(yt)&&Je.className&&st.test(Je.className)){Oe=!0;break}}if(!Oe){ie.className+=" prettyprinted";var kt=C.lang;if(!kt){kt=ye.match(tt);var Ke;!kt&&(Ke=te(ie))&&ut.test(Ke.tagName)&&(kt=Ke.className.match(tt)),kt&&(kt=kt[1])}var wt;if(vt.test(ie.tagName))wt=1;else{var mt=ie.currentStyle,ot=De.defaultView,Dt=mt?mt.whiteSpace:ot&&ot.getComputedStyle?ot.getComputedStyle(ie,null).getPropertyValue("white-space"):0;wt=Dt&&Dt.substring(0,3)==="pre"}var At=C.linenums;(At=At==="true"||+At)||(At=ye.match(/\blinenums\b(?::(\d+))?/),At=At?At[1]&&At[1].length?+At[1]:!0:!1),At&&fe(ie,At,wt);var Vt={langExtension:kt,sourceNode:ie,numberLines:At,pre:wt,sourceCode:null,basePos:null,spans:null,decorations:null};b(Vt)}}}at<Ue.length?I.setTimeout(ae,250):typeof ne=="function"&&ne()}ae()}var ge=I.PR={createSimpleLexer:Ee,registerLangHandler:ee,sourceDecorator:Le,PR_ATTRIB_NAME:j,PR_ATTRIB_VALUE:D,PR_COMMENT:me,PR_DECLARATION:Y,PR_KEYWORD:Fe,PR_LITERAL:Pe,PR_NOCODE:_,PR_PLAIN:L,PR_PUNCTUATION:xe,PR_SOURCE:x,PR_STRING:be,PR_TAG:ue,PR_TYPE:Se,prettyPrintOne:oe?I.prettyPrintOne=G:V=G,prettyPrint:O=oe?I.prettyPrint=M:O=M},we=I.define;typeof we=="function"&&we.amd&&we("google-code-prettify",[],function(){return ge})})()},"VrN/":function(nt,Ge,v){(function(H,he){nt.exports=he()})(this,function(){"use strict";var H=navigator.userAgent,he=navigator.platform,oe=/gecko\/\d/i.test(H),_e=/MSIE \d/.test(H),le=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(H),V=/Edge\/(\d+)/.exec(H),O=_e||le||V,I=O&&(_e?document.documentMode||6:+(V||le)[1]),R=!V&&/WebKit\//.test(H),A=R&&/Qt\/\d+\.\d+/.test(H),S=!V&&/Chrome\//.test(H),T=/Opera\//.test(H),$=/Apple Computer/.test(navigator.vendor),z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(H),N=/PhantomJS/.test(H),J=!V&&/AppleWebKit/.test(H)&&/Mobile\/\w+/.test(H),K=/Android/.test(H),Q=J||K||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(H),de=J||/Mac/.test(he),Ne=/\bCrOS\b/.test(H),Xe=/win/i.test(he),ke=T&&H.match(/Version\/(\d*\.\d*)/);ke&&(ke=Number(ke[1])),ke&&ke>=15&&(T=!1,R=!0);var be=de&&(A||T&&(ke==null||ke<12.11)),Fe=oe||O&&I>=9;function me(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Se=function(e,t){var i=e.className,n=me(t).exec(i);if(n){var r=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(r?n[1]+r:"")}};function Pe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function xe(e,t){return Pe(e).appendChild(t)}function L(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)r.appendChild(t[s]);return r}function ue(e,t,i,n){var r=L(e,t,i,n);return r.setAttribute("role","presentation"),r}var Y;document.createRange?Y=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:Y=function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(r){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};function x(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function j(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function D(e,t){var i=e.className;me(t).test(i)||(e.className+=(i?" ":"")+t)}function _(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!me(i[n]).test(t)&&(t+=" "+i[n]);return t}var k=function(e){e.select()};J?k=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:O&&(k=function(e){try{e.select()}catch(t){}});function p(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function d(e,t,i){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(i!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function w(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=r||0;;){var f=e.indexOf(" ",s);if(f<0||f>=t)return l+(t-s);l+=f-s,l+=i-l%i,s=f+1}}var F=function(){this.id=null,this.f=null,this.time=0,this.handler=p(this.onTimeout,this)};F.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},F.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function te(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ee=50,Le={toString:function(){return"CodeMirror.Pass"}},pe={scroll:!1},fe={origin:"*mouse"},re={origin:"+move"};function se(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||r+l>=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var ee=[""];function B(e){for(;ee.length<=e;)ee.push(b(ee)+" ");return ee[e]}function b(e){return e[e.length-1]}function G(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function M(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function ge(){}function we(e,t){var i;return Object.create?i=Object.create(e):(ge.prototype=e,i=new ge),t&&d(t,i),i}var ne=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Te(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ne.test(e))}function Ie(e,t){return t?t.source.indexOf("\\w")>-1&&Te(e)?!0:t.test(e):Te(e)}function De(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ae=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Me(e){return e.charCodeAt(0)>=768&&Ae.test(e)}function Ue(e,t,i){for(;(i<0?t>0:t<e.length)&&Me(e.charAt(t));)t+=i;return t}function et(e,t,i){for(var n=t>i?-1:1;;){if(t==i)return t;var r=(t+i)/2,s=n<0?Math.ceil(r):Math.floor(r);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+n}}function Ve(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var Ze=null;function Qe(e,t,i){var n;Ze=null;for(var r=0;r<e.length;++r){var s=e[r];if(s.from<t&&s.to>t)return r;s.to==t&&(s.from!=s.to&&i=="before"?n=r:Ze=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:Ze=r)}return n!=null?n:Ze}var at=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(y){return y<=247?e.charAt(y):1424<=y&&y<=1524?"R":1536<=y&&y<=1785?t.charAt(y-1536):1774<=y&&y<=2220?"r":8192<=y&&y<=8203?"w":y==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function m(y,W,X){this.level=y,this.from=W,this.to=X}return function(y,W){var X=W=="ltr"?"L":"R";if(y.length==0||W=="ltr"&&!n.test(y))return!1;for(var ve=y.length,ce=[],je=0;je<ve;++je)ce.push(i(y.charCodeAt(je)));for(var ze=0,qe=X;ze<ve;++ze){var it=ce[ze];it=="m"?ce[ze]=qe:qe=it}for(var lt=0,rt=X;lt<ve;++lt){var ht=ce[lt];ht=="1"&&rt=="r"?ce[lt]="n":s.test(ht)&&(rt=ht,ht=="r"&&(ce[lt]="R"))}for(var xt=1,gt=ce[0];xt<ve-1;++xt){var Tt=ce[xt];Tt=="+"&&gt=="1"&&ce[xt+1]=="1"?ce[xt]="1":Tt==","&&gt==ce[xt+1]&&(gt=="1"||gt=="n")&&(ce[xt]=gt),gt=Tt}for(var $t=0;$t<ve;++$t){var fn=ce[$t];if(fn==",")ce[$t]="N";else if(fn=="%"){var Zt=void 0;for(Zt=$t+1;Zt<ve&&ce[Zt]=="%";++Zt);for(var Un=$t&&ce[$t-1]=="!"||Zt<ve&&ce[Zt]=="1"?"1":"N",Rn=$t;Rn<Zt;++Rn)ce[Rn]=Un;$t=Zt-1}}for(var tn=0,Dn=X;tn<ve;++tn){var xn=ce[tn];Dn=="L"&&xn=="1"?ce[tn]="L":s.test(xn)&&(Dn=xn)}for(var an=0;an<ve;++an)if(r.test(ce[an])){var nn=void 0;for(nn=an+1;nn<ve&&r.test(ce[nn]);++nn);for(var Qt=(an?ce[an-1]:X)=="L",Pn=(nn<ve?ce[nn]:X)=="L",cr=Qt==Pn?Qt?"L":"R":X,Li=an;Li<nn;++Li)ce[Li]=cr;an=nn-1}for(var _n=[],si,pn=0;pn<ve;)if(l.test(ce[pn])){var Yo=pn;for(++pn;pn<ve&&l.test(ce[pn]);++pn);_n.push(new m(0,Yo,pn))}else{var gi=pn,Gi=_n.length,Vi=W=="rtl"?1:0;for(++pn;pn<ve&&ce[pn]!="L";++pn);for(var Sn=gi;Sn<pn;)if(f.test(ce[Sn])){gi<Sn&&(_n.splice(Gi,0,new m(1,gi,Sn)),Gi+=Vi);var dr=Sn;for(++Sn;Sn<pn&&f.test(ce[Sn]);++Sn);_n.splice(Gi,0,new m(2,dr,Sn)),Gi+=Vi,gi=Sn}else++Sn;gi<pn&&_n.splice(Gi,0,new m(1,gi,pn))}return W=="ltr"&&(_n[0].level==1&&(si=y.match(/^\s+/))&&(_n[0].from=si[0].length,_n.unshift(new m(0,0,si[0].length))),b(_n).level==1&&(si=y.match(/\s+$/))&&(b(_n).to-=si[0].length,_n.push(new m(0,ve-si[0].length,ve)))),W=="rtl"?_n.reverse():_n}}();function tt(e,t){var i=e.order;return i==null&&(i=e.order=at(e.text,t)),i}var st=[],Re=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||st).concat(i)}};function vt(e,t){return e._handlers&&e._handlers[t]||st}function ut(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=te(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function Be(e,t){var i=vt(e,t);if(!i.length)return;for(var n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)}function Ye(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Be(e,i||t.type,e,t),P(t)||t.codemirrorIgnore}function ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)te(i,t[n])==-1&&i.push(t[n])}function q(e,t){return vt(e,t).length>0}function ie(e){e.prototype.on=function(t,i){Re(this,t,i)},e.prototype.off=function(t,i){ut(this,t,i)}}function C(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function E(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function P(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function U(e){C(e),E(e)}function ye(e){return e.target||e.srcElement}function Oe(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),de&&e.ctrlKey&&t==1&&(t=3),t}var Je=function(){if(O&&I<9)return!1;var e=L("div");return"draggable"in e||"dragDrop"in e}(),yt;function kt(e){if(yt==null){var t=L("span","\u200B");xe(e,L("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(yt=t.offsetWidth<=1&&t.offsetHeight>2&&!(O&&I<8))}var i=yt?L("span","\u200B"):L("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ke;function wt(e){if(Ke!=null)return Ke;var t=xe(e,document.createTextNode("A\u062EA")),i=Y(t,0,1).getBoundingClientRect(),n=Y(t,1,2).getBoundingClientRect();return Pe(e),!i||i.left==i.right?!1:Ke=n.right-i.right<3}var mt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(`
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ot=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Dt=function(){var e=L("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),At=null;function Vt(e){if(At!=null)return At;var t=xe(e,L("span","x")),i=t.getBoundingClientRect(),n=Y(t,0,1).getBoundingClientRect();return At=Math.abs(i.left-n.left)>1}var jt={},St={};function mn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),jt[e]=t}function sn(e,t){St[e]=t}function pt(e){if(typeof e=="string"&&St.hasOwnProperty(e))e=St[e];else if(e&&typeof e.name=="string"&&St.hasOwnProperty(e.name)){var t=St[e.name];typeof t=="string"&&(t={name:t}),e=we(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return pt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return pt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function wn(e,t){t=pt(t);var i=jt[t.name];if(!i)return wn(e,"text/plain");var n=i(e,t);if(ln.hasOwnProperty(t.name)){var r=ln[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=r[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var ln={};function gn(e,t){var i=ln.hasOwnProperty(e)?ln[e]:ln[e]={};d(t,i)}function kn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i}function li(e,t){for(var i;e.innerMode&&!(i=e.innerMode(t),!i||i.mode==e);)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Kn(e,t,i){return e.startState?e.startState(t,i):!0}var Nt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};Nt.prototype.eol=function(){return this.pos>=this.string.length},Nt.prototype.sol=function(){return this.pos==this.lineStart},Nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Nt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Nt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},Nt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Nt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Nt.prototype.skipToEnd=function(){this.pos=this.string.length},Nt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Nt.prototype.backUp=function(e){this.pos-=e},Nt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=w(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?w(this.string,this.lineStart,this.tabSize):0)},Nt.prototype.indentation=function(){return w(this.string,null,this.tabSize)-(this.lineStart?w(this.string,this.lineStart,this.tabSize):0)},Nt.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(n(r)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Nt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Nt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Nt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function dt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],s=r.chunkSize();if(t<s){i=r;break}t-=s}return i.lines[t]}function Fn(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;r==i.line&&(l=l.slice(0,i.ch)),r==t.line&&(l=l.slice(t.ch)),n.push(l),++r}),n}function ui(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function Tn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Mt(e){if(e.parent==null)return null;for(var t=e.parent,i=te(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;!(n.children[r]==t);++r)i+=n.children[r].chunkSize();return i+t.first}function Xn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var f=e.lines[l],m=f.height;if(t<m)break;t-=m}return i+l}function hi(e,t){return t>=e.first&&t<e.first+e.size}function vi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function $e(e,t,i){if(i===void 0&&(i=null),!(this instanceof $e))return new $e(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ct(e,t){return e.line-t.line||e.ch-t.ch}function ti(e,t){return e.sticky==t.sticky&&Ct(e,t)==0}function ci(e){return $e(e.line,e.ch)}function di(e,t){return Ct(e,t)<0?t:e}function Mi(e,t){return Ct(e,t)<0?e:t}function c(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function o(e,t){if(t.line<e.first)return $e(e.first,0);var i=e.first+e.size-1;return t.line>i?$e(i,dt(e,i).text.length):a(t,dt(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?$e(e.line,t):i<0?$e(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var g=function(e,t){this.state=e,this.lookAhead=t},h=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};h.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},h.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,i){return t instanceof g?new h(e,kn(e.mode,t.state),i,t.lookAhead):new h(e,kn(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?kn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new g(t,this.maxLookAhead):t};function Z(e,t,i,n){var r=[e.state.modeGen],s={};Hn(e,t.text,e.doc.mode,i,function(y,W){return r.push(y,W)},s,n);for(var l=i.state,f=function(y){i.baseTokens=r;var W=e.state.overlays[y],X=1,ve=0;i.state=!0,Hn(e,t.text,W.mode,i,function(ce,je){for(var ze=X;ve<ce;){var qe=r[X];qe>ce&&r.splice(X,1,ce,r[X+1],qe),X+=2,ve=Math.min(ce,qe)}if(!je)return;if(W.opaque)r.splice(ze,X-ze,ce,"overlay "+je),X=ze+2;else for(;ze<X;ze+=2){var it=r[ze+1];r[ze+1]=(it?it+" ":"")+"overlay "+je}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},m=0;m<e.state.overlays.length;++m)f(m);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function We(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Ce(e,Mt(t)),r=t.text.length>e.options.maxHighlightLength&&kn(e.doc.mode,n.state),s=Z(e,t,n);r&&(n.state=r),t.stateAfter=n.save(!r),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ce(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=un(e,t,i),l=s>n.first&&dt(n,s-1).stateAfter,f=l?h.fromSaved(n,l,s):new h(n,Kn(n.mode),s);return n.iter(s,t,function(m){ct(e,m.text,f);var y=f.line;m.stateAfter=y==t-1||y%5==0||y>=r.viewFrom&&y<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function ct(e,t,i,n){var r=e.doc.mode,s=new Nt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&He(r,i.state);!s.eol();)_t(r,s,i.state),s.start=s.pos}function He(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=li(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function _t(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=li(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}var Pt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Wt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=dt(r,t.line),m=Ce(e,t.line,i),y=new Nt(f.text,e.options.tabSize,m),W;for(n&&(W=[]);(n||y.pos<t.ch)&&!y.eol();)y.start=y.pos,l=_t(s,y,m.state),n&&W.push(new Pt(y,l,kn(r.mode,m.state)));return n?W:new Pt(y,l,m.state)}function Wn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";t[n]==null?t[n]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+i[2])}return e}function Hn(e,t,i,n,r,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var m=0,y=null,W=new Nt(t,e.options.tabSize,n),X,ve=e.options.addModeClass&&[null];for(t==""&&Wn(He(i,n.state),s);!W.eol();){if(W.pos>e.options.maxHighlightLength?(f=!1,l&&ct(e,t,n,W.pos),W.pos=t.length,X=null):X=Wn(_t(i,W,n.state,ve),s),ve){var ce=ve[0].name;ce&&(X="m-"+(X?ce+" "+X:ce))}if(!f||y!=X){for(;m<W.start;)m=Math.min(W.start,m+5e3),r(m,y);y=X}W.start=W.pos}for(;m<W.pos;){var je=Math.min(W.pos,m+5e3);r(je,y),m=je}}function un(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var m=dt(s,f-1),y=m.stateAfter;if(y&&(!i||f+(y instanceof g?y.lookAhead:0)<=s.modeFrontier))return f;var W=w(m.text,null,e.options.tabSize);(r==null||n>W)&&(r=f-1,n=W)}return r}function $n(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var i=e.first,n=t-1;n>i;n--){var r=dt(e,n).stateAfter;if(r&&(!(r instanceof g)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Ki=!1,An=!1;function On(){Ki=!0}function ni(){An=!0}function yi(e,t,i){this.marker=e,this.from=t,this.to=i}function Jn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function ii(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function zn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function fr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(f||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var m=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new yi(l,s.from,m?null:s.to))}}return n}function Xi(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var m=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new yi(l,m?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Nn(e,t){if(t.full)return null;var i=hi(e,t.from.line)&&dt(e,t.from.line).markedSpans,n=hi(e,t.to.line)&&dt(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=Ct(t.from,t.to)==0,f=fr(i,r,l),m=Xi(n,s,l),y=t.text.length==1,W=b(t.text).length+(y?r:0);if(f)for(var X=0;X<f.length;++X){var ve=f[X];if(ve.to==null){var ce=Jn(m,ve.marker);ce?y&&(ve.to=ce.to==null?null:ce.to+W):ve.to=r}}if(m)for(var je=0;je<m.length;++je){var ze=m[je];if(ze.to!=null&&(ze.to+=W),ze.from==null){var qe=Jn(f,ze.marker);qe||(ze.from=W,y&&(f||(f=[])).push(ze))}else ze.from+=W,y&&(f||(f=[])).push(ze)}f&&(f=In(f)),m&&m!=f&&(m=In(m));var it=[f];if(!y){var lt=t.text.length-2,rt;if(lt>0&&f)for(var ht=0;ht<f.length;++ht)f[ht].to==null&&(rt||(rt=[])).push(new yi(f[ht].marker,null,null));for(var xt=0;xt<lt;++xt)it.push(rt);it.push(m)}return it}function In(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ri(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ce){if(ce.markedSpans)for(var je=0;je<ce.markedSpans.length;++je){var ze=ce.markedSpans[je].marker;ze.readOnly&&(!n||te(n,ze)==-1)&&(n||(n=[])).push(ze)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],f=l.find(0),m=0;m<r.length;++m){var y=r[m];if(Ct(y.to,f.from)<0||Ct(y.from,f.to)>0)continue;var W=[m,1],X=Ct(y.from,f.from),ve=Ct(y.to,f.to);(X<0||!l.inclusiveLeft&&!X)&&W.push({from:y.from,to:f.from}),(ve>0||!l.inclusiveRight&&!ve)&&W.push({from:f.to,to:y.to}),r.splice.apply(r,W),m+=W.length-3}return r}function Di(e){var t=e.markedSpans;if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}function Pi(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function qt(e){return e.inclusiveLeft?-1:0}function Bt(e){return e.inclusiveRight?1:0}function vn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=Ct(n.from,r.from)||qt(e)-qt(t);if(s)return-s;var l=Ct(n.to,r.to)||Bt(e)-Bt(t);return l||t.id-e.id}function Ut(e,t){var i=An&&e.markedSpans,n;if(i)for(var r=void 0,s=0;s<i.length;++s)r=i[s],r.marker.collapsed&&(t?r.from:r.to)==null&&(!n||vn(n,r.marker)<0)&&(n=r.marker);return n}function yn(e){return Ut(e,!0)}function Xt(e){return Ut(e,!1)}function bi(e,t){var i=An&&e.markedSpans,n;if(i)for(var r=0;r<i.length;++r){var s=i[r];s.marker.collapsed&&(s.from==null||s.from<t)&&(s.to==null||s.to>t)&&(!n||vn(n,s.marker)<0)&&(n=s.marker)}return n}function rn(e,t,i,n,r){var s=dt(e,t),l=An&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var m=l[f];if(!m.marker.collapsed)continue;var y=m.marker.find(0),W=Ct(y.from,i)||qt(m.marker)-qt(r),X=Ct(y.to,n)||Bt(m.marker)-Bt(r);if(W>=0&&X<=0||W<=0&&X>=0)continue;if(W<=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(y.to,i)>=0:Ct(y.to,i)>0)||W>=0&&(m.marker.inclusiveRight&&r.inclusiveLeft?Ct(y.from,n)<=0:Ct(y.from,n)<0))return!0}}function on(e){for(var t;t=yn(e);)e=t.find(-1,!0).line;return e}function ri(e){for(var t;t=Xt(e);)e=t.find(1,!0).line;return e}function xi(e){for(var t,i;t=Xt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Ci(e,t){var i=dt(e,t),n=on(i);return i==n?t:Mt(n)}function Ur(e,t){if(t>e.lastLine())return t;var i=dt(e,t),n;if(!Zn(e,i))return t;for(;n=Xt(i);)i=n.find(1,!0).line;return Mt(i)+1}function Zn(e,t){var i=An&&t.markedSpans;if(i)for(var n=void 0,r=0;r<i.length;++r){if(n=i[r],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&$i(e,t,n))return!0}}function $i(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return $i(e,n.line,Jn(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var r=void 0,s=0;s<t.markedSpans.length;++s)if(r=t.markedSpans[s],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(r.to==null||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&$i(e,t,r))return!0}function jn(e){e=on(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var f=s.children[l];if(f==i)break;t+=f.height}return t}function Yi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=yn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Xt(n);){var s=i.find(0,!0);t-=n.text.length-s.from.ch,n=s.to.line,t+=n.text.length-s.to.ch}return t}function fi(e){var t=e.display,i=e.doc;t.maxLine=dt(i,i.first),t.maxLineLength=Yi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Yi(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var _i=function(e,t,i){this.text=e,Pi(this,t),this.height=i?i(this):1};_i.prototype.lineNo=function(){return Mt(this)},ie(_i);function uo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Di(e),Pi(e,i);var r=n?n(e):1;r!=e.height&&Tn(e,r)}function ho(e){e.parent=null,Di(e)}var Zo={},Qo={};function co(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:Zo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Fr(e,t){var i=ue("span",null,null,R?"padding-right: .1px":null),n={pre:ue("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;n.pos=0,n.addToken=Et,wt(e.display.measure)&&(l=tt(s,e.doc.direction))&&(n.addToken=Ot(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&Mt(s);Ht(s,n,We(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=_(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=_(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(kt(e.display.measure))),r==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(R){var m=n.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Be(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=_(n.pre.className,n.textClass||"")),n}function ft(e){var t=L("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Et(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?bt(t,e.trailingSpace):t,m=e.cm.state.specialChars,y=!1,W;if(!m.test(t))e.col+=t.length,W=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,W),O&&I<9&&(y=!0),e.pos+=t.length;else{W=document.createDocumentFragment();for(var X=0;;){m.lastIndex=X;var ve=m.exec(t),ce=ve?ve.index-X:t.length-X;if(ce){var je=document.createTextNode(f.slice(X,X+ce));O&&I<9?W.appendChild(L("span",[je])):W.appendChild(je),e.map.push(e.pos,e.pos+ce,je),e.col+=ce,e.pos+=ce}if(!ve)break;X+=ce+1;var ze=void 0;if(ve[0]==" "){var qe=e.cm.options.tabSize,it=qe-e.col%qe;ze=W.appendChild(L("span",B(it),"cm-tab")),ze.setAttribute("role","presentation"),ze.setAttribute("cm-text"," "),e.col+=it}else ve[0]=="\r"||ve[0]==`
`?(ze=W.appendChild(L("span",ve[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ze.setAttribute("cm-text",ve[0]),e.col+=1):(ze=e.cm.options.specialCharPlaceholder(ve[0]),ze.setAttribute("cm-text",ve[0]),O&&I<9?W.appendChild(L("span",[ze])):W.appendChild(ze),e.col+=1);e.map.push(e.pos,e.pos+1,ze),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||y||s||l){var lt=i||"";n&&(lt+=n),r&&(lt+=r);var rt=L("span",[W],lt,s);if(l)for(var ht in l)l.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&rt.setAttribute(ht,l[ht]);return e.content.appendChild(rt)}e.content.appendChild(W)}function bt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&i&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function Ot(e,t){return function(i,n,r,s,l,f,m){r=r?r+" cm-force-border":"cm-force-border";for(var y=i.pos,W=y+n.length;;){for(var X=void 0,ve=0;ve<t.length&&!(X=t[ve],X.to>y&&X.from<=y);ve++);if(X.to>=W)return e(i,n,r,s,l,f,m);e(i,n.slice(0,X.to-y),r,s,null,f,m),s=null,n=n.slice(X.to-y),y=X.to}}}function It(e,t,i,n){var r=!n&&i.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!n&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",i.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function Ht(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),co(i[l+1],t.cm.options));return}for(var f=r.length,m=0,y=1,W="",X,ve,ce=0,je,ze,qe,it,lt;;){if(ce==m){je=ze=qe=ve="",lt=null,it=null,ce=Infinity;for(var rt=[],ht=void 0,xt=0;xt<n.length;++xt){var gt=n[xt],Tt=gt.marker;if(Tt.type=="bookmark"&&gt.from==m&&Tt.widgetNode)rt.push(Tt);else if(gt.from<=m&&(gt.to==null||gt.to>m||Tt.collapsed&&gt.to==m&&gt.from==m)){if(gt.to!=null&&gt.to!=m&&ce>gt.to&&(ce=gt.to,ze=""),Tt.className&&(je+=" "+Tt.className),Tt.css&&(ve=(ve?ve+";":"")+Tt.css),Tt.startStyle&&gt.from==m&&(qe+=" "+Tt.startStyle),Tt.endStyle&&gt.to==ce&&(ht||(ht=[])).push(Tt.endStyle,gt.to),Tt.title&&((lt||(lt={})).title=Tt.title),Tt.attributes)for(var $t in Tt.attributes)(lt||(lt={}))[$t]=Tt.attributes[$t];Tt.collapsed&&(!it||vn(it.marker,Tt)<0)&&(it=gt)}else gt.from>m&&ce>gt.from&&(ce=gt.from)}if(ht)for(var fn=0;fn<ht.length;fn+=2)ht[fn+1]==ce&&(ze+=" "+ht[fn]);if(!it||it.from==m)for(var Zt=0;Zt<rt.length;++Zt)It(t,0,rt[Zt]);if(it&&(it.from||0)==m){if(It(t,(it.to==null?f+1:it.to)-m,it.marker,it.from==null),it.to==null)return;it.to==m&&(it=!1)}}if(m>=f)break;for(var Un=Math.min(f,ce);;){if(W){var Rn=m+W.length;if(!it){var tn=Rn>Un?W.slice(0,Un-m):W;t.addToken(t,tn,X?X+je:je,qe,m+tn.length==ce?ze:"",ve,lt)}if(Rn>=Un){W=W.slice(Un-m),m=Un;break}m=Rn,qe=""}W=r.slice(s,s=i[y++]),X=co(i[y++],t.cm.options)}}}function Rt(e,t,i){this.line=t,this.rest=xi(t),this.size=this.rest?Mt(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Zn(e,t)}function Jt(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Rt(e.doc,dt(e.doc,s),s);r=s+l.size,n.push(l)}return n}var hn=null;function Lt(e){hn?hn.ops.push(e):e.ownsGroup=hn={ops:[e],delayedCallbacks:[]}}function Ni(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var n=0;n<e.ops.length;n++){var r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(i<t.length)}function zt(e,t){var i=e.ownsGroup;if(!i)return;try{Ni(i)}finally{hn=null,t(i)}}var bn=null;function Kt(e,t){var i=vt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;hn?r=hn.delayedCallbacks:bn?r=bn:(r=bn=[],setTimeout(Yn,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Yn(){var e=bn;bn=null;for(var t=0;t<e.length;++t)e[t]()}function pr(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ps(e,t):s=="gutter"?ea(e,t,i,n):s=="class"?fo(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=L("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),O&&I<8&&(e.node.style.zIndex=2)),e.node}function Ds(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=mr(t);t.background=n.insertBefore(L("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function qo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Fr(e,t)}function Ps(e,t){var i=t.text.className,n=qo(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,fo(e,t)):i&&(t.text.className=i)}function fo(e,t){Ds(e,t),t.line.wrapClass?mr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ea(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=mr(t);t.gutterBackground=L("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=mr(t),f=t.gutter=L("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(f),l.insertBefore(f,t.text),t.line.gutterClass&&(f.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=f.appendChild(L("div",vi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var m=0;m<e.display.gutterSpecs.length;++m){var y=e.display.gutterSpecs[m].className,W=s.hasOwnProperty(y)&&s[y];W&&f.appendChild(L("div",[W],"CodeMirror-gutter-elt","left: "+n.gutterLeft[y]+"px; width: "+n.gutterWidth[y]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=me("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ta(e,t,i)}function Is(e,t,i,n){var r=qo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),fo(e,t),ea(e,t,i,n),ta(e,t,n),t.node}function ta(e,t,i){if(na(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)na(e,t.rest[n],t,i,!1)}function na(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),l=0,f=t.widgets;l<f.length;++l){var m=f[l],y=L("div",[m.node],"CodeMirror-linewidget"+(m.className?" "+m.className:""));m.handleMouseEvents||y.setAttribute("cm-ignore-events","true"),js(m,y,i,n),e.display.input.setUneditable(y),r&&m.above?s.insertBefore(y,i.gutter||i.text):s.appendChild(y),Kt(m,"redraw")}}function js(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!x(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),xe(t.display.measure,L("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=ye(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Wr(e){return e.lineSpace.offsetTop}function po(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=xe(e.measure,L("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function oi(e){return Ee-e.display.nativeBarWidth}function Ii(e){return e.display.scroller.clientWidth-oi(e)-e.display.barWidth}function mo(e){return e.display.scroller.clientHeight-oi(e)-e.display.barHeight}function Bs(e,t,i){var n=e.options.lineWrapping,r=n&&Ii(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),f=0;f<l.length-1;f++){var m=l[f],y=l[f+1];Math.abs(m.bottom-y.bottom)>2&&s.push((m.bottom+y.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ra(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var r=0;r<e.rest.length;r++)if(Mt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=on(t);var i=Mt(t),n=e.display.externalMeasured=new Rt(e.doc,t,i);n.lineN=i;var r=n.built=Fr(e,n);return n.text=r.pre,xe(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return ai(e,Ji(e,t),i,n)}function go(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ui(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Ji(e,t){var i=Mt(t),n=go(e,i);n&&!n.text?n=null:n&&n.changes&&(pr(e,n,i,_o(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var r=ra(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ai(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bs(e,t.view,t.rect),t.hasHeights=!0),l=Ws(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var aa={left:0,right:0,top:0,bottom:0};function sa(e,t,i){for(var n,r,s,l,f,m,y=0;y<e.length;y+=3)if(f=e[y],m=e[y+1],t<f?(r=0,s=1,l="left"):t<m?(r=t-f,s=r+1):(y==e.length-3||t==m&&e[y+3]>t)&&(s=m-f,r=s-1,t>=m&&(l="right")),r!=null){if(n=e[y+2],f==m&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;y&&e[y-2]==e[y-3]&&e[y-1].insertLeft;)n=e[(y-=3)+2],l="left";if(i=="right"&&r==m-f)for(;y<e.length-3&&e[y+3]==e[y+4]&&!e[y+5].insertLeft;)n=e[(y+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:f,coverEnd:m}}function Fs(e,t){var i=aa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function Ws(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,f=r.end,m=r.collapse,y;if(s.nodeType==3){for(var W=0;W<4;W++){for(;l&&Me(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Me(t.line.text.charAt(r.coverStart+f));)++f;if(O&&I<9&&l==0&&f==r.coverEnd-r.coverStart?y=s.parentNode.getBoundingClientRect():y=Fs(Y(s,l,f).getClientRects(),n),y.left||y.right||l==0)break;f=l,l=l-1,m="right"}O&&I<11&&(y=Hs(e.display.measure,y))}else{l>0&&(m=n="right");var X;e.options.lineWrapping&&(X=s.getClientRects()).length>1?y=X[n=="right"?X.length-1:0]:y=s.getBoundingClientRect()}if(O&&I<9&&!l&&(!y||!y.left&&!y.right)){var ve=s.parentNode.getClientRects()[0];ve?y={left:ve.left,right:ve.left+Qi(e.display),top:ve.top,bottom:ve.bottom}:y=aa}for(var ce=y.top-t.rect.top,je=y.bottom-t.rect.top,ze=(ce+je)/2,qe=t.view.measure.heights,it=0;it<qe.length-1&&!(ze<qe[it]);it++);var lt=it?qe[it-1]:0,rt=qe[it],ht={left:(m=="right"?y.right:y.left)-t.rect.left,right:(m=="left"?y.left:y.right)-t.rect.left,top:lt,bottom:rt};return!y.left&&!y.right&&(ht.bogus=!0),e.options.singleCursorHeightPerLine||(ht.rtop=ce,ht.rbottom=je),ht}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Vt(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function la(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function ua(e){e.display.externalMeasure=null,Pe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)la(e.display.view[t])}function vr(e){ua(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ha(){return S&&K?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ca(){return S&&K?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vo(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=gr(e.widgets[i]));return t}function Hr(e,t,i,n,r){if(!r){var s=vo(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=jn(t);if(n=="local"?l+=Wr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:ca());var m=f.left+(n=="window"?0:ha());i.left+=m,i.right+=m}return i.top+=l,i.bottom+=l,i}function da(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ha(),r-=ca();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function yo(e,t,i,n,r){return n||(n=dt(e.doc,t.line)),Hr(e,n,oa(e,n,t.ch,r),i)}function Qn(e,t,i,n,r,s){n=n||dt(e.doc,t.line),r||(r=Ji(e,n));function l(je,ze){var qe=ai(e,r,je,ze?"right":"left",s);return ze?qe.left=qe.right:qe.right=qe.left,Hr(e,n,qe,i)}var f=tt(n,e.doc.direction),m=t.ch,y=t.sticky;if(m>=n.text.length?(m=n.text.length,y="before"):m<=0&&(m=0,y="after"),!f)return l(y=="before"?m-1:m,y=="before");function W(je,ze,qe){var it=f[ze],lt=it.level==1;return l(qe?je-1:je,lt!=qe)}var X=Qe(f,m,y),ve=Ze,ce=W(m,X,y=="before");return ve!=null&&(ce.other=W(m,ve,y!="before")),ce}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Qi(e.display)*t.ch);var n=dt(e.doc,t.line),r=jn(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=$e(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function xo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return bo(n.first,0,null,-1,-1);var r=Xn(n,i),s=n.first+n.size-1;if(r>s)return bo(n.first+n.size-1,dt(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=dt(n,r);;){var f=zs(e,l,r,t,i),m=bi(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!m)return f;var y=m.find(1);if(y.line==r)return y;l=dt(n,r=y.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=et(function(l){return ai(e,i,l-1).bottom<=n},r,0);return r=et(function(l){return ai(e,i,l).top>n},s,r),{begin:s,end:r}}function ma(e,t,i,n){i||(i=Ji(e,t));var r=Hr(e,t,ai(e,i,n),"line").top;return pa(e,t,i,r)}function Co(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function zs(e,t,i,n,r){r-=jn(t);var s=Ji(e,t),l=vo(t),f=0,m=t.text.length,y=!0,W=tt(t,e.doc.direction);if(W){var X=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,W,n,r);y=X.level!=1,f=y?X.from:X.to-1,m=y?X.to:X.from-1}var ve=null,ce=null,je=et(function(xt){var gt=ai(e,s,xt);return gt.top+=l,gt.bottom+=l,Co(gt,n,r,!1)?(gt.top<=r&&gt.left<=n&&(ve=xt,ce=gt),!0):!1},f,m),ze,qe,it=!1;if(ce){var lt=n-ce.left<ce.right-n,rt=lt==y;je=ve+(rt?0:1),qe=rt?"after":"before",ze=lt?ce.left:ce.right}else{!y&&(je==m||je==f)&&je++,qe=je==0?"after":je==t.text.length?"before":ai(e,s,je-(y?1:0)).bottom+l<=r==y?"after":"before";var ht=Qn(e,$e(i,je,qe),"line",t,s);ze=ht.left,it=r<ht.top?-1:r>=ht.bottom?1:0}return je=Ue(t.text,je,1),bo(i,je,qe,it,n-ze)}function Gs(e,t,i,n,r,s,l){var f=et(function(X){var ve=r[X],ce=ve.level!=1;return Co(Qn(e,$e(i,ce?ve.to:ve.from,ce?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),m=r[f];if(f>0){var y=m.level!=1,W=Qn(e,$e(i,y?m.from:m.to,y?"after":"before"),"line",t,n);Co(W,s,l,!0)&&W.top>l&&(m=r[f-1])}return m}function Vs(e,t,i,n,r,s,l){var f=pa(e,t,n,l),m=f.begin,y=f.end;/\s/.test(t.text.charAt(y-1))&&y--;for(var W=null,X=null,ve=0;ve<r.length;ve++){var ce=r[ve];if(ce.from>=y||ce.to<=m)continue;var je=ce.level!=1,ze=ai(e,n,je?Math.min(y,ce.to)-1:Math.max(m,ce.from)).right,qe=ze<s?s-ze+1e9:ze-s;(!W||X>qe)&&(W=ce,X=qe)}return W||(W=r[r.length-1]),W.from<m&&(W={from:m,to:W.to,level:W.level}),W.to>y&&(W={from:W.from,to:y,level:W.level}),W}var ji;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ji==null){ji=L("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ji.appendChild(document.createTextNode("x")),ji.appendChild(L("br"));ji.appendChild(document.createTextNode("x"))}xe(e.measure,ji);var i=ji.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Pe(e.measure),i||1}function Qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=L("span","xxxxxxxxxx"),i=L("pre",[t],"CodeMirror-line-like");xe(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function _o(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+r,n[f]=s.clientWidth}return{fixedPos:wo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function wo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ga(e){var t=Zi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Qi(e.display)-3);return function(r){if(Zn(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function Eo(e){var t=e.doc,i=ga(e);t.iter(function(n){var r=i(n);r!=n.height&&Tn(n,r)})}function Bi(e,t,i,n){var r=e.display;if(!i&&ye(t).getAttribute("cm-not-content")=="true")return null;var s,l,f=r.lineSpace.getBoundingClientRect();try{s=t.clientX-f.left,l=t.clientY-f.top}catch(X){return null}var m=xo(e,s,l),y;if(n&&m.xRel>0&&(y=dt(e.doc,m.line).text).length==m.ch){var W=w(y,y.length,e.options.tabSize)-y.length;m=$e(m.line,Math.max(0,Math.round((s-ia(e.display).left)/Qi(e.display))-W))}return m}function Ui(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if(t-=i[n].size,t<0)return n}function Ln(e,t,i,n){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),n||(n=0);var r=e.display;if(n&&i<r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)An&&Ci(e.doc,t)<r.viewTo&&Ei(e);else if(i<=r.viewFrom)An&&Ur(e.doc,i+n)>r.viewFrom?Ei(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ei(e);else if(t<=r.viewFrom){var s=zr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Ei(e)}else if(i>=r.viewTo){var l=zr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ei(e)}else{var f=zr(e,t,t,-1),m=zr(e,i,i+n,1);f&&m?(r.view=r.view.slice(0,f.index).concat(Jt(e,f.lineN,m.lineN)).concat(r.view.slice(m.index)),r.viewTo+=n):Ei(e)}var y=r.externalMeasured;y&&(i<y.lineN?y.lineN+=n:t<y.lineN+y.size&&(r.externalMeasured=null))}function wi(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var s=n.view[Ui(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);te(l,i)==-1&&l.push(i)}function Ei(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zr(e,t,i,n){var r=Ui(e,t),s,l=e.display.view;if(!An||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,m=0;m<r;m++)f+=l[m].size;if(f!=t){if(n>0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-t;t+=s,i+=s}for(;Ci(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Ks(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Jt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Jt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ui(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Jt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ui(e,i)))),n.viewTo=i}function va(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ya(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var f=i.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var m=f.empty();(m||e.options.showCursorWhenSelecting)&&ba(e,f.head,r),m||Xs(e,f,s)}return n}function ba(e,t,i){var n=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(L("div","\xA0","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(L("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Gr(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=ia(e.display),f=l.left,m=Math.max(n.sizerWidth,Ii(e)-n.sizer.offsetLeft)-l.right,y=r.direction=="ltr";function W(rt,ht,xt,gt){ht<0&&(ht=0),ht=Math.round(ht),gt=Math.round(gt),s.appendChild(L("div",null,"CodeMirror-selected","position: absolute; left: "+rt+`px;
top: `+ht+"px; width: "+(xt==null?m-rt:xt)+`px;
height: `+(gt-ht)+"px"))}function X(rt,ht,xt){var gt=dt(r,rt),Tt=gt.text.length,$t,fn;function Zt(tn,Dn){return yo(e,$e(rt,tn),"div",gt,Dn)}function Un(tn,Dn,xn){var an=ma(e,gt,null,tn),nn=Dn=="ltr"==(xn=="after")?"left":"right",Qt=xn=="after"?an.begin:an.end-(/\s/.test(gt.text.charAt(an.end-1))?2:1);return Zt(Qt,nn)[nn]}var Rn=tt(gt,r.direction);return Ve(Rn,ht||0,xt==null?Tt:xt,function(tn,Dn,xn,an){var nn=xn=="ltr",Qt=Zt(tn,nn?"left":"right"),Pn=Zt(Dn-1,nn?"right":"left"),cr=ht==null&&tn==0,Li=xt==null&&Dn==Tt,_n=an==0,si=!Rn||an==Rn.length-1;if(Pn.top-Qt.top<=3){var pn=(y?cr:Li)&&_n,Yo=(y?Li:cr)&&si,gi=pn?f:(nn?Qt:Pn).left,Gi=Yo?m:(nn?Pn:Qt).right;W(gi,Qt.top,Gi-gi,Qt.bottom)}else{var Vi,Sn,dr,Jo;nn?(Vi=y&&cr&&_n?f:Qt.left,Sn=y?m:Un(tn,xn,"before"),dr=y?f:Un(Dn,xn,"after"),Jo=y&&Li&&si?m:Pn.right):(Vi=y?Un(tn,xn,"before"):f,Sn=!y&&cr&&_n?m:Qt.right,dr=!y&&Li&&si?f:Pn.left,Jo=y?Un(Dn,xn,"after"):m),W(Vi,Qt.top,Sn-Vi,Qt.bottom),Qt.bottom<Pn.top&&W(f,Qt.bottom,null,Pn.top),W(dr,Pn.top,Jo-dr,Pn.bottom)}(!$t||Gr(Qt,$t)<0)&&($t=Qt),Gr(Pn,$t)<0&&($t=Pn),(!fn||Gr(Qt,fn)<0)&&(fn=Qt),Gr(Pn,fn)<0&&(fn=Pn)}),{start:$t,end:fn}}var ve=t.from(),ce=t.to();if(ve.line==ce.line)X(ve.line,ve.ch,ce.ch);else{var je=dt(r,ve.line),ze=dt(r,ce.line),qe=on(je)==on(ze),it=X(ve.line,ve.ch,qe?je.text.length+1:null).end,lt=X(ce.line,qe?0:null,ce.ch).start;qe&&(it.top<lt.top-2?(W(it.right,it.top,null,it.bottom),W(f,lt.top,lt.left,lt.bottom)):W(it.right,it.top,lt.left-it.right,it.bottom)),it.bottom<lt.top&&W(f,it.bottom,null,lt.top)}i.appendChild(s)}function So(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||qi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function xa(e){e.state.focused||(e.display.input.focus(),ko(e))}function Ca(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,qi(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Be(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),R&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),So(e)}function qi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Be(e,"blur",e,t),e.state.focused=!1,Se(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r=t.view[n],s=e.options.lineWrapping,l=void 0,f=0;if(r.hidden)continue;if(O&&I<8){var m=r.node.offsetTop+r.node.offsetHeight;l=m-i,i=m}else{var y=r.node.getBoundingClientRect();l=y.bottom-y.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-y.left-1)}var W=r.line.height-l;if((W>.005||W<-.005)&&(Tn(r.line,l),_a(r.line),r.rest))for(var X=0;X<r.rest.length;X++)_a(r.rest[X]);if(f>e.display.sizerWidth){var ve=Math.ceil(f/Qi(e.display));ve>e.display.maxLineLength&&(e.display.maxLineLength=ve,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function _a(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Kr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Xn(t,n),l=Xn(t,r);if(i&&i.ensure){var f=i.ensure.from.line,m=i.ensure.to.line;f<s?(s=f,l=Xn(t,jn(dt(t,f))+e.wrapper.clientHeight)):Math.min(m,t.lastLine())>=l&&(s=Xn(t,jn(dt(t,m))-e.wrapper.clientHeight),l=m)}return{from:s,to:Math.max(l,s+1)}}function $s(e,t){if(Ye(e,"scrollCursorIntoView"))return;var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),r!=null&&!N){var s=L("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Wr(e.display))+`px;
height: `+(t.bottom-t.top+oi(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function Ys(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?$e(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?$e(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Qn(e,t),m=!i||i==t?f:Qn(e,i);r={left:Math.min(f.left,m.left),top:Math.min(f.top,m.top)-n,right:Math.max(f.left,m.left),bottom:Math.max(f.bottom,m.bottom)+n};var y=To(e,r),W=e.doc.scrollTop,X=e.doc.scrollLeft;if(y.scrollTop!=null&&(xr(e,y.scrollTop),Math.abs(e.doc.scrollTop-W)>1&&(l=!0)),y.scrollLeft!=null&&(Fi(e,y.scrollLeft),Math.abs(e.doc.scrollLeft-X)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=To(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&Fi(e,i.scrollLeft)}function To(e,t){var i=e.display,n=Zi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=mo(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+po(i),m=t.top<n,y=t.bottom>f-n;if(t.top<r)l.scrollTop=m?0:t.top;else if(t.bottom>r+s){var W=Math.min(t.top,(y?f:t.bottom)-s);W!=r&&(l.scrollTop=W)}var X=e.options.fixedGutter?0:i.gutters.offsetWidth,ve=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-X,ce=Ii(e)-i.gutters.offsetWidth,je=t.right-t.left>ce;return je&&(t.right=t.left+ce),t.left<10?l.scrollLeft=0:t.left<ve?l.scrollLeft=Math.max(0,t.left+X-(je?0:10)):t.right>ce+ve-3&&(l.scrollLeft=t.right+(je?0:10)-ce),l}function Ao(e,t){if(t==null)return;Xr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function er(e){Xr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Xr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Xr(e),e.curOp.scrollToPos=t}function Xr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=fa(e,t.from),n=fa(e,t.to);wa(e,i,n,t.margin)}}function wa(e,t,i,n){var r=To(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});br(e,r.scrollLeft,r.scrollTop)}function xr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;oe||Lo(e,{top:t}),Ea(e,t,!0),oe&&Lo(e),wr(e,100)}function Ea(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Fi(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Oa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Cr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+po(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+oi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Wi=function(e,t,i){this.cm=i;var n=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Re(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Re(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,O&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var r=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?n:0,bottom:t?n:0}},Wi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wi.prototype.zeroWidthHack=function(){var e=de&&!z?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new F,this.disableVert=new F},Wi.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function n(){var r=e.getBoundingClientRect(),s=i=="vert"?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);s!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},Wi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var _r=function(){};_r.prototype.update=function(){return{bottom:0,right:0}},_r.prototype.setScrollLeft=function(){},_r.prototype.setScrollTop=function(){},_r.prototype.clear=function(){};function tr(e,t){t||(t=Cr(e));var i=e.display.barWidth,n=e.display.barHeight;Sa(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Vr(e),Sa(e,Cr(e)),i=e.display.barWidth,n=e.display.barHeight}function Sa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var ka={native:Wi,null:_r};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Se(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Re(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?Fi(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Hi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},Lt(e.curOp)}function zi(e){var t=e.curOp;t&&zt(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&fi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Oo(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=Cr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oa(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+oi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ii(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==j();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&tr(t,e.barMeasure),e.updatedDisplay&&Ro(t,e.barMeasure),e.selectionChanged&&So(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&xa(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Aa(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ea(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Fi(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=Ys(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var f=0;f<s.length;++f)s[f].lines.length||Be(s[f],"hide");if(l)for(var m=0;m<l.length;++m)l[m].lines.length&&Be(l[m],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Bn(e,t){if(e.curOp)return t();Hi(e);try{return t()}finally{zi(e)}}function cn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hi(e);try{return t.apply(e,arguments)}finally{zi(e)}}}function En(e){return function(){if(this.curOp)return e.apply(this,arguments);Hi(this);try{return e.apply(this,arguments)}finally{zi(this)}}}function dn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hi(t);try{return e.apply(this,arguments)}finally{zi(t)}}}function wr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,p(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=Ce(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,f=s.text.length>e.options.maxHighlightLength?kn(t.mode,n.state):null,m=Z(e,s,n,!0);f&&(n.state=f),s.styles=m.styles;var y=s.styleClasses,W=m.classes;W?s.styleClasses=W:y&&(s.styleClasses=null);for(var X=!l||l.length!=s.styles.length||y!=W&&(!y||!W||y.bgClass!=W.bgClass||y.textClass!=W.textClass),ve=0;!X&&ve<l.length;++ve)X=l[ve]!=s.styles[ve];X&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&ct(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return wr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&Bn(e,function(){for(var s=0;s<r.length;s++)wi(e,r[s],"text")})}var $r=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Kr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ii(e),this.force=i,this.dims=_o(e),this.events=[]};$r.prototype.signal=function(e,t){q(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Be.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=oi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=oi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=j();if(!t||!x(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&x(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==j())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&x(document.body,e.anchorNode)&&x(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Oo(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Ei(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&va(e)==0)return!1;La(e)&&(Ei(e),t.dims=_o(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),An&&(s=Ci(e.doc,s),l=Ur(e.doc,l));var f=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Ks(e,s,l),i.viewOffset=jn(dt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=va(e);if(!f&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var y=sl(e);return m>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(y),Pe(i.cursorDiv),Pe(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,f&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,wr(e,400)),i.updateLineNumbers=null,!0}function Aa(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ii(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-mo(e),i.top)}),t.visible=Kr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Kr(e.display,e.doc,i));if(!Oo(e,t))break;Vr(e);var r=Cr(e);yr(e),tr(e,r),Ro(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Lo(e,t){var i=new $r(e,t);if(Oo(e,i)){Vr(e),Aa(e,i);var n=Cr(e);yr(e),tr(e,n),Ro(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function f(je){var ze=je.nextSibling;return R&&de&&e.display.currentWheelTarget==je?je.style.display="none":je.parentNode.removeChild(je),ze}for(var m=n.view,y=n.viewFrom,W=0;W<m.length;W++){var X=m[W];if(!X.hidden)if(!X.node||X.node.parentNode!=s){var ve=Is(e,X,y,i);s.insertBefore(ve,l)}else{for(;l!=X.node;)l=f(l);var ce=r&&t!=null&&t<=y&&X.lineNumber;X.changes&&(te(X.changes,"gutter")>-1&&(ce=!1),pr(e,X,y,i)),ce&&(Pe(X.lineNumber),X.lineNumber.appendChild(document.createTextNode(vi(e.options,y)))),l=X.node.nextSibling}y+=X.size}for(;l;)l=f(l)}function Mo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ro(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+oi(e)+"px"}function Oa(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=wo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var f=i[l].alignable;if(f)for(var m=0;m<f.length;m++)f[m].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function La(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=vi(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(L("div",[L("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Mo(e.display),!0}return!1}function Do(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Ma(e){var t=e.gutters,i=e.gutterSpecs;Pe(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,f=t.appendChild(L("div",null,"CodeMirror-gutter "+s));l&&(f.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=f,f.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Mo(e)}function Er(e){Ma(e.display),Ln(e),Oa(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=L("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=L("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ue("div",null,"CodeMirror-code"),r.selectionDiv=L("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=L("div",null,"CodeMirror-cursors"),r.measure=L("div",null,"CodeMirror-measure"),r.lineMeasure=L("div",null,"CodeMirror-measure"),r.lineSpace=ue("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=ue("div",[r.lineSpace],"CodeMirror-lines");r.mover=L("div",[s],null,"position: relative"),r.sizer=L("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=L("div",null,null,"position: absolute; height: "+Ee+"px; width: 1px;"),r.gutters=L("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=L("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=L("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),O&&I<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!R&&!(oe&&Q)&&(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,r.gutterSpecs=Do(n.gutters,n.lineNumbers),Ma(r),i.init(r)}var Yr=0,Gn=null;O?Gn=-.53:oe?Gn=15:S?Gn=-.7:$&&(Gn=-1/3);function Ra(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function cl(e){var t=Ra(e);return t.x*=Gn,t.y*=Gn,t}function Da(e,t){var i=Ra(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,m=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&m))return;if(r&&de&&R){e:for(var y=t.target,W=s.view;y!=l;y=y.parentNode)for(var X=0;X<W.length;X++)if(W[X].node==y){e.display.currentWheelTarget=y;break e}}if(n&&!oe&&!T&&Gn!=null){r&&m&&xr(e,Math.max(0,l.scrollTop+r*Gn)),Fi(e,Math.max(0,l.scrollLeft+n*Gn)),(!r||r&&m)&&C(t),s.wheelStartX=null;return}if(r&&Gn!=null){var ve=r*Gn,ce=e.doc.scrollTop,je=ce+s.wrapper.clientHeight;ve<0?ce=Math.max(0,ce+ve-50):je=Math.min(e.doc.height,je+ve+50),Lo(e,{top:ce,bottom:je})}Yr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var ze=l.scrollLeft-s.wheelStartX,qe=l.scrollTop-s.wheelStartY,it=qe&&s.wheelDY&&qe/s.wheelDY||ze&&s.wheelDX&&ze/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!it)return;Gn=(Gn*Yr+it)/(Yr+1),++Yr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Vn=function(e,t){this.ranges=e,this.primIndex=t};Vn.prototype.primary=function(){return this.ranges[this.primIndex]},Vn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(!ti(i.anchor,n.anchor)||!ti(i.head,n.head))return!1}return!0},Vn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ft(ci(this.ranges[t].anchor),ci(this.ranges[t].head));return new Vn(e,this.primIndex)},Vn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Vn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ct(t,n.from())>=0&&Ct(e,n.to())<=0)return i}return-1};var Ft=function(e,t){this.anchor=e,this.head=t};Ft.prototype.from=function(){return Mi(this.anchor,this.head)},Ft.prototype.to=function(){return di(this.anchor,this.head)},Ft.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qn(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(ve,ce){return Ct(ve.from(),ce.from())}),i=te(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],m=Ct(f.to(),l.from());if(n&&!l.empty()?m>0:m>=0){var y=Mi(f.from(),l.from()),W=di(f.to(),l.to()),X=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ft(X?W:y,X?y:W))}}return new Vn(t,i)}function Si(e,t){return new Vn([new Ft(e,t||e)],0)}function ki(e){return e.text?$e(e.from.line+e.text.length-1,b(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Pa(e,t){if(Ct(e,t.from)<0)return e;if(Ct(e,t.to)<=0)return ki(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=ki(t).ch-t.to.ch),$e(i,n)}function Po(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Ft(Pa(r.anchor,t),Pa(r.head,t)))}return qn(e.cm,i,e.sel.primIndex)}function Na(e,t,i){return e.line==t.line?$e(i.line,e.ch-t.ch+i.ch):$e(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=$e(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],m=Na(f.from,r,s),y=Na(ki(f),r,s);if(r=f.to,s=y,i=="around"){var W=e.sel.ranges[l],X=Ct(W.head,W.anchor)<0;n[l]=new Ft(X?y:m,X?m:y)}else n[l]=new Ft(m,m)}return new Vn(n,e.sel.primIndex)}function No(e){e.doc.mode=wn(e.options,e.doc.modeOption),Sr(e)}function Sr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,wr(e,100),e.state.modeGen++,e.curOp&&Ln(e)}function Ia(e,t){return t.from.ch==0&&t.to.ch==0&&b(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Io(e,t,i,n){function r(lt){return i?i[lt]:null}function s(lt,rt,ht){uo(lt,rt,ht,n),Kt(lt,"change",lt,t)}function l(lt,rt){for(var ht=[],xt=lt;xt<rt;++xt)ht.push(new _i(y[xt],r(xt),n));return ht}var f=t.from,m=t.to,y=t.text,W=dt(e,f.line),X=dt(e,m.line),ve=b(y),ce=r(y.length-1),je=m.line-f.line;if(t.full)e.insert(0,l(0,y.length)),e.remove(y.length,e.size-y.length);else if(Ia(e,t)){var ze=l(0,y.length-1);s(X,X.text,ce),je&&e.remove(f.line,je),ze.length&&e.insert(f.line,ze)}else if(W==X)if(y.length==1)s(W,W.text.slice(0,f.ch)+ve+W.text.slice(m.ch),ce);else{var qe=l(1,y.length-1);qe.push(new _i(ve+W.text.slice(m.ch),ce,n)),s(W,W.text.slice(0,f.ch)+y[0],r(0)),e.insert(f.line+1,qe)}else if(y.length==1)s(W,W.text.slice(0,f.ch)+y[0]+X.text.slice(m.ch),r(0)),e.remove(f.line+1,je);else{s(W,W.text.slice(0,f.ch)+y[0],r(0)),s(X,ve+X.text.slice(m.ch),ce);var it=l(1,y.length-1);je>1&&e.remove(f.line+1,je-1),e.insert(f.line+1,it)}Kt(e,"change",e,t)}function Ti(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var m=r.linked[f];if(m.doc==s)continue;var y=l&&m.sharedHist;if(i&&!y)continue;t(m.doc,y),n(m.doc,r,y)}}n(e,null,!0)}function ja(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Eo(e),No(e),Ba(e),e.options.lineWrapping||fi(e),e.options.mode=t.modeOption,Ln(e)}function Ba(e){(e.doc.direction=="rtl"?D:Se)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Bn(e,function(){Ba(e),Ln(e)})}function Jr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function jo(e,t){var i={from:ci(t.from),to:ki(t),text:Fn(e,t.from,t.to)};return Wa(e,i,t.from.line,t.to.line+1),Ti(e,function(n){return Wa(n,i,t.from.line,t.to.line+1)},!0),i}function Ua(e){for(;e.length;){var t=b(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ua(e.done),b(e.done);if(e.done.length&&!b(e.done).ranges)return b(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),b(e.done)}function Fa(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,f;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))f=b(l.changes),Ct(t.from,t.to)==0&&Ct(t.from,f.to)==0?f.to=ki(t):l.changes.push(jo(e,t));else{var m=b(r.done);for((!m||!m.ranges)&&Zr(e.sel,r.done),l={changes:[jo(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,f||Be(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,b(r.done),t))?r.done[r.done.length-1]=t:Zr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ua(r.undone)}function Zr(e,t){var i=b(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Wa(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function Ha(e,t){var i=yl(e,t),n=Nn(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var f=0;f<l.length;++f){for(var m=l[f],y=0;y<s.length;++y)if(s[y].marker==m.marker)continue e;s.push(m)}}else l&&(i[r]=l)}return i}function nr(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Vn.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var m=0;m<l.length;++m){var y=l[m],W=void 0;if(f.push({from:y.from,to:y.to,text:y.text}),t)for(var X in y)(W=X.match(/^spans_(\d+)$/))&&(te(t,Number(W[1]))>-1&&(b(f)[X]=y[X],delete y[X]))}}return n}function Bo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=Ct(t,r)<0;s!=Ct(i,r)<0?(r=t,t=i):s!=Ct(t,i)<0&&(t=i)}return new Ft(r,t)}else return new Ft(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Cn(e,new Vn([Bo(e.sel.primary(),t,i,r)],0),n)}function za(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=Bo(e.sel.ranges[s],t[s],null,r);var l=qn(e.cm,n,e.sel.primIndex);Cn(e,l,i)}function Uo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Cn(e,qn(e.cm,r,e.sel.primIndex),n)}function Ga(e,t,i,n){Cn(e,Si(t,i),n)}function bl(e,t,i){var n={ranges:t.ranges,update:function(r){this.ranges=[];for(var s=0;s<r.length;s++)this.ranges[s]=new Ft(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return Be(e,"beforeSelectionChange",e,n),e.cm&&Be(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?qn(e.cm,n.ranges,n.ranges.length-1):t}function Va(e,t,i){var n=e.history.done,r=b(n);r&&r.ranges?(n[n.length-1]=t,qr(e,t,i)):Cn(e,t,i)}function Cn(e,t,i){qr(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function qr(e,t,i){(q(e,"beforeSelectionChange")||e.cm&&q(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ct(t.primary().head,e.sel.primary().head)<0?-1:1);Ka(e,$a(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&er(e.cm)}function Ka(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ae(e.cm)),Kt(e,"cursorActivity",e)}function Xa(e){Ka(e,$a(e,e.sel,null,!1))}function $a(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],f=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],m=eo(e,l.anchor,f&&f.anchor,i,n),y=eo(e,l.head,f&&f.head,i,n);(r||m!=l.anchor||y!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ft(m,y))}return r?qn(e.cm,r,t.primIndex):t}function ir(e,t,i,n,r){var s=dt(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],m=f.marker,y="selectLeft"in m?!m.selectLeft:m.inclusiveLeft,W="selectRight"in m?!m.selectRight:m.inclusiveRight;if((f.from==null||(y?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(W?f.to>=t.ch:f.to>t.ch))){if(r&&(Be(m,"beforeCursorEnter"),m.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!m.atomic)continue;if(i){var X=m.find(n<0?1:-1),ve=void 0;if((n<0?W:y)&&(X=Ya(e,X,-n,X&&X.line==t.line?s:null)),X&&X.line==t.line&&(ve=Ct(X,i))&&(n<0?ve<0:ve>0))return ir(e,X,t,n,r)}var ce=m.find(n<0?-1:1);return(n<0?y:W)&&(ce=Ya(e,ce,n,ce.line==t.line?s:null)),ce?ir(e,ce,t,n,r):null}}return t}function eo(e,t,i,n,r){var s=n||1,l=ir(e,t,i,s,r)||!r&&ir(e,t,i,s,!0)||ir(e,t,i,-s,r)||!r&&ir(e,t,i,-s,!0);return l||(e.cantEdit=!0,$e(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,$e(t.line-1)):null:i>0&&t.ch==(n||dt(e,t.line)).text.length?t.line<e.first+e.size-1?$e(t.line+1,0):null:new $e(t.line,t.ch+i)}function Ja(e){e.setSelection($e(e.firstLine(),0),$e(e.lastLine()),pe)}function Za(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(r,s,l,f){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),f!==void 0&&(n.origin=f)}),Be(e,"beforeChange",e,n),e.cm&&Be(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function rr(e,t,i){if(e.cm){if(!e.cm.curOp)return cn(e.cm,rr)(e,t,i);if(e.cm.state.suppressEdits)return}if((q(e,"beforeChange")||e.cm&&q(e.cm,"beforeChange"))&&(t=Za(e,t,!0),!t))return;var n=Ki&&!i&&Ri(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Qa(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Qa(e,t)}function Qa(e,t){if(t.text.length==1&&t.text[0]==""&&Ct(t.from,t.to)==0)return;var i=Po(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),kr(e,t,i,Nn(e,t));var n=[];Ti(e,function(r,s){!s&&te(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),kr(r,t,null,Nn(r,t))})}function to(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,f=t=="undo"?r.done:r.undone,m=t=="undo"?r.undone:r.done,y=0;y<f.length&&!(s=f[y],i?s.ranges&&!s.equals(e.sel):!s.ranges);y++);if(y==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Zr(s,m),i&&!s.equals(e.sel)){Cn(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var W=[];Zr(l,m),m.push({changes:W,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var X=q(e,"beforeChange")||e.cm&&q(e.cm,"beforeChange"),ve=function(ze){var qe=s.changes[ze];if(qe.origin=t,X&&!Za(e,qe,!1))return f.length=0,{};W.push(jo(e,qe));var it=ze?Po(e,qe):b(f);kr(e,qe,it,Ha(e,qe)),!ze&&e.cm&&e.cm.scrollIntoView({from:qe.from,to:ki(qe)});var lt=[];Ti(e,function(rt,ht){!ht&&te(lt,rt.history)==-1&&(ns(rt.history,qe),lt.push(rt.history)),kr(rt,qe,null,Ha(rt,qe))})},ce=s.changes.length-1;ce>=0;--ce){var je=ve(ce);if(je)return je.v}}function qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Vn(G(e.sel.ranges,function(r){return new Ft($e(r.anchor.line+t,r.anchor.ch),$e(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Ln(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)wi(e.cm,n,"gutter")}}function kr(e,t,i,n){if(e.cm&&!e.cm.curOp)return cn(e.cm,kr)(e,t,i,n);if(t.to.line<e.first){qa(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);qa(e,r),t={from:$e(e.first,0),to:$e(t.to.line+r,t.to.ch),text:[b(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:$e(s,dt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Fn(e,t.from,t.to),i||(i=Po(e,t)),e.cm?xl(e.cm,t,n):Io(e,t,n),qr(e,i,pe),e.cantEdit&&eo(e,$e(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,f=!1,m=s.line;e.options.lineWrapping||(m=Mt(on(dt(n,s.line))),n.iter(m,l.line+1,function(ce){if(ce==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ae(e),Io(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(m,s.line+t.text.length,function(ce){var je=Yi(ce);je>r.maxLineLength&&(r.maxLine=ce,r.maxLineLength=je,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),$n(n,s.line),wr(e,400);var y=t.text.length-(l.line-s.line)-1;t.full?Ln(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?wi(e,s.line,"text"):Ln(e,s.line,l.line+1,y);var W=q(e,"changes"),X=q(e,"change");if(X||W){var ve={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};X&&Kt(e,"change",e,ve),W&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ve)}e.display.selForContextMenu=null}function or(e,t,i,n,r){var s;n||(n=i),Ct(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),rr(e,{from:i,to:n,text:t,origin:r})}function es(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ts(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var f=0;f<s.ranges.length;f++)es(s.ranges[f].anchor,t,i,n),es(s.ranges[f].head,t,i,n);continue}for(var m=0;m<s.changes.length;++m){var y=s.changes[m];if(i<y.from.line)y.from=$e(y.from.line+n,y.from.ch),y.to=$e(y.to.line+n,y.to.ch);else if(t<=y.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ns(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;ts(e.done,i,n,r),ts(e.undone,i,n,r)}function Tr(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=dt(e,c(e,t)):r=Mt(t),r==null?null:(n(s,r)&&e.cm&&wi(e.cm,r,i),s)}function Ar(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ar.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,ho(r),Kt(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}};function Or(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var r=e[n];t+=r.chunkSize(),i+=r.height,r.parent=this}this.size=t,this.height=i,this.parent=null}Or.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ar))){var f=[];this.collapse(f),this.children=[new Ar(f)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,f=l;f<r.lines.length;){var m=new Ar(r.lines.slice(f,f+=25));r.height-=m.height,this.children.splice(++n,0,m),m.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Or(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=te(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Or(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Lr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Lr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Mt(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=gr(this);Tn(i,Math.max(0,i.height-s)),e&&(Bn(e,function(){is(e,i,-s),wi(e,n,"widget")}),Kt(e,"lineWidgetCleared",e,this,n))},Lr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=gr(this)-t;if(!r)return;Zn(this.doc,n)||Tn(n,n.height+r),i&&Bn(i,function(){i.curOp.forceUpdate=!0,is(i,n,r),Kt(i,"lineWidgetChanged",i,e,Mt(n))})},ie(Lr);function is(e,t,i){jn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ao(e,i)}function Cl(e,t,i,n){var r=new Lr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Tr(e,t,"widget",function(l){var f=l.widgets||(l.widgets=[]);if(r.insertAt==null?f.push(r):f.splice(Math.min(f.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Zn(e,l)){var m=jn(l)<e.scrollTop;Tn(l,l.height+gr(r)),m&&Ao(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&Kt(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Mt(t)),r}var rs=0,Ai=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};Ai.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hi(e),q(this,"clear")){var i=this.find();i&&Kt(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],f=Jn(l.markedSpans,this);e&&!this.collapsed?wi(e,Mt(l),"text"):e&&(f.to!=null&&(r=Mt(l)),f.from!=null&&(n=Mt(l))),l.markedSpans=ii(l.markedSpans,f),f.from==null&&this.collapsed&&!Zn(this.doc,l)&&e&&Tn(l,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var m=0;m<this.lines.length;++m){var y=on(this.lines[m]),W=Yi(y);W>e.display.maxLineLength&&(e.display.maxLine=y,e.display.maxLineLength=W,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ln(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xa(e.doc)),e&&Kt(e,"markerCleared",e,this,n,r),t&&zi(e),this.parent&&this.parent.clear()},Ai.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=Jn(s.markedSpans,this);if(l.from!=null&&(i=$e(t?s:Mt(s),l.from),e==-1))return i;if(l.to!=null&&(n=$e(t?s:Mt(s),l.to),e==1))return n}return i&&{from:i,to:n}},Ai.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Bn(n,function(){var r=t.line,s=Mt(t.line),l=go(n,s);if(l&&(la(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Zn(i.doc,r)&&i.height!=null){var f=i.height;i.height=null;var m=gr(i)-f;m&&Tn(r,r.height+m)}Kt(n,"markerChanged",n,e)})},Ai.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||te(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ai.prototype.detachLine=function(e){if(this.lines.splice(te(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ie(Ai);function ar(e,t,i,n,r){if(n&&n.shared)return _l(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return cn(e.cm,ar)(e,t,i,n,r);var s=new Ai(e,r),l=Ct(t,i);if(n&&d(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=ue("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(rn(e,t.line,t,i,s)||t.line!=i.line&&rn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");ni()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,m=e.cm,y;if(e.iter(f,i.line+1,function(X){m&&s.collapsed&&!m.options.lineWrapping&&on(X)==m.display.maxLine&&(y=!0),s.collapsed&&f!=t.line&&Tn(X,0),zn(X,new yi(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(X){Zn(e,X)&&Tn(X,0)}),s.clearOnEnter&&Re(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(On(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),m){if(y&&(m.curOp.updateMaxLine=!0),s.collapsed)Ln(m,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var W=t.line;W<=i.line;W++)wi(m,W,"text");s.atomic&&Xa(m.doc),Kt(m,"markerAdded",m,s)}return s}var Mr=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Mr.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Kt(this,"clear")},Mr.prototype.find=function(e,t){return this.primary.find(e,t)},ie(Mr);function _l(e,t,i,n,r){n=d(n),n.shared=!1;var s=[ar(e,t,i,n,r)],l=s[0],f=n.widgetNode;return Ti(e,function(m){f&&(n.widgetNode=f.cloneNode(!0)),s.push(ar(m,o(m,t),o(m,i),n,r));for(var y=0;y<m.linked.length;++y)if(m.linked[y].isParent)return;l=b(s)}),new Mr(s,l)}function os(e){return e.findMarks($e(e.first,0),e.clipPos($e(e.lastLine())),function(t){return t.parent})}function wl(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(Ct(s,l)){var f=ar(e,s,l,n.primary,n.primary.type);n.markers.push(f),f.parent=n}}}function El(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Ti(r.primary.doc,function(m){return s.push(m)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];te(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,Mn=function(e,t,i,n,r){if(!(this instanceof Mn))return new Mn(e,t,i,n,r);i==null&&(i=0),Or.call(this,[new Ar([new _i("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=$e(i,0);this.sel=Si(s),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Io(this,{from:s,to:s,text:e}),Cn(this,Si(s),pe)};Mn.prototype=we(Or.prototype,{constructor:Mn,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ui(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:dn(function(e){var t=$e(this.first,0),i=this.first+this.size-1;rr(this,{from:t,to:$e(i,dt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),Cn(this,Si(t),pe)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,or(this,e,t,i,n)},getRange:function(e,t,i){var n=Fn(this,o(this,e),o(this,t));return i===!1?n:n.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(hi(this,e))return dt(this,e)},getLineNumber:function(e){return Mt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=dt(this,e)),on(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return o(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:dn(function(e,t,i){Ga(this,o(this,typeof e=="number"?$e(e,t||0):e),null,i)}),setSelection:dn(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:dn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:dn(function(e,t){za(this,u(this,e),t)}),extendSelectionsBy:dn(function(e,t){var i=G(this.sel.ranges,e);za(this,u(this,i),t)}),setSelections:dn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Ft(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Cn(this,qn(this.cm,n,t),i)}),addSelection:dn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Ft(o(this,e),o(this,t||e))),Cn(this,qn(this.cm,n,n.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,n=0;n<t.length;n++){var r=Fn(this,t[n].from(),t[n].to());i=i?i.concat(r):r}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var r=Fn(this,i[n].from(),i[n].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:dn(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var f=t&&t!="end"&&dl(this,n,t),m=n.length-1;m>=0;m--)rr(this,n[m]);f?Va(this,f):this.cm&&er(this.cm)}),undo:dn(function(){to(this,"undo")}),redo:dn(function(){to(this,"redo")}),undoSelection:dn(function(){to(this,"undo",!0)}),redoSelection:dn(function(){to(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),Ti(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:nr(this.history.done),undone:nr(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=nr(e.done.slice(0),null,!0),t.undone=nr(e.undone.slice(0),null,!0)},setGutterMarker:dn(function(e,t,i){return Tr(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&De(r)&&(n.gutterMarkers=null),!0})}),clearGutter:dn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Tr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,De(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!hi(this,e))return null;if(t=e,e=dt(this,e),!e)return null}else if(t=Mt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:dn(function(e,t,i){return Tr(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[r])n[r]=i;else{if(me(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:dn(function(e,t,i){return Tr(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[r];if(s)if(i==null)n[r]=null;else{var l=s.match(me(i));if(!l)return!1;var f=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||f==s.length?"":" ")+s.slice(f)||null}else return!1;return!0})}),addLineWidget:dn(function(e,t,i){return Cl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return ar(this,o(this,e),o(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=o(this,e),ar(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=dt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var f=0;f<l.length;f++){var m=l[f];!(m.to!=null&&r==e.line&&e.ch>=m.to||m.from==null&&r!=e.line||m.from!=null&&r==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&n.push(m.marker.parent||m.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,$e(i,t))},indexFromPos:function(e){e=o(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+i}),t},copy:function(e){var t=new Mn(ui(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var n=new Mn(ui(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],wl(n,os(this)),n},unlinkDoc:function(e){if(e instanceof Yt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),El(os(this));break}if(e.history==this.history){var n=[e.id];Ti(e,function(r){return n.push(r.id)},!0),e.history=new Jr(null),e.history.done=nr(this.history.done,n),e.history.undone=nr(this.history.undone,n)}},iterLinkedDocs:function(e){Ti(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):mt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:dn(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&fl(this.cm)})}),Mn.prototype.eachLine=Mn.prototype.iter;var as=0;function kl(e){var t=this;if(ss(t),Ye(t,e)||pi(t.display,e))return;C(e),O&&(as=+new Date);var i=Bi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,s=Array(r),l=0,f=function(){++l==r&&cn(t,function(){i=o(t.doc,i);var ce={from:i,to:i,text:t.doc.splitLines(s.filter(function(je){return je!=null}).join(t.doc.lineSeparator())),origin:"paste"};rr(t.doc,ce),Va(t.doc,Si(o(t.doc,i),o(t.doc,ki(ce))))})()},m=function(ce,je){if(t.options.allowDropFileTypes&&te(t.options.allowDropFileTypes,ce.type)==-1){f();return}var ze=new FileReader;ze.onerror=function(){return f()},ze.onload=function(){var qe=ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(qe)){f();return}s[je]=qe,f()},ze.readAsText(ce)},y=0;y<n.length;y++)m(n[y],y);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var W=e.dataTransfer.getData("Text");if(W){var X;if(t.state.draggingText&&!t.state.draggingText.copy&&(X=t.listSelections()),qr(t.doc,Si(i,i)),X)for(var ve=0;ve<X.length;++ve)or(t.doc,"",X[ve].anchor,X[ve].head,"drag");t.replaceSelection(W,"around","paste"),t.display.input.focus()}}catch(ce){}}}function Tl(e,t){if(O&&(!e.state.draggingText||+new Date-as<100)){U(t);return}if(Ye(e,t)||pi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!$){var i=L("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),T&&i.parentNode.removeChild(i)}}function Al(e,t){var i=Bi(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),xe(e.display.dragCursor,n)}function ss(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ls(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&i.push(r)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var us=!1;function Ol(){if(us)return;Ll(),us=!0}function Ll(){var e;Re(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Ml)},100))}),Re(window,"blur",function(){return ls(qi)})}function Ml(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Oi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Rr=0;Rr<10;Rr++)Oi[Rr+48]=Oi[Rr+96]=String(Rr);for(var no=65;no<=90;no++)Oi[no]=String.fromCharCode(no);for(var Dr=1;Dr<=12;Dr++)Oi[Dr+111]=Oi[Dr+63235]="F"+Dr;var mi={};mi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},mi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},mi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},mi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},mi.default=de?mi.macDefault:mi.pcDefault;function Rl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var f=t[l];if(/^(cmd|meta|m)$/i.test(f))s=!0;else if(/^a(lt)?$/i.test(f))i=!0;else if(/^(c|ctrl|control)$/i.test(f))n=!0;else if(/^s(hift)?$/i.test(f))r=!0;else throw new Error("Unrecognized modifier name: "+f)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Dl(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(n=="..."){delete e[i];continue}for(var r=G(i.split(" "),Rl),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=n):(f=r.slice(0,s+1).join(" "),l="...");var m=t[f];if(!m)t[f]=l;else if(m!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var y in t)e[y]=t[y];return e}function sr(e,t,i,n){t=io(t);var r=t.call?t.call(e,n):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&i(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return sr(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=sr(e,t.fallthrough[s],i,n);if(l)return l}}}function hs(e){var t=typeof e=="string"?e:Oi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function cs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(be?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(be?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ds(e,t){if(T&&e.keyCode==34&&e.char)return!1;var i=Oi[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),cs(i,e,t))}function io(e){return typeof e=="string"?mi[e]:e}function lr(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&Ct(s.from,b(n).to)<=0;){var l=n.pop();if(Ct(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Bn(e,function(){for(var f=n.length-1;f>=0;f--)or(e.doc,"",n[f].from,n[f].to,"+delete");er(e)})}function Fo(e,t,i){var n=Ue(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Wo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new $e(t.line,n,i<0?"after":"before")}function Ho(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=tt(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),m=f?"after":"before",y;if(l.level>0||t.doc.direction=="rtl"){var W=Ji(t,i);y=r<0?i.text.length-1:0;var X=ai(t,W,y).top;y=et(function(ve){return ai(t,W,ve).top==X},r<0==(l.level==1)?l.from:l.to-1,y),m=="before"&&(y=Fo(i,y,1))}else y=r<0?l.to:l.from;return new $e(n,y,m)}}return new $e(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=tt(t,e.doc.direction);if(!r)return Wo(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=Qe(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return Wo(t,i,n);var f=function(it,lt){return Fo(t,it instanceof $e?it.ch:it,lt)},m,y=function(it){return e.options.lineWrapping?(m=m||Ji(e,t),ma(e,t,m,it)):{begin:0,end:t.text.length}},W=y(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var X=l.level==1==n<0,ve=f(i,X?1:-1);if(ve!=null&&(X?ve<=l.to&&ve<=W.end:ve>=l.from&&ve>=W.begin)){var ce=X?"before":"after";return new $e(i.line,ve,ce)}}var je=function(it,lt,rt){for(var ht=function($t,fn){return fn?new $e(i.line,f($t,1),"before"):new $e(i.line,$t,"after")};it>=0&&it<r.length;it+=lt){var xt=r[it],gt=lt>0==(xt.level!=1),Tt=gt?rt.begin:f(rt.end,-1);if(xt.from<=Tt&&Tt<xt.to)return ht(Tt,gt);if(Tt=gt?xt.from:f(xt.to,-1),rt.begin<=Tt&&Tt<rt.end)return ht(Tt,gt)}},ze=je(s+n,n,W);if(ze)return ze;var qe=n>0?W.end:f(W.begin,-1);return qe!=null&&!(n>0&&qe==t.text.length)&&(ze=je(n>0?0:r.length-1,n,y(qe)),ze)?ze:null}var Pr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),pe)},killLine:function(e){return lr(e,function(t){if(t.empty()){var i=dt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:$e(t.head.line+1,0)}:{from:t.head,to:$e(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return lr(e,function(t){return{from:$e(t.from().line,0),to:o(e.doc,$e(t.to().line+1,0))}})},delLineLeft:function(e){return lr(e,function(t){return{from:$e(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return lr(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return lr(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection($e(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection($e(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ps(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},re)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},re)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ps(e,t.head):n},re)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=w(e.getLine(s.line),s.ch,n);t.push(B(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Bn(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var r=t[n].head,s=dt(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new $e(r.line,r.ch-1)),r.ch>0)r=new $e(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),$e(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=dt(e.doc,r.line-1).text;l&&(r=new $e(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),$e(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ft(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Bn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);er(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function fs(e,t){var i=dt(e.doc,t),n=on(i);return n!=i&&(t=Mt(n)),Ho(!0,e,n,t,1)}function Nl(e,t){var i=dt(e.doc,t),n=ri(i);return n!=i&&(t=Mt(n)),Ho(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=dt(e.doc,i.line),r=tt(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return $e(i.line,l?0:s,i.sticky)}return i}function ro(e,t,i){if(typeof t=="string"&&(t=Pr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=Le}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function Il(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=sr(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&sr(t,e.options.extraKeys,i,e)||sr(t,e.options.keyMap,i,e)}var jl=new F;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(hs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ms(e,r+" "+t,i,n))return!0}return ms(e,t,i,n)}function ms(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&Kt(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(C(i),So(e)),!!r}function gs(e,t){var i=ds(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return ro(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ro(e,n)}):Nr(e,i,t,function(n){return ro(e,n)}):!1}function Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var zo=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=j(),Ye(t,e))return;O&&I<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);T&&(zo=n?i:null,!n&&i==88&&!Dt&&(de?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),oe&&!de&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;D(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(Se(t,"CodeMirror-crosshair"),ut(document,"keyup",i),ut(document,"mouseover",i))}Re(document,"keyup",i),Re(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ye(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(pi(t.display,e)||Ye(t,e)||e.ctrlKey&&!e.altKey||de&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(T&&i==zo){zo=null,C(e);return}if(T&&(!e.which||e.which<10)&&gs(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Bl(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,Go=function(e,t,i){this.time=e,this.pos=t,this.button=i};Go.prototype.compare=function(e,t,i){return this.time+Fl>e&&Ct(t,this.pos)==0&&i==this.button};var Ir,jr;function Wl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new Go(i,e,t),Ir=null,"double"):(Ir=new Go(i,e,t),jr=null,"single")}function xs(e){var t=this,i=t.display;if(Ye(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,pi(i,e)){R||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Bi(t,e),r=Oe(e),s=n?Wl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&Hl(t,r,n,s,e))return;r==1?n?Gl(t,n,s,e):ye(e)==i.scroller&&C(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Fe?t.display.input.onContextMenu(e):Ca(t))}function Hl(e,t,i,n,r){var s="Click";return n=="double"?s="Double"+s:n=="triple"&&(s="Triple"+s),s=(t==1?"Left":t==2?"Middle":"Right")+s,Nr(e,cs(s,r),r,function(l){if(typeof l=="string"&&(l=Pr[l]),!l)return!1;var f=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),f=l(e,i)!=Le}finally{e.state.suppressEdits=!1}return f})}function zl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Ne?i.shiftKey&&i.metaKey:i.altKey;r.unit=s?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(r.extend==null||e.doc.extend)&&(r.extend=e.doc.extend||i.shiftKey),r.addNew==null&&(r.addNew=de?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(de?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){O?setTimeout(p(xa,e),0):e.curOp.focus=j();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Je&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(Ct((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(Ct(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Kl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=cn(e,function(y){R&&(r.scroller.draggable=!1),e.state.draggingText=!1,ut(r.wrapper.ownerDocument,"mouseup",l),ut(r.wrapper.ownerDocument,"mousemove",f),ut(r.scroller,"dragstart",m),ut(r.scroller,"drop",l),s||(C(y),n.addNew||Qr(e.doc,i,null,null,n.extend),R&&!$||O&&I==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(y){s=s||Math.abs(t.clientX-y.clientX)+Math.abs(t.clientY-y.clientY)>=10},m=function(){return s=!0};R&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Re(r.wrapper.ownerDocument,"mouseup",l),Re(r.wrapper.ownerDocument,"mousemove",f),Re(r.scroller,"dragstart",m),Re(r.scroller,"drop",l),Ca(e),setTimeout(function(){return r.input.focus()},20)}function Cs(e,t,i){if(i=="char")return new Ft(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ft($e(t.line,0),o(e.doc,$e(t.line+1,0)));var n=i(e,t);return new Ft(n.from,n.to)}function Kl(e,t,i,n){var r=e.display,s=e.doc;C(t);var l,f,m=s.sel,y=m.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=y[f]:l=new Ft(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ft(i,i)),i=Bi(e,t,!0,!0),f=-1;else{var W=Cs(e,i,n.unit);n.extend?l=Bo(l,W.anchor,W.head,n.extend):l=W}n.addNew?f==-1?(f=y.length,Cn(s,qn(e,y.concat([l]),f),{scroll:!1,origin:"*mouse"})):y.length>1&&y[f].empty()&&n.unit=="char"&&!n.extend?(Cn(s,qn(e,y.slice(0,f).concat(y.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),m=s.sel):Uo(s,f,l,fe):(f=0,Cn(s,new Vn([l],0),fe),m=s.sel);var X=i;function ve(rt){if(Ct(X,rt)==0)return;if(X=rt,n.unit=="rectangle"){for(var ht=[],xt=e.options.tabSize,gt=w(dt(s,i.line).text,i.ch,xt),Tt=w(dt(s,rt.line).text,rt.ch,xt),$t=Math.min(gt,Tt),fn=Math.max(gt,Tt),Zt=Math.min(i.line,rt.line),Un=Math.min(e.lastLine(),Math.max(i.line,rt.line));Zt<=Un;Zt++){var Rn=dt(s,Zt).text,tn=se(Rn,$t,xt);$t==fn?ht.push(new Ft($e(Zt,tn),$e(Zt,tn))):Rn.length>tn&&ht.push(new Ft($e(Zt,tn),$e(Zt,se(Rn,fn,xt))))}ht.length||ht.push(new Ft(i,i)),Cn(s,qn(e,m.ranges.slice(0,f).concat(ht),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(rt)}else{var Dn=l,xn=Cs(e,rt,n.unit),an=Dn.anchor,nn;Ct(xn.anchor,an)>0?(nn=xn.head,an=Mi(Dn.from(),xn.anchor)):(nn=xn.anchor,an=di(Dn.to(),xn.head));var Qt=m.ranges.slice(0);Qt[f]=Xl(e,new Ft(o(s,an),nn)),Cn(s,qn(e,Qt,f),fe)}}var ce=r.wrapper.getBoundingClientRect(),je=0;function ze(rt){var ht=++je,xt=Bi(e,rt,!0,n.unit=="rectangle");if(!xt)return;if(Ct(xt,X)!=0){e.curOp.focus=j(),ve(xt);var gt=Kr(r,s);(xt.line>=gt.to||xt.line<gt.from)&&setTimeout(cn(e,function(){je==ht&&ze(rt)}),150)}else{var Tt=rt.clientY<ce.top?-20:rt.clientY>ce.bottom?20:0;Tt&&setTimeout(cn(e,function(){if(je!=ht)return;r.scroller.scrollTop+=Tt,ze(rt)}),50)}}function qe(rt){e.state.selectingText=!1,je=Infinity,rt&&(C(rt),r.input.focus()),ut(r.wrapper.ownerDocument,"mousemove",it),ut(r.wrapper.ownerDocument,"mouseup",lt),s.history.lastSelOrigin=null}var it=cn(e,function(rt){rt.buttons===0||!Oe(rt)?qe(rt):ze(rt)}),lt=cn(e,qe);e.state.selectingText=lt,Re(r.wrapper.ownerDocument,"mousemove",it),Re(r.wrapper.ownerDocument,"mouseup",lt)}function Xl(e,t){var i=t.anchor,n=t.head,r=dt(e.doc,i.line);if(Ct(i,n)==0&&i.sticky==n.sticky)return t;var s=tt(r);if(!s)return t;var l=Qe(s,i.ch,i.sticky),f=s[l];if(f.from!=i.ch&&f.to!=i.ch)return t;var m=l+(f.from==i.ch==(f.level!=1)?0:1);if(m==0||m==s.length)return t;var y;if(n.line!=i.line)y=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var W=Qe(s,n.ch,n.sticky),X=W-l||(n.ch-i.ch)*(f.level==1?-1:1);W==m-1||W==m?y=X<0:y=X>0}var ve=s[m+(y?-1:0)],ce=y==(ve.level==1),je=ce?ve.from:ve.to,ze=ce?"after":"before";return i.ch==je&&i.sticky==ze?t:new Ft(new $e(i.line,je,ze),n)}function _s(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(ve){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&C(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!q(e,i))return P(t);s-=f.top-l.viewOffset;for(var m=0;m<e.display.gutterSpecs.length;++m){var y=l.gutters.childNodes[m];if(y&&y.getBoundingClientRect().right>=r){var W=Xn(e.doc,s),X=e.display.gutterSpecs[m];return Be(e,i,e,W,X.className,t),P(t)}}}function Vo(e,t){return _s(e,t,"gutterClick",!0)}function ws(e,t){if(pi(e.display,t)||$l(e,t))return;if(Ye(e,t,"contextmenu"))return;Fe||e.display.input.onContextMenu(t)}function $l(e,t){return q(e,"gutterContextMenu")?_s(e,t,"gutterContextMenu",!1):!1}function Es(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var ur={toString:function(){return"CodeMirror.Init"}},Ss={},oo={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,m,y){y!=ur&&s(f,m,y)}:s)}e.defineOption=i,e.Init=ur,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,No(n)},!0),i("indentUnit",2,No,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Sr(n),vr(n),Ln(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(m){for(var y=0;;){var W=m.text.indexOf(r,y);if(W==-1)break;y=W+r.length,s.push($e(l,W))}l++});for(var f=s.length-1;f>=0;f--)or(n.doc,r,s[f],$e(s[f].line,s[f].ch+r.length))}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,r,s){n.state.specialChars=new RegExp(r.source+(r.test(" ")?"":"| "),"g"),s!=ur&&n.refresh()}),i("specialCharPlaceholder",ft,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",Q?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(n,r){return n.getInputField().spellcheck=r},!0),i("autocorrect",!1,function(n,r){return n.getInputField().autocorrect=r},!0),i("autocapitalize",!1,function(n,r){return n.getInputField().autocapitalize=r},!0),i("rtlMoveVisually",!Xe),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Es(n),Er(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),f=s!=ur&&io(s);f&&f.detach&&f.detach(n,l),l.attach&&l.attach(n,f||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Do(r,n.options.lineNumbers),Er(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?wo(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return tr(n)},!0),i("scrollbarStyle","native",function(n){Ta(n),tr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),i("lineNumbers",!1,function(n,r){n.display.gutterSpecs=Do(n.options.gutters,r),Er(n)},!0),i("firstLineNumber",1,Er,!0),i("lineNumberFormatter",function(n){return n},Er,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(qi(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Sr,!0),i("addModeClass",!1,Sr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Sr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=ur;if(!t!=!n){var r=e.display.dragFunctions,s=t?Re:ut;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Zl(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Se(e.display.wrapper,"CodeMirror-wrap"),fi(e)),Eo(e),Ln(e),vr(e),setTimeout(function(){return tr(e)},100)}function Yt(e,t){var i=this;if(!(this instanceof Yt))return new Yt(e,t);this.options=t=t?d(t):{},d(Ss,t,!1);var n=t.value;typeof n=="string"?n=new Mn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new Yt.inputStyles[t.inputStyle](this),s=this.display=new hl(e,n,r,t);s.wrapper.CodeMirror=this,Es(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ta(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new F,keySeq:null,specialChars:null},t.autofocus&&!Q&&s.input.focus(),O&&I<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ol(),Hi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!Q||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(i)},20):qi(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],ur);La(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Ko.length;++f)Ko[f](this);zi(this),R&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Yt.defaults=Ss,Yt.optionHandlers=oo;function Ql(e){var t=e.display;Re(t.scroller,"mousedown",cn(e,xs)),O&&I<11?Re(t.scroller,"dblclick",cn(e,function(m){if(Ye(e,m))return;var y=Bi(e,m);if(!y||Vo(e,m)||pi(e.display,m))return;C(m);var W=e.findWordAt(y);Qr(e.doc,W.anchor,W.head)})):Re(t.scroller,"dblclick",function(m){return Ye(e,m)||C(m)}),Re(t.scroller,"contextmenu",function(m){return ws(e,m)}),Re(t.input.getField(),"contextmenu",function(m){t.scroller.contains(m.target)||ws(e,m)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(m){if(m.touches.length!=1)return!1;var y=m.touches[0];return y.radiusX<=1&&y.radiusY<=1}function l(m,y){if(y.left==null)return!0;var W=y.left-m.left,X=y.top-m.top;return W*W+X*X>20*20}Re(t.scroller,"touchstart",function(m){if(!Ye(e,m)&&!s(m)&&!Vo(e,m)){t.input.ensurePolled(),clearTimeout(i);var y=+new Date;t.activeTouch={start:y,moved:!1,prev:y-n.end<=300?n:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Re(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Re(t.scroller,"touchend",function(m){var y=t.activeTouch;if(y&&!pi(t,m)&&y.left!=null&&!y.moved&&new Date-y.start<300){var W=e.coordsChar(t.activeTouch,"page"),X;!y.prev||l(y,y.prev)?X=new Ft(W,W):!y.prev.prev||l(y,y.prev.prev)?X=e.findWordAt(W):X=new Ft($e(W.line,0),o(e.doc,$e(W.line+1,0))),e.setSelection(X.anchor,X.head),e.focus(),C(m)}r()}),Re(t.scroller,"touchcancel",r),Re(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),Fi(e,t.scroller.scrollLeft,!0),Be(e,"scroll",e))}),Re(t.scroller,"mousewheel",function(m){return Da(e,m)}),Re(t.scroller,"DOMMouseScroll",function(m){return Da(e,m)}),Re(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){Ye(e,m)||U(m)},over:function(m){Ye(e,m)||(Al(e,m),U(m))},start:function(m){return Tl(e,m)},drop:cn(e,kl),leave:function(m){Ye(e,m)||ss(e)}};var f=t.input.getField();Re(f,"keyup",function(m){return ys.call(e,m)}),Re(f,"keydown",cn(e,vs)),Re(f,"keypress",cn(e,bs)),Re(f,"focus",function(m){return ko(e,m)}),Re(f,"blur",function(m){return qi(e,m)})}var Ko=[];Yt.defineInitHook=function(e){return Ko.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=Ce(e,t).state:i="prev");var l=e.options.tabSize,f=dt(r,t),m=w(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var y=f.text.match(/^\s*/)[0],W;if(!n&&!/\S/.test(f.text))W=0,i="not";else if(i=="smart"&&(W=r.mode.indent(s,f.text.slice(y.length),f.text),W==Le||W>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?W=w(dt(r,t-1).text,null,l):W=0:i=="add"?W=m+e.options.indentUnit:i=="subtract"?W=m-e.options.indentUnit:typeof i=="number"&&(W=m+i),W=Math.max(0,W);var X="",ve=0;if(e.options.indentWithTabs)for(var ce=Math.floor(W/l);ce;--ce)ve+=l,X+=" ";if(ve<W&&(X+=B(W-ve)),X!=y)return or(r,X,$e(t,0),$e(t,y.length),"+input"),f.stateAfter=null,!0;for(var je=0;je<r.sel.ranges.length;je++){var ze=r.sel.ranges[je];if(ze.head.line==t&&ze.head.ch<y.length){var qe=$e(t,y.length);Uo(r,je,new Ft(qe,qe));break}}}var ei=null;function ao(e){ei=e}function Xo(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,f=r=="paste"||e.state.pasteIncoming>l,m=mt(t),y=null;if(f&&n.ranges.length>1)if(ei&&ei.text.join(`
`)==t){if(n.ranges.length%ei.text.length==0){y=[];for(var W=0;W<ei.text.length;W++)y.push(s.splitLines(ei.text[W]))}}else m.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(y=G(m,function(it){return[it]}));for(var X=e.curOp.updateInput,ve=n.ranges.length-1;ve>=0;ve--){var ce=n.ranges[ve],je=ce.from(),ze=ce.to();ce.empty()&&(i&&i>0?je=$e(je.line,je.ch-i):e.state.overwrite&&!f?ze=$e(ze.line,Math.min(dt(s,ze.line).text.length,ze.ch+b(m).length)):f&&ei&&ei.lineWise&&ei.text.join(`
`)==m.join(`
`)&&(je=ze=$e(je.line,0)));var qe={from:je,to:ze,text:y?y[ve%y.length]:m,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};rr(e.doc,qe),Kt(e,"inputRead",e,qe)}t&&!f&&Ts(e,t),er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=X),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Bn(t,function(){return Xo(t,i,0,null,"paste")}),!0}function Ts(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var f=0;f<s.electricChars.length;f++)if(t.indexOf(s.electricChars.charAt(f))>-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(dt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&Kt(e,"electricInput",e,r.head.line)}}function As(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,s={anchor:$e(r,0),head:$e(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Os(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ls(){var e=L("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=L("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return R?e.style.width="1000px":e.setAttribute("wrap","off"),J&&(e.style.border="1px solid black"),Os(e),t}function ql(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&cn(this,t[n])(this,r,l),Be(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](io(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:En(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");M(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Ln(this)}),removeOverlay:En(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,Ln(this);return}}}),indentLine:En(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),hi(this.doc,n)&&Br(this,n,r,s)}),indentSelection:En(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var f=r[l];if(f.empty())f.head.line>s&&(Br(this,f.head.line,n,!0),s=f.head.line,l==this.doc.sel.primIndex&&er(this));else{var m=f.from(),y=f.to(),W=Math.max(s,m.line);s=Math.min(this.lastLine(),y.line-(y.ch?0:1))+1;for(var X=W;X<s;++X)Br(this,X,n);var ve=this.doc.sel.ranges;m.ch==0&&r.length==ve.length&&ve[l].from().ch>0&&Uo(this.doc,l,new Ft(m,ve[l].to()),pe)}}}),getTokenAt:function(n,r){return Wt(this,n,r)},getLineTokens:function(n,r){return Wt(this,$e(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=We(this,dt(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,m;if(f==0)m=r[2];else for(;;){var y=s+l>>1;if((y?r[y*2-1]:0)>=f)l=y;else if(r[y*2+1]<f)s=y+1;else{m=r[y*2+2];break}}var W=m?m.indexOf("overlay "):-1;return W<0?m:W==0?null:m.slice(0,W-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],f=this.getModeAt(n);if(typeof f[r]=="string")l[f[r]]&&s.push(l[f[r]]);else if(f[r])for(var m=0;m<f[r].length;m++){var y=l[f[r][m]];y&&s.push(y)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var W=0;W<l._global.length;W++){var X=l._global[W];X.pred(f,this)&&te(s,X.val)==-1&&s.push(X.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=c(s,n==null?s.first+s.size-1:n),Ce(this,n+1,r).state},cursorCoords:function(n,r){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=o(this.doc,n):s=n?l.from():l.to(),Qn(this,s,r||"page")},charCoords:function(n,r){return yo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=da(this,n,r||"page"),xo(this,n.left,n.top)},lineAtHeight:function(n,r){return n=da(this,{top:n,left:0},r||"page").top,Xn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,f;if(typeof n=="number"){var m=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>m&&(n=m,l=!0),f=dt(this.doc,n)}else f=n;return Hr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-jn(f):0)},defaultTextHeight:function(){return Zi(this.display)},defaultCharWidth:function(){return Qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,f){var m=this.display;n=Qn(this,o(this.doc,n));var y=n.bottom,W=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),m.sizer.appendChild(r),l=="over")y=n.top;else if(l=="above"||l=="near"){var X=Math.max(m.wrapper.clientHeight,this.doc.height),ve=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>X)&&n.top>r.offsetHeight?y=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=X&&(y=n.bottom),W+r.offsetWidth>ve&&(W=ve-r.offsetWidth)}r.style.top=y+"px",r.style.left=r.style.right="",f=="right"?(W=m.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?W=0:f=="middle"&&(W=(m.sizer.clientWidth-r.offsetWidth)/2),r.style.left=W+"px"),s&&Js(this,{left:W,top:y,right:W+r.offsetWidth,bottom:y+r.offsetHeight})},triggerOnKeyDown:En(vs),triggerOnKeyPress:En(bs),triggerOnKeyUp:ys,triggerOnMouseDown:En(xs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:En(function(n){Ts(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var m=o(this.doc,n),y=0;y<r&&!(m=$o(this.doc,m,f,s,l),m.hitSide);++y);return m},moveH:En(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?$o(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},re)}),deleteH:En(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):lr(this,function(f){var m=$o(l,f.head,n,r,!1);return n<0?{from:m,to:f.head}:{from:f.head,to:m}})}),findPosV:function(n,r,s,l){var f=1,m=l;r<0&&(f=-1,r=-r);for(var y=o(this.doc,n),W=0;W<r;++W){var X=Qn(this,y,"div");if(m==null?m=X.left:X.left=m,y=Ms(this,X,f,s),y.hitSide)break}return y},moveV:En(function(n,r){var s=this,l=this.doc,f=[],m=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(W){if(m)return n<0?W.from():W.to();var X=Qn(s,W.head,"div");W.goalColumn!=null&&(X.left=W.goalColumn),f.push(X.left);var ve=Ms(s,X,n,r);return r=="page"&&W==l.sel.primary()&&Ao(s,yo(s,ve,"div").top-X.top),ve},re),f.length)for(var y=0;y<l.sel.ranges.length;y++)l.sel.ranges[y].goalColumn=f[y]}),findWordAt:function(n){var r=this.doc,s=dt(r,n.line).text,l=n.ch,f=n.ch;if(s){var m=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var y=s.charAt(l),W=Ie(y,m)?function(X){return Ie(X,m)}:/\s/.test(y)?function(X){return/\s/.test(X)}:function(X){return!/\s/.test(X)&&!Ie(X)};l>0&&W(s.charAt(l-1));)--l;for(;f<s.length&&W(s.charAt(f));)++f}return new Ft($e(n.line,l),$e(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?D(this.display.cursorDiv,"CodeMirror-overwrite"):Se(this.display.cursorDiv,"CodeMirror-overwrite"),Be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==j()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:En(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-oi(this)-this.display.barHeight,width:n.scrollWidth-oi(this)-this.display.barWidth,clientHeight:mo(this),clientWidth:Ii(this)}},scrollIntoView:En(function(n,r){n==null?(n={from:this.doc.sel.primary().head,to:null},r==null&&(r=this.options.cursorScrollMargin)):typeof n=="number"?n={from:$e(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?Zs(this,n):wa(this,n.from,n.to,n.margin)}),setSize:En(function(n,r){var s=this,l=function(m){return typeof m=="number"||/^\d+$/.test(String(m))?m+"px":m};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&ua(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(m){if(m.widgets){for(var y=0;y<m.widgets.length;y++)if(m.widgets[y].noHScroll){wi(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Be(this,"refresh",this)}),operation:function(n){return Bn(this,n)},startOperation:function(){return Hi(this)},endOperation:function(){return zi(this)},refresh:En(function(){var n=this.display.cachedTextHeight;Ln(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Mo(this.display),(n==null||Math.abs(n-Zi(this.display))>.5||this.options.lineWrapping)&&Eo(this),Be(this,"refresh",this)}),swapDoc:En(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),ja(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Kt(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ie(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function $o(e,t,i,n,r){var s=t,l=i,f=dt(e,t.line),m=r&&e.direction=="rtl"?-i:i;function y(){var lt=t.line+m;return lt<e.first||lt>=e.first+e.size?!1:(t=new $e(lt,t.ch,t.sticky),f=dt(e,lt))}function W(lt){var rt;if(n=="codepoint"){var ht=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ht)?rt=null:rt=new $e(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(ht>=55296&&ht<56320?2:1))),-i)}else r?rt=Pl(e.cm,f,t,i):rt=Wo(f,t,i);if(rt==null)if(!lt&&y())t=Ho(r,e.cm,f,t.line,m);else return!1;else t=rt;return!0}if(n=="char"||n=="codepoint")W();else if(n=="column")W(!0);else if(n=="word"||n=="group")for(var X=null,ve=n=="group",ce=e.cm&&e.cm.getHelper(t,"wordChars"),je=!0;!(i<0&&!W(!je));je=!1){var ze=f.text.charAt(t.ch)||`
`,qe=Ie(ze,ce)?"w":ve&&ze==`
`?"n":!ve||/\s/.test(ze)?null:"p";if(ve&&!je&&!qe&&(qe="s"),X&&X!=qe){i<0&&(i=1,W(),t.sticky="after");break}if(qe&&(X=qe),i>0&&!W(!je))break}var it=eo(e,t,s,l,!0);return ti(s,it)&&(it.hitSide=!0),it}function Ms(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),m=Math.max(f-.5*Zi(e.display),3);l=(i>0?t.bottom:t.top)+i*m}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var y;!(y=xo(e,s,l),!y.outside);){if(i<0?l<=0:l>=r.height){y.hitSide=!0;break}l+=i*5}return y}var Gt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new F,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Gt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;Os(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var m=f.target;m;m=m.parentNode){if(m==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Re(r,"paste",function(f){if(!s(f)||Ye(n,f)||ks(f,n))return;I<=11&&setTimeout(cn(n,function(){return t.updateFromDOM()}),20)}),Re(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Re(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Re(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Re(r,"touchstart",function(){return i.forceCompositionEnd()}),Re(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||Ye(n,f))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var m=As(n);ao({lineWise:!0,text:m.text}),f.type=="cut"&&n.operation(function(){n.setSelections(m.ranges,0,pe),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var y=ei.text.join(`
`);if(f.clipboardData.setData("Text",y),f.clipboardData.getData("Text")==y){f.preventDefault();return}}var W=Ls(),X=W.firstChild;n.display.lineSpace.insertBefore(W,n.display.lineSpace.firstChild),X.value=ei.text.join(`
`);var ve=document.activeElement;k(X),setTimeout(function(){n.display.lineSpace.removeChild(W),ve.focus(),ve==r&&i.showPrimarySelection()},50)}Re(r,"copy",l),Re(r,"cut",l)},Gt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Gt.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},Gt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Gt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Gt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),r=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||r.line<t.display.viewFrom){e.removeAllRanges();return}var s=so(t,e.anchorNode,e.anchorOffset),l=so(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&Ct(Mi(s,l),n)==0&&Ct(di(s,l),r)==0)return;var f=t.display.view,m=n.line>=t.display.viewFrom&&Rs(t,n)||{node:f[0].measure.map[2],offset:0},y=r.line<t.display.viewTo&&Rs(t,r);if(!y){var W=f[f.length-1].measure,X=W.maps?W.maps[W.maps.length-1]:W.map;y={node:X[X.length-1],offset:X[X.length-2]-X[X.length-3]}}if(!m||!y){e.removeAllRanges();return}var ve=e.rangeCount&&e.getRangeAt(0),ce;try{ce=Y(m.node,m.offset,y.offset,y.node)}catch(je){}ce&&(!oe&&t.state.focused?(e.collapse(m.node,m.offset),ce.collapsed||(e.removeAllRanges(),e.addRange(ce))):(e.removeAllRanges(),e.addRange(ce)),ve&&e.anchorNode==null?e.addRange(ve):oe&&this.startGracePeriod()),this.rememberSelection()},Gt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Gt.prototype.showMultipleSelections=function(e){xe(this.cm.display.cursorDiv,e.cursors),xe(this.cm.display.selectionDiv,e.selection)},Gt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Gt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return x(this.div,t)},Gt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Gt.prototype.blur=function(){this.div.blur()},Gt.prototype.getField=function(){return this.div},Gt.prototype.supportsTouch=function(){return!0},Gt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Bn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Gt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Gt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(K&&S&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=so(t,e.anchorNode,e.anchorOffset),n=so(t,e.focusNode,e.focusOffset);i&&n&&Bn(t,function(){Cn(t.doc,Si(i,n),pe),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Gt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.ch==0&&n.line>e.firstLine()&&(n=$e(n.line-1,dt(e.doc,n.line-1).length)),r.ch==dt(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=$e(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ui(e,n.line))==0?(l=Mt(t.view[0].line),f=t.view[0].node):(l=Mt(t.view[s].line),f=t.view[s-1].node.nextSibling);var m=Ui(e,r.line),y,W;if(m==t.view.length-1?(y=t.viewTo-1,W=t.lineDiv.lastChild):(y=Mt(t.view[m+1].line)-1,W=t.view[m+1].node.previousSibling),!f)return!1;for(var X=e.doc.splitLines(tu(e,f,W,l,y)),ve=Fn(e.doc,$e(l,0),$e(y,dt(e.doc,y).text.length));X.length>1&&ve.length>1;)if(b(X)==b(ve))X.pop(),ve.pop(),y--;else if(X[0]==ve[0])X.shift(),ve.shift(),l++;else break;for(var ce=0,je=0,ze=X[0],qe=ve[0],it=Math.min(ze.length,qe.length);ce<it&&ze.charCodeAt(ce)==qe.charCodeAt(ce);)++ce;for(var lt=b(X),rt=b(ve),ht=Math.min(lt.length-(X.length==1?ce:0),rt.length-(ve.length==1?ce:0));je<ht&&lt.charCodeAt(lt.length-je-1)==rt.charCodeAt(rt.length-je-1);)++je;if(X.length==1&&ve.length==1&&l==n.line)for(;ce&&ce>n.ch&&lt.charCodeAt(lt.length-je-1)==rt.charCodeAt(rt.length-je-1);)ce--,je++;X[X.length-1]=lt.slice(0,lt.length-je).replace(/^\u200b+/,""),X[0]=X[0].slice(ce).replace(/\u200b+$/,"");var xt=$e(l,ce),gt=$e(y,ve.length?b(ve).length-je:0);if(X.length>1||X[0]||Ct(xt,gt))return or(e.doc,X,xt,gt,"+input"),!0},Gt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Gt.prototype.reset=function(){this.forceCompositionEnd()},Gt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Gt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},Gt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Bn(this.cm,function(){return Ln(e.cm)})},Gt.prototype.setUneditable=function(e){e.contentEditable="false"},Gt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||cn(this.cm,Xo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Gt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Gt.prototype.onContextMenu=function(){},Gt.prototype.resetPosition=function(){},Gt.prototype.needsContentAttribute=!0;function Rs(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=dt(e.doc,t.line),r=ra(i,n,t.line),s=tt(n,e.doc.direction),l="left";if(s){var f=Qe(s,t.ch);l=f%2?"right":"left"}var m=sa(r.map,t.ch,l);return m.offset=m.collapse=="right"?m.end:m.start,m}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function hr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,f=e.doc.lineSeparator(),m=!1;function y(ce){return function(je){return je.id==ce}}function W(){l&&(s+=f,m&&(s+=f),l=m=!1)}function X(ce){ce&&(W(),s+=ce)}function ve(ce){if(ce.nodeType==1){var je=ce.getAttribute("cm-text");if(je){X(je);return}var ze=ce.getAttribute("cm-marker"),qe;if(ze){var it=e.findMarks($e(n,0),$e(r+1,0),y(+ze));it.length&&(qe=it[0].find(0))&&X(Fn(e.doc,qe.from,qe.to).join(f));return}if(ce.getAttribute("contenteditable")=="false")return;var lt=/^(pre|div|p|li|table|br)$/i.test(ce.nodeName);if(!/^br$/i.test(ce.nodeName)&&ce.textContent.length==0)return;lt&&W();for(var rt=0;rt<ce.childNodes.length;rt++)ve(ce.childNodes[rt]);/^(pre|p)$/i.test(ce.nodeName)&&(m=!0),lt&&(l=!0)}else ce.nodeType==3&&X(ce.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ve(t),t==i);)t=t.nextSibling,m=!1;return s}function so(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return hr(e.clipPos($e(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var s=e.display.view[r];if(s.node==n)return nu(s,t,i)}}function nu(e,t,i){var n=e.text.firstChild,r=!1;if(!t||!x(n,t))return hr($e(Mt(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?b(e.rest):e.line;return hr($e(Mt(s),s.text.length),r)}var l=t.nodeType==3?t:null,f=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));f.parentNode!=n;)f=f.parentNode;var m=e.measure,y=m.maps;function W(qe,it,lt){for(var rt=-1;rt<(y?y.length:0);rt++)for(var ht=rt<0?m.map:y[rt],xt=0;xt<ht.length;xt+=3){var gt=ht[xt+2];if(gt==qe||gt==it){var Tt=Mt(rt<0?e.line:e.rest[rt]),$t=ht[xt]+lt;return(lt<0||gt!=qe)&&($t=ht[xt+(lt?1:0)]),$e(Tt,$t)}}}var X=W(l,f,i);if(X)return hr(X,r);for(var ve=f.nextSibling,ce=l?l.nodeValue.length-i:0;ve;ve=ve.nextSibling){if(X=W(ve,ve.firstChild,0),X)return hr($e(X.line,X.ch-ce),r);ce+=ve.textContent.length}for(var je=f.previousSibling,ze=i;je;je=je.previousSibling){if(X=W(je,je.firstChild,-1),X)return hr($e(X.line,X.ch+ze),r);ze+=je.textContent.length}}var en=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new F,this.hasSelection=!1,this.composing=null};en.prototype.init=function(e){var t=this,i=this,n=this.cm;this.createField(e);var r=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),J&&(r.style.width="0px"),Re(r,"input",function(){O&&I>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Re(r,"paste",function(l){if(Ye(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Ye(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=As(n);ao({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,pe):(i.prevInput="",r.value=f.text.join(`
`),k(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Re(r,"cut",s),Re(r,"copy",s),Re(e.scroller,"paste",function(l){if(pi(e,l)||Ye(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var f=new Event("paste");f.clipboardData=l.clipboardData,r.dispatchEvent(f)}),Re(e.lineSpace,"selectstart",function(l){pi(e,l)||C(l)}),Re(r,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Re(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},en.prototype.createField=function(e){this.wrapper=Ls(),this.textarea=this.wrapper.firstChild},en.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},en.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ya(e);if(e.options.moveInputWithCursor){var r=Qn(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},en.prototype.showSelection=function(e){var t=this.cm,i=t.display;xe(i.cursorDiv,e.cursors),xe(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},en.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&k(this.textarea),O&&I>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",O&&I>=9&&(this.hasSelection=null))},en.prototype.getField=function(){return this.textarea},en.prototype.supportsTouch=function(){return!1},en.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Q||j()!=this.textarea))try{this.textarea.focus()}catch(e){}},en.prototype.blur=function(){this.textarea.blur()},en.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},en.prototype.receivedFocus=function(){this.slowPoll()},en.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},en.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},en.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ot(i)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=i.value;if(r==n&&!t.somethingSelected())return!1;if(O&&I>=9&&this.hasSelection===r||de&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,f=Math.min(n.length,r.length);l<f&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return Bn(t,function(){Xo(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},en.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},en.prototype.onKeyPress=function(){O&&I>=9&&(this.hasSelection=null),this.fastPoll()},en.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Bi(i,e),l=n.scroller.scrollTop;if(!s||T)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&cn(i,Cn)(i.doc,Si(s),pe);var m=r.style.cssText,y=t.wrapper.style.cssText,W=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-W.top-5)+"px; left: "+(e.clientX-W.left-5)+`px;
z-index: 1000; background: `+(O?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var X;R&&(X=window.scrollY),n.input.focus(),R&&window.scrollTo(null,X),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=ce,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ve(){if(r.selectionStart!=null){var ze=i.somethingSelected(),qe="\u200B"+(ze?r.value:"");r.value="\u21DA",r.value=qe,t.prevInput=ze?"":"\u200B",r.selectionStart=1,r.selectionEnd=qe.length,n.selForContextMenu=i.doc.sel}}function ce(){if(t.contextMenuPending!=ce)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=y,r.style.cssText=m,O&&I<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!O||O&&I<9)&&ve();var ze=0,qe=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?cn(i,Ja)(i):ze++<10?n.detectingSelectAll=setTimeout(qe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(qe,200)}}if(O&&I>=9&&ve(),Fe){U(e);var je=function(){ut(window,"mouseup",je),setTimeout(ce,20)};Re(window,"mouseup",je)}else setTimeout(ce,50)},en.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},en.prototype.setUneditable=function(){},en.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?d(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=j();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(Re(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(m){}}t.finishInit=function(m){m.save=n,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,n(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(ut(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=Yt(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return f}function ru(e){e.off=ut,e.on=Re,e.wheelEventPixels=cl,e.Doc=Mn,e.splitLines=mt,e.countColumn=w,e.findColumn=se,e.isWordChar=Te,e.Pass=Le,e.signal=Be,e.Line=_i,e.changeEnd=ki,e.scrollbarModel=ka,e.Pos=$e,e.cmpPos=Ct,e.modes=jt,e.mimeModes=St,e.resolveMode=pt,e.getMode=wn,e.modeExtensions=ln,e.extendMode=gn,e.copyState=kn,e.startState=Kn,e.innerMode=li,e.commands=Pr,e.keyMap=mi,e.keyName=ds,e.isModifierKey=hs,e.lookupKey=sr,e.normalizeKeyMap=Dl,e.StringStream=Nt,e.SharedTextMarker=Mr,e.TextMarker=Ai,e.LineWidget=Lr,e.e_preventDefault=C,e.e_stopPropagation=E,e.e_stop=U,e.addClass=D,e.contains=x,e.rmClass=Se,e.keyNames=Oi}Yl(Yt),ql(Yt);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in Mn.prototype)Mn.prototype.hasOwnProperty(lo)&&te(ou,lo)<0&&(Yt.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Mn.prototype[lo]));return ie(Mn),Yt.inputStyles={textarea:en,contenteditable:Gt},Yt.defineMode=function(e){!Yt.defaults.mode&&e!="null"&&(Yt.defaults.mode=e),mn.apply(this,arguments)},Yt.defineMIME=sn,Yt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Yt.defineMIME("text/plain","null"),Yt.defineExtension=function(e,t){Yt.prototype[e]=t},Yt.defineDocExtension=function(e,t){Mn.prototype[e]=t},Yt.fromTextArea=iu,ru(Yt),Yt.version="5.58.2",Yt})},WdTA:function(nt,Ge,v){nt.exports=v.p+"static/studnetqun.598eeb43.png"},Y1PL:function(nt,Ge,v){"use strict";v.r(Ge),v.d(Ge,"ResizableTextArea",function(){return te});var H=v("wx14"),he=v("1OyB"),oe=v("vuIU"),_e=v("Ji7U"),le=v("LK+K"),V=v("q1tI"),O=v("VTBJ"),I=v("rePB"),R=v("Zm9Q"),A=v("Kwbf"),S=v("c+Xe"),T=v("m+aA"),$=v("bdgK"),z=new Map;function N(pe){pe.forEach(function(fe){var re,se=fe.target;(re=z.get(se))===null||re===void 0||re.forEach(function(ee){return ee(se)})})}var J=new $.default(N),K=null,Q=null;function de(pe,fe){z.has(pe)||(z.set(pe,new Set),J.observe(pe)),z.get(pe).add(fe)}function Ne(pe,fe){z.has(pe)&&(z.get(pe).delete(fe),z.get(pe).size||(J.unobserve(pe),z.delete(pe)))}var Xe=function(pe){Object(_e.a)(re,pe);var fe=Object(le.a)(re);function re(){return Object(he.a)(this,re),fe.apply(this,arguments)}return Object(oe.a)(re,[{key:"render",value:function(){return this.props.children}}]),re}(V.Component),ke=V.createContext(null);function be(pe){var fe=pe.children,re=pe.onBatchResize,se=V.useRef(0),ee=V.useRef([]),B=V.useContext(ke),b=V.useCallback(function(G,M,ge){se.current+=1;var we=se.current;ee.current.push({size:G,element:M,data:ge}),Promise.resolve().then(function(){we===se.current&&(re==null||re(ee.current),ee.current=[])}),B==null||B(G,M,ge)},[re,B]);return V.createElement(ke.Provider,{value:b},fe)}function Fe(pe){var fe=pe.children,re=pe.disabled,se=V.useRef(null),ee=V.useRef(null),B=V.useContext(ke),b=V.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),G=V.isValidElement(fe)&&Object(S.c)(fe),M=G?fe.ref:null,ge=V.useMemo(function(){return Object(S.a)(M,se)},[M,se]),we=V.useRef(pe);we.current=pe;var ne=V.useCallback(function(Te){var Ie=we.current,De=Ie.onResize,Ae=Ie.data,Me=Te.getBoundingClientRect(),Ue=Me.width,et=Me.height,Ve=Te.offsetWidth,Ze=Te.offsetHeight,Qe=Math.floor(Ue),at=Math.floor(et);if(b.current.width!==Qe||b.current.height!==at||b.current.offsetWidth!==Ve||b.current.offsetHeight!==Ze){var tt={width:Qe,height:at,offsetWidth:Ve,offsetHeight:Ze};b.current=tt;var st=Ve===Math.round(Ue)?Ue:Ve,Re=Ze===Math.round(et)?et:Ze,vt=Object(O.a)(Object(O.a)({},tt),{},{offsetWidth:st,offsetHeight:Re});B==null||B(vt,Te,Ae),De&&Promise.resolve().then(function(){De(vt,Te)})}},[]);return V.useEffect(function(){var Te=Object(T.a)(se.current)||Object(T.a)(ee.current);return Te&&!re&&de(Te,ne),function(){return Ne(Te,ne)}},[se.current,re]),V.createElement(Xe,{ref:ee},G?V.cloneElement(fe,{ref:ge}):fe)}var me="rc-observer-key";function Se(pe){var fe=pe.children,re=Object(R.a)(fe);return re.map(function(se,ee){var B=(se==null?void 0:se.key)||"".concat(me,"-").concat(ee);return V.createElement(Fe,Object(H.a)({},pe,{key:B}),se)})}Se.Collection=be;var Pe=Se,xe=v("bT9E"),L=v("TSYQ"),ue=v.n(L),Y=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,x=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],j={},D;function _(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,re=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(fe&&j[re])return j[re];var se=window.getComputedStyle(pe),ee=se.getPropertyValue("box-sizing")||se.getPropertyValue("-moz-box-sizing")||se.getPropertyValue("-webkit-box-sizing"),B=parseFloat(se.getPropertyValue("padding-bottom"))+parseFloat(se.getPropertyValue("padding-top")),b=parseFloat(se.getPropertyValue("border-bottom-width"))+parseFloat(se.getPropertyValue("border-top-width")),G=x.map(function(ge){return"".concat(ge,":").concat(se.getPropertyValue(ge))}).join(";"),M={sizingStyle:G,paddingSize:B,borderSize:b,boxSizing:ee};return fe&&re&&(j[re]=M),M}function k(pe){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,se=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;D||(D=document.createElement("textarea"),D.setAttribute("tab-index","-1"),D.setAttribute("aria-hidden","true"),document.body.appendChild(D)),pe.getAttribute("wrap")?D.setAttribute("wrap",pe.getAttribute("wrap")):D.removeAttribute("wrap");var ee=_(pe,fe),B=ee.paddingSize,b=ee.borderSize,G=ee.boxSizing,M=ee.sizingStyle;D.setAttribute("style","".concat(M,";").concat(Y)),D.value=pe.value||pe.placeholder||"";var ge=Number.MIN_SAFE_INTEGER,we=Number.MAX_SAFE_INTEGER,ne=D.scrollHeight,Te;if(G==="border-box"?ne+=b:G==="content-box"&&(ne-=B),re!==null||se!==null){D.value=" ";var Ie=D.scrollHeight-B;re!==null&&(ge=Ie*re,G==="border-box"&&(ge=ge+B+b),ne=Math.max(ge,ne)),se!==null&&(we=Ie*se,G==="border-box"&&(we=we+B+b),Te=ne>we?"":"hidden",ne=Math.min(we,ne))}return{height:ne,minHeight:ge,maxHeight:we,overflowY:Te,resize:"none"}}var p=v("Gytx"),d=v.n(p),w;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(w||(w={}));var F=function(pe){Object(_e.a)(re,pe);var fe=Object(le.a)(re);function re(se){var ee;return Object(he.a)(this,re),ee=fe.call(this,se),ee.nextFrameActionId=void 0,ee.resizeFrameId=void 0,ee.textArea=void 0,ee.saveTextArea=function(B){ee.textArea=B},ee.handleResize=function(B){var b=ee.state.resizeStatus,G=ee.props,M=G.autoSize,ge=G.onResize;if(b!==w.NONE)return;typeof ge=="function"&&ge(B),M&&ee.resizeOnNextFrame()},ee.resizeOnNextFrame=function(){cancelAnimationFrame(ee.nextFrameActionId),ee.nextFrameActionId=requestAnimationFrame(ee.resizeTextarea)},ee.resizeTextarea=function(){var B=ee.props.autoSize;if(!B||!ee.textArea)return;var b=B.minRows,G=B.maxRows,M=k(ee.textArea,!1,b,G);ee.setState({textareaStyles:M,resizeStatus:w.RESIZING},function(){cancelAnimationFrame(ee.resizeFrameId),ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:w.RESIZED},function(){ee.resizeFrameId=requestAnimationFrame(function(){ee.setState({resizeStatus:w.NONE}),ee.fixFirefoxAutoScroll()})})})})},ee.renderTextArea=function(){var B=ee.props,b=B.prefixCls,G=b===void 0?"rc-textarea":b,M=B.autoSize,ge=B.onResize,we=B.className,ne=B.disabled,Te=ee.state,Ie=Te.textareaStyles,De=Te.resizeStatus,Ae=Object(xe.a)(ee.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Me=ue()(G,we,Object(I.a)({},"".concat(G,"-disabled"),ne));"value"in Ae&&(Ae.value=Ae.value||"");var Ue=Object(O.a)(Object(O.a)(Object(O.a)({},ee.props.style),Ie),De===w.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return V.createElement(Pe,{onResize:ee.handleResize,disabled:!(M||ge)},V.createElement("textarea",Object(H.a)({},Ae,{className:Me,style:Ue,ref:ee.saveTextArea})))},ee.state={textareaStyles:{},resizeStatus:w.NONE},ee}return Object(oe.a)(re,[{key:"componentDidUpdate",value:function(ee){(ee.value!==this.props.value||!d()(ee.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var ee=this.textArea.selectionStart,B=this.textArea.selectionEnd;this.textArea.setSelectionRange(ee,B)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),re}(V.Component),te=F,Ee=function(pe){Object(_e.a)(re,pe);var fe=Object(le.a)(re);function re(se){var ee;Object(he.a)(this,re),ee=fe.call(this,se),ee.resizableTextArea=void 0,ee.focus=function(){ee.resizableTextArea.textArea.focus()},ee.saveTextArea=function(b){ee.resizableTextArea=b},ee.handleChange=function(b){var G=ee.props.onChange;ee.setValue(b.target.value,function(){ee.resizableTextArea.resizeTextarea()}),G&&G(b)},ee.handleKeyDown=function(b){var G=ee.props,M=G.onPressEnter,ge=G.onKeyDown;b.keyCode===13&&M&&M(b),ge&&ge(b)};var B=typeof se.value=="undefined"||se.value===null?se.defaultValue:se.value;return ee.state={value:B},ee}return Object(oe.a)(re,[{key:"setValue",value:function(ee,B){"value"in this.props||this.setState({value:ee},B)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return V.createElement(te,Object(H.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ee){return"value"in ee?{value:ee.value}:null}}]),re}(V.Component),Le=Ge.default=Ee},ZW9T:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return Xe});var H=v("k1fw"),he=v("miYZ"),oe=v("tsqr"),_e=v("rAM+"),le=v("tJVT"),V=v("PpiC"),O=v("q1tI"),I=v.n(O),R=v("bdgK");function A(ke,be,Fe,me,Se){var Pe=be.getWordUntilPosition(Fe),xe={startLineNumber:Fe.lineNumber,endLineNumber:Fe.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},L=me.map(function(ue){return{label:ue,kind:ke.languages.CompletionItemKind.Keyword,insertText:ue,insertTextRules:ke.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}});return Se.map(function(ue){L.push(Object(H.a)(Object(H.a)({},ue),{},{range:xe}))}),L}var S=function(ke){var be={label:"ifelse",kind:ke.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:ke.languages.CompletionItemInsertTextRule.InsertAsSnippet},Fe=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];ke.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(xe,L){var ue=A(ke,xe,L,Fe,[be]);return{suggestions:ue}}});var me=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];ke.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(xe,L){var ue=[{label:"print",kind:ke.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:ke.languages.CompletionItemInsertTextRule.InsertAsSnippet}],Y=A(ke,xe,L,me,ue);return{suggestions:Y}}});var Se=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];ke.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(xe,L){var ue=[be,{label:"main",kind:ke.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:ke.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:ke.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:ke.languages.CompletionItemInsertTextRule.InsertAsSnippet}],Y=A(ke,xe,L,Se,ue);return{suggestions:Y}}})},T="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",$=v("LvDl");function z(ke){return/^\d+$/.test(ke)?"".concat(ke,"px"):ke}function N(){}var J=!1,K={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function Q(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],be=ke;if(Array.isArray(ke)){for(var Fe=0;Fe<ke.length;Fe++){var me=K[ke[Fe]];if(me)return me}return be[0]}return K[be]||be}var de=null,Ne=Ge.b=function(ke){var be=ke.width,Fe=be===void 0?"100%":be,me=ke.height,Se=me===void 0?"100%":me,Pe=ke.value,xe=ke.language,L=xe===void 0?"javascript":xe,ue=ke.style,Y=ue===void 0?{}:ue,x=ke.options,j=x===void 0?{}:x,D=ke.overrideServices,_=D===void 0?{}:D,k=ke.theme,p=k===void 0?"vs-dark":k,d=ke.onEditBlur,w=ke.onSave,F=ke.autoHeight,te=F===void 0?!1:F,Ee=ke.forbidCopy,Le=Ee===void 0?!1:Ee,pe=ke.onChange,fe=pe===void 0?N:pe,re=ke.editorDidMount,se=re===void 0?N:re,ee=ke.onFocus,B=ee===void 0?N:ee,b=ke.filename,G=b===void 0?"educoder.txt":b,M=Object(V.a)(ke,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ge=Object(O.useRef)(),we=Object(O.useRef)({}),ne=Object(O.useRef)(),Te=Object(O.useRef)(!1),Ie=Object(O.useRef)(),De=Object(O.useState)(!1),Ae=Object(le.a)(De,2),Me=Ae[0],Ue=Ae[1];function et(){var P;return ge.current&&(P=new R.default(function(U){var ye=Object(_e.a)(U),Oe;try{for(ye.s();!(Oe=ye.n()).done;){var Je=Oe.value;(Je.target.offsetHeight>0||Je.target.offsetWidth>0)&&we.current.instance.layout()}}catch(yt){ye.e(yt)}finally{ye.f()}}),P.observe(ge.current)),P}function Ve(){oe.b.warn(decodeURIComponent(T))}var Ze=function(){var U=we.current.instance;if(Pe!=null&&U&&Me){var ye=U.getModel();ye&&Pe!==ye.getValue()&&(J=!0,ye.setValue(Pe),U.layout(),J=!1)}};Object(O.useEffect)(function(){ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){Ze()},500)},[Pe,Me,we.current]);function Qe(){var P=we.current.instance;if(P){var U=P.getSelection(),ye=we.current.pastePos||{},Oe=new de.Range(ye.startLineNumber||U.endLineNumber,ye.startColumn||U.endColumn,ye.endLineNumber||U.endLineNumber,ye.endColumn||U.endColumn);setTimeout(function(){P.executeEdits("",[{range:Oe,text:""}])},300)}}function at(P){(window.navigator.platform.match("Mac")?P.metaKey:P.ctrlKey)&&P.keyCode==83&&(P.preventDefault(),w())}var tt=function(){if(te&&we.current.instance){var U=we.current.instance.getContentHeight();C(U<Se?Se:U)}else C(Se)};function st(P){var U=document.createEvent("MouseEvents");U.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),P.dispatchEvent(U)}function Re(P,U){var ye=window.URL||window.webkitURL||window,Oe=new Blob([U]),Je=document.createElementNS("http://www.w3.org/1999/xhtml","a");Je.href=ye.createObjectURL(Oe),Je.download=P,st(Je)}Object(O.useEffect)(function(){tt()},[tt]),Object(O.useEffect)(function(){ge.current&&!Me&&v.e(27).then(v.t.bind(null,"M/lh",7)).then(function(P){try{de=P,we.current.instance=de.editor.create(ge.current,{value:Pe,language:Q(L),theme:p,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},_);var U=we.current.instance;if(se(U,de),setTimeout(function(){tt(),we.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Re(G||"educoder.txt",U.getValue())}})},500),we.current.subscription=U.onDidChangeModelContent(function(Oe){Te.current?clearTimeout(Ie.current):(tt(),fe(U.getValue(),Oe)),Ie.current=setTimeout(function(){Te.current=!1},500)}),window.Monaco||S(de),Le&&(U.addCommand(de.KeyMod.CtrlCmd|de.KeyMod.Shift|de.KeyCode.KEY_V,function(){return Ve(),null}),U.addCommand(de.KeyMod.CtrlCmd|de.KeyCode.KEY_C,function(){return Ve(),null})),window.Monaco=de,d&&U.onDidBlurEditorWidget(function(){d(U.getValue())}),B&&U.onDidFocusEditorText(function(){B(U.getValue())}),Le){U.addCommand(de.KeyMod.CtrlCmd|de.KeyCode.KEY_V,function(){return Ve(),null}),U.onDidPaste(function(Oe){we.current.pastePos=Oe});try{window.addEventListener("paste",Qe)}catch(Oe){}}var ye=et();return Ue(!0),function(){var Oe=we.current.instance;Oe.dispose();var Je=Oe.getModel();Je&&Je.dispose(),we.current.subscription&&we.current.subscription.dispose(),Le&&window.removeEventListener("paste",Qe),ye.unobserve(ge.current)}}catch(Oe){}})},[]),Object(O.useEffect)(function(){var P=we.current.instance;if(P&&Me)return document.addEventListener("keydown",at,!1),function(){document.removeEventListener("keydown",at)}},[w,Me]),Object(O.useEffect)(function(){var P=we.current.instance;if(P&&Me){var U=Q(L);de.editor.setModelLanguage(P.getModel(),U),console.log("language:",L,P.getModel(),U)}},[L,Me]),Object(O.useEffect)(function(){var P=we.current.instance;P&&Me&&de.editor.setTheme(p)},[p,Me]),Object(O.useEffect)(function(){var P=we.current.instance;P&&Me&&(P.updateOptions(Object(H.a)({},j)),setTimeout(function(){P.getModel().updateOptions(Object(H.a)({},j))},200))},[JSON.stringify(j),Me]),Object(O.useEffect)(function(){var P=we.current.instance;P&&Me&&P.layout()},[Fe,Se,Me]);var vt=Object(O.useState)(z(Fe)),ut=Object(le.a)(vt,2),Be=ut[0],Ye=ut[1],ae=Object(O.useState)(z(Se)),q=Object(le.a)(ae,2),ie=q[0],C=q[1],E=Object(H.a)(Object(H.a)({},Y),{},{width:Be,height:ie});return I.a.createElement("div",{className:"my-monaco-editor",ref:ge,style:E})};function Xe(ke){var be=ke.width,Fe=be===void 0?"100%":be,me=ke.height,Se=me===void 0?"100%":me,Pe=ke.original,xe=ke.modified,L=ke.language,ue=ke.options,Y=ue===void 0?{}:ue,x=Object(O.useRef)(),j=Object(O.useState)(null),D=Object(le.a)(j,2),_=D[0],k=D[1];function p(te){var Ee;return x.current&&(Ee=new R.default(function(Le){var pe=Object(_e.a)(Le),fe;try{for(pe.s();!(fe=pe.n()).done;){var re=fe.value;(re.target.offsetHeight>0||re.target.offsetWidth>0)&&te.layout()}}catch(se){pe.e(se)}finally{pe.f()}}),Ee.observe(x.current)),Ee}Object(O.useEffect)(function(){x.current&&v.e(27).then(v.t.bind(null,"M/lh",7)).then(function(te){de=te;var Ee=de.editor.createDiffEditor(x.current,Object(H.a)(Object(H.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Y),{},{wordWrap:!0}));k(Ee);var Le=p(Ee);return function(){Ee.dispose();var pe=Ee.getModel();pe&&pe.dispose(),Le.unobserve(x.current)}})},[]),Object(O.useEffect)(function(){_&&_.setModel({original:de.editor.createModel(Pe,L),modified:de.editor.createModel(xe,L)})},[Pe,xe,L,_]);var d=z(Fe),w=z(Se),F={width:d,height:w};return I.a.createElement("div",{className:"my-diff-editor",ref:x,style:F})}},ZpRC:function(nt,Ge,v){"use strict";function H(S){return typeof S=="object"&&S!=null&&S.nodeType===1}function he(S,T){return(!T||S!=="hidden")&&S!=="visible"&&S!=="clip"}function oe(S,T){if(S.clientHeight<S.scrollHeight||S.clientWidth<S.scrollWidth){var $=getComputedStyle(S,null);return he($.overflowY,T)||he($.overflowX,T)||function(z){var N=function(J){if(!J.ownerDocument||!J.ownerDocument.defaultView)return null;try{return J.ownerDocument.defaultView.frameElement}catch(K){return null}}(z);return!!N&&(N.clientHeight<z.scrollHeight||N.clientWidth<z.scrollWidth)}(S)}return!1}function _e(S,T,$,z,N,J,K,Q){return J<S&&K>T||J>S&&K<T?0:J<=S&&Q<=$||K>=T&&Q>=$?J-S-z:K>T&&Q<$||J<S&&Q>$?K-T+N:0}var le=function(S,T){var $=window,z=T.scrollMode,N=T.block,J=T.inline,K=T.boundary,Q=T.skipOverflowHiddenElements,de=typeof K=="function"?K:function(Ie){return Ie!==K};if(!H(S))throw new TypeError("Invalid target");for(var Ne=document.scrollingElement||document.documentElement,Xe=[],ke=S;H(ke)&&de(ke);){if((ke=ke.parentElement)===Ne){Xe.push(ke);break}ke!=null&&ke===document.body&&oe(ke)&&!oe(document.documentElement)||ke!=null&&oe(ke,Q)&&Xe.push(ke)}for(var be=$.visualViewport?$.visualViewport.width:innerWidth,Fe=$.visualViewport?$.visualViewport.height:innerHeight,me=window.scrollX||pageXOffset,Se=window.scrollY||pageYOffset,Pe=S.getBoundingClientRect(),xe=Pe.height,L=Pe.width,ue=Pe.top,Y=Pe.right,x=Pe.bottom,j=Pe.left,D=N==="start"||N==="nearest"?ue:N==="end"?x:ue+xe/2,_=J==="center"?j+L/2:J==="end"?Y:j,k=[],p=0;p<Xe.length;p++){var d=Xe[p],w=d.getBoundingClientRect(),F=w.height,te=w.width,Ee=w.top,Le=w.right,pe=w.bottom,fe=w.left;if(z==="if-needed"&&ue>=0&&j>=0&&x<=Fe&&Y<=be&&ue>=Ee&&x<=pe&&j>=fe&&Y<=Le)return k;var re=getComputedStyle(d),se=parseInt(re.borderLeftWidth,10),ee=parseInt(re.borderTopWidth,10),B=parseInt(re.borderRightWidth,10),b=parseInt(re.borderBottomWidth,10),G=0,M=0,ge="offsetWidth"in d?d.offsetWidth-d.clientWidth-se-B:0,we="offsetHeight"in d?d.offsetHeight-d.clientHeight-ee-b:0;if(Ne===d)G=N==="start"?D:N==="end"?D-Fe:N==="nearest"?_e(Se,Se+Fe,Fe,ee,b,Se+D,Se+D+xe,xe):D-Fe/2,M=J==="start"?_:J==="center"?_-be/2:J==="end"?_-be:_e(me,me+be,be,se,B,me+_,me+_+L,L),G=Math.max(0,G+Se),M=Math.max(0,M+me);else{G=N==="start"?D-Ee-ee:N==="end"?D-pe+b+we:N==="nearest"?_e(Ee,pe,F,ee,b+we,D,D+xe,xe):D-(Ee+F/2)+we/2,M=J==="start"?_-fe-se:J==="center"?_-(fe+te/2)+ge/2:J==="end"?_-Le+B+ge:_e(fe,Le,te,se,B+ge,_,_+L,L);var ne=d.scrollLeft,Te=d.scrollTop;D+=Te-(G=Math.max(0,Math.min(Te+G,d.scrollHeight-F+we))),_+=ne-(M=Math.max(0,Math.min(ne+M,d.scrollWidth-te+ge)))}k.push({el:d,top:G,left:M})}return k};function V(S){return S===Object(S)&&Object.keys(S).length!==0}function O(S,T){T===void 0&&(T="auto");var $="scrollBehavior"in document.body.style;S.forEach(function(z){var N=z.el,J=z.top,K=z.left;N.scroll&&$?N.scroll({top:J,left:K,behavior:T}):(N.scrollTop=J,N.scrollLeft=K)})}function I(S){return S===!1?{block:"end",inline:"nearest"}:V(S)?S:{block:"start",inline:"nearest"}}function R(S,T){var $=!S.ownerDocument.documentElement.contains(S);if(V(T)&&typeof T.behavior=="function")return T.behavior($?[]:le(S,T));if($)return;var z=I(T);return O(le(S,z),z.behavior)}var A=Ge.a=R},Zss7:function(nt,Ge,v){var H;(function(he){var oe=/^\s+/,_e=/\s+$/,le=0,V=he.round,O=he.min,I=he.max,R=he.random;function A(b,G){if(b=b||"",G=G||{},b instanceof A)return b;if(!(this instanceof A))return new A(b,G);var M=S(b);this._originalInput=b,this._r=M.r,this._g=M.g,this._b=M.b,this._a=M.a,this._roundA=V(100*this._a)/100,this._format=G.format||M.format,this._gradientType=G.gradientType,this._r<1&&(this._r=V(this._r)),this._g<1&&(this._g=V(this._g)),this._b<1&&(this._b=V(this._b)),this._ok=M.ok,this._tc_id=le++}A.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var b=this.toRgb();return(b.r*299+b.g*587+b.b*114)/1e3},getLuminance:function(){var b=this.toRgb(),G,M,ge,we,ne,Te;return G=b.r/255,M=b.g/255,ge=b.b/255,G<=.03928?we=G/12.92:we=he.pow((G+.055)/1.055,2.4),M<=.03928?ne=M/12.92:ne=he.pow((M+.055)/1.055,2.4),ge<=.03928?Te=ge/12.92:Te=he.pow((ge+.055)/1.055,2.4),.2126*we+.7152*ne+.0722*Te},setAlpha:function(b){return this._a=k(b),this._roundA=V(100*this._a)/100,this},toHsv:function(){var b=N(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=N(this._r,this._g,this._b),G=V(b.h*360),M=V(b.s*100),ge=V(b.v*100);return this._a==1?"hsv("+G+", "+M+"%, "+ge+"%)":"hsva("+G+", "+M+"%, "+ge+"%, "+this._roundA+")"},toHsl:function(){var b=$(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=$(this._r,this._g,this._b),G=V(b.h*360),M=V(b.s*100),ge=V(b.l*100);return this._a==1?"hsl("+G+", "+M+"%, "+ge+"%)":"hsla("+G+", "+M+"%, "+ge+"%, "+this._roundA+")"},toHex:function(b){return K(this._r,this._g,this._b,b)},toHexString:function(b){return"#"+this.toHex(b)},toHex8:function(b){return Q(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:V(this._r),g:V(this._g),b:V(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+V(this._r)+", "+V(this._g)+", "+V(this._b)+")":"rgba("+V(this._r)+", "+V(this._g)+", "+V(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:V(p(this._r,255)*100)+"%",g:V(p(this._g,255)*100)+"%",b:V(p(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+V(p(this._r,255)*100)+"%, "+V(p(this._g,255)*100)+"%, "+V(p(this._b,255)*100)+"%)":"rgba("+V(p(this._r,255)*100)+"%, "+V(p(this._g,255)*100)+"%, "+V(p(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:D[K(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var G="#"+de(this._r,this._g,this._b,this._a),M=G,ge=this._gradientType?"GradientType = 1, ":"";if(b){var we=A(b);M="#"+de(we._r,we._g,we._b,we._a)}return"progid:DXImageTransform.Microsoft.gradient("+ge+"startColorstr="+G+",endColorstr="+M+")"},toString:function(b){var G=!!b;b=b||this._format;var M=!1,ge=this._a<1&&this._a>=0,we=!G&&ge&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return we?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(M=this.toRgbString()),b==="prgb"&&(M=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(M=this.toHexString()),b==="hex3"&&(M=this.toHexString(!0)),b==="hex4"&&(M=this.toHex8String(!0)),b==="hex8"&&(M=this.toHex8String()),b==="name"&&(M=this.toName()),b==="hsl"&&(M=this.toHslString()),b==="hsv"&&(M=this.toHsvString()),M||this.toHexString())},clone:function(){return A(this.toString())},_applyModification:function(b,G){var M=b.apply(null,[this].concat([].slice.call(G)));return this._r=M._r,this._g=M._g,this._b=M._b,this.setAlpha(M._a),this},lighten:function(){return this._applyModification(be,arguments)},brighten:function(){return this._applyModification(Fe,arguments)},darken:function(){return this._applyModification(me,arguments)},desaturate:function(){return this._applyModification(Ne,arguments)},saturate:function(){return this._applyModification(Xe,arguments)},greyscale:function(){return this._applyModification(ke,arguments)},spin:function(){return this._applyModification(Se,arguments)},_applyCombination:function(b,G){return b.apply(null,[this].concat([].slice.call(G)))},analogous:function(){return this._applyCombination(Y,arguments)},complement:function(){return this._applyCombination(Pe,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(ue,arguments)},triad:function(){return this._applyCombination(xe,arguments)},tetrad:function(){return this._applyCombination(L,arguments)}},A.fromRatio=function(b,G){if(typeof b=="object"){var M={};for(var ge in b)b.hasOwnProperty(ge)&&(ge==="a"?M[ge]=b[ge]:M[ge]=Le(b[ge]));b=M}return A(b,G)};function S(b){var G={r:0,g:0,b:0},M=1,ge=null,we=null,ne=null,Te=!1,Ie=!1;return typeof b=="string"&&(b=ee(b)),typeof b=="object"&&(se(b.r)&&se(b.g)&&se(b.b)?(G=T(b.r,b.g,b.b),Te=!0,Ie=String(b.r).substr(-1)==="%"?"prgb":"rgb"):se(b.h)&&se(b.s)&&se(b.v)?(ge=Le(b.s),we=Le(b.v),G=J(b.h,ge,we),Te=!0,Ie="hsv"):se(b.h)&&se(b.s)&&se(b.l)&&(ge=Le(b.s),ne=Le(b.l),G=z(b.h,ge,ne),Te=!0,Ie="hsl"),b.hasOwnProperty("a")&&(M=b.a)),M=k(M),{ok:Te,format:b.format||Ie,r:O(255,I(G.r,0)),g:O(255,I(G.g,0)),b:O(255,I(G.b,0)),a:M}}function T(b,G,M){return{r:p(b,255)*255,g:p(G,255)*255,b:p(M,255)*255}}function $(b,G,M){b=p(b,255),G=p(G,255),M=p(M,255);var ge=I(b,G,M),we=O(b,G,M),ne,Te,Ie=(ge+we)/2;if(ge==we)ne=Te=0;else{var De=ge-we;Te=Ie>.5?De/(2-ge-we):De/(ge+we);switch(ge){case b:ne=(G-M)/De+(G<M?6:0);break;case G:ne=(M-b)/De+2;break;case M:ne=(b-G)/De+4;break}ne/=6}return{h:ne,s:Te,l:Ie}}function z(b,G,M){var ge,we,ne;b=p(b,360),G=p(G,100),M=p(M,100);function Te(Ae,Me,Ue){return Ue<0&&(Ue+=1),Ue>1&&(Ue-=1),Ue<1/6?Ae+(Me-Ae)*6*Ue:Ue<1/2?Me:Ue<2/3?Ae+(Me-Ae)*(2/3-Ue)*6:Ae}if(G===0)ge=we=ne=M;else{var Ie=M<.5?M*(1+G):M+G-M*G,De=2*M-Ie;ge=Te(De,Ie,b+1/3),we=Te(De,Ie,b),ne=Te(De,Ie,b-1/3)}return{r:ge*255,g:we*255,b:ne*255}}function N(b,G,M){b=p(b,255),G=p(G,255),M=p(M,255);var ge=I(b,G,M),we=O(b,G,M),ne,Te,Ie=ge,De=ge-we;if(Te=ge===0?0:De/ge,ge==we)ne=0;else{switch(ge){case b:ne=(G-M)/De+(G<M?6:0);break;case G:ne=(M-b)/De+2;break;case M:ne=(b-G)/De+4;break}ne/=6}return{h:ne,s:Te,v:Ie}}function J(b,G,M){b=p(b,360)*6,G=p(G,100),M=p(M,100);var ge=he.floor(b),we=b-ge,ne=M*(1-G),Te=M*(1-we*G),Ie=M*(1-(1-we)*G),De=ge%6,Ae=[M,Te,ne,ne,Ie,M][De],Me=[Ie,M,M,Te,ne,ne][De],Ue=[ne,ne,Ie,M,M,Te][De];return{r:Ae*255,g:Me*255,b:Ue*255}}function K(b,G,M,ge){var we=[Ee(V(b).toString(16)),Ee(V(G).toString(16)),Ee(V(M).toString(16))];return ge&&we[0].charAt(0)==we[0].charAt(1)&&we[1].charAt(0)==we[1].charAt(1)&&we[2].charAt(0)==we[2].charAt(1)?we[0].charAt(0)+we[1].charAt(0)+we[2].charAt(0):we.join("")}function Q(b,G,M,ge,we){var ne=[Ee(V(b).toString(16)),Ee(V(G).toString(16)),Ee(V(M).toString(16)),Ee(pe(ge))];return we&&ne[0].charAt(0)==ne[0].charAt(1)&&ne[1].charAt(0)==ne[1].charAt(1)&&ne[2].charAt(0)==ne[2].charAt(1)&&ne[3].charAt(0)==ne[3].charAt(1)?ne[0].charAt(0)+ne[1].charAt(0)+ne[2].charAt(0)+ne[3].charAt(0):ne.join("")}function de(b,G,M,ge){var we=[Ee(pe(ge)),Ee(V(b).toString(16)),Ee(V(G).toString(16)),Ee(V(M).toString(16))];return we.join("")}A.equals=function(b,G){return!b||!G?!1:A(b).toRgbString()==A(G).toRgbString()},A.random=function(){return A.fromRatio({r:R(),g:R(),b:R()})};function Ne(b,G){G=G===0?0:G||10;var M=A(b).toHsl();return M.s-=G/100,M.s=d(M.s),A(M)}function Xe(b,G){G=G===0?0:G||10;var M=A(b).toHsl();return M.s+=G/100,M.s=d(M.s),A(M)}function ke(b){return A(b).desaturate(100)}function be(b,G){G=G===0?0:G||10;var M=A(b).toHsl();return M.l+=G/100,M.l=d(M.l),A(M)}function Fe(b,G){G=G===0?0:G||10;var M=A(b).toRgb();return M.r=I(0,O(255,M.r-V(255*-(G/100)))),M.g=I(0,O(255,M.g-V(255*-(G/100)))),M.b=I(0,O(255,M.b-V(255*-(G/100)))),A(M)}function me(b,G){G=G===0?0:G||10;var M=A(b).toHsl();return M.l-=G/100,M.l=d(M.l),A(M)}function Se(b,G){var M=A(b).toHsl(),ge=(M.h+G)%360;return M.h=ge<0?360+ge:ge,A(M)}function Pe(b){var G=A(b).toHsl();return G.h=(G.h+180)%360,A(G)}function xe(b){var G=A(b).toHsl(),M=G.h;return[A(b),A({h:(M+120)%360,s:G.s,l:G.l}),A({h:(M+240)%360,s:G.s,l:G.l})]}function L(b){var G=A(b).toHsl(),M=G.h;return[A(b),A({h:(M+90)%360,s:G.s,l:G.l}),A({h:(M+180)%360,s:G.s,l:G.l}),A({h:(M+270)%360,s:G.s,l:G.l})]}function ue(b){var G=A(b).toHsl(),M=G.h;return[A(b),A({h:(M+72)%360,s:G.s,l:G.l}),A({h:(M+216)%360,s:G.s,l:G.l})]}function Y(b,G,M){G=G||6,M=M||30;var ge=A(b).toHsl(),we=360/M,ne=[A(b)];for(ge.h=(ge.h-(we*G>>1)+720)%360;--G;)ge.h=(ge.h+we)%360,ne.push(A(ge));return ne}function x(b,G){G=G||6;for(var M=A(b).toHsv(),ge=M.h,we=M.s,ne=M.v,Te=[],Ie=1/G;G--;)Te.push(A({h:ge,s:we,v:ne})),ne=(ne+Ie)%1;return Te}A.mix=function(b,G,M){M=M===0?0:M||50;var ge=A(b).toRgb(),we=A(G).toRgb(),ne=M/100,Te={r:(we.r-ge.r)*ne+ge.r,g:(we.g-ge.g)*ne+ge.g,b:(we.b-ge.b)*ne+ge.b,a:(we.a-ge.a)*ne+ge.a};return A(Te)},A.readability=function(b,G){var M=A(b),ge=A(G);return(he.max(M.getLuminance(),ge.getLuminance())+.05)/(he.min(M.getLuminance(),ge.getLuminance())+.05)},A.isReadable=function(b,G,M){var ge=A.readability(b,G),we,ne;ne=!1,we=B(M);switch(we.level+we.size){case"AAsmall":case"AAAlarge":ne=ge>=4.5;break;case"AAlarge":ne=ge>=3;break;case"AAAsmall":ne=ge>=7;break}return ne},A.mostReadable=function(b,G,M){var ge=null,we=0,ne,Te,Ie,De;M=M||{},Te=M.includeFallbackColors,Ie=M.level,De=M.size;for(var Ae=0;Ae<G.length;Ae++)ne=A.readability(b,G[Ae]),ne>we&&(we=ne,ge=A(G[Ae]));return A.isReadable(b,ge,{level:Ie,size:De})||!Te?ge:(M.includeFallbackColors=!1,A.mostReadable(b,["#fff","#000"],M))};var j=A.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},D=A.hexNames=_(j);function _(b){var G={};for(var M in b)b.hasOwnProperty(M)&&(G[b[M]]=M);return G}function k(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function p(b,G){F(b)&&(b="100%");var M=te(b);return b=O(G,I(0,parseFloat(b))),M&&(b=parseInt(b*G,10)/100),he.abs(b-G)<1e-6?1:b%G/parseFloat(G)}function d(b){return O(1,I(0,b))}function w(b){return parseInt(b,16)}function F(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function te(b){return typeof b=="string"&&b.indexOf("%")!=-1}function Ee(b){return b.length==1?"0"+b:""+b}function Le(b){return b<=1&&(b=b*100+"%"),b}function pe(b){return he.round(parseFloat(b)*255).toString(16)}function fe(b){return w(b)/255}var re=function(){var b="[-\\+]?\\d+%?",G="[-\\+]?\\d*\\.\\d+%?",M="(?:"+G+")|(?:"+b+")",ge="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?",we="[\\s|\\(]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")[,|\\s]+("+M+")\\s*\\)?";return{CSS_UNIT:new RegExp(M),rgb:new RegExp("rgb"+ge),rgba:new RegExp("rgba"+we),hsl:new RegExp("hsl"+ge),hsla:new RegExp("hsla"+we),hsv:new RegExp("hsv"+ge),hsva:new RegExp("hsva"+we),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function se(b){return!!re.CSS_UNIT.exec(b)}function ee(b){b=b.replace(oe,"").replace(_e,"").toLowerCase();var G=!1;if(j[b])b=j[b],G=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var M;return(M=re.rgb.exec(b))?{r:M[1],g:M[2],b:M[3]}:(M=re.rgba.exec(b))?{r:M[1],g:M[2],b:M[3],a:M[4]}:(M=re.hsl.exec(b))?{h:M[1],s:M[2],l:M[3]}:(M=re.hsla.exec(b))?{h:M[1],s:M[2],l:M[3],a:M[4]}:(M=re.hsv.exec(b))?{h:M[1],s:M[2],v:M[3]}:(M=re.hsva.exec(b))?{h:M[1],s:M[2],v:M[3],a:M[4]}:(M=re.hex8.exec(b))?{r:w(M[1]),g:w(M[2]),b:w(M[3]),a:fe(M[4]),format:G?"name":"hex8"}:(M=re.hex6.exec(b))?{r:w(M[1]),g:w(M[2]),b:w(M[3]),format:G?"name":"hex"}:(M=re.hex4.exec(b))?{r:w(M[1]+""+M[1]),g:w(M[2]+""+M[2]),b:w(M[3]+""+M[3]),a:fe(M[4]+""+M[4]),format:G?"name":"hex8"}:(M=re.hex3.exec(b))?{r:w(M[1]+""+M[1]),g:w(M[2]+""+M[2]),b:w(M[3]+""+M[3]),format:G?"name":"hex"}:!1}function B(b){var G,M;return b=b||{level:"AA",size:"small"},G=(b.level||"AA").toUpperCase(),M=(b.size||"small").toLowerCase(),G!=="AA"&&G!=="AAA"&&(G="AA"),M!=="small"&&M!=="large"&&(M="small"),{level:G,size:M}}nt.exports?nt.exports=A:!(H=function(){return A}.call(Ge,v,Ge,nt),H!==void 0&&(nt.exports=H))})(Math)},aRTE:function(nt,Ge){nt.exports={L:1,M:0,Q:3,H:2}},bT9E:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return he});var H=v("VTBJ");function he(oe,_e){var le=Object(H.a)({},oe);return Array.isArray(_e)&&_e.forEach(function(V){delete le[V]}),le}},c5Ni:function(nt,Ge,v){},dQei:function(nt,Ge){for(var v={glog:function(he){if(he<1)throw new Error("glog("+he+")");return v.LOG_TABLE[he]},gexp:function(he){for(;he<0;)he+=255;for(;he>=256;)he-=255;return v.EXP_TABLE[he]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},H=0;H<8;H++)v.EXP_TABLE[H]=1<<H;for(var H=8;H<256;H++)v.EXP_TABLE[H]=v.EXP_TABLE[H-4]^v.EXP_TABLE[H-5]^v.EXP_TABLE[H-6]^v.EXP_TABLE[H-8];for(var H=0;H<255;H++)v.LOG_TABLE[v.EXP_TABLE[H]]=H;nt.exports=v},dWSS:function(nt,Ge,v){var H=v("dQei");function he(oe,_e){if(oe.length==null)throw new Error(oe.length+"/"+_e);for(var le=0;le<oe.length&&oe[le]==0;)le++;this.num=new Array(oe.length-le+_e);for(var V=0;V<oe.length-le;V++)this.num[V]=oe[V+le]}he.prototype={get:function(oe){return this.num[oe]},getLength:function(){return this.num.length},multiply:function(oe){for(var _e=new Array(this.getLength()+oe.getLength()-1),le=0;le<this.getLength();le++)for(var V=0;V<oe.getLength();V++)_e[le+V]^=H.gexp(H.glog(this.get(le))+H.glog(oe.get(V)));return new he(_e,0)},mod:function(oe){if(this.getLength()-oe.getLength()<0)return this;for(var _e=H.glog(this.get(0))-H.glog(oe.get(0)),le=new Array(this.getLength()),V=0;V<this.getLength();V++)le[V]=this.get(V);for(var V=0;V<oe.getLength();V++)le[V]^=H.gexp(H.glog(oe.get(V))+_e);return new he(le,0).mod(oe)}},nt.exports=he},dejd:function(nt,Ge,v){},dmUQ:function(nt,Ge,v){"use strict";var H=v("Ff2n"),he=v("rePB"),oe=v("1OyB"),_e=v("vuIU"),le=v("Ji7U"),V=v("md7G"),O=v("foSv"),I=v("q1tI"),R=v.n(I),A=v("TSYQ"),S=v.n(A),T=v("4IlW");function $(xe,L){var ue=Object.keys(xe);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(xe);L&&(Y=Y.filter(function(x){return Object.getOwnPropertyDescriptor(xe,x).enumerable})),ue.push.apply(ue,Y)}return ue}function z(xe){for(var L=1;L<arguments.length;L++){var ue=arguments[L]!=null?arguments[L]:{};L%2?$(Object(ue),!0).forEach(function(Y){Object(he.a)(xe,Y,ue[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(xe,Object.getOwnPropertyDescriptors(ue)):$(Object(ue)).forEach(function(Y){Object.defineProperty(xe,Y,Object.getOwnPropertyDescriptor(ue,Y))})}return xe}function N(xe){var L=J();return function(){var Y=Object(O.a)(xe),x;if(L){var j=Object(O.a)(this).constructor;x=Reflect.construct(Y,arguments,j)}else x=Y.apply(this,arguments);return Object(V.a)(this,x)}}function J(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(xe){return!1}}function K(){}function Q(xe){xe.preventDefault()}var de=function(L){return L.replace(/[^\w.-]+/g,"")},Ne=200,Xe=600,ke=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,be=function(L){return L!=null},Fe=function(L,ue){return ue===L||typeof ue=="number"&&typeof L=="number"&&isNaN(ue)&&isNaN(L)},me=function(xe){Object(le.a)(ue,xe);var L=N(ue);function ue(Y){var x;Object(oe.a)(this,ue),x=L.call(this,Y),x.onKeyDown=function(_){var k=x.props,p=k.onKeyDown,d=k.onPressEnter;if(_.keyCode===T.a.UP){var w=x.getRatio(_);x.up(_,w,null),x.stop()}else if(_.keyCode===T.a.DOWN){var F=x.getRatio(_);x.down(_,F,null),x.stop()}else _.keyCode===T.a.ENTER&&d&&d(_);if(x.recordCursorPosition(),x.lastKeyCode=_.keyCode,p){for(var te=arguments.length,Ee=new Array(te>1?te-1:0),Le=1;Le<te;Le++)Ee[Le-1]=arguments[Le];p.apply(void 0,[_].concat(Ee))}},x.onKeyUp=function(_){var k=x.props.onKeyUp;if(x.stop(),x.recordCursorPosition(),k){for(var p=arguments.length,d=new Array(p>1?p-1:0),w=1;w<p;w++)d[w-1]=arguments[w];k.apply(void 0,[_].concat(d))}},x.onChange=function(_){var k=x.props.onChange;x.state.focused&&(x.inputting=!0),x.rawInput=x.props.parser(x.getValueFromEvent(_)),x.setState({inputValue:x.rawInput}),k(x.toNumber(x.rawInput))},x.onMouseUp=function(){var _=x.props.onMouseUp;x.recordCursorPosition(),_&&_.apply(void 0,arguments)},x.onFocus=function(){var _;x.setState({focused:!0}),(_=x.props).onFocus.apply(_,arguments)},x.onBlur=function(){var _=x.props.onBlur;x.inputting=!1,x.setState({focused:!1});var k=x.getCurrentValidValue(x.state.inputValue),p=x.setValue(k,K);if(_){var d=x.input.value,w=x.getInputDisplayValue({focus:!1,value:p});x.input.value=w&&Number(w),_.apply(void 0,arguments),x.input.value=d}},x.getRatio=function(_){var k=1;return _.metaKey||_.ctrlKey?k=.1:_.shiftKey&&(k=10),k},x.getFullNum=function(_){return isNaN(_)?_:/e/i.test(String(_))?Number(_).toFixed(18).replace(/\.?0+$/,""):_},x.getPrecision=function(_){if(be(x.props.precision))return x.props.precision;var k=String(_);if(k.indexOf("e-")>=0)return parseInt(k.slice(k.indexOf("e-")+2),10);var p=0;return k.indexOf(".")>=0&&(p=k.length-k.indexOf(".")-1),p},x.getInputDisplayValue=function(_){var k=_||x.state,p=k.focused,d=k.inputValue,w=k.value,F;p?F=d:F=x.toPrecisionAsStep(w),F==null&&(F="");var te=x.formatWrapper(F);return be(x.props.decimalSeparator)&&(te=te.toString().replace(".",x.props.decimalSeparator)),te},x.recordCursorPosition=function(){try{x.cursorStart=x.input.selectionStart,x.cursorEnd=x.input.selectionEnd,x.currentValue=x.input.value,x.cursorBefore=x.input.value.substring(0,x.cursorStart),x.cursorAfter=x.input.value.substring(x.cursorEnd)}catch(_){}},x.restoreByAfter=function(_){if(_===void 0)return!1;var k=x.input.value,p=k.lastIndexOf(_);if(p===-1)return!1;var d=x.cursorBefore.length;return x.lastKeyCode===T.a.DELETE&&x.cursorBefore.charAt(d-1)===_[0]?(x.fixCaret(d,d),!0):p+_.length===k.length?(x.fixCaret(p,p),!0):!1},x.partRestoreByAfter=function(_){return _===void 0?!1:Array.prototype.some.call(_,function(k,p){var d=_.substring(p);return x.restoreByAfter(d)})},x.isNotCompleteNumber=function(_){return isNaN(_)||_===""||_===null||_&&_.toString().indexOf(".")===_.toString().length-1},x.stop=function(){x.autoStepTimer&&clearTimeout(x.autoStepTimer)},x.down=function(_,k,p){x.pressingUpOrDown=!0,x.step("down",_,k,p)},x.up=function(_,k,p){x.pressingUpOrDown=!0,x.step("up",_,k,p)},x.saveInput=function(_){x.input=_};var j=Y.value;j===void 0&&(j=Y.defaultValue),x.state={focused:Y.autoFocus};var D=x.getValidValue(x.toNumber(j));return x.state=z(z({},x.state),{},{inputValue:x.toPrecisionAsStep(D),value:D}),x}return Object(_e.a)(ue,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(x){var j=this.props,D=j.value,_=j.onChange,k=j.max,p=j.min,d=this.state.focused;if(x){if(!Fe(x.value,D)||!Fe(x.max,k)||!Fe(x.min,p)){var w=d?D:this.getValidValue(D),F;this.pressingUpOrDown?F=w:this.inputting?F=this.rawInput:F=this.toPrecisionAsStep(w),this.setState({value:w,inputValue:F})}var te="value"in this.props?D:this.state.value;"max"in this.props&&x.max!==k&&typeof te=="number"&&te>k&&_&&_(k),"min"in this.props&&x.min!==p&&typeof te=="number"&&te<p&&_&&_(p)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ee=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===T.a.BACKSPACE?Ee=this.cursorStart-1:this.lastKeyCode===T.a.DELETE&&(Ee=this.cursorStart):Ee=this.input.value.length,this.fixCaret(Ee,Ee)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case T.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case T.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Le){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(x){var j=x;return j===""?j="":this.isNotCompleteNumber(parseFloat(j))?j=this.state.value:j=this.getValidValue(j),this.toNumber(j)}},{key:"getValueFromEvent",value:function(x){var j=x.target.value.trim().replace(/。/g,".");return be(this.props.decimalSeparator)&&(j=j.replace(this.props.decimalSeparator,".")),j}},{key:"getValidValue",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,_=parseFloat(x);return isNaN(_)?x:(_<j&&(_=j),_>D&&(_=D),_)}},{key:"setValue",value:function(x,j){var D=this.props.precision,_=this.isNotCompleteNumber(parseFloat(x))?null:parseFloat(x),k=this.state.value,p=k===void 0?null:k,d=this.state.inputValue,w=d===void 0?null:d,F=typeof _=="number"?_.toFixed(D):"".concat(_),te=_!==p||F!=="".concat(w);return"value"in this.props?(w=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:w},j)):this.setState({value:_,inputValue:this.toPrecisionAsStep(x)},j),te&&this.props.onChange(_),_}},{key:"getMaxPrecision",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,D=this.props,_=D.precision,k=D.step;if(be(_))return _;var p=this.getPrecision(j),d=this.getPrecision(k),w=this.getPrecision(x);return x?Math.max(w,p+d):p+d}},{key:"getPrecisionFactor",value:function(x){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,D=this.getMaxPrecision(x,j);return Math.pow(10,D)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(x){return this.props.formatter?this.props.formatter(x):x}},{key:"toPrecisionAsStep",value:function(x){if(this.isNotCompleteNumber(x)||x==="")return x;var j=Math.abs(this.getMaxPrecision(x));return isNaN(j)?x.toString():Number(x).toFixed(j)}},{key:"toNumber",value:function(x){var j=this.props.precision,D=this.state.focused,_=x&&x.length>16&&D;return this.isNotCompleteNumber(x)||_?x:be(j)?Math.round(x*Math.pow(10,j))/Math.pow(10,j):Number(x)}},{key:"upStep",value:function(x,j){var D=this.props.step,_=this.getPrecisionFactor(x,j),k=Math.abs(this.getMaxPrecision(x,j)),p=((_*x+_*D*j)/_).toFixed(k);return this.toNumber(p)}},{key:"downStep",value:function(x,j){var D=this.props.step,_=this.getPrecisionFactor(x,j),k=Math.abs(this.getMaxPrecision(x,j)),p=((_*x-_*D*j)/_).toFixed(k);return this.toNumber(p)}},{key:"step",value:function(x,j){var D=this,_=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=arguments.length>3?arguments[3]:void 0;this.stop(),j&&(j.persist(),j.preventDefault());var p=this.props;if(p.disabled)return;var d=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(d))return;var w=this["".concat(x,"Step")](d,_),F=w>p.max||w<p.min;if(w>p.max?w=p.max:w<p.min&&(w=p.min),this.setValue(w,null),this.setState({focused:!0},function(){D.pressingUpOrDown=!1}),F)return;this.autoStepTimer=setTimeout(function(){D[x](j,_,!0)},k?Ne:Xe)}},{key:"fixCaret",value:function(x,j){if(x===void 0||j===void 0||!this.input||!this.input.value)return;try{var D=this.input.selectionStart,_=this.input.selectionEnd;(x!==D||j!==_)&&this.input.setSelectionRange(x,j)}catch(k){}}},{key:"render",value:function(){var x,j=this.props,D=j.prefixCls,_=j.disabled,k=j.readOnly,p=j.useTouch,d=j.autoComplete,w=j.upHandler,F=j.downHandler,te=j.className,Ee=j.max,Le=j.min,pe=j.style,fe=j.title,re=j.onMouseEnter,se=j.onMouseLeave,ee=j.onMouseOver,B=j.onMouseOut,b=j.required,G=j.onClick,M=j.tabIndex,ge=j.type,we=j.placeholder,ne=j.id,Te=j.inputMode,Ie=j.pattern,De=j.step,Ae=j.maxLength,Me=j.autoFocus,Ue=j.name,et=j.onPaste,Ve=j.onInput,Ze=Object(H.a)(j,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Qe=this.state,at=Qe.value,tt=Qe.focused,st=S()(D,(x={},Object(he.a)(x,te,!!te),Object(he.a)(x,"".concat(D,"-disabled"),_),Object(he.a)(x,"".concat(D,"-focused"),tt),x)),Re={};Object.keys(Ze).forEach(function(U){(U.substr(0,5)==="data-"||U.substr(0,5)==="aria-"||U==="role")&&(Re[U]=Ze[U])});var vt=!k&&!_,ut=this.getInputDisplayValue(null),Be=(at||at===0)&&(isNaN(at)||Number(at)>=Ee),Ye=(at||at===0)&&(isNaN(at)||Number(at)<=Le),ae=Be||_||k,q=Ye||_||k,ie=S()("".concat(D,"-handler"),"".concat(D,"-handler-up"),Object(he.a)({},"".concat(D,"-handler-up-disabled"),ae)),C=S()("".concat(D,"-handler"),"".concat(D,"-handler-down"),Object(he.a)({},"".concat(D,"-handler-down-disabled"),q)),E=p?{onTouchStart:ae?K:this.up,onTouchEnd:this.stop}:{onMouseDown:ae?K:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},P=p?{onTouchStart:q?K:this.down,onTouchEnd:this.stop}:{onMouseDown:q?K:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return R.a.createElement("div",{className:st,style:pe,title:fe,onMouseEnter:re,onMouseLeave:se,onMouseOver:ee,onMouseOut:B,onFocus:function(){return null},onBlur:function(){return null}},R.a.createElement("div",{className:"".concat(D,"-handler-wrap")},R.a.createElement("span",Object.assign({unselectable:"on"},E,{role:"button","aria-label":"Increase Value","aria-disabled":ae,className:ie}),w||R.a.createElement("span",{unselectable:"on",className:"".concat(D,"-handler-up-inner"),onClick:Q})),R.a.createElement("span",Object.assign({unselectable:"on"},P,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:C}),F||R.a.createElement("span",{unselectable:"on",className:"".concat(D,"-handler-down-inner"),onClick:Q}))),R.a.createElement("div",{className:"".concat(D,"-input-wrap")},R.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Le,"aria-valuemax":Ee,"aria-valuenow":at,required:b,type:ge,placeholder:we,onPaste:et,onClick:G,onMouseUp:this.onMouseUp,className:"".concat(D,"-input"),tabIndex:M,autoComplete:d,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:K,onKeyUp:vt?this.onKeyUp:K,autoFocus:Me,maxLength:Ae,readOnly:k,disabled:_,max:Ee,min:Le,step:De,name:Ue,title:fe,id:ne,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ut),pattern:Ie,inputMode:Te,onInput:Ve},Re))))}}]),ue}(R.a.Component);me.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:ke,min:-ke,step:1,style:{},onChange:K,onKeyDown:K,onPressEnter:K,onFocus:K,onBlur:K,parser:de,required:!1,autoComplete:"off"};var Se=me,Pe=Ge.a=Se},f4xo:function(nt,Ge,v){var H=v("nVVt");function he(oe){this.mode=H.MODE_8BIT_BYTE,this.data=oe}he.prototype={getLength:function(oe){return this.data.length},write:function(oe){for(var _e=0;_e<this.data.length;_e++)oe.put(this.data.charCodeAt(_e),8)}},nt.exports=he},gHQ5:function(nt,Ge,v){"use strict";v.r(Ge);var H=v("+L6B"),he=v("2/Rp"),oe=v("5NDa"),_e=v("5rEg"),le=v("k1fw"),V=v("9og8"),O=v("y8nQ"),I=v("Vl3Y"),R=v("tJVT"),A=v("CiB2"),S=v("WmNS"),T=v.n(S),$=v("q1tI"),z=v.n($),N=v("3vs6"),J=v("l3Yi"),K=v.n(J),Q=v("Ot1p"),de=v("500L"),Ne=v("ErOA"),Xe=v("Ty5D"),ke=v("9kvl"),be=function(me){var Se;Object(A.a)(me);var Pe=Object($.useState)({}),xe=Object(R.a)(Pe,2),L=xe[0],ue=xe[1],Y=I.a.useForm(),x=Object(R.a)(Y,1),j=x[0],D=Object($.useState)(!0),_=Object(R.a)(D,2),k=_[0],p=_[1],d=Object($.useState)(!1),w=Object(R.a)(d,2),F=w[0],te=w[1],Ee=Object($.useState)(!1),Le=Object(R.a)(Ee,2),pe=Le[0],fe=Le[1],re=Object(Xe.i)(),se=re==null?void 0:re.virtual_spacesId;Object($.useEffect)(function(){re!=null&&re.id?ee():fe(!0)},[]);var ee=function(){var b=Object(V.a)(T.a.mark(function G(){var M,ge;return T.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return ne.next=2,Object(Ne.a)("/api/virtual_classrooms/".concat(se,"/syllabuses/").concat(re==null?void 0:re.id,"/edit.json"),{method:"get"});case 2:M=ne.sent,M&&(ge={title:M.title,description:M.description,attachment_ids:Object(de.a)(M.attachments)},console.log(ge,"formData"),j.setFieldsValue(Object(le.a)({},ge)),ue(Object(le.a)({},ge)),fe(!0));case 4:case"end":return ne.stop()}},G)}));return function(){return b.apply(this,arguments)}}(),B=function(){var b=Object(V.a)(T.a.mark(function G(M){var ge,we,ne,Te,Ie;return T.a.wrap(function(Ae){for(;;)switch(Ae.prev=Ae.next){case 0:if(we=Object(le.a)({},L),we.attachment_ids&&(we.attachment_ids=we==null||((ne=we.attachment_ids)===null||ne===void 0)?void 0:ne.map(function(Me){return Me.response.id})),te(!0),!(re!=null&&re.id)){Ae.next=9;break}return Ae.next=6,Object(Ne.a)("/api/virtual_classrooms/".concat(se,"/syllabuses/").concat(re==null?void 0:re.id,".json"),{method:"put",body:Object(le.a)({},we)});case 6:Te=Ae.sent,Ae.next=12;break;case 9:return Ae.next=11,Object(Ne.a)("/api/virtual_classrooms/".concat(se,"/syllabuses.json"),{method:"post",body:Object(le.a)({},we)});case 11:Te=Ae.sent;case 12:(ge=Te)!==null&&ge!==void 0&&ge.virtual_classroom_id&&ke.d.push("/vspaces/".concat(se,"/syllabuses/").concat((Ie=Te)===null||Ie===void 0?void 0:Ie.id,"/detail")),te(!1);case 14:case"end":return Ae.stop()}},G)}));return function(M){return b.apply(this,arguments)}}();return z.a.createElement("div",{className:K.a.wrap},z.a.createElement(N.a,null),z.a.createElement("div",{className:K.a.form},z.a.createElement("div",{className:K.a.title},z.a.createElement("span",{onClick:function(){return ke.d.push("/vspaces/".concat(se,"/syllabuses"))}},z.a.createElement("i",{className:"iconfont icon-zuoshangjiaofanhui"}),"\u8FD4\u56DE"),z.a.createElement("span",null,"\u65B0\u5EFA\u6559\u5B66\u5927\u7EB2")),z.a.createElement(I.a,{colon:!1,form:j,scrollToFirstError:!0,onValuesChange:function(){ue(Object(le.a)({},j.getFieldsValue()))},onFinish:B},z.a.createElement(I.a.Item,{name:"title",label:"\u5927\u7EB2\u6807\u9898",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5927\u7EB2\u6807\u9898"}]},z.a.createElement(_e.a,{maxLength:60,suffix:"".concat(((Se=L.title)===null||Se===void 0?void 0:Se.length)||0,"/60"),placeholder:"\u8BF7\u8F93\u5165\u5927\u7EB2\u6807\u9898"})),z.a.createElement("div",{style:{margin:"20px 0 12px 10px"}},"\u5927\u7EB2\u5185\u5BB9"),z.a.createElement(I.a.Item,{className:"ml10",name:"description",rules:[{max:5e4,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u523650000\u4E2A\u5B57\u7B26"}]},z.a.createElement(Q.a,{watch:!0,defaultValue:L.description})),z.a.createElement(I.a.Item,{className:"ml10",name:"attachment_ids",label:"\u9644\u4EF6"},pe&&z.a.createElement(de.b,{className:K.a.file,title:z.a.createElement("span",null,z.a.createElement("i",{className:"iconfont icon-shangchuan1 font14 mr5"}),"\u4E0A\u4F20\u9644\u4EF6")})),z.a.createElement("div",{style:{textAlign:"right"}},z.a.createElement(I.a.Item,null,z.a.createElement(he.a,{onClick:function(){return ke.d.push("/vspaces/".concat(se,"/syllabuses"))},className:"mr10"},"\u53D6\u6D88"),z.a.createElement(he.a,{type:"primary",htmlType:"submit",loading:F},"\u786E\u8BA4"))))))};Ge.default=be},h78n:function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return x});var H=v("q1tI"),he=v.n(H),oe=v("TSYQ"),_e=v.n(oe),le={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},V=function(_){var k=_.map(function(){return Object(H.useRef)()}),p=Object(H.useRef)();return Object(H.useEffect)(function(){var d=Date.now(),w=!1;Object.keys(k).forEach(function(F){var te=k[F].current;if(!te)return;w=!0;var Ee=te.style;Ee.transitionDuration=".3s, .3s, .3s, .06s",p.current&&d-p.current<100&&(Ee.transitionDuration="0s, 0s")}),w&&(p.current=Date.now())}),[k]};function O(){return O=Object.assign||function(D){for(var _=1;_<arguments.length;_++){var k=arguments[_];for(var p in k)Object.prototype.hasOwnProperty.call(k,p)&&(D[p]=k[p])}return D},O.apply(this,arguments)}function I(D,_){return $(D)||T(D,_)||A(D,_)||R()}function R(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(D,_){if(!D)return;if(typeof D=="string")return S(D,_);var k=Object.prototype.toString.call(D).slice(8,-1);if(k==="Object"&&D.constructor&&(k=D.constructor.name),k==="Map"||k==="Set")return Array.from(D);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return S(D,_)}function S(D,_){(_==null||_>D.length)&&(_=D.length);for(var k=0,p=new Array(_);k<_;k++)p[k]=D[k];return p}function T(D,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(D)))return;var k=[],p=!0,d=!1,w=void 0;try{for(var F=D[Symbol.iterator](),te;!(p=(te=F.next()).done)&&!(k.push(te.value),_&&k.length===_);p=!0);}catch(Ee){d=!0,w=Ee}finally{try{!p&&F.return!=null&&F.return()}finally{if(d)throw w}}return k}function $(D){if(Array.isArray(D))return D}function z(D,_){if(D==null)return{};var k=N(D,_),p,d;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(D);for(d=0;d<w.length;d++){if(p=w[d],_.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(D,p))continue;k[p]=D[p]}}return k}function N(D,_){if(D==null)return{};var k={},p=Object.keys(D),d,w;for(w=0;w<p.length;w++){if(d=p[w],_.indexOf(d)>=0)continue;k[d]=D[d]}return k}var J=function(_){var k=_.className,p=_.percent,d=_.prefixCls,w=_.strokeColor,F=_.strokeLinecap,te=_.strokeWidth,Ee=_.style,Le=_.trailColor,pe=_.trailWidth,fe=_.transition,re=z(_,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete re.gapPosition;var se=Array.isArray(p)?p:[p],ee=Array.isArray(w)?w:[w],B=V(se),b=I(B,1),G=b[0],M=te/2,ge=100-te/2,we="M ".concat(F==="round"?M:0,",").concat(M,`
L `).concat(F==="round"?ge:100,",").concat(M),ne="0 0 100 ".concat(te),Te=0;return he.a.createElement("svg",O({className:_e()("".concat(d,"-line"),k),viewBox:ne,preserveAspectRatio:"none",style:Ee},re),he.a.createElement("path",{className:"".concat(d,"-line-trail"),d:we,strokeLinecap:F,stroke:Le,strokeWidth:pe||te,fillOpacity:"0"}),se.map(function(Ie,De){var Ae={strokeDasharray:"".concat(Ie,"px, 100px"),strokeDashoffset:"-".concat(Te,"px"),transition:fe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Me=ee[De]||ee[ee.length-1];return Te+=Ie,he.a.createElement("path",{key:De,className:"".concat(d,"-line-path"),d:we,strokeLinecap:F,stroke:Me,strokeWidth:te,fillOpacity:"0",ref:G[De],style:Ae})}))};J.defaultProps=le;var K=J;function Q(){return Q=Object.assign||function(D){for(var _=1;_<arguments.length;_++){var k=arguments[_];for(var p in k)Object.prototype.hasOwnProperty.call(k,p)&&(D[p]=k[p])}return D},Q.apply(this,arguments)}function de(D,_){return Fe(D)||be(D,_)||Xe(D,_)||Ne()}function Ne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xe(D,_){if(!D)return;if(typeof D=="string")return ke(D,_);var k=Object.prototype.toString.call(D).slice(8,-1);if(k==="Object"&&D.constructor&&(k=D.constructor.name),k==="Map"||k==="Set")return Array.from(D);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return ke(D,_)}function ke(D,_){(_==null||_>D.length)&&(_=D.length);for(var k=0,p=new Array(_);k<_;k++)p[k]=D[k];return p}function be(D,_){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(D)))return;var k=[],p=!0,d=!1,w=void 0;try{for(var F=D[Symbol.iterator](),te;!(p=(te=F.next()).done)&&!(k.push(te.value),_&&k.length===_);p=!0);}catch(Ee){d=!0,w=Ee}finally{try{!p&&F.return!=null&&F.return()}finally{if(d)throw w}}return k}function Fe(D){if(Array.isArray(D))return D}function me(D,_){if(D==null)return{};var k=Se(D,_),p,d;if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(D);for(d=0;d<w.length;d++){if(p=w[d],_.indexOf(p)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(D,p))continue;k[p]=D[p]}}return k}function Se(D,_){if(D==null)return{};var k={},p=Object.keys(D),d,w;for(w=0;w<p.length;w++){if(d=p[w],_.indexOf(d)>=0)continue;k[d]=D[d]}return k}var Pe=0;function xe(D){return+D.replace("%","")}function L(D){return Array.isArray(D)?D:[D]}function ue(D,_,k,p){var d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,w=arguments.length>5?arguments[5]:void 0,F=50-p/2,te=0,Ee=-F,Le=0,pe=-2*F;switch(w){case"left":te=-F,Ee=0,Le=2*F,pe=0;break;case"right":te=F,Ee=0,Le=-2*F,pe=0;break;case"bottom":Ee=F,pe=2*F;break;default:}var fe="M 50,50 m ".concat(te,",").concat(Ee,`
a `).concat(F,",").concat(F," 0 1 1 ").concat(Le,",").concat(-pe,`
a `).concat(F,",").concat(F," 0 1 1 ").concat(-Le,",").concat(pe),re=Math.PI*2*F,se={stroke:k,strokeDasharray:"".concat(_/100*(re-d),"px ").concat(re,"px"),strokeDashoffset:"-".concat(d/2+D/100*(re-d),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:fe,pathStyle:se}}var Y=function(_){var k=_.prefixCls,p=_.strokeWidth,d=_.trailWidth,w=_.gapDegree,F=_.gapPosition,te=_.trailColor,Ee=_.strokeLinecap,Le=_.style,pe=_.className,fe=_.strokeColor,re=_.percent,se=me(_,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ee=Object(H.useMemo)(function(){return Pe+=1,Pe},[]),B=ue(0,100,te,p,w,F),b=B.pathString,G=B.pathStyle,M=L(re),ge=L(fe),we=ge.find(function(Ae){return Object.prototype.toString.call(Ae)==="[object Object]"}),ne=V(M),Te=de(ne,1),Ie=Te[0],De=function(){var Me=0;return M.map(function(Ue,et){var Ve=ge[et]||ge[ge.length-1],Ze=Object.prototype.toString.call(Ve)==="[object Object]"?"url(#".concat(k,"-gradient-").concat(ee,")"):"",Qe=ue(Me,Ue,Ve,p,w,F);return Me+=Ue,he.a.createElement("path",{key:et,className:"".concat(k,"-circle-path"),d:Qe.pathString,stroke:Ze,strokeLinecap:Ee,strokeWidth:p,opacity:Ue===0?0:1,fillOpacity:"0",style:Qe.pathStyle,ref:Ie[et]})})};return he.a.createElement("svg",Q({className:_e()("".concat(k,"-circle"),pe),viewBox:"0 0 100 100",style:Le},se),we&&he.a.createElement("defs",null,he.a.createElement("linearGradient",{id:"".concat(k,"-gradient-").concat(ee),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(we).sort(function(Ae,Me){return xe(Ae)-xe(Me)}).map(function(Ae,Me){return he.a.createElement("stop",{key:Me,offset:Ae,stopColor:we[Ae]})}))),he.a.createElement("path",{className:"".concat(k,"-circle-trail"),d:b,stroke:te,strokeLinecap:Ee,strokeWidth:d||p,fillOpacity:"0",style:G}),De().reverse())};Y.defaultProps=le;var x=Y,j={Line:K,Circle:x}},kSUc:function(nt,Ge,v){},l3Yi:function(nt,Ge,v){nt.exports={flex_box_center:"flex_box_center___354pw",flex_space_between:"flex_space_between___10PE2",flex_box_vertical_center:"flex_box_vertical_center___YT9_A",flex_box_center_end:"flex_box_center_end___1qNoU",flex_box_column:"flex_box_column___2E4_8",wrap:"wrap___1umYZ",form:"form___2x_Sk",title:"title___idVlc",file:"file___1g_02"}},lZu9:function(nt,Ge,v){(function(H){H(v("VrN/"),v("1eCo"),v("8EBN"))})(function(H){"use strict";H.defineMode("markdown",function(he,oe){var _e=H.getMode(he,"text/html"),le=_e.name=="null";function V(p){if(H.findModeByName){var d=H.findModeByName(p);d&&(p=d.mime||d.mimes[0])}var w=H.getMode(he,p);return w.name=="null"?null:w}oe.highlightFormatting===void 0&&(oe.highlightFormatting=!1),oe.maxBlockquoteDepth===void 0&&(oe.maxBlockquoteDepth=0),oe.taskLists===void 0&&(oe.taskLists=!1),oe.strikethrough===void 0&&(oe.strikethrough=!1),oe.emoji===void 0&&(oe.emoji=!1),oe.fencedCodeBlockHighlighting===void 0&&(oe.fencedCodeBlockHighlighting=!0),oe.fencedCodeBlockDefaultMode===void 0&&(oe.fencedCodeBlockDefaultMode="text/plain"),oe.xml===void 0&&(oe.xml=!0),oe.tokenTypeOverrides===void 0&&(oe.tokenTypeOverrides={});var O={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var I in O)O.hasOwnProperty(I)&&oe.tokenTypeOverrides[I]&&(O[I]=oe.tokenTypeOverrides[I]);var R=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,S=/^\[(x| )\](?=\s)/i,T=oe.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,$=/^ {0,3}(?:\={1,}|-{2,})\s*$/,z=/^[^#!\[\]*_\\<>` "'(~:]+/,N=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,J=/^\s*\[[^\]]+?\]:.*$/,K=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,Q=" ";function de(p,d,w){return d.f=d.inline=w,w(p,d)}function Ne(p,d,w){return d.f=d.block=w,w(p,d)}function Xe(p){return!p||!/\S/.test(p.string)}function ke(p){if(p.linkTitle=!1,p.linkHref=!1,p.linkText=!1,p.em=!1,p.strong=!1,p.strikethrough=!1,p.quote=0,p.indentedCode=!1,p.f==Fe){var d=le;if(!d){var w=H.innerMode(_e,p.htmlState);d=w.mode.name=="xml"&&w.state.tagStart===null&&!w.state.context&&w.state.tokenize.isInText}d&&(p.f=xe,p.block=be,p.htmlState=null)}return p.trailingSpace=0,p.trailingSpaceNewLine=!1,p.prevLine=p.thisLine,p.thisLine={stream:null},null}function be(p,d){var w=p.column()===d.indentation,F=Xe(d.prevLine.stream),te=d.indentedCode,Ee=d.prevLine.hr,Le=d.list!==!1,pe=(d.listStack[d.listStack.length-1]||0)+3;d.indentedCode=!1;var fe=d.indentation;if(d.indentationDiff===null&&(d.indentationDiff=d.indentation,Le)){for(d.list=null;fe<d.listStack[d.listStack.length-1];)d.listStack.pop(),d.listStack.length?d.indentation=d.listStack[d.listStack.length-1]:d.list=!1;d.list!==!1&&(d.indentationDiff=fe-d.listStack[d.listStack.length-1])}var re=!F&&!Ee&&!d.prevLine.header&&(!Le||!te)&&!d.prevLine.fencedCodeEnd,se=(d.list===!1||Ee||F)&&d.indentation<=pe&&p.match(R),ee=null;if(d.indentationDiff>=4&&(te||d.prevLine.fencedCodeEnd||d.prevLine.header||F))return p.skipToEnd(),d.indentedCode=!0,O.code;if(p.eatSpace())return null;if(w&&d.indentation<=pe&&(ee=p.match(T))&&ee[1].length<=6)return d.quote=0,d.header=ee[1].length,d.thisLine.header=!0,oe.highlightFormatting&&(d.formatting="header"),d.f=d.inline,Se(d);if(d.indentation<=pe&&p.eat(">"))return d.quote=w?1:d.quote+1,oe.highlightFormatting&&(d.formatting="quote"),p.eatSpace(),Se(d);if(!se&&!d.setext&&w&&d.indentation<=pe&&(ee=p.match(A))){var B=ee[1]?"ol":"ul";return d.indentation=fe+p.current().length,d.list=!0,d.quote=0,d.listStack.push(d.indentation),d.em=!1,d.strong=!1,d.code=!1,d.strikethrough=!1,oe.taskLists&&p.match(S,!1)&&(d.taskList=!0),d.f=d.inline,oe.highlightFormatting&&(d.formatting=["list","list-"+B]),Se(d)}else{if(w&&d.indentation<=pe&&(ee=p.match(N,!0)))return d.quote=0,d.fencedEndRE=new RegExp(ee[1]+"+ *$"),d.localMode=oe.fencedCodeBlockHighlighting&&V(ee[2]||oe.fencedCodeBlockDefaultMode),d.localMode&&(d.localState=H.startState(d.localMode)),d.f=d.block=me,oe.highlightFormatting&&(d.formatting="code-block"),d.code=-1,Se(d);if(d.setext||(!re||!Le)&&!d.quote&&d.list===!1&&!d.code&&!se&&!J.test(p.string)&&(ee=p.lookAhead(1))&&(ee=ee.match($)))return d.setext?(d.header=d.setext,d.setext=0,p.skipToEnd(),oe.highlightFormatting&&(d.formatting="header")):(d.header=ee[0].charAt(0)=="="?1:2,d.setext=d.header),d.thisLine.header=!0,d.f=d.inline,Se(d);if(se)return p.skipToEnd(),d.hr=!0,d.thisLine.hr=!0,O.hr;if(p.peek()==="[")return de(p,d,j)}return de(p,d,d.inline)}function Fe(p,d){var w=_e.token(p,d.htmlState);if(!le){var F=H.innerMode(_e,d.htmlState);(F.mode.name=="xml"&&F.state.tagStart===null&&!F.state.context&&F.state.tokenize.isInText||d.md_inside&&p.current().indexOf(">")>-1)&&(d.f=xe,d.block=be,d.htmlState=null)}return w}function me(p,d){var w=d.listStack[d.listStack.length-1]||0,F=d.indentation<w,te=w+3;if(d.fencedEndRE&&d.indentation<=te&&(F||p.match(d.fencedEndRE))){oe.highlightFormatting&&(d.formatting="code-block");var Ee;return F||(Ee=Se(d)),d.localMode=d.localState=null,d.block=be,d.f=xe,d.fencedEndRE=null,d.code=0,d.thisLine.fencedCodeEnd=!0,F?Ne(p,d,d.block):Ee}else return d.localMode?d.localMode.token(p,d.localState):(p.skipToEnd(),O.code)}function Se(p){var d=[];if(p.formatting){d.push(O.formatting),typeof p.formatting=="string"&&(p.formatting=[p.formatting]);for(var w=0;w<p.formatting.length;w++)d.push(O.formatting+"-"+p.formatting[w]),p.formatting[w]==="header"&&d.push(O.formatting+"-"+p.formatting[w]+"-"+p.header),p.formatting[w]==="quote"&&(!oe.maxBlockquoteDepth||oe.maxBlockquoteDepth>=p.quote?d.push(O.formatting+"-"+p.formatting[w]+"-"+p.quote):d.push("error"))}if(p.taskOpen)return d.push("meta"),d.length?d.join(" "):null;if(p.taskClosed)return d.push("property"),d.length?d.join(" "):null;if(p.linkHref?d.push(O.linkHref,"url"):(p.strong&&d.push(O.strong),p.em&&d.push(O.em),p.strikethrough&&d.push(O.strikethrough),p.emoji&&d.push(O.emoji),p.linkText&&d.push(O.linkText),p.code&&d.push(O.code),p.image&&d.push(O.image),p.imageAltText&&d.push(O.imageAltText,"link"),p.imageMarker&&d.push(O.imageMarker)),p.header&&d.push(O.header,O.header+"-"+p.header),p.quote&&(d.push(O.quote),!oe.maxBlockquoteDepth||oe.maxBlockquoteDepth>=p.quote?d.push(O.quote+"-"+p.quote):d.push(O.quote+"-"+oe.maxBlockquoteDepth)),p.list!==!1){var F=(p.listStack.length-1)%3;F?F===1?d.push(O.list2):d.push(O.list3):d.push(O.list1)}return p.trailingSpaceNewLine?d.push("trailing-space-new-line"):p.trailingSpace&&d.push("trailing-space-"+(p.trailingSpace%2?"a":"b")),d.length?d.join(" "):null}function Pe(p,d){return p.match(z,!0)?Se(d):void 0}function xe(p,d){var w=d.text(p,d);if(typeof w!="undefined")return w;if(d.list)return d.list=null,Se(d);if(d.taskList){var F=p.match(S,!0)[1]===" ";return F?d.taskOpen=!0:d.taskClosed=!0,oe.highlightFormatting&&(d.formatting="task"),d.taskList=!1,Se(d)}if(d.taskOpen=!1,d.taskClosed=!1,d.header&&p.match(/^#+$/,!0))return oe.highlightFormatting&&(d.formatting="header"),Se(d);var te=p.next();if(d.linkTitle){d.linkTitle=!1;var Ee=te;te==="("&&(Ee=")"),Ee=(Ee+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Le="^\\s*(?:[^"+Ee+"\\\\]+|\\\\\\\\|\\\\.)"+Ee;if(p.match(new RegExp(Le),!0))return O.linkHref}if(te==="`"){var pe=d.formatting;oe.highlightFormatting&&(d.formatting="code"),p.eatWhile("`");var fe=p.current().length;if(d.code==0&&(!d.quote||fe==1))return d.code=fe,Se(d);if(fe==d.code){var re=Se(d);return d.code=0,re}else return d.formatting=pe,Se(d)}else if(d.code)return Se(d);if(te==="\\"&&(p.next(),oe.highlightFormatting)){var se=Se(d),ee=O.formatting+"-escape";return se?se+" "+ee:ee}if(te==="!"&&p.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return d.imageMarker=!0,d.image=!0,oe.highlightFormatting&&(d.formatting="image"),Se(d);if(te==="["&&d.imageMarker&&p.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return d.imageMarker=!1,d.imageAltText=!0,oe.highlightFormatting&&(d.formatting="image"),Se(d);if(te==="]"&&d.imageAltText){oe.highlightFormatting&&(d.formatting="image");var se=Se(d);return d.imageAltText=!1,d.image=!1,d.inline=d.f=ue,se}if(te==="["&&!d.image)return d.linkText&&p.match(/^.*?\]/)||(d.linkText=!0,oe.highlightFormatting&&(d.formatting="link")),Se(d);if(te==="]"&&d.linkText){oe.highlightFormatting&&(d.formatting="link");var se=Se(d);return d.linkText=!1,d.inline=d.f=p.match(/\(.*?\)| ?\[.*?\]/,!1)?ue:xe,se}if(te==="<"&&p.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=L,oe.highlightFormatting&&(d.formatting="link");var se=Se(d);return se?se+=" ":se="",se+O.linkInline}if(te==="<"&&p.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){d.f=d.inline=L,oe.highlightFormatting&&(d.formatting="link");var se=Se(d);return se?se+=" ":se="",se+O.linkEmail}if(oe.xml&&te==="<"&&p.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var B=p.string.indexOf(">",p.pos);if(B!=-1){var b=p.string.substring(p.start,B);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(d.md_inside=!0)}return p.backUp(1),d.htmlState=H.startState(_e),Ne(p,d,Fe)}if(oe.xml&&te==="<"&&p.match(/^\/\w*?>/))return d.md_inside=!1,"tag";if(te==="*"||te==="_"){for(var G=1,M=p.pos==1?" ":p.string.charAt(p.pos-2);G<3&&p.eat(te);)G++;var ge=p.peek()||" ",we=!/\s/.test(ge)&&(!K.test(ge)||/\s/.test(M)||K.test(M)),ne=!/\s/.test(M)&&(!K.test(M)||/\s/.test(ge)||K.test(ge)),Te=null,Ie=null;if(G%2&&(!d.em&&we&&(te==="*"||!ne||K.test(M))?Te=!0:d.em==te&&ne&&(te==="*"||!we||K.test(ge))&&(Te=!1)),G>1&&(!d.strong&&we&&(te==="*"||!ne||K.test(M))?Ie=!0:d.strong==te&&ne&&(te==="*"||!we||K.test(ge))&&(Ie=!1)),Ie!=null||Te!=null){oe.highlightFormatting&&(d.formatting=Te==null?"strong":Ie==null?"em":"strong em"),Te===!0&&(d.em=te),Ie===!0&&(d.strong=te);var re=Se(d);return Te===!1&&(d.em=!1),Ie===!1&&(d.strong=!1),re}}else if(te===" "&&(p.eat("*")||p.eat("_"))){if(p.peek()===" ")return Se(d);p.backUp(1)}if(oe.strikethrough){if(te==="~"&&p.eatWhile(te)){if(d.strikethrough){oe.highlightFormatting&&(d.formatting="strikethrough");var re=Se(d);return d.strikethrough=!1,re}else if(p.match(/^[^\s]/,!1))return d.strikethrough=!0,oe.highlightFormatting&&(d.formatting="strikethrough"),Se(d)}else if(te===" "&&p.match(/^~~/,!0)){if(p.peek()===" ")return Se(d);p.backUp(2)}}if(oe.emoji&&te===":"&&p.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){d.emoji=!0,oe.highlightFormatting&&(d.formatting="emoji");var De=Se(d);return d.emoji=!1,De}return te===" "&&(p.match(/^ +$/,!1)?d.trailingSpace++:d.trailingSpace&&(d.trailingSpaceNewLine=!0)),Se(d)}function L(p,d){var w=p.next();if(w===">"){d.f=d.inline=xe,oe.highlightFormatting&&(d.formatting="link");var F=Se(d);return F?F+=" ":F="",F+O.linkInline}return p.match(/^[^>]+/,!0),O.linkInline}function ue(p,d){if(p.eatSpace())return null;var w=p.next();return w==="("||w==="["?(d.f=d.inline=x(w==="("?")":"]"),oe.highlightFormatting&&(d.formatting="link-string"),d.linkHref=!0,Se(d)):"error"}var Y={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function x(p){return function(d,w){var F=d.next();if(F===p){w.f=w.inline=xe,oe.highlightFormatting&&(w.formatting="link-string");var te=Se(w);return w.linkHref=!1,te}return d.match(Y[p]),w.linkHref=!0,Se(w)}}function j(p,d){return p.match(/^([^\]\\]|\\.)*\]:/,!1)?(d.f=D,p.next(),oe.highlightFormatting&&(d.formatting="link"),d.linkText=!0,Se(d)):de(p,d,xe)}function D(p,d){if(p.match(/^\]:/,!0)){d.f=d.inline=_,oe.highlightFormatting&&(d.formatting="link");var w=Se(d);return d.linkText=!1,w}return p.match(/^([^\]\\]|\\.)+/,!0),O.linkText}function _(p,d){return p.eatSpace()?null:(p.match(/^[^\s]+/,!0),p.peek()===void 0?d.linkTitle=!0:p.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),d.f=d.inline=xe,O.linkHref+" url")}var k={startState:function(){return{f:be,prevLine:{stream:null},thisLine:{stream:null},block:be,htmlState:null,indentation:0,inline:xe,text:Pe,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(p){return{f:p.f,prevLine:p.prevLine,thisLine:p.thisLine,block:p.block,htmlState:p.htmlState&&H.copyState(_e,p.htmlState),indentation:p.indentation,localMode:p.localMode,localState:p.localMode?H.copyState(p.localMode,p.localState):null,inline:p.inline,text:p.text,formatting:!1,linkText:p.linkText,linkTitle:p.linkTitle,linkHref:p.linkHref,code:p.code,em:p.em,strong:p.strong,strikethrough:p.strikethrough,emoji:p.emoji,header:p.header,setext:p.setext,hr:p.hr,taskList:p.taskList,list:p.list,listStack:p.listStack.slice(0),quote:p.quote,indentedCode:p.indentedCode,trailingSpace:p.trailingSpace,trailingSpaceNewLine:p.trailingSpaceNewLine,md_inside:p.md_inside,fencedEndRE:p.fencedEndRE}},token:function(p,d){if(d.formatting=!1,p!=d.thisLine.stream){if(d.header=0,d.hr=!1,p.match(/^\s*$/,!0))return ke(d),null;if(d.prevLine=d.thisLine,d.thisLine={stream:p},d.taskList=!1,d.trailingSpace=0,d.trailingSpaceNewLine=!1,!d.localState&&(d.f=d.block,d.f!=Fe)){var w=p.match(/^\s*/,!0)[0].replace(/\t/g,Q).length;if(d.indentation=w,d.indentationDiff=null,w>0)return null}}return d.f(p,d)},innerMode:function(p){return p.block==Fe?{state:p.htmlState,mode:_e}:p.localState?{state:p.localState,mode:p.localMode}:{state:p,mode:k}},indent:function(p,d,w){return p.block==Fe&&_e.indent?_e.indent(p.htmlState,d,w):p.localState&&p.localMode.indent?p.localMode.indent(p.localState,d,w):H.Pass},blankLine:ke,getType:Se,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return k},"xml"),H.defineMIME("text/markdown","markdown"),H.defineMIME("text/x-markdown","markdown")})},mOS8:function(nt,Ge,v){nt.exports=v.p+"static/403Qrcode.6c17b6f4.png"},nVVt:function(nt,Ge){nt.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(nt,Ge,v){(function(H){H(v("VrN/"))})(function(H){"use strict";var he=H.Pos;function oe(K,Q){return K.line-Q.line||K.ch-Q.ch}var _e="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",le=_e+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",V=new RegExp("<(/?)(["+_e+"]["+le+"]*)","g");function O(K,Q,de,Ne){this.line=Q,this.ch=de,this.cm=K,this.text=K.getLine(Q),this.min=Ne?Math.max(Ne.from,K.firstLine()):K.firstLine(),this.max=Ne?Math.min(Ne.to-1,K.lastLine()):K.lastLine()}function I(K,Q){var de=K.cm.getTokenTypeAt(he(K.line,Q));return de&&/\btag\b/.test(de)}function R(K){return K.line>=K.max?void 0:(K.ch=0,K.text=K.cm.getLine(++K.line),!0)}function A(K){return K.line<=K.min?void 0:(K.text=K.cm.getLine(--K.line),K.ch=K.text.length,!0)}function S(K){for(;;){var Q=K.text.indexOf(">",K.ch);if(Q==-1){if(R(K))continue;return}if(!I(K,Q+1)){K.ch=Q+1;continue}var de=K.text.lastIndexOf("/",Q),Ne=de>-1&&!/\S/.test(K.text.slice(de+1,Q));return K.ch=Q+1,Ne?"selfClose":"regular"}}function T(K){for(;;){var Q=K.ch?K.text.lastIndexOf("<",K.ch-1):-1;if(Q==-1){if(A(K))continue;return}if(!I(K,Q+1)){K.ch=Q;continue}V.lastIndex=Q,K.ch=Q;var de=V.exec(K.text);if(de&&de.index==Q)return de}}function $(K){for(;;){V.lastIndex=K.ch;var Q=V.exec(K.text);if(!Q){if(R(K))continue;return}if(!I(K,Q.index+1)){K.ch=Q.index+1;continue}return K.ch=Q.index+Q[0].length,Q}}function z(K){for(;;){var Q=K.ch?K.text.lastIndexOf(">",K.ch-1):-1;if(Q==-1){if(A(K))continue;return}if(!I(K,Q+1)){K.ch=Q;continue}var de=K.text.lastIndexOf("/",Q),Ne=de>-1&&!/\S/.test(K.text.slice(de+1,Q));return K.ch=Q+1,Ne?"selfClose":"regular"}}function N(K,Q){for(var de=[];;){var Ne=$(K),Xe,ke=K.line,be=K.ch-(Ne?Ne[0].length:0);if(!Ne||!(Xe=S(K)))return;if(Xe=="selfClose")continue;if(Ne[1]){for(var Fe=de.length-1;Fe>=0;--Fe)if(de[Fe]==Ne[2]){de.length=Fe;break}if(Fe<0&&(!Q||Q==Ne[2]))return{tag:Ne[2],from:he(ke,be),to:he(K.line,K.ch)}}else de.push(Ne[2])}}function J(K,Q){for(var de=[];;){var Ne=z(K);if(!Ne)return;if(Ne=="selfClose"){T(K);continue}var Xe=K.line,ke=K.ch,be=T(K);if(!be)return;if(be[1])de.push(be[2]);else{for(var Fe=de.length-1;Fe>=0;--Fe)if(de[Fe]==be[2]){de.length=Fe;break}if(Fe<0&&(!Q||Q==be[2]))return{tag:be[2],from:he(K.line,K.ch),to:he(Xe,ke)}}}}H.registerHelper("fold","xml",function(K,Q){for(var de=new O(K,Q.line,0);;){var Ne=$(de);if(!Ne||de.line!=Q.line)return;var Xe=S(de);if(!Xe)return;if(!Ne[1]&&Xe!="selfClose"){var ke=he(de.line,de.ch),be=N(de,Ne[2]);return be&&oe(be.from,ke)>0?{from:ke,to:be.from}:null}}}),H.findMatchingTag=function(K,Q,de){var Ne=new O(K,Q.line,Q.ch,de);if(Ne.text.indexOf(">")==-1&&Ne.text.indexOf("<")==-1)return;var Xe=S(Ne),ke=Xe&&he(Ne.line,Ne.ch),be=Xe&&T(Ne);if(!Xe||!be||oe(Ne,Q)>0)return;var Fe={from:he(Ne.line,Ne.ch),to:ke,tag:be[2]};return Xe=="selfClose"?{open:Fe,close:null,at:"open"}:be[1]?{open:J(Ne,be[2]),close:Fe,at:"close"}:(Ne=new O(K,ke.line,ke.ch,de),{open:Fe,close:N(Ne,be[2]),at:"open"})},H.findEnclosingTag=function(K,Q,de,Ne){for(var Xe=new O(K,Q.line,Q.ch,de);;){var ke=J(Xe,Ne);if(!ke)break;var be=new O(K,Q.line,Q.ch,de),Fe=N(be,ke.tag);if(Fe)return{open:ke,close:Fe}}},H.scanForClosingTag=function(K,Q,de,Ne){var Xe=new O(K,Q.line,Q.ch,Ne?{from:0,to:Ne}:null);return N(Xe,de)}})},p5ED:function(nt,Ge,v){"use strict";var H=v("+L6B"),he=v("2/Rp"),oe=v("5Dmo"),_e=v("3S7+"),le=v("k1fw"),V=v("9og8"),O=v("tJVT"),I=v("WmNS"),R=v.n(I),A=v("q1tI"),S=v.n(A),T=v("vHTk"),$=v.n(T),z=v("yEEn"),N=v("ZW9T"),J=v("1vsH"),K=v("V0Rq"),Q=v("m3rI"),de=function(Xe){var ke=Xe.name,be=Xe.data,Fe=Xe.theme,me=Xe.type,Se=Xe.filename,Pe=Xe.monacoEditor,xe=Xe.className,L=Xe.style,ue=Xe.close,Y=Xe.onClose,x=Xe.hasMask,j=Xe.otherData,D=j===void 0?{}:j,_=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),k=Object(O.a)(_,2),p=k[0],d=k[1],w=Object(A.useState)(""),F=Object(O.a)(w,2),te=F[0],Ee=F[1],Le=Object(A.useState)(),pe=Object(O.a)(Le,2),fe=pe[0],re=pe[1],se,ee=1024*1024,B=10*ee,b=Object(A.useRef)();me==="office"&&(se=Object(J.R)(be).filesize,se>B&&(me="other")),Se&&(Pe.filename=Se),Object(A.useEffect)(function(){var we,ne,Te=(we=document.cookie)===null||we===void 0||((ne=we.replace(/\s/g,""))===null||ne===void 0)?void 0:ne.split(";");Te==null||Te.map(function(Ie){var De=Ie.split("=");De[0]==="_educoder_session"&&Ee(De[1])})},[]),Object(A.useEffect)(function(){me==="office"&&G()},[me]);var G=function(){var we=Object(V.a)(R.a.mark(function ne(){var Te,Ie,De;return R.a.wrap(function(Me){for(;;)switch(Me.prev=Me.next){case 0:return console.log("data:",be),Te=be,be.startsWith("http")||(Te=location.origin+Te),Ie=new URL(Te).pathname.split("/").pop(),Me.next=6,Object(K.U)({attachment_id:Ie});case 6:De=Me.sent,re(De);case 8:case"end":return Me.stop()}},ne)}));return function(){return we.apply(this,arguments)}}(),M=function(){if(be.startsWith("http")||be.startsWith("blob:")){ge();return}Object(J.x)(Se||"educoder",be,Se)},ge=function(){Object(J.v)(Se||"educoder",decodeURIComponent(be))};return S.a.createElement("div",{style:Object(le.a)({},L||{}),className:"".concat(x&&$.a.bgBlack," ").concat(me?$.a.wrp:"hide")},ue&&S.a.createElement("div",{className:$.a.close,ref:b},S.a.createElement(_e.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return b.current}},S.a.createElement("span",{onClick:ge},S.a.createElement("i",{className:"icon-quxiaozhiding"}))),S.a.createElement(_e.a,{title:"\u5173\u95ED",getPopupContainer:function(){return b.current}},S.a.createElement("span",{className:"",onClick:function(){Y(),re(null)}},S.a.createElement("i",{className:"icon-guanbi1"})))),S.a.createElement("div",{className:"".concat($.a[xe]," ").concat(xe," ").concat($.a.monaco," ").concat(me==="txt"?"show":"hide")},me==="txt"&&S.a.createElement(N.b,Pe)),me==="audio"&&S.a.createElement("audio",{src:"".concat((be==null?void 0:be.indexOf("http://"))>-1||(be==null?void 0:be.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(be),autoPlay:!0}),me==="video"&&S.a.createElement(S.a.Fragment,null,(be==null?void 0:be.indexOf("http"))>-1?S.a.createElement("video",{controls:!0,src:"".concat(be),autoPlay:!0}):S.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(be),autoPlay:!0})),me==="office"&&fe&&S.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(fe.key,"&url=").concat(Q.a.API_SERVER+fe.url,"&callbackUrl=").concat(Q.a.API_SERVER+fe.callbackUrl,"&fileType=").concat(fe.fileType,"&title=").concat(fe.title,"&model=view")}),(me==="xlsx"||me==="doc"||me==="pptx"||me==="docx")&&S.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(D.key,"&url=").concat(Q.a.API_SERVER+D.url,"&callbackUrl=").concat(Q.a.API_SERVER+D.callbackUrl,"&fileType=").concat(D.fileType,"&title=").concat(D.title,"&model=").concat(D.model)}),me==="html"&&S.a.createElement("iframe",{src:be+"&disposition=inline"}),me==="pdf"&&S.a.createElement("embed",{className:$.a.embed,src:be,type:"application/pdf"}),me==="image"&&S.a.createElement("img",{src:"".concat((be==null?void 0:be.indexOf("http://"))>-1||(be==null?void 0:be.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(be)}),me==="other"&&S.a.createElement("div",null,S.a.createElement(he.a,{type:"primary",size:"large",onClick:M},S.a.createElement(z.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),me==="download"&&S.a.createElement(he.a,{type:"primary",size:"large",onClick:M},S.a.createElement(z.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Ge.a=de},"p77/":function(nt,Ge,v){},"rAM+":function(nt,Ge,v){"use strict";v.d(Ge,"a",function(){return he});var H=v("Qw5x");function he(oe,_e){var le;if(typeof Symbol=="undefined"||oe[Symbol.iterator]==null){if(Array.isArray(oe)||(le=Object(H.a)(oe))||_e&&oe&&typeof oe.length=="number"){le&&(oe=le);var V=0,O=function(){};return{s:O,n:function(){return V>=oe.length?{done:!0}:{done:!1,value:oe[V++]}},e:function(T){throw T},f:O}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var I=!0,R=!1,A;return{s:function(){le=oe[Symbol.iterator]()},n:function(){var T=le.next();return I=T.done,T},e:function(T){R=!0,A=T},f:function(){try{!I&&le.return!=null&&le.return()}finally{if(R)throw A}}}}},rUJ1:function(nt,Ge){const v=/[&<>"']/,H=/[&<>"']/g,he=/[<>"']|&(?!#?\w+;)/,oe=/[<>"']|&(?!#?\w+;)/g,_e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},le=me=>_e[me];function V(me,Se){if(Se){if(v.test(me))return me.replace(H,le)}else if(he.test(me))return me.replace(oe,le);return me}const O=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I(me){return me.replace(O,(Se,Pe)=>(Pe=Pe.toLowerCase(),Pe==="colon"?":":Pe.charAt(0)==="#"?Pe.charAt(1)==="x"?String.fromCharCode(parseInt(Pe.substring(2),16)):String.fromCharCode(+Pe.substring(1)):""))}const R=/(^|[^\[])\^/g;function A(me,Se){me=me.source||me,Se=Se||"";const Pe={replace:(xe,L)=>(L=L.source||L,L=L.replace(R,"$1"),me=me.replace(xe,L),Pe),getRegex:()=>new RegExp(me,Se)};return Pe}const S=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function $(me,Se,Pe){if(me){let xe;try{xe=decodeURIComponent(I(Pe)).replace(S,"").toLowerCase()}catch(L){return null}if(xe.indexOf("javascript:")===0||xe.indexOf("vbscript:")===0||xe.indexOf("data:")===0)return null}Se&&!T.test(Pe)&&(Pe=Q(Se,Pe));try{Pe=encodeURI(Pe).replace(/%25/g,"%")}catch(xe){return null}return Pe}const z={},N=/^[^:]+:\/*[^/]*$/,J=/^([^:]+:)[\s\S]*$/,K=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Q(me,Se){z[" "+me]||(N.test(me)?z[" "+me]=me+"/":z[" "+me]=ke(me,"/",!0)),me=z[" "+me];const Pe=me.indexOf(":")===-1;return Se.substring(0,2)==="//"?Pe?Se:me.replace(J,"$1")+Se:Se.charAt(0)==="/"?Pe?Se:me.replace(K,"$1")+Se:me+Se}const de={exec:function(){}};function Ne(me){let Se=1,Pe,xe;for(;Se<arguments.length;Se++){Pe=arguments[Se];for(xe in Pe)Object.prototype.hasOwnProperty.call(Pe,xe)&&(me[xe]=Pe[xe])}return me}function Xe(me,Se){const Pe=me.replace(/\|/g,(ue,Y,x)=>{let j=!1,D=Y;for(;--D>=0&&x[D]==="\\";)j=!j;return j?"|":" |"}),xe=Pe.split(/ \|/);let L=0;if(xe.length>Se)xe.splice(Se);else for(;xe.length<Se;)xe.push("");for(;L<xe.length;L++)xe[L]=xe[L].trim().replace(/\\\|/g,"|");return xe}function ke(me,Se,Pe){const xe=me.length;if(xe===0)return"";let L=0;for(;L<xe;){const ue=me.charAt(xe-L-1);if(ue===Se&&!Pe)L++;else if(ue!==Se&&Pe)L++;else break}return me.substr(0,xe-L)}function be(me,Se){if(me.indexOf(Se[1])===-1)return-1;const Pe=me.length;let xe=0,L=0;for(;L<Pe;L++)if(me[L]==="\\")L++;else if(me[L]===Se[0])xe++;else if(me[L]===Se[1]&&(xe--,xe<0))return L;return-1}function Fe(me){me&&me.sanitize&&!me.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}nt.exports={escape:V,unescape:I,edit:A,cleanUrl:$,resolveUrl:Q,noopTest:de,merge:Ne,splitCells:Xe,rtrim:ke,findClosingBracket:be,checkSanitizeDeprecation:Fe}},rcnY:function(nt,Ge,v){var H=v("aRTE");function he(oe,_e){this.totalCount=oe,this.dataCount=_e}he.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],he.getRSBlocks=function(oe,_e){var le=he.getRsBlockTable(oe,_e);if(le==null)throw new Error("bad rs block @ typeNumber:"+oe+"/errorCorrectLevel:"+_e);for(var V=le.length/3,O=new Array,I=0;I<V;I++)for(var R=le[I*3+0],A=le[I*3+1],S=le[I*3+2],T=0;T<R;T++)O.push(new he(A,S));return O},he.getRsBlockTable=function(oe,_e){switch(_e){case H.L:return he.RS_BLOCK_TABLE[(oe-1)*4+0];case H.M:return he.RS_BLOCK_TABLE[(oe-1)*4+1];case H.Q:return he.RS_BLOCK_TABLE[(oe-1)*4+2];case H.H:return he.RS_BLOCK_TABLE[(oe-1)*4+3];default:return}},nt.exports=he},ttuQ:function(nt,Ge,v){nt.exports={bg:"bg___3F6Km",name:"name___1NsJT",member:"member___2pzzt"}},vHTk:function(nt,Ge,v){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(nt,Ge){function v(){this.buffer=new Array,this.length=0}v.prototype={get:function(H){var he=Math.floor(H/8);return(this.buffer[he]>>>7-H%8&1)==1},put:function(H,he){for(var oe=0;oe<he;oe++)this.putBit((H>>>he-oe-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(H){var he=Math.floor(this.length/8);this.buffer.length<=he&&this.buffer.push(0),H&&(this.buffer[he]|=128>>>this.length%8),this.length++}},nt.exports=v},wzkS:function(nt,Ge,v){"use strict";v.d(Ge,"c",function(){return le}),v.d(Ge,"b",function(){return V}),v.d(Ge,"d",function(){return O}),v.d(Ge,"a",function(){return R}),v.d(Ge,"e",function(){return A});var H=v("9og8"),he=v("WmNS"),oe=v.n(he),_e=v("ErOA");function le(S){return Object(_e.c)("libraries/".concat(S,".json"))}function V(){return Object(_e.c)("library_tags.json")}function O(S){return I.apply(this,arguments)}function I(){return I=Object(H.a)(oe.a.mark(function S(T){var $;return oe.a.wrap(function(N){for(;;)switch(N.prev=N.next){case 0:return N.next=2,Object(_e.b)("attachments/".concat(T,".json"));case 2:return $=N.sent,N.abrupt("return",$.status===0);case 4:case"end":return N.stop()}},S)})),I.apply(this,arguments)}function R(S){return Object(_e.f)("libraries.json",S)}function A(S,T){return Object(_e.g)("libraries/".concat(S,".json"),T)}},y5JW:function(nt,Ge,v){"use strict";v.d(Ge,"c",function(){return J}),v.d(Ge,"a",function(){return K});var H=v("DZo9"),he=v("8z0m"),oe=v("+L6B"),_e=v("2/Rp"),le=v("9og8"),V=v("k1fw"),O=v("oBTY"),I=v("miYZ"),R=v("tsqr"),A=v("WmNS"),S=v.n(A),T=v("q1tI"),$=v.n(T),z=v("m3rI"),N=v("wzkS"),J="\u3000\u3000";function K(Q){var de=["Bytes","KB","MB","GB","TB"];if(Q==0)return"0 Byte";var Ne=parseInt(""+Math.floor(Math.log(Q)/Math.log(1024)),10);return(Q/Math.pow(1024,Ne)).toFixed(1)+" "+de[Ne]}Ge.b=function(Q){var de=Q.value,Ne=de===void 0?[]:de,Xe=Q.action,ke=Q.onChange,be=Q.className,Fe=Q.maxSize,me=Fe===void 0?150:Fe,Se=Q.title,Pe=Se===void 0?"\u6587\u4EF6\u4E0A\u4F20":Se,xe=Q.accept,L=xe===void 0?null:xe,ue={multiple:!1,fileList:Ne,accept:L,withCredentials:!0,beforeUpload:function(j){var D=j.size/1024/1024;return D<me?!0:(R.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(me,"MB),\u5EFA\u8BAE\u4E0A\u4F20\u5230\u767E\u5EA6\u4E91\u7B49\u5176\u5B83\u5171\u4EAB\u5DE5\u5177\u91CC\uFF0C\u7136\u540E\u518Dtxt\u6587\u6863\u91CC\u7ED9\u51FA\u94FE\u63A5\u4EE5\u53CA\u5171\u4EAB\u5BC6\u7801\u5E76\u4E0A\u4F20")),Promise.reject())},action:"".concat(z.a.API_SERVER,"/api/attachments.json"),onChange:function(j){var D=Object(O.a)(j.fileList);D=D.map(function(_){return _.name.indexOf(J)===-1&&(_.name="".concat(_.name).concat(J).concat(K(_.size))),Object(V.a)({},_)}),ke(D)},onRemove:function(){var x=Object(le.a)(S.a.mark(function D(_){var k,p,d;return S.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:if(k=_.size/1024/1024,!(_.status==="uploading")){F.next=3;break}return F.abrupt("return",!0);case 3:if(k<me){F.next=7;break}return F.abrupt("return",!0);case 7:if(p=_.response?_.response.id:_.uid,!p){F.next=15;break}return F.next=11,Object(N.d)(_.response?_.response.id:_.id);case 11:return d=F.sent,F.abrupt("return",d);case 15:return F.abrupt("return",!0);case 16:case"end":return F.stop()}},D)}));function j(D){return x.apply(this,arguments)}return j}()};function Y(x){x.preventDefault(),x.stopPropagation()}return $.a.createElement("div",{className:"single-upload ".concat(be||"")},$.a.createElement(he.a,ue,$.a.createElement(_e.a,{type:"primary",title:Ne.length>0?"\u6BCF\u6B21\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u8D44\u6E90\uFF0C \u5220\u9664\u4E0B\u9762\u8D44\u6E90\u53EF\u91CD\u65B0\u4E0A\u4F20 ":"",disabled:Ne.length>0,ghost:!0},Pe),$.a.createElement("span",{onClick:Y,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",me,"M) ")))}}}]);