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.
350 lines
616 KiB
350 lines
616 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[280,6,7,14],{"+NIl":function(ct,Xe,y){(function(Q){Q(y("VrN/"))})(function(Q){"use strict";Q.defineMode("stex",function(Te,ye){"use strict";function De(V,F){V.cmdState.push(F)}function Se(V){return V.cmdState.length>0?V.cmdState[V.cmdState.length-1]:null}function se(V){var F=V.cmdState.pop();F&&F.closeBracket()}function N(V){for(var F=V.cmdState,Y=F.length-1;Y>=0;Y--){var W=F[Y];if(W.name=="DEFAULT")continue;return W}return{styleIdentifier:function(){return null}}}function te(V,F,Y){return function(){this.name=V,this.bracketNo=0,this.style=F,this.styles=Y,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var J={};J.importmodule=te("importmodule","tag",["string","builtin"]),J.documentclass=te("documentclass","tag",["","atom"]),J.usepackage=te("usepackage","tag",["atom"]),J.begin=te("begin","tag",["atom"]),J.end=te("end","tag",["atom"]),J.label=te("label","tag",["atom"]),J.ref=te("ref","tag",["atom"]),J.eqref=te("eqref","tag",["atom"]),J.cite=te("cite","tag",["atom"]),J.bibitem=te("bibitem","tag",["atom"]),J.Bibitem=te("Bibitem","tag",["atom"]),J.RBibitem=te("RBibitem","tag",["atom"]),J.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function K(V,F){V.f=F}function D(V,F){var Y;if(V.match(/^\\[a-zA-Z@]+/)){var W=V.current().slice(1);return Y=J.hasOwnProperty(W)?J[W]:J.DEFAULT,Y=new Y,De(F,Y),K(F,oe),Y.style}if(V.match(/^\\[$&%#{}_]/))return"tag";if(V.match(/^\\[,;!\/\\]/))return"tag";if(V.match("\\["))return K(F,function(ue,je){return B(ue,je,"\\]")}),"keyword";if(V.match("\\("))return K(F,function(ue,je){return B(ue,je,"\\)")}),"keyword";if(V.match("$$"))return K(F,function(ue,je){return B(ue,je,"$$")}),"keyword";if(V.match("$"))return K(F,function(ue,je){return B(ue,je,"$")}),"keyword";var Z=V.next();if(Z=="%")return V.skipToEnd(),"comment";if(Z=="}"||Z=="]"){if(Y=Se(F),Y)Y.closeBracket(Z),K(F,oe);else return"error";return"bracket"}else return Z=="{"||Z=="["?(Y=J.DEFAULT,Y=new Y,De(F,Y),"bracket"):/\d/.test(Z)?(V.eatWhile(/[\w.%]/),"atom"):(V.eatWhile(/[\w\-_]/),Y=N(F),Y.name=="begin"&&(Y.argument=V.current()),Y.styleIdentifier())}function B(V,F,Y){if(V.eatSpace())return null;if(Y&&V.match(Y))return K(F,D),"keyword";if(V.match(/^\\[a-zA-Z@]+/))return"tag";if(V.match(/^[a-zA-Z]+/))return"variable-2";if(V.match(/^\\[$&%#{}_]/))return"tag";if(V.match(/^\\[,;!\/]/))return"tag";if(V.match(/^[\^_&]/))return"tag";if(V.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(V.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var W=V.next();return W=="{"||W=="}"||W=="["||W=="]"||W=="("||W==")"?"bracket":W=="%"?(V.skipToEnd(),"comment"):"error"}function oe(V,F){var Y=V.peek(),W;return Y=="{"||Y=="["?(W=Se(F),W.openBracket(Y),V.eat(Y),K(F,D),"bracket"):/[ \t\r]/.test(Y)?(V.eat(Y),null):(K(F,D),se(F),D(V,F))}return{startState:function(){var V=ye.inMathMode?function(F,Y){return B(F,Y)}:D;return{cmdState:[],f:V}},copyState:function(V){return{cmdState:V.cmdState.slice(),f:V.f}},token:function(V,F){return F.f(V,F)},blankLine:function(V){V.f=D,V.cmdState.length=0},lineComment:"%"}}),Q.defineMIME("text/x-stex","stex"),Q.defineMIME("text/x-latex","stex")})},"19Vz":function(ct,Xe,y){(function(Q){Q(y("VrN/"))})(function(Q){Q.defineOption("placeholder","",function(te,J,K){var D=K&&K!=Q.Init;if(J&&!D)te.on("blur",Se),te.on("change",se),te.on("swapDoc",se),Q.on(te.getInputField(),"compositionupdate",te.state.placeholderCompose=function(){De(te)}),se(te);else if(!J&&D){te.off("blur",Se),te.off("change",se),te.off("swapDoc",se),Q.off(te.getInputField(),"compositionupdate",te.state.placeholderCompose),Te(te);var B=te.getWrapperElement();B.className=B.className.replace(" CodeMirror-empty","")}J&&!te.hasFocus()&&Se(te)});function Te(te){te.state.placeholder&&(te.state.placeholder.parentNode.removeChild(te.state.placeholder),te.state.placeholder=null)}function ye(te){Te(te);var J=te.state.placeholder=document.createElement("pre");J.style.cssText="height: 0; overflow: visible",J.style.direction=te.getOption("direction"),J.className="CodeMirror-placeholder CodeMirror-line-like";var K=te.getOption("placeholder");typeof K=="string"&&(K=document.createTextNode(K)),J.appendChild(K),te.display.lineSpace.insertBefore(J,te.display.lineSpace.firstChild)}function De(te){setTimeout(function(){var J=!1,K=te.getInputField();K.nodeName=="TEXTAREA"?J=!K.value:te.lineCount()==1&&(J=!/[^\u200b]/.test(K.querySelector(".CodeMirror-line").textContent)),J?ye(te):Te(te)},20)}function Se(te){N(te)&&ye(te)}function se(te){var J=te.getWrapperElement(),K=N(te);J.className=J.className.replace(" CodeMirror-empty","")+(K?" CodeMirror-empty":""),K?ye(te):Te(te)}function N(te){return te.lineCount()===1&&te.getLine(0)===""}})},"1ZF9":function(ct,Xe,y){ct.exports=y.p+"static/Authorize.cc9c212f.png"},"1eCo":function(ct,Xe,y){(function(Q){Q(y("VrN/"))})(function(Q){"use strict";var Te={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},ye={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};Q.defineMode("xml",function(De,Se){var se=De.indentUnit,N={},te=Se.htmlMode?Te:ye;for(var J in te)N[J]=te[J];for(var J in Se)N[J]=Se[J];var K,D;function B(w,re){function j(z){return re.tokenize=z,z(w,re)}var S=w.next();if(S=="<")return w.eat("!")?w.eat("[")?w.match("CDATA[")?j(F("atom","]]>")):null:w.match("--")?j(F("comment","-->")):w.match("DOCTYPE",!0,!0)?(w.eatWhile(/[\w\._\-]/),j(Y(1))):null:w.eat("?")?(w.eatWhile(/[\w\._\-]/),re.tokenize=F("meta","?>"),"meta"):(K=w.eat("/")?"closeTag":"openTag",re.tokenize=oe,"tag bracket");if(S=="&"){var he;return w.eat("#")?w.eat("x")?he=w.eatWhile(/[a-fA-F\d]/)&&w.eat(";"):he=w.eatWhile(/[\d]/)&&w.eat(";"):he=w.eatWhile(/[\w\.\-:]/)&&w.eat(";"),he?"atom":"error"}else return w.eatWhile(/[^&<]/),null}B.isInText=!0;function oe(w,re){var j=w.next();if(j==">"||j=="/"&&w.eat(">"))return re.tokenize=B,K=j==">"?"endTag":"selfcloseTag","tag bracket";if(j=="=")return K="equals",null;if(j=="<"){re.tokenize=B,re.state=je,re.tagName=re.tagStart=null;var S=re.tokenize(w,re);return S?S+" tag error":"tag error"}else return/[\'\"]/.test(j)?(re.tokenize=V(j),re.stringStartCol=w.column(),re.tokenize(w,re)):(w.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function V(w){var re=function(j,S){for(;!j.eol();)if(j.next()==w){S.tokenize=oe;break}return"string"};return re.isInAttribute=!0,re}function F(w,re){return function(j,S){for(;!j.eol();){if(j.match(re)){S.tokenize=B;break}j.next()}return w}}function Y(w){return function(re,j){for(var S;(S=re.next())!=null;){if(S=="<")return j.tokenize=Y(w+1),j.tokenize(re,j);if(S==">")if(w==1){j.tokenize=B;break}else return j.tokenize=Y(w-1),j.tokenize(re,j)}return"meta"}}function W(w,re,j){this.prev=w.context,this.tagName=re,this.indent=w.indented,this.startOfLine=j,(N.doNotIndent.hasOwnProperty(re)||w.context&&w.context.noIndent)&&(this.noIndent=!0)}function Z(w){w.context&&(w.context=w.context.prev)}function ue(w,re){for(var j;;){if(!w.context)return;if(j=w.context.tagName,!N.contextGrabbers.hasOwnProperty(j)||!N.contextGrabbers[j].hasOwnProperty(re))return;Z(w)}}function je(w,re,j){return w=="openTag"?(j.tagStart=re.column(),Ke):w=="closeTag"?_e:je}function Ke(w,re,j){return w=="word"?(j.tagName=re.current(),D="tag",fe):N.allowMissingTagName&&w=="endTag"?(D="tag bracket",fe(w,re,j)):(D="error",Ke)}function _e(w,re,j){if(w=="word"){var S=re.current();return j.context&&j.context.tagName!=S&&N.implicitlyClosed.hasOwnProperty(j.context.tagName)&&Z(j),j.context&&j.context.tagName==S||N.matchClosing===!1?(D="tag",ge):(D="tag error",ze)}else return N.allowMissingTagName&&w=="endTag"?(D="tag bracket",ge(w,re,j)):(D="error",ze)}function ge(w,re,j){return w!="endTag"?(D="error",ge):(Z(j),je)}function ze(w,re,j){return D="error",ge(w,re,j)}function fe(w,re,j){if(w=="word")return D="attribute",Ce;if(w=="endTag"||w=="selfcloseTag"){var S=j.tagName,he=j.tagStart;return j.tagName=j.tagStart=null,w=="selfcloseTag"||N.autoSelfClosers.hasOwnProperty(S)?ue(j,S):(ue(j,S),j.context=new W(j,S,he==j.indented)),je}return D="error",fe}function Ce(w,re,j){return w=="equals"?Pe:(N.allowMissing||(D="error"),fe(w,re,j))}function Pe(w,re,j){return w=="string"?pe:w=="word"&&N.allowUnquoted?(D="string",fe):(D="error",fe(w,re,j))}function pe(w,re,j){return w=="string"?pe:fe(w,re,j)}return{startState:function(w){var re={tokenize:B,state:je,indented:w||0,tagName:null,tagStart:null,context:null};return w!=null&&(re.baseIndent=w),re},token:function(w,re){if(!re.tagName&&w.sol()&&(re.indented=w.indentation()),w.eatSpace())return null;K=null;var j=re.tokenize(w,re);return(j||K)&&j!="comment"&&(D=null,re.state=re.state(K||j,w,re),D&&(j=D=="error"?j+" error":D)),j},indent:function(w,re,j){var S=w.context;if(w.tokenize.isInAttribute)return w.tagStart==w.indented?w.stringStartCol+1:w.indented+se;if(S&&S.noIndent)return Q.Pass;if(w.tokenize!=oe&&w.tokenize!=B)return j?j.match(/^(\s*)/)[0].length:0;if(w.tagName)return N.multilineTagIndentPastTag!==!1?w.tagStart+w.tagName.length+2:w.tagStart+se*(N.multilineTagIndentFactor||1);if(N.alignCDATA&&/<!\[CDATA\[/.test(re))return 0;var he=re&&/^<(\/)?([\w_:\.-]*)/.exec(re);if(he&&he[1])for(;S;)if(S.tagName==he[2]){S=S.prev;break}else if(N.implicitlyClosed.hasOwnProperty(S.tagName))S=S.prev;else break;else if(he)for(;S;){var z=N.contextGrabbers[S.tagName];if(z&&z.hasOwnProperty(he[2]))S=S.prev;else break}for(;S&&S.prev&&!S.startOfLine;)S=S.prev;return S?S.indent+se:w.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:N.htmlMode?"html":"xml",helperType:N.htmlMode?"html":"xml",skipAttribute:function(w){w.state==Pe&&(w.state=fe)},xmlCurrentTag:function(w){return w.tagName?{name:w.tagName,close:w.type=="closeTag"}:null},xmlCurrentContext:function(w){for(var re=[],j=w.context;j;j=j.prev)j.tagName&&re.push(j.tagName);return re.reverse()}}}),Q.defineMIME("text/xml","xml"),Q.defineMIME("application/xml","xml"),Q.mimeModes.hasOwnProperty("text/html")||Q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"3vs6":function(ct,Xe,y){"use strict";var Q=y("+L6B"),Te=y("2/Rp"),ye=y("5Dmo"),De=y("3S7+"),Se=y("k1fw"),se=y("miYZ"),N=y("tsqr"),te=y("9og8"),J=y("2qtc"),K=y("kLXV"),D=y("tJVT"),B=y("WmNS"),oe=y.n(B),V=y("q1tI"),F=y.n(V),Y=y("ttuQ"),W=y.n(Y),Z=y("ErOA"),ue=y("m3rI"),je=y("IE1O"),Ke=y("xKgJ"),_e=y("NLgs"),ge=y("Ty5D"),ze=y("9kvl"),fe=function(Pe){var pe=Pe.virtualSpaces,w=Pe.user,re=Pe.dispatch,j=Object(V.useState)(!1),S=Object(D.a)(j,2),he=S[0],z=S[1],O=Object(ge.i)(),T=pe.virtualSpacesDetails;Object(V.useEffect)(function(){m()},[]);var m=function(){re({type:"virtualSpaces/getVirtualSpacesDetails",payload:{id:O==null?void 0:O.virtual_spacesId}})},p=function(){if(!Object(_e.f)(re))return;K.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:F.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 be=Object(te.a)(oe.a.mark(function ie(){var le;return oe.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,Object(Z.a)("/api/virtual_classrooms/".concat(O==null?void 0:O.virtual_spacesId,"/apply_become_member.json"),{method:"post"});case 2:le=R.sent,(le==null?void 0:le.status)!==-1&&(N.b.success(le==null?void 0:le.message),m());case 4:case"end":return R.stop()}},ie)}));function ve(){return be.apply(this,arguments)}return ve}()})},_=function(){K.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:F.a.createElement("div",{className:"font14"},F.a.createElement("p",null,"\u786E\u8BA4\u5411\u5E73\u53F0\u7533\u8BF7\u516C\u5F00\u865A\u62DF\u793E\u533A\u5417\uFF1F"),F.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"),F.a.createElement("div",null,"\u516C\u5F00\u7684\u865A\u62DF\u793E\u533A\u5C06\u5BF9\u5E73\u53F0\u6240\u6709\u4EBA\u53EF\u89C1\u3002")),onOk:function(){var be=Object(te.a)(oe.a.mark(function ie(){var le;return oe.a.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,Object(Z.a)("/api/virtual_classrooms/".concat(O==null?void 0:O.virtual_spacesId,"/apply_public.json"),{method:"post"});case 2:le=R.sent,(le==null?void 0:le.status)!==-1&&(N.b.success(le==null?void 0:le.message),m());case 4:case"end":return R.stop()}},ie)}));function ve(){return be.apply(this,arguments)}return ve}()})},M=function(){var Re=Object(te.a)(oe.a.mark(function be(ve){var ie;return oe.a.wrap(function($){for(;;)switch($.prev=$.next){case 0:return $.next=2,Object(Z.a)("/api/virtual_classrooms/".concat(O==null?void 0:O.virtual_spacesId,".json"),{method:"put",body:ve});case 2:ie=$.sent,(ie==null?void 0:ie.status)===0&&(m(),z(!1));case 4:case"end":return $.stop()}},be)}));return function(ve){return Re.apply(this,arguments)}}(),ne=function(){var Re=Object(te.a)(oe.a.mark(function be(ve){return oe.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:z(Object(Se.a)({},T));case 1:case"end":return le.stop()}},be)}));return function(ve){return Re.apply(this,arguments)}}(),we=(T==null?void 0:T.is_member)||Object(Ke.v)();return F.a.createElement("div",{className:W.a.bg,style:{background:"url('".concat(ue.a.IMG_SERVER+(T==null?void 0:T.backbground_image_url),"') no-repeat center center")}},F.a.createElement("aside",null,F.a.createElement("div",null,F.a.createElement("div",{className:W.a.member},F.a.createElement("div",null,F.a.createElement(De.a,{title:"\u6210\u5458\u603B\u6570"},F.a.createElement("i",{style:{color:"#FF8B58",fontSize:24},className:"iconfont icon-a-chengyuan1"})),F.a.createElement(De.a,{title:"\u6210\u5458\u603B\u6570"},F.a.createElement("span",null,T==null?void 0:T.members_count))),F.a.createElement("div",null,F.a.createElement(De.a,{title:"\u8D44\u6E90\u603B\u6570"},F.a.createElement("i",{style:{color:"#07C160",marginLeft:100},className:"iconfont icon-a-ziyuanku1"})),F.a.createElement(De.a,{title:"\u8D44\u6E90\u603B\u6570"},F.a.createElement("span",null,T==null?void 0:T.resources_count)))),we&&F.a.createElement(Te.a,{disabled:(T==null?void 0:T.status)!==2,onClick:_,type:"primary"},F.a.createElement("i",{className:"iconfont icon-sheweigongkai2 mr5 font14"}),(T==null?void 0:T.status)===2?"\u7533\u8BF7\u516C\u5F00":(T==null?void 0:T.status)===0?"\u7533\u8BF7\u4E2D":"\u5DF2\u516C\u5F00"),!we&&F.a.createElement(Te.a,{onClick:p,type:"primary"},F.a.createElement("i",{className:"iconfont icon-shenqingjiaru2 mr5 font14"}),"\u7533\u8BF7\u52A0\u5165"))),F.a.createElement(je.b,{visible:he,title:"\u7F16\u8F91\u865A\u62DF\u793E\u533A",onCancel:function(){return z(!1)},onOk:M}))};Xe.a=Object(ze.a)(function(Ce){var Pe=Ce.virtualSpaces,pe=Ce.user;return{virtualSpaces:Pe,user:pe}})(fe)},"500L":function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return _e});var Q=y("+L6B"),Te=y("2/Rp"),ye=y("2qtc"),De=y("kLXV"),Se=y("9og8"),se=y("k1fw"),N=y("miYZ"),te=y("tsqr"),J=y("oBTY"),K=y("tJVT"),D=y("DZo9"),B=y("8z0m"),oe=y("WmNS"),V=y.n(oe),F=y("q1tI"),Y=y.n(F),W=y("m3rI"),Z=y("wzkS"),ue=y("y5JW"),je=y("LtfV"),Ke=B.a.Dragger;function _e(ge){var ze=[];return ge&&ge.length>0&&(ze=ge.map(function(fe){return{uid:fe.id,id:fe.id,name:fe.title+ue.c+fe.filesize,url:fe.url,filesize:fe.filesize,status:"done",response:{id:fe.id}}})),ze}Xe.b=function(ge){var ze=ge.value,fe=ge.onChange,Ce=ge.action,Pe=ge.className,pe=ge.maxSize,w=pe===void 0?150:pe,re=ge.title,j=re===void 0?"\u4E0A\u4F20\u9644\u4EF6":re,S=ge.showRemoveModal,he=S===void 0?!1:S,z=ge.accept,O=z===void 0?"":z,T=ge.additionalText,m=ge.isDragger,p=ge.number,_=p===void 0?1e3:p,M=ge.aloneClear,ne=M===void 0?!1:M,we=ge.restrict,Re=we===void 0?!0:we,be=Object(F.useState)(!1),ve=Object(K.a)(be,2),ie=ve[0],le=ve[1],$=Object(F.useState)(ze||[]),R=Object(K.a)($,2),b=R[0],P=R[1];Object(F.useEffect)(function(){ze&&(P(Object(J.a)(ze)),_===(ze==null?void 0:ze.length)&&le(!0))},[ze]);var E=function(){setTimeout(function(){b.pop(),P(Object(J.a)(b))},500)},de={multiple:!0,disabled:ie,accept:O,withCredentials:!0,fileList:b,beforeUpload:function(Ee,Le){var Me=Ee.size/1024/1024;return b.concat(Le).length>_?(b.pop(),P(Object(J.a)(b)),te.b.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20".concat(_,"\u4E2A\u6587\u4EF6")),ne?Promise.reject():(E(),!1)):Me<w?!0:(te.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(w,"MB).")),ne?Promise.reject():(E(),!1))},action:Ce||"".concat(W.a.API_SERVER,"/api/attachments.json"),onChange:function(Ee){var Le=Object(J.a)(Ee.fileList);Le.length>=_?le(!0):le(!1),P(Object(J.a)(Le)),Le=Le.map(function(Me){var ke;if(Me!=null&&(ke=Me.response)!==null&&ke!==void 0&&ke.id){var Ae;Me.url="/api/attachments/".concat(Me==null||((Ae=Me.response)===null||Ae===void 0)?void 0:Ae.id)}return Me.name.indexOf(ue.c)===-1&&(Me.name="".concat(Me.name).concat(ue.c).concat(Object(ue.a)(Me.size))),Object(se.a)({},Me)}),console.log("info:",Ee),fe(Le)},onRemove:function(){var G=Object(Se.a)(V.a.mark(function Le(Me){var ke;return V.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:if(ke=function(){var Je=Object(Se.a)(V.a.mark(function We(){var $e,Qe;return V.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:if($e=Me.response?Me.response.id:Me.id,!$e){et.next=8;break}return et.next=4,Object(Z.d)(Me.response?Me.response.id:Me.uid);case 4:return Qe=et.sent,et.abrupt("return",Qe);case 8:return et.abrupt("return",!0);case 9:case"end":return et.stop()}},We)}));return function(){return Je.apply(this,arguments)}}(),!he){Ne.next=5;break}return Ne.abrupt("return",new Promise(function(Je,We){De.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:Y.a.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:function(){var $e=Object(Se.a)(V.a.mark(function st(){var et;return V.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.next=2,ke();case 2:et=Oe.sent,te.b.success("\u5220\u9664\u6210\u529F"),Je(!0);case 5:case"end":return Oe.stop()}},st)}));function Qe(){return $e.apply(this,arguments)}return Qe}(),onCancel:function(){return Je(!1)}})}));case 5:return Ne.next=7,ke();case 7:return Ne.abrupt("return",Ne.sent);case 8:case"end":return Ne.stop()}},Le)}));function Ee(Le){return G.apply(this,arguments)}return Ee}()};function xe(G){G.preventDefault(),G.stopPropagation()}return Y.a.createElement("div",{className:"multi-upload ".concat(Pe||"")},m&&Y.a.createElement(Ke,de,Y.a.createElement("p",{className:"ant-upload-drag-icon"},Y.a.createElement(je.a,null)),Y.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",Y.a.createElement("br",null),Y.a.createElement("span",{style:{display:Re?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927\u9650\u5236\u4E3A",w,"MB) ")),T),!m&&Y.a.createElement(B.a,de,Y.a.createElement(Te.a,{disabled:ie},j),Y.a.createElement("span",{onClick:xe,style:{marginLeft:10,color:"#FA6400",display:Re?"block":"none"}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",w,"MB) ")))}},"7Cbv":function(ct,Xe,y){"use strict";var Q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Te=new Uint8Array(16);function ye(){if(!Q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Q(Te)}var De=/^(?:[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 Se(oe){return typeof oe=="string"&&De.test(oe)}for(var se=Se,N=[],te=0;te<256;++te)N.push((te+256).toString(16).substr(1));function J(oe){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,F=(N[oe[V+0]]+N[oe[V+1]]+N[oe[V+2]]+N[oe[V+3]]+"-"+N[oe[V+4]]+N[oe[V+5]]+"-"+N[oe[V+6]]+N[oe[V+7]]+"-"+N[oe[V+8]]+N[oe[V+9]]+"-"+N[oe[V+10]]+N[oe[V+11]]+N[oe[V+12]]+N[oe[V+13]]+N[oe[V+14]]+N[oe[V+15]]).toLowerCase();if(!se(F))throw TypeError("Stringified UUID is invalid");return F}var K=J;function D(oe,V,F){oe=oe||{};var Y=oe.random||(oe.rng||ye)();if(Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128,V){F=F||0;for(var W=0;W<16;++W)V[F+W]=Y[W];return V}return K(Y)}var B=Xe.a=D},"7ahc":function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return Ke});var Q=y("k1fw"),Te=y("0Owb"),ye=y("+L6B"),De=y("2/Rp"),Se=y("y8nQ"),se=y("Vl3Y"),N=y("tJVT"),te=y("OaEy"),J=y("2fM7"),K=y("q1tI"),D=y.n(K),B=y("VrN/"),oe=y.n(B),V=y("p77/"),F=y.n(V),Y=y("c5Ni"),W=y.n(Y),Z=J.a.Option,ue={labelCol:{span:4},wrapperCol:{span:20}},je={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"]};Xe.b=function(_e){var ge=_e.callback,ze=_e.onCancel,fe=Object(K.useState)("python"),Ce=Object(N.a)(fe,2),Pe=Ce[0],pe=Ce[1];function w(j){pe(je[j][1])}function re(j){ge(j)}return D.a.createElement(se.a,Object(Te.a)({},ue,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:re}),D.a.createElement(se.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},D.a.createElement(J.a,{onChange:w},Object.keys(je).map(function(j){return D.a.createElement(Z,{key:j,value:j},je[j][0])}))),D.a.createElement(se.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},D.a.createElement(Ke,{mode:Pe})),D.a.createElement("div",{className:"flex-container flex-end"},D.a.createElement(De.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),D.a.createElement(De.a,{type:"ghost",onClick:ze},"\u53D6\u6D88")))};function Ke(_e){var ge=_e.value,ze=_e.onChange,fe=_e.mode,Ce=_e.options,Pe=Ce===void 0?{}:Ce,pe=Object(K.useRef)(),w=Object(K.useState)(),re=Object(N.a)(w,2),j=re[0],S=re[1];return Object(K.useEffect)(function(){if(j){function he(z){var O=z.getValue();ze&&ze(O)}return j.on("change",he),function(){j.off("change",he)}}},[j,ze]),Object(K.useEffect)(function(){j&&j.setOption("mode",fe)},[j,fe]),Object(K.useEffect)(function(){j&&((ge!==j.getValue()||ge==="")&&setTimeout(function(){j.setValue(ge||" ")},300))},[j,ge]),Object(K.useEffect)(function(){if(pe.current&&!j){var he=oe.a.fromTextArea(pe.current,Object(Q.a)({mode:fe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Pe));S(he)}},[pe.current,j]),D.a.createElement("div",{className:"my-codemirror-container"},D.a.createElement("textarea",{ref:pe}))}},"7ixt":function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return ye});var Q={adjustX:1,adjustY:1},Te=[0,0],ye={left:{points:["cr","cl"],overflow:Q,offset:[-4,0],targetOffset:Te},right:{points:["cl","cr"],overflow:Q,offset:[4,0],targetOffset:Te},top:{points:["bc","tc"],overflow:Q,offset:[0,-4],targetOffset:Te},bottom:{points:["tc","bc"],overflow:Q,offset:[0,4],targetOffset:Te},topLeft:{points:["bl","tl"],overflow:Q,offset:[0,-4],targetOffset:Te},leftTop:{points:["tr","tl"],overflow:Q,offset:[-4,0],targetOffset:Te},topRight:{points:["br","tr"],overflow:Q,offset:[0,-4],targetOffset:Te},rightTop:{points:["tl","tr"],overflow:Q,offset:[4,0],targetOffset:Te},bottomRight:{points:["tr","br"],overflow:Q,offset:[0,4],targetOffset:Te},rightBottom:{points:["bl","br"],overflow:Q,offset:[4,0],targetOffset:Te},bottomLeft:{points:["tl","bl"],overflow:Q,offset:[0,4],targetOffset:Te},leftBottom:{points:["br","bl"],overflow:Q,offset:[-4,0],targetOffset:Te}},De=ye},"8EBN":function(ct,Xe,y){(function(Q){Q(y("VrN/"))})(function(Q){"use strict";Q.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 Te=0;Te<Q.modeInfo.length;Te++){var ye=Q.modeInfo[Te];ye.mimes&&(ye.mime=ye.mimes[0])}Q.findModeByMIME=function(De){De=De.toLowerCase();for(var Se=0;Se<Q.modeInfo.length;Se++){var se=Q.modeInfo[Se];if(se.mime==De)return se;if(se.mimes){for(var N=0;N<se.mimes.length;N++)if(se.mimes[N]==De)return se}}if(/\+xml$/.test(De))return Q.findModeByMIME("application/xml");if(/\+json$/.test(De))return Q.findModeByMIME("application/json")},Q.findModeByExtension=function(De){De=De.toLowerCase();for(var Se=0;Se<Q.modeInfo.length;Se++){var se=Q.modeInfo[Se];if(se.ext){for(var N=0;N<se.ext.length;N++)if(se.ext[N]==De)return se}}},Q.findModeByFileName=function(De){for(var Se=0;Se<Q.modeInfo.length;Se++){var se=Q.modeInfo[Se];if(se.file&&se.file.test(De))return se}var N=De.lastIndexOf("."),te=N>-1&&De.substring(N+1,De.length);if(te)return Q.findModeByExtension(te)},Q.findModeByName=function(De){De=De.toLowerCase();for(var Se=0;Se<Q.modeInfo.length;Se++){var se=Q.modeInfo[Se];if(se.name.toLowerCase()==De)return se;if(se.alias){for(var N=0;N<se.alias.length;N++)if(se.alias[N].toLowerCase()==De)return se}}}})},"8hTe":function(ct,Xe,y){ct.exports={button:"button___1wy9m"}},"9Bee":function(ct,Xe,y){"use strict";var Q=y("DYRE"),Te=y("zeV3"),ye=y("+L6B"),De=y("2/Rp"),Se=y("k1fw"),se=y("9og8"),N=y("tJVT"),te=y("WmNS"),J=y.n(te),K=y("q1tI"),D=y.n(K),B=y("vg9a"),oe=y("DlQD"),V=y.n(oe),F=y("rUJ1");function Y(c,o){var a=c.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(d){var h=d.match(/^\s+/);if(h===null)return d;var U=Object(N.a)(h,1),Fe=U[0];return Fe.length>=u.length?d.slice(u.length):d}).join(`
|
|
`)}var W=[],Z=["<ul>"],ue=new V.a.Renderer,je=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ke(){W.length=0,Z=["<ul>"]}var _e={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ge(c,o,a,u){if(o>=c.length||c[o].level<=a)return o;var d=c[o];u.push("<li><a href='#"+d.anchor+"'>"+d.text+"</a>"),o++;var h=[];return o=ge(c,o,d.level,h),h.length>0&&(u.push("<ul>"),h.forEach(function(U){u.push(U)}),u.push("</ul>")),u.push("</li>"),o=ge(c,o,a,u),o}function ze(){return ge(W,0,0,Z),Z.push("</ul>"),Z.join("")}var fe={heading:function(o){var a=je.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],d=Y(u,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var U=pe(),Fe=d;d=U,w[U]={type:"block",expression:Fe}}return{type:"code",raw:u,lang:h,text:d}}}},Ce=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Pe=0,pe=function(){return"__special_katext_id_".concat(Pe++,"__")},w={};function re(){return w}function j(){Pe=0,w={}}function S(c){return c=c.replace(Ce,function(o,a){var u=pe();return w[u]={type:"inline",expression:a},u}),c}var he=ue.listitem;ue.listitem=function(c){return he(S(c))};var z=ue.paragraph;ue.paragraph=function(c){return z(S(c))};var O=ue.tablecell;ue.tablecell=function(c,o){return O(S(c),o)},ue.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(F.escape)(c,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?c:Object(F.escape)(c,!0))+"</code></pre>"},ue.heading=function(c,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return W.push({anchor:u,level:o,text:c}),"<h"+o+' id="'+u+'">'+c+"</h"+o+">"},V.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),V.a.use({tokenizer:fe,renderer:ue});var T=V.a,m=y("SJMd"),p=y("ulZh"),_=y.n(p),M=y("m3rI"),ne=y("Oy/b"),we=y("p5ED"),Re=y("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 be=function(c,o){return(be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])})(c,o)};function ve(c,o){function a(){this.constructor=c}be(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ie(c,o,a,u){return new(a||(a=Promise))(function(d,h){function U(lt){try{qe(u.next(lt))}catch(He){h(He)}}function Fe(lt){try{qe(u.throw(lt))}catch(He){h(He)}}function qe(lt){var He;lt.done?d(lt.value):(He=lt.value,He instanceof a?He:new a(function(Ct){Ct(He)})).then(U,Fe)}qe((u=u.apply(c,o||[])).next())})}function le(c,o){var a,u,d,h,U={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return h={next:Fe(0),throw:Fe(1),return:Fe(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function Fe(qe){return function(lt){return function(He){if(a)throw new TypeError("Generator is already executing.");for(;U;)try{if(a=1,u&&(d=2&He[0]?u.return:He[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,He[1])).done)return d;switch(u=0,d&&(He=[2&He[0],d.value]),He[0]){case 0:case 1:d=He;break;case 4:return U.label++,{value:He[1],done:!1};case 5:U.label++,u=He[1],He=[0];continue;case 7:He=U.ops.pop(),U.trys.pop();continue;default:if(!(d=U.trys,(d=d.length>0&&d[d.length-1])||He[0]!==6&&He[0]!==2)){U=0;continue}if(He[0]===3&&(!d||He[1]>d[0]&&He[1]<d[3])){U.label=He[1];break}if(He[0]===6&&U.label<d[1]){U.label=d[1],d=He;break}if(d&&U.label<d[2]){U.label=d[2],U.ops.push(He);break}d[2]&&U.ops.pop(),U.trys.pop();continue}He=o.call(c,U)}catch(Ct){He=[6,Ct],u=0}finally{a=d=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([qe,lt])}}}function $(){for(var c=0,o=0,a=arguments.length;o<a;o++)c+=arguments[o].length;var u=Array(c),d=0;for(o=0;o<a;o++)for(var h=arguments[o],U=0,Fe=h.length;U<Fe;U++,d++)u[d]=h[U];return u}var R=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,d=a;u<d.length;u++){var h=d[u],U=h[0],Fe=h[1];o.setAttribute(U,Fe)}},c.createRect=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");return d.setAttribute("width",o.toString()),d.setAttribute("height",a.toString()),u&&c.setAttributes(d,u),d},c.createLine=function(o,a,u,d,h){var U=document.createElementNS("http://www.w3.org/2000/svg","line");return U.setAttribute("x1",o.toString()),U.setAttribute("y1",a.toString()),U.setAttribute("x2",u.toString()),U.setAttribute("y2",d.toString()),h&&c.setAttributes(U,h),U},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 d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return d.setAttribute("cx",(o/2).toString()),d.setAttribute("cy",(a/2).toString()),d.setAttribute("rx",(o/2).toString()),d.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(d,u),d},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,d,h,U,Fe){var qe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(qe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",h.toString()],["refY",U.toString()]]),qe.appendChild(Fe),qe},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}(),P=function(){function c(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return c.prototype.rasterize=function(o,a,u){var d=this;return new Promise(function(h){var U=u!==void 0?u:document.createElement("canvas");o===null&&(d.markersOnly=!0,d.naturalSize=!1);var Fe=document.createElementNS("http://www.w3.org/2000/svg","svg");Fe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Fe.setAttribute("width",a.width.baseVal.valueAsString),Fe.setAttribute("height",a.height.baseVal.valueAsString),Fe.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Fe.innerHTML=a.innerHTML,d.naturalSize===!0?(Fe.width.baseVal.value=o.naturalWidth,Fe.height.baseVal.value=o.naturalHeight):d.width!==void 0&&d.height!==void 0&&(Fe.width.baseVal.value=d.width,Fe.height.baseVal.value=d.height),U.width=Fe.width.baseVal.value,U.height=Fe.height.baseVal.value;var qe=Fe.outerHTML,lt=U.getContext("2d");d.markersOnly!==!0&<.drawImage(o,0,0,U.width,U.height);var He=window.URL,Ct=new Image(U.width,U.height);Ct.setAttribute("crossOrigin","anonymous");var Lt=new Blob([qe],{type:"image/svg+xml"}),Vt=He.createObjectURL(Lt);Ct.onload=function(){lt.drawImage(Ct,0,0),He.revokeObjectURL(Vt);var In=U.toDataURL(d.imageType,d.imageQuality);h(In)},Ct.src=Vt})},c}(),E=function(){},de=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 xe("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new xe("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new xe("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new G("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new G("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}(),xe=function(c,o){this.selector=c,this.style=o},G=function(c,o){this.localName=c,this.style=o},Ee=function(){function c(o,a,u,d,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=d,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 U=document.createElement("div");U.className=""+a.toolbarButtonStyleClass.name,U.setAttribute("data-type-name",h.typeName),U.innerHTML=h.icon,U.addEventListener("click",function(){a.markerToolbarButtonClicked(U,h)}),a.buttons.push(U),a.markerButtons.push(U)}),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 d=document.createElement("div");d.className=this.toolbarBlockStyleClass.name,d.style.whiteSpace="nowrap",d.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(d),this.addActionButton(d,'<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(d,'<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 d=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",u),h.addEventListener("click",function(){d.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 G("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 G("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new G("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new G("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 G("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new G("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 G("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new G("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new xe("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new xe("."+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}(),Le=function(){function c(o,a,u,d){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=d,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return c.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new G("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 G("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new G("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new G("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new G("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 G("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new G("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 G("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new G("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new xe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new xe("."+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,d=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 U;h.uiStyleSettings=d.uiStyleSettings;var Fe=document.createElement("div");Fe.className=d.toolboxButtonStyleClass.name+" "+((U=d.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&U!==void 0?U:d.toolboxButtonStyleColorsClass.name),Fe.innerHTML=h.icon,Fe.title=h.title,Fe.addEventListener("click",function(){d.panelButtonClick(h)}),d.panelButtons.push(Fe),d.buttonRow.appendChild(Fe)}),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 d=o.getUi();d.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(d),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,U){var Fe,qe;h.className=a.toolboxButtonStyleClass.name+" "+(U===u?""+((Fe=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Fe!==void 0?Fe:a.toolboxActiveButtonStyleColorsClass.name):""+((qe=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&qe!==void 0?qe:a.toolboxButtonStyleColorsClass.name))})},c}(),Me=function(c,o){this.title=c,this.icon=o},ke=function(c){function o(a,u,d,h){var U=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 U.colors=[],U.addTransparent=!1,U.colorBoxes=[],U.colors=u,U.currentColor=d,U.setCurrentColor=U.setCurrentColor.bind(U),U.getColorBox=U.getColorBox.bind(U),U}return ve(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(d){var h=a.getColorBox(d);u.appendChild(h),a.colorBoxes.push(h)}),u},o.prototype.getColorBox=function(a){var u=this,d=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-d,U=document.createElement("div");U.style.display="inline-block",U.style.boxSizing="content-box",U.style.width=h-2+"px",U.style.height=h-2+"px",U.style.padding="1px",U.style.marginRight="2px",U.style.marginBottom="2px",U.style.borderWidth="2px",U.style.borderStyle="solid",U.style.borderRadius=(h+2)/2+"px",U.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",U.addEventListener("click",function(){u.setCurrentColor(a,U)});var Fe=document.createElement("div");return Fe.style.display="inline-block",Fe.style.width=h-2+"px",Fe.style.height=h-2+"px",Fe.style.backgroundColor=a,Fe.style.borderRadius=h/2+"px",a==="transparent"&&(Fe.style.fill=this.uiStyleSettings.toolboxAccentColor,Fe.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>`),U.appendChild(Fe),U},o.prototype.setCurrentColor=function(a,u){var d=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Me),Ae=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}(),Ne=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}(),Je=function(){function c(){this.GRIP_SIZE=10,this.visual=R.createGroup(),this.visual.appendChild(R.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(R.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}(),We=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}(),$e=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||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(R.createTransform()),h.setupControlBox(),h}return ve(o,c),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=R.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 d=this.unrotatePoint(a);if(this.manipulationStartX=d.x,this.manipulationStartY=d.y,this.offsetX=d.x-this.left,this.offsetY=d.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 U=this.container.transform.baseVal.getItem(0);U.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(U,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,d=this.manipulationStartWidth,h=this.manipulationStartTop,U=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,d=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:d=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,U=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:U=this.manipulationStartHeight+a.y-this.manipulationStartY}d>=0?(this.left=u,this.width=d):(this.left=u+d,this.width=-d),U>=0?(this.top=h,this.height=U):(this.top=h+U,this.height=-U),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(),d=R.createPoint(a.x,a.y);return{x:(d=d.matrixTransform(u)).x,y:d.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var d=R.createPoint(a.x,a.y);return{x:(d=d.matrixTransform(u)).x,y:d.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=R.createGroup();var a=R.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=R.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=R.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ne,this.addControlGrips(),this.controlBox.style.display="none"},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 Je;return a.visual.transform.baseVal.appendItem(R.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,d=u,h=(this.width+this.CB_DISTANCE)/2-a/2,U=(this.height+this.CB_DISTANCE)/2-a/2,Fe=this.height+this.CB_DISTANCE-a/2,qe=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,d),this.positionGrip(this.controlGrips.topCenter.visual,h,d),this.positionGrip(this.controlGrips.topRight.visual,qe,d),this.positionGrip(this.controlGrips.centerLeft.visual,u,U),this.positionGrip(this.controlGrips.centerRight.visual,qe,U),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Fe),this.positionGrip(this.controlGrips.bottomCenter.visual,h,Fe),this.positionGrip(this.controlGrips.bottomRight.visual,qe,Fe),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,d-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,d){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,d),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:We.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:We.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(We.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(We.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){c.prototype.scale.call(this,a,u);var d=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:d.x*a,y:d.y*u});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Ae),Qe=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=R.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),R.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&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&R.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}($e),st=function(c){function o(a,u,d,h){var U=c.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return U.widths=[],U.widthBoxes=[],U.widths=u,U.currentWidth=d,U.setCurrentWidth=U.setCurrentWidth.bind(U),U}return ve(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(d){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=d===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(d,h)}),u.appendChild(h);var U=document.createElement("div");U.innerText=d.toString(),U.style.marginRight="5px",h.appendChild(U);var Fe=document.createElement("div");Fe.style.minHeight="20px",Fe.style.flexGrow="2",Fe.style.display="flex",Fe.style.alignItems="center";var qe=document.createElement("hr");qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop=d+"px solid "+a.uiStyleSettings.toolboxColor,qe.style.flexGrow="2",Fe.appendChild(qe),h.appendChild(Fe),a.widthBoxes.push(h)}),u},o.prototype.setCurrentWidth=function(a,u){var d=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Me),et=function(c){function o(a,u,d,h){var U=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 U.styles=[],U.styleBoxes=[],U.styles=u,U.currentStyle=d,U.setCurrentStyle=U.setCurrentStyle.bind(U),U}return ve(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(d){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=d===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(d,h)}),u.appendChild(h);var U=document.createElement("div");U.style.minHeight="20px",U.style.flexGrow="2",U.style.overflow="hidden";var Fe=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(d!==""?'stroke-dasharray="'+d+'"':"")+` />
|
|
</svg>`;U.innerHTML=Fe,h.appendChild(U),a.styleBoxes.push(h)}),u},o.prototype.setCurrentStyle=function(a,u){var d=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Me),ot=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new ke("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new st("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new et("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="FrameMarker",o.title="Frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',o}(Qe),Oe=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,d){var h=c.call(this,a,u,d)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return ve(o,c),o.prototype.ownsTarget=function(a){return!!c.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){c.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;c.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){c.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){c.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=R.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 Je;return a.visual.transform.baseVal.appendItem(R.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,d){var h=a.transform.baseVal.getItem(0);h.setTranslate(u,d),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}(Ae),at=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||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=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new ke("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new st("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new et("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=R.createGroup(),this.selectorLine=R.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=R.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()),R.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),R.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,d,h){var U=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 U.fonts=[],U.fontBoxes=[],U.fonts=u,U.currentFont=d,U.setCurrentFont=U.setCurrentFont.bind(U),U}return ve(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(d){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=d===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(d,h)}),u.appendChild(h);var U=document.createElement("div");U.style.display="flex",U.style.minHeight="20px",U.style.flexGrow="2",U.style.fontFamily=d,U.style.overflow="hidden";var Fe=document.createElement("div");Fe.style.whiteSpace="nowrap",Fe.style.overflow="hidden",Fe.style.textOverflow="ellipsis",Fe.innerHTML="The quick brown fox jumps over the lazy dog",U.appendChild(Fe),h.appendChild(U),a.fontBoxes.push(h)}),u},o.prototype.setCurrentFont=function(a,u){var d=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Me),Ye=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=d.defaultColor,h.fontFamily=d.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 ke("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new Be("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return ve(o,c),o.prototype.ownsTarget=function(a){if(c.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(d){d===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=R.createGroup(),this.bgRectangle=R.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=R.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(R.createTransform()),this.textElement.transform.baseVal.appendItem(R.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(R.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 d=(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(d,h)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),d=0,h=0;return u.width>0&&u.height>0&&(d=(this.width-u.width*a)/2,h=this.height/2-u.height*a/2),{x:d,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),d=this.getTextPosition(u);d.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+d.x+"px, "+d.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(d.x,d.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&&(R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.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 d=u.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(d)),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}),d=this.textElement.getBBox(),h={x:d.width*a,y:d.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&&R.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&&R.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}($e),q=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=d.defaultColor,h.lineWidth=d.defaultStrokeWidth,h.pixelRatio=d.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 ke("Color",d.defaultColorSet,d.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new st("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=R.createGroup(),this.drawingImage=R.createImage(),this.visual.appendChild(this.drawingImage);var a=R.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),R.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),R.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],d=u[0],h=u[1],U=u[2],Fe=u[3],qe=!1,lt=0;lt<this.canvasElement.height;lt++)for(var He=0;He<this.canvasElement.width;He++)a.data[lt*this.canvasElement.width*4+4*He+3]>0&&(qe=!0,lt<h&&(h=lt),He<d&&(d=He),lt>Fe&&(Fe=lt),He>U&&(U=He));if(qe){this.left=d/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(U-d)/this.pixelRatio,this.height=(Fe-h)/this.pixelRatio;var Ct=document.createElement("canvas");Ct.width=U-d,Ct.height=Fe-h,Ct.getContext("2d").putImageData(this.canvasContext.getImageData(d,h,U-d,Fe-h),0,0),this.drawingImgUrl=Ct.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){R.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),R.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}($e),H=function(c){function o(a,u,d){var h=c.call(this,a,d||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return h.typeBoxes=[],h.currentType=u,h.setCurrentType=h.setCurrentType.bind(h),h}return ve(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var d=function(Fe){var qe="both";switch(Fe){case 0:qe="both";break;case 1:qe="start";break;case 2:qe="end";break;case 3:qe="none"}var lt=document.createElement("div");if(lt.style.display="flex",lt.style.flexGrow="2",lt.style.alignItems="center",lt.style.justifyContent="space-between",lt.style.padding="5px",lt.style.borderWidth="2px",lt.style.borderStyle="solid",lt.style.borderColor=qe===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",lt.addEventListener("click",function(){a.setCurrentType(qe,lt)}),u.appendChild(lt),qe==="both"||qe==="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",lt.appendChild(He)}var Ct=document.createElement("div");Ct.style.display="flex",Ct.style.alignItems="center",Ct.style.minHeight="20px",Ct.style.flexGrow="2";var Lt=document.createElement("hr");if(Lt.style.minWidth="20px",Lt.style.border="0px",Lt.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),Lt.style.flexGrow="2",Ct.appendChild(Lt),lt.appendChild(Ct),qe==="both"||qe==="end"){var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.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>`,Vt.style.marginRight="5px",lt.appendChild(Vt)}h.typeBoxes.push(lt)},h=this,U=0;U<4;U++)d(U);return u},o.prototype.setCurrentType=function(a,u){var d=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings!==void 0?d.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Me),X=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||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 H("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var d=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-d/2+","+(u+h/2)+" "+a+","+(u-h/2)+" "+(a+d/2)+","+(u+h/2)},o.prototype.createTips=function(){this.arrow1=R.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(R.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=R.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(R.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",R.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),R.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 d=this.arrow2.transform.baseVal.getItem(0);d.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(d,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}(at),x=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.fillColor=d.defaultFillColor,h.strokeWidth=0,h.fillPanel=new ke("Color",d.defaultColorSet,d.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return ve(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="CoverMarker",o.title="Cover marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',o}(Qe),C=function(c){function o(a,u,d,h){var U=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 U.opacities=[],U.opacityBoxes=[],U.opacities=u,U.currentOpacity=d,U.setCurrentOpacity=U.setCurrentOpacity.bind(U),U}return ve(o,c),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(d){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=d===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(d,h)}),u.appendChild(h);var U=document.createElement("div");U.innerText=100*d+"%",h.appendChild(U),a.opacityBoxes.push(h)}),u},o.prototype.setCurrentOpacity=function(a,u){var d=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===u?d.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Me),k=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=d.defaultHighlightColor,h.strokeWidth=0,h.opacity=d.defaultHighlightOpacity,h.fillPanel=new ke("Color",d.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new C("Opacity",d.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ve(o,c),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&R.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}(x),A='<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>',me=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||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=d.defaultStrokeColor,h.bgColor=d.defaultFillColor,h.fontFamily=d.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 ke("Text color",d.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 ke("Fill color",d.defaultColorSet,h.bgColor,A),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new Be("Font",d.defaultFontFamilies,d.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new Je,h.tipGrip.visual.transform.baseVal.appendItem(R.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return ve(o,c),o.prototype.ownsTarget=function(a){return c.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){R.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=R.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&&(R.setAttributes(this.bgRectangle,[["fill",a]]),R.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),d=this.height/5;a&&(this.tipPosition={x:u+d/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))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+d,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+d}):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))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-d,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+d}):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))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-d,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-d},this.tipBase2Position={x:this.width,y:this.height-u}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(d=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+d,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-d})},o.prototype.resize=function(a){c.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){R.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),ee=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.fillColor=d.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 ke("Line color",$(d.defaultColorSet,["transparent"]),d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new ke("Fill color",$(d.defaultColorSet,["transparent"]),h.fillColor,A),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new st("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new et("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new C("Opacity",d.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=R.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),R.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&&R.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&R.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&R.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&R.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&R.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}($e),Ue=function(c){function o(a,u,d){return c.call(this,a,u,d)||this}return ve(o,c),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=R.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(R.createTransform()),this.visual.appendChild(this.tip1),this.tip2=R.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(R.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&&(R.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()]]),R.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 d=this.tip2.transform.baseVal.getItem(0);d.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(d,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}(at),it=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||this;return h.strokePanel.colors=d.defaultColorSet,h.fillColor="transparent",h}return ve(o,c),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=c.prototype.getState.call(this);return a.typeName=o.typeName,a},o.typeName="EllipseFrameMarker",o.title="Ellipse frame marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(ee),pt=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}(),ht=function(c){function o(a,u,d){var h=c.call(this,a,u,d)||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=d.defaultColor,h.strokeWidth=d.defaultStrokeWidth,h.strokeDasharray=d.defaultStrokeDasharray,h.strokePanel=new ke("Line color",d.defaultColorSet,d.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new st("Line width",d.defaultStrokeWidths,d.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new et("Line style",d.defaultStrokeDasharrays,d.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ve(o,c),o.prototype.ownsTarget=function(a){return!(!c.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorCurve&&a!==this.visibleCurve&&!this.curveGrip.ownsTarget(a))},o.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},o.prototype.createVisual=function(){this.visual=R.createGroup(),this.selectorCurve=R.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=R.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()),R.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),R.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),R.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){c.prototype.setupControlBox.call(this),this.curveControlLine1=R.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=R.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),St=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}(),Et=function(c){function o(a,u,d){var h=c.call(this,a,!1)||this;return h.dataUrl=u,h.state=d,h}return ve(o,c),o}(St),dt=function(c){function o(a,u,d){d===void 0&&(d=!1);var h=c.call(this,a,d)||this;return h.marker=u,h}return ve(o,c),o}(St),Xt=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}(),Nt=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 Oe,this._isOpen=!1,this.undoRedoManager=new pt,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 Xt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=c.instanceCounter++,this.styles=new de(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[ot,q,X,Ye,it,ee,k,me,Ue,x,at,ht]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ot,q,X,Ye,ee,k,me]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ot,q,X,Ye,k]},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 d=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===u});d!==void 0&&a._availableMarkerTypes.push(d)}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&&E.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=E.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new St(o))})},c.prototype.render=function(){return ie(this,void 0,void 0,function(){var o;return le(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new P).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(d){var h=new St(a,!0);d(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(d){return d(new St(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,d=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,d),this._isResizing=!1},c.prototype.scaleMarkers=function(o,a){var u,d=this;this._currentMarker&&this._currentMarker instanceof Ye?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==d._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=R.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 Ee(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 Le(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(d){var h=new dt(o,o._currentMarker,!0);d(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(d){return d(new dt(o,u))})}}},c.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(U){var Fe=new dt(o,void 0,!0);U(Fe),Fe.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(U){var Fe=d.markers[U];d.setCurrentMarker(d.markers[U]),d._currentMarker.dispose(),d.markerImage.removeChild(d._currentMarker.container),d.markers.splice(d.markers.indexOf(d._currentMarker),1),d.eventListeners.markerdelete.forEach(function(qe){return qe(new dt(o,Fe))})},d=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 d=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),d<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new St(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new St(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 St(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 St(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 ie(this,void 0,void 0,function(){var o,a,u=this;return le(this,function(d){switch(d.label){case 0:return[4,this.render()];case 1:return o=d.sent(),a=this.getState(),this.eventListeners.render.forEach(function(h){return h(new Et(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 d=a._availableMarkerTypes.find(function(U){return U.typeName===u.typeName});if(d!==void 0){var h=a.addNewMarker(d);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 St(a))})},c.prototype.addNewMarker=function(o){var a=R.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(d){return d.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(d){return d(new dt(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 q&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(q):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new dt(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 dt(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 dt(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 dt(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 St(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 St(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 Gt=function(c,o){return(Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(a[d]=u[d])})(c,o)};function Wt(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}Gt(c,o),c.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Tt(c,o,a,u){return new(a||(a=Promise))(function(d,h){function U(lt){try{qe(u.next(lt))}catch(He){h(He)}}function Fe(lt){try{qe(u.throw(lt))}catch(He){h(He)}}function qe(lt){var He;lt.done?d(lt.value):(He=lt.value,He instanceof a?He:new a(function(Ct){Ct(He)})).then(U,Fe)}qe((u=u.apply(c,o||[])).next())})}function Hn(c,o){var a,u,d,h,U={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return h={next:Fe(0),throw:Fe(1),return:Fe(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function Fe(qe){return function(lt){return function(He){if(a)throw new TypeError("Generator is already executing.");for(;U;)try{if(a=1,u&&(d=2&He[0]?u.return:He[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,He[1])).done)return d;switch(u=0,d&&(He=[2&He[0],d.value]),He[0]){case 0:case 1:d=He;break;case 4:return U.label++,{value:He[1],done:!1};case 5:U.label++,u=He[1],He=[0];continue;case 7:He=U.ops.pop(),U.trys.pop();continue;default:if(!(d=U.trys,(d=d.length>0&&d[d.length-1])||He[0]!==6&&He[0]!==2)){U=0;continue}if(He[0]===3&&(!d||He[1]>d[0]&&He[1]<d[3])){U.label=He[1];break}if(He[0]===6&&U.label<d[1]){U.label=d[1],d=He;break}if(d&&U.label<d[2]){U.label=d[2],U.ops.push(He);break}d[2]&&U.ops.pop(),U.trys.pop();continue}He=o.call(c,U)}catch(Ct){He=[6,Ct],u=0}finally{a=d=0}if(5&He[0])throw He[1];return{value:He[0]?He[1]:void 0,done:!0}}([qe,lt])}}}var ai=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}(),yt=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,d=a;u<d.length;u++){var h=d[u],U=h[0],Fe=h[1];o.setAttribute(U,Fe)}},c.createRect=function(o,a,u){var d=document.createElementNS("http://www.w3.org/2000/svg","rect");return d.setAttribute("width",o.toString()),d.setAttribute("height",a.toString()),u&&c.setAttributes(d,u),d},c.createLine=function(o,a,u,d,h){var U=document.createElementNS("http://www.w3.org/2000/svg","line");return U.setAttribute("x1",o.toString()),U.setAttribute("y1",a.toString()),U.setAttribute("x2",u.toString()),U.setAttribute("y2",d.toString()),h&&c.setAttributes(U,h),U},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 d=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return d.setAttribute("cx",(o/2).toString()),d.setAttribute("cy",(a/2).toString()),d.setAttribute("rx",(o/2).toString()),d.setAttribute("ry",(a/2).toString()),u&&c.setAttributes(d,u),d},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,d,h,U,Fe){var qe=document.createElementNS("http://www.w3.org/2000/svg","marker");return c.setAttributes(qe,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",d.toString()],["refX",h.toString()],["refY",U.toString()]]),qe.appendChild(Fe),qe},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,d,h,U,Fe,qe){return"M"+o+","+a+"V"+(a+d)+"H"+(o+u)+"V"+a+"H"+h+"V"+U+"H"+(h+Fe)+"V"+(U+qe)+"H"+h+"V"+a+"Z"},c}(),Xn=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 on("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new on("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new on("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new fn("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new fn("_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}(),on=function(c,o){this.selector=c,this.style=o},fn=function(c,o){this.localName=c,this.style=o},zn=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}(),si=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}(),li=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.buttons=[],a}return Wt(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}(si),Dt=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}(),ft=function(c){function o(){var a=c!==null&&c.apply(this,arguments)||this;return a.elements=[],a}return Wt(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}(si),Pn=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 Pn(o,a),d=u.ratio>=1?20:u.getHorizontalLength(20),h=u.ratio<1?20:u.getVerticalLength(20),U=document.createElementNS("http://www.w3.org/2000/svg","svg");U.setAttribute("xmlns","http://www.w3.org/2000/svg"),U.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(U);var Fe=yt.createDefs();U.appendChild(Fe);var qe=yt.createElement("clipPath",[["id","text-bg-clip"]]);Fe.appendChild(qe);var lt=yt.createPath(yt.getHollowRectanglePath((24-d)/2,(24-h)/2,d,h,(24-d)/2+2,(24-h)/2+2,d-4,h-4));U.appendChild(lt);var He=yt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);He.appendChild(yt.createTSpan(o+":"+a)),U.appendChild(He);var Ct=He.getBBox();yt.setAttributes(He,[["x",((24-Ct.width)/2).toString()],["y",((24-Ct.height)/2-Ct.y).toString()]]);var Lt=yt.createPath(yt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Ct.width))/2,(24-Math.ceil(Ct.height))/2,Math.ceil(Ct.width),Math.ceil(Ct.height)));return qe.appendChild(Lt),yt.setAttributes(lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(U),U.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}(),Cn=function(c){function o(a,u,d){var h=c.call(this,a,u)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=d,h}return Wt(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}(Dt),At=function(){function c(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=yt.createGroup(),this.visual.appendChild(yt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(yt.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 yt.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},c}(),Nn=function(){function c(o,a,u,d){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=d,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&&yt.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=yt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=yt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(yt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(yt.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=yt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new At(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new At(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),yt.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,U){var Fe=a.y+u*(U+1);yt.setAttributes(h,[["x1",""+a.x],["y1",""+Fe],["x2",""+(a.x+a.width)],["y2",""+Fe]])});var d=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,U){var Fe=a.x+d*(U+1);yt.setAttributes(h,[["x1",""+Fe],["y1",""+a.y],["x2",""+Fe],["y2",""+(a.y+a.height)]])}),yt.setAttributes(this.cropShadeElement,[["d",yt.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,d=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+=d,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+=d}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),d=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<d/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=d,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,d,h,U){var Fe=u/o,qe=d/a;return{x:(h.x-U)*Fe+U,y:(h.y-U)*qe+U,width:h.width*Fe,height:h.height*qe}},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}(),$n=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();yt.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 d=u%5==0?this.height/3:this.height/6;a+="h4v"+-d+"h1v"+d}a+="v1H0Z",this.scaleShape=yt.createPath(a);var h=yt.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=yt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=yt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var U=yt.createTSpan("");return U.innerHTML="°",this.angleLabelElement.appendChild(U),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},c}(),hi=function(){function c(){this.naturalSize=!1,this.imageType="image/png"}return c.prototype.rasterize=function(o,a,u,d,h,U,Fe){var qe=this;return new Promise(function(lt){var He=document.createElement("canvas");He.width=o.width.baseVal.value-2*d,He.height=o.height.baseVal.value-2*d;var Ct=1,Lt=1;qe.naturalSize===!0?(Ct=a.naturalWidth/(o.width.baseVal.value-2*d)/U,Lt=a.naturalHeight/(o.height.baseVal.value-2*d)/Fe,He.width=a.naturalWidth/U,He.height=a.naturalHeight/Fe):qe.width!==void 0&&qe.height!==void 0&&(Ct=qe.width/u.width,Lt=qe.height/u.height,He.width*=Ct,He.height*=Lt);var Vt=He.getContext("2d");Vt.translate(He.width/2,He.height/2),Vt.rotate(h*Math.PI/180),Vt.scale(U,Fe),Vt.translate(-He.width/2,-He.height/2),Vt.drawImage(a,0,0,He.width,He.height);var In=document.createElement("canvas");In.width=u.width*Ct,In.height=u.height*Lt,In.getContext("2d").putImageData(Vt.getImageData((u.x-d)*Ct,(u.y-d)*Lt,u.width*Ct,u.height*Lt),0,0),lt(In.toDataURL(qe.imageType,qe.imageQuality))})},c}(),Ve=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 Xn(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",yt.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();yt.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=yt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=yt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=yt.createGroup(),this.editingTargetRotationScaleContainer=yt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=yt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=yt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=yt.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=yt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Nn(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 zn,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 li;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Lt){var Vt=new Dt(ui.getIcon(Lt.horizontal,Lt.vertical),Lt.horizontal===0&&Lt.vertical===0?"FREE":Lt.horizontal+":"+Lt.vertical);Vt.onClick=function(){return o.ratioButtonClicked(Lt)},u.push(Vt)}),this.aspectRatioButton=new Cn(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 d=new Dt('<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");d.isActive=this.isGridVisible,d.onClick=function(){o.isGridVisible=!o.isGridVisible,d.isActive=o.isGridVisible},a.addButton(d);var h=new Dt('<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),!ai.isLicensed){var U=new ft;this.topToolbar.addElementBlock(U);var Fe=document.createElement("div");Fe.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var qe=document.createElement("a");qe.style.color="currentColor",qe.href="https://markerjs.com/products/cropro",qe.target="_blank",qe.innerHTML='<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>',Fe.appendChild(qe),U.addElement(Fe)}var lt=new li;lt.minWidth=3*this.toolbarHeight+"px",lt.contentAlign="end",this.topToolbar.addButtonBlock(lt);var He=new Dt('<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,lt.addButton(He),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(He.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Ct=new Dt('<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");Ct.onClick=this.close,lt.addButton(Ct),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Ct.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},c.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new zn,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 li;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Dt('<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 d=new Dt('<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");d.onClick=this.rotateRightButtonClicked,a.addButton(d);var h=new ft;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new $n("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(lt){o.rotateBy(lt),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var U=new li;U.minWidth=2*this.toolbarHeight+"px",U.contentAlign="end",this.bottomToolbar.addButtonBlock(U);var Fe=new Dt('<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");Fe.onClick=this.flipHorizontallyButtonClicked,U.addButton(Fe);var qe=new Dt('<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");qe.onClick=this.flipVerticallyButtonClicked,U.addButton(qe)},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 Pn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},c.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},c.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},c.prototype.restoreState=function(o){if(o){var a=this.cropLayer.getRescaledRect(o.width,o.height,this.imageWidth,this.imageHeight,o.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(a),this.cropRectChanged(a),this.flippedHorizontally=o.flippedHorizontally,this.flippedVertically=o.flippedVertically,this.applyFlip(),this.rotationAngle=o.rotationAngle,this.applyRotation()}},c.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},c.prototype.onWindowResize=function(){this.positionUI()},c.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var o=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=o+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},c.prototype.rotateLeftButtonClicked=function(){var o=this.rotationAngle-90;this.rotationAngle%90!=0&&(o+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateRightButtonClicked=function(){var o=this.rotationAngle+90;this.rotationAngle%90!=0&&(o-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(o)},c.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},c.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},c.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},c.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},c.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},c.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},c.prototype.startRenderAndClose=function(){return Tt(this,void 0,void 0,function(){var o,a;return Hn(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(d){return d(o,a)}),this.close(!0),[2]}})})},c.prototype.render=function(){return Tt(this,void 0,void 0,function(){var o;return Hn(this,function(a){switch(a.label){case 0:return(o=new hi).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),yt.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 fn("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 fn("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new fn("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new fn("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 fn("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new fn("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new on("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new on("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new fn("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 fn("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new fn("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 fn("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 fn("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},c.instanceCounter=0,c}(),_t=y("8hTe"),ci=y.n(_t),Ai=/<pre[^>]*>/g;function di(c){var o=document.createElement("div");return o.innerHTML=c,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var Oi=Xe.a=function(c){var o=c.value,a=o===void 0?"":o,u=c.edit,d=u===void 0?!1:u,h=c.className,U=c.showTextOnly,Fe=c.showLines,qe=c.replaces,lt=c.zoomImg,He=c.hasMask,Ct=c.style,Lt=Ct===void 0?{}:Ct,Vt=c.stylesPrev,In=Vt===void 0?{}:Vt,jn=String(a),an=Object(K.useRef)(),Gn=Object(K.useRef)(),zi=Object(K.useState)(""),_n=Object(N.a)(zi,2),Bn=_n[0],Ln=_n[1],vi=Object(K.useState)("office"),Yn=Object(N.a)(vi,2),fi=Yn[0],ti=Yn[1],cr=function(){var It=new Ve(Gn.current);It.displayMode="popup",It.addRenderEventListener(function(){var pn=Object(se.a)(J.a.mark(function Pt(en){var Ut;return J.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return an.current.style.display="none",Qt.next=3,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:en}});case 3:Ut=Qt.sent,Ut!=null&&Ut.id&&qe(Gn.current.getAttribute("src").replace(M.a.API_SERVER,""),"/api/attachments/".concat(Ut==null?void 0:Ut.id,"?type=").concat(Ut.content_type));case 5:case"end":return Qt.stop()}},Pt)}));return function(Pt){return pn.apply(this,arguments)}}()),It.show()},Gi=function(){var It=new Nt(Gn.current);It.settings.displayMode="popup",It.addEventListener("render",function(){var pn=Object(se.a)(J.a.mark(function Pt(en){var Ut;return J.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(an.current.style.display="none",!Gn.current){Qt.next=6;break}return Qt.next=4,Object(Re.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:en.dataUrl}});case 4:Ut=Qt.sent,Ut!=null&&Ut.id&&qe(Gn.current.getAttribute("src").replace(M.a.API_SERVER,""),"/api/attachments/".concat(Ut==null?void 0:Ut.id,"?type=").concat(Ut.content_type));case 6:case"end":return Qt.stop()}},Pt)}));return function(Pt){return pn.apply(this,arguments)}}()),It.show(),window.markerArea=It},Jn=Object(K.useMemo)(function(){try{var Jt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,It=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;jn=jn.replace(Jt,"("+M.a.API_SERVER+"/api/attachments/").replace(It,'"'+M.a.API_SERVER+"/api/attachments/").replace(pn,'"'+M.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,`
|
|
`),jn=jn.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(ni){}var Pt=T(jn),en=re();if(jn.match(/\[TOC\]/)&&(Pt=Pt.replace("<p>[TOC]</p>",ze()),Ke()),Pt=Pt.replace(/(__special_katext_id_\d+__)/g,function(ni,Qt){var wn=en[Qt],Vi=wn.type,Ki=wn.expression;return Object(ne.renderToString)(di(Ki)||"",{displayMode:Vi==="block",throwOnError:!1,output:"html"})}),Pt=Pt.replace(/▁/g,"\u2581\u2581\u2581"),j(),U){var Ut=document.createElement("div");return Ut.innerHTML=Pt,Ut.innerText}return setTimeout(function(){return Mi()},500),Pt},[jn]),Un=Object(K.useRef)();_e.WebkitLineClamp=Fe,Fe&&(Lt=Object(Se.a)(Object(Se.a)({},Lt),_e));function Li(Jt){var It=Jt.target;if(It.tagName.toUpperCase()==="IMG"){if(lt){var pn=It.getAttribute("src");Ln(pn),ti("image")}}else if(It.tagName.toUpperCase()==="A"){var Pt=It.getAttribute("href");if(Pt.indexOf("office")>-1)Jt.preventDefault(),Ln(Pt),ti("office");else if(Pt.indexOf("application/pdf")>-1)Jt.preventDefault(),Ln(Pt),ti("pdf");else if(Pt.indexOf("type=text")>-1)Jt.preventDefault(),Ln(Pt),ti("html");else if(Pt.startsWith("#")){Jt.preventDefault();var en=document.getElementById(Pt.replace("#",""));en&&en.scrollIntoView(!0)}}}var Mi=function(){var It,pn=(It=Un.current)===null||It===void 0?void 0:It.querySelectorAll("video");pn==null||pn.forEach(function(Pt){if(Pt.oncontextmenu=function(){return!1},Pt.src.indexOf(".m3u8")>-1&&!Pt.canPlayType("application/vnd.apple.mpegurl")){if(_.a.isSupported()){var en=new _.a;en.loadSource(Pt.src),en.attachMedia(Pt)}}})};Object(K.useEffect)(function(){if(Un.current&&Jn&&(Jn.match(Ai)&&window.PR.prettyPrint()),Un.current)return Un.current.addEventListener("click",Li),function(){Un.current.removeEventListener("click",Li),j(),Ke()}},[Jn,Un.current,Li]);var dr=function(It){if(!d)return;It.target.nodeName==="IMG"?(an.current.style.display="flex",an.current.style.width=It.target.clientWidth+"px",an.current.style.height=It.target.clientHeight+"px",an.current.style.top=It.target.offsetTop+"px",an.current.style.left=It.target.offsetLeft+"px",Gn.current.src=It.target.getAttribute("src")):an.current.style.display="none"};return D.a.createElement("div",{style:{position:"relative"}},D.a.createElement("div",{ref:Un,style:Object(Se.a)({},Lt),className:"".concat(h||""," markdown-body ").concat(ci.a.mdBody),onMouseOver:dr,dangerouslySetInnerHTML:{__html:Jn}}),D.a.createElement("div",{ref:an,className:ci.a.button},D.a.createElement(Te.a,null,D.a.createElement(De.a,{onClick:function(){return cr()}},"\u88C1\u526A"),D.a.createElement(De.a,{onClick:function(){return Gi()}},"\u7F16\u8F91"))),D.a.createElement("img",{ref:Gn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),D.a.createElement(we.a,{close:!0,data:Bn,hasMask:He,type:Bn!=null&&Bn.length?fi:"",style:Object(Se.a)({},In),onClose:function(){return Ln("")}}))}},"9VGf":function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return ye});var Q=y("q1tI"),Te=y.n(Q);function ye(De,Se){var se=Object(Q.useRef)();Object(Q.useEffect)(function(){se.current=De}),Object(Q.useEffect)(function(){function N(){se.current()}if(Se!==null){var te=setInterval(N,Se);return function(){return clearInterval(te)}}},[Se])}},Bd2K:function(ct,Xe,y){(function(Q){Q(y("VrN/"),y("osHv"))})(function(Q){Q.defineOption("autoCloseTags",!1,function(J,K,D){if(D!=Q.Init&&D&&J.removeKeyMap("autoCloseTags"),!K)return;var B={name:"autoCloseTags"};(typeof K!="object"||K.whenClosing!==!1)&&(B["'/'"]=function(oe){return se(oe)}),(typeof K!="object"||K.whenOpening!==!1)&&(B["'>'"]=function(oe){return De(oe)}),J.addKeyMap(B)});var Te=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ye=["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 De(J){if(J.getOption("disableInput"))return Q.Pass;for(var K=J.listSelections(),D=[],B=J.getOption("autoCloseTags"),oe=0;oe<K.length;oe++){if(!K[oe].empty())return Q.Pass;var V=K[oe].head,F=J.getTokenAt(V),Y=Q.innerMode(J.getMode(),F.state),W=Y.state,Z=Y.mode.xmlCurrentTag&&Y.mode.xmlCurrentTag(W),ue=Z&&Z.name;if(!ue)return Q.Pass;var je=Y.mode.configuration=="html",Ke=typeof B=="object"&&B.dontCloseTags||je&&Te,_e=typeof B=="object"&&B.indentTags||je&&ye;F.end>V.ch&&(ue=ue.slice(0,ue.length-F.end+V.ch));var ge=ue.toLowerCase();if(!ue||F.type=="string"&&(F.end!=V.ch||!/[\"\']/.test(F.string.charAt(F.string.length-1))||F.string.length==1)||F.type=="tag"&&Z.close||F.string.indexOf("/")==V.ch-F.start-1||Ke&&N(Ke,ge)>-1||te(J,Y.mode.xmlCurrentContext&&Y.mode.xmlCurrentContext(W)||[],ue,V,!0))return Q.Pass;var ze=typeof B=="object"&&B.emptyTags;if(ze&&N(ze,ue)>-1){D[oe]={text:"/>",newPos:Q.Pos(V.line,V.ch+2)};continue}var fe=_e&&N(_e,ge)>-1;D[oe]={indent:fe,text:">"+(fe?`
|
|
|
|
`:"")+"</"+ue+">",newPos:fe?Q.Pos(V.line+1,0):Q.Pos(V.line,V.ch+1)}}for(var Ce=typeof B=="object"&&B.dontIndentOnAutoClose,oe=K.length-1;oe>=0;oe--){var Pe=D[oe];J.replaceRange(Pe.text,K[oe].head,K[oe].anchor,"+insert");var pe=J.listSelections().slice(0);pe[oe]={head:Pe.newPos,anchor:Pe.newPos},J.setSelections(pe),!Ce&&Pe.indent&&(J.indentLine(Pe.newPos.line,null,!0),J.indentLine(Pe.newPos.line+1,null,!0))}}function Se(J,K){for(var D=J.listSelections(),B=[],oe=K?"/":"</",V=J.getOption("autoCloseTags"),F=typeof V=="object"&&V.dontIndentOnSlash,Y=0;Y<D.length;Y++){if(!D[Y].empty())return Q.Pass;var W=D[Y].head,Z=J.getTokenAt(W),ue=Q.innerMode(J.getMode(),Z.state),je=ue.state;if(K&&(Z.type=="string"||Z.string.charAt(0)!="<"||Z.start!=W.ch-1))return Q.Pass;var Ke,_e=ue.mode.name!="xml"&&J.getMode().name=="htmlmixed";if(_e&&ue.mode.name=="javascript")Ke=oe+"script";else if(_e&&ue.mode.name=="css")Ke=oe+"style";else{var ge=ue.mode.xmlCurrentContext&&ue.mode.xmlCurrentContext(je);if(!ge||ge.length&&te(J,ge,ge[ge.length-1],W))return Q.Pass;Ke=oe+ge[ge.length-1]}J.getLine(W.line).charAt(Z.end)!=">"&&(Ke+=">"),B[Y]=Ke}if(J.replaceSelections(B),D=J.listSelections(),!F)for(var Y=0;Y<D.length;Y++)(Y==D.length-1||D[Y].head.line<D[Y+1].head.line)&&J.indentLine(D[Y].head.line)}function se(J){return J.getOption("disableInput")?Q.Pass:Se(J,!0)}Q.commands.closeTag=function(J){return Se(J)};function N(J,K){if(J.indexOf)return J.indexOf(K);for(var D=0,B=J.length;D<B;++D)if(J[D]==K)return D;return-1}function te(J,K,D,B,oe){if(!Q.scanForClosingTag)return!1;var V=Math.min(J.lastLine()+1,B.line+500),F=Q.scanForClosingTag(J,B,null,V);if(!F||F.tag!=D)return!1;for(var Y=oe?1:0,W=K.length-1;W>=0&&K[W]==D;W--)++Y;B=F.to;for(var W=1;W<Y;W++){var Z=Q.scanForClosingTag(J,B,null,V);if(!Z||Z.tag!=D)return!1;B=Z.to}return!0}})},BjJ7:function(ct,Xe,y){"use strict";y.d(Xe,"d",function(){return Te}),y.d(Xe,"c",function(){return ye}),y.d(Xe,"e",function(){return De}),y.d(Xe,"b",function(){return Se}),y.d(Xe,"a",function(){return N});var Q=y("m3rI");function Te(te){var J=!0;if(te.length>0){for(var K=0;K<te.length;K++)if(te[K].compile_success==0||!te[K].compile_success){J=!1;break}}else J=!1;return J}function ye(te){for(var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",K=[],D=0;D<te.length;D++){var B=te[D],oe=J?"".concat(J,"/").concat(B.name):"".concat(B.name);K.push({title:B.name,isLeaf:!(B.type==="tree"),key:oe})}return K}function De(te,J,K){for(var D=0;D<te.length;D++){var B=te[D];if(B.key===J){B.children=K;break}B.children&&De(B.children,J,K)}return te}function Se(te,J,K){var D;return function(){var B=this,oe=arguments,V=function(){D=null,K||te.apply(B,oe)},F=K&&!D;clearTimeout(D),D=setTimeout(V,J),F&&te.apply(B,oe)}}var se=!0,N=Q.a.API_SERVER},"C+DQ":function(ct,Xe,y){},DlQD:function(ct,Xe,y){(function(Q,Te){ct.exports=Te()})(this,function(){"use strict";function Q(q,H){for(var X=0;X<H.length;X++){var x=H[X];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(q,x.key,x)}}function Te(q,H,X){return H&&Q(q.prototype,H),X&&Q(q,X),q}function ye(q,H){if(!q)return;if(typeof q=="string")return De(q,H);var X=Object.prototype.toString.call(q).slice(8,-1);if(X==="Object"&&q.constructor&&(X=q.constructor.name),X==="Map"||X==="Set")return Array.from(q);if(X==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(X))return De(q,H)}function De(q,H){(H==null||H>q.length)&&(H=q.length);for(var X=0,x=new Array(H);X<H;X++)x[X]=q[X];return x}function Se(q,H){var X;if(typeof Symbol=="undefined"||q[Symbol.iterator]==null){if(Array.isArray(q)||(X=ye(q))||H&&q&&typeof q.length=="number"){X&&(q=X);var x=0;return function(){return x>=q.length?{done:!0}:{done:!1,value:q[x++]}}}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 X=q[Symbol.iterator](),X.next.bind(X)}function se(q,H){return H={exports:{}},q(H,H.exports),H.exports}var N=se(function(q){function H(){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 X(x){q.exports.defaults=x}q.exports={defaults:H(),getDefaults:H,changeDefaults:X}}),te=N.defaults,J=N.getDefaults,K=N.changeDefaults,D=/[&<>"']/,B=/[&<>"']/g,oe=/[<>"']|&(?!#?\w+;)/,V=/[<>"']|&(?!#?\w+;)/g,F={"&":"&","<":"<",">":">",'"':""","'":"'"},Y=function(H){return F[H]};function W(q,H){if(H){if(D.test(q))return q.replace(B,Y)}else if(oe.test(q))return q.replace(V,Y);return q}var Z=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function ue(q){return q.replace(Z,function(H,X){return X=X.toLowerCase(),X==="colon"?":":X.charAt(0)==="#"?X.charAt(1)==="x"?String.fromCharCode(parseInt(X.substring(2),16)):String.fromCharCode(+X.substring(1)):""})}var je=/(^|[^\[])\^/g;function Ke(q,H){q=q.source||q,H=H||"";var X={replace:function(C,k){return k=k.source||k,k=k.replace(je,"$1"),q=q.replace(C,k),X},getRegex:function(){return new RegExp(q,H)}};return X}var _e=/[^\w:]/g,ge=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ze(q,H,X){if(q){var x;try{x=decodeURIComponent(ue(X)).replace(_e,"").toLowerCase()}catch(C){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}H&&!ge.test(X)&&(X=w(H,X));try{X=encodeURI(X).replace(/%25/g,"%")}catch(C){return null}return X}var fe={},Ce=/^[^:]+:\/*[^/]*$/,Pe=/^([^:]+:)[\s\S]*$/,pe=/^([^:]+:\/*[^/]*)[\s\S]*$/;function w(q,H){fe[" "+q]||(Ce.test(q)?fe[" "+q]=q+"/":fe[" "+q]=he(q,"/",!0)),q=fe[" "+q];var X=q.indexOf(":")===-1;return H.substring(0,2)==="//"?X?H:q.replace(Pe,"$1")+H:H.charAt(0)==="/"?X?H:q.replace(pe,"$1")+H:q+H}var re={exec:function(){}};function j(q){for(var H=1,X,x;H<arguments.length;H++){X=arguments[H];for(x in X)Object.prototype.hasOwnProperty.call(X,x)&&(q[x]=X[x])}return q}function S(q,H){var X=q.replace(/\|/g,function(k,A,me){for(var ee=!1,Ue=A;--Ue>=0&&me[Ue]==="\\";)ee=!ee;return ee?"|":" |"}),x=X.split(/ \|/),C=0;if(x.length>H)x.splice(H);else for(;x.length<H;)x.push("");for(;C<x.length;C++)x[C]=x[C].trim().replace(/\\\|/g,"|");return x}function he(q,H,X){var x=q.length;if(x===0)return"";for(var C=0;C<x;){var k=q.charAt(x-C-1);if(k===H&&!X)C++;else if(k!==H&&X)C++;else break}return q.substr(0,x-C)}function z(q,H){if(q.indexOf(H[1])===-1)return-1;for(var X=q.length,x=0,C=0;C<X;C++)if(q[C]==="\\")C++;else if(q[C]===H[0])x++;else if(q[C]===H[1]&&(x--,x<0))return C;return-1}function O(q){q&&q.sanitize&&!q.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 T={escape:W,unescape:ue,edit:Ke,cleanUrl:ze,resolveUrl:w,noopTest:re,merge:j,splitCells:S,rtrim:he,findClosingBracket:z,checkSanitizeDeprecation:O},m=N.defaults,p=T.rtrim,_=T.splitCells,M=T.escape,ne=T.findClosingBracket;function we(q,H,X){var x=H.href,C=H.title?M(H.title):null,k=q[1].replace(/\\([\[\]])/g,"$1");return q[0].charAt(0)!=="!"?{type:"link",raw:X,href:x,title:C,text:k}:{type:"image",raw:X,href:x,title:C,text:M(k)}}function Re(q,H){var X=q.match(/^(\s+)(?:```)/);if(X===null)return H;var x=X[1];return H.split(`
|
|
`).map(function(C){var k=C.match(/^\s+/);if(k===null)return C;var A=k[0];return A.length>=x.length?C.slice(x.length):C}).join(`
|
|
`)}var be=function(){function q(X){this.options=X||m}var H=q.prototype;return H.space=function(x){var C=this.rules.block.newline.exec(x);if(C)return C[0].length>1?{type:"space",raw:C[0]}:{raw:`
|
|
`}},H.code=function(x,C){var k=this.rules.block.code.exec(x);if(k){var A=C[C.length-1];if(A&&A.type==="paragraph")return{raw:k[0],text:k[0].trimRight()};var me=k[0].replace(/^ {4}/gm,"");return{type:"code",raw:k[0],codeBlockStyle:"indented",text:this.options.pedantic?me:p(me,`
|
|
`)}}},H.fences=function(x){var C=this.rules.block.fences.exec(x);if(C){var k=C[0],A=Re(k,C[3]||"");return{type:"code",raw:k,lang:C[2]?C[2].trim():C[2],text:A}}},H.heading=function(x){var C=this.rules.block.heading.exec(x);if(C)return{type:"heading",raw:C[0],depth:C[1].length,text:C[2]}},H.nptable=function(x){var C=this.rules.block.nptable.exec(x);if(C){var k={type:"table",header:_(C[1].replace(/^ *| *\| *$/g,"")),align:C[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:C[3]?C[3].replace(/\n$/,"").split(`
|
|
`):[],raw:C[0]};if(k.header.length===k.align.length){var A=k.align.length,me;for(me=0;me<A;me++)/^ *-+: *$/.test(k.align[me])?k.align[me]="right":/^ *:-+: *$/.test(k.align[me])?k.align[me]="center":/^ *:-+ *$/.test(k.align[me])?k.align[me]="left":k.align[me]=null;for(A=k.cells.length,me=0;me<A;me++)k.cells[me]=_(k.cells[me],k.header.length);return k}}},H.hr=function(x){var C=this.rules.block.hr.exec(x);if(C)return{type:"hr",raw:C[0]}},H.blockquote=function(x){var C=this.rules.block.blockquote.exec(x);if(C){var k=C[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:C[0],text:k}}},H.list=function(x){var C=this.rules.block.list.exec(x);if(C){for(var k=C[0],A=C[2],me=A.length>1,ee=A[A.length-1]===")",Ue={type:"list",raw:k,ordered:me,start:me?+A.slice(0,-1):"",loose:!1,items:[]},it=C[0].match(this.rules.block.item),pt=!1,ht,St,Et,dt,Xt,Nt,Gt,Wt=it.length,Tt=0;Tt<Wt;Tt++)ht=it[Tt],k=ht,St=ht.length,ht=ht.replace(/^ *([*+-]|\d+[.)]) */,""),~ht.indexOf(`
|
|
`)&&(St-=ht.length,ht=this.options.pedantic?ht.replace(/^ {1,4}/gm,""):ht.replace(new RegExp("^ {1,"+St+"}","gm"),"")),Tt!==Wt-1&&(Et=this.rules.block.bullet.exec(it[Tt+1])[0],(me?Et.length===1||!ee&&Et[Et.length-1]===")":Et.length>1||this.options.smartLists&&Et!==A)&&(dt=it.slice(Tt+1).join(`
|
|
`),Ue.raw=Ue.raw.substring(0,Ue.raw.length-dt.length),Tt=Wt-1)),Xt=pt||/\n\n(?!\s*$)/.test(ht),Tt!==Wt-1&&(pt=ht.charAt(ht.length-1)===`
|
|
`,Xt||(Xt=pt)),Xt&&(Ue.loose=!0),Nt=/^\[[ xX]\] /.test(ht),Gt=void 0,Nt&&(Gt=ht[1]!==" ",ht=ht.replace(/^\[[ xX]\] +/,"")),Ue.items.push({type:"list_item",raw:k,task:Nt,checked:Gt,loose:Xt,text:ht});return Ue}},H.html=function(x){var C=this.rules.block.html.exec(x);if(C)return{type:this.options.sanitize?"paragraph":"html",raw:C[0],pre:!this.options.sanitizer&&(C[1]==="pre"||C[1]==="script"||C[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(C[0]):M(C[0]):C[0]}},H.def=function(x){var C=this.rules.block.def.exec(x);if(C){C[3]&&(C[3]=C[3].substring(1,C[3].length-1));var k=C[1].toLowerCase().replace(/\s+/g," ");return{tag:k,raw:C[0],href:C[2],title:C[3]}}},H.table=function(x){var C=this.rules.block.table.exec(x);if(C){var k={type:"table",header:_(C[1].replace(/^ *| *\| *$/g,"")),align:C[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:C[3]?C[3].replace(/\n$/,"").split(`
|
|
`):[]};if(k.header.length===k.align.length){k.raw=C[0];var A=k.align.length,me;for(me=0;me<A;me++)/^ *-+: *$/.test(k.align[me])?k.align[me]="right":/^ *:-+: *$/.test(k.align[me])?k.align[me]="center":/^ *:-+ *$/.test(k.align[me])?k.align[me]="left":k.align[me]=null;for(A=k.cells.length,me=0;me<A;me++)k.cells[me]=_(k.cells[me].replace(/^ *\| *| *\| *$/g,""),k.header.length);return k}}},H.lheading=function(x){var C=this.rules.block.lheading.exec(x);if(C)return{type:"heading",raw:C[0],depth:C[2].charAt(0)==="="?1:2,text:C[1]}},H.paragraph=function(x){var C=this.rules.block.paragraph.exec(x);if(C)return{type:"paragraph",raw:C[0],text:C[1].charAt(C[1].length-1)===`
|
|
`?C[1].slice(0,-1):C[1]}},H.text=function(x,C){var k=this.rules.block.text.exec(x);if(k){var A=C[C.length-1];return A&&A.type==="text"?{raw:k[0],text:k[0]}:{type:"text",raw:k[0],text:k[0]}}},H.escape=function(x){var C=this.rules.inline.escape.exec(x);if(C)return{type:"escape",raw:C[0],text:M(C[1])}},H.tag=function(x,C,k){var A=this.rules.inline.tag.exec(x);if(A)return!C&&/^<a /i.test(A[0])?C=!0:C&&/^<\/a>/i.test(A[0])&&(C=!1),!k&&/^<(pre|code|kbd|script)(\s|>)/i.test(A[0])?k=!0:k&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(A[0])&&(k=!1),{type:this.options.sanitize?"text":"html",raw:A[0],inLink:C,inRawBlock:k,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(A[0]):M(A[0]):A[0]}},H.link=function(x){var C=this.rules.inline.link.exec(x);if(C){var k=ne(C[2],"()");if(k>-1){var A=C[0].indexOf("!")===0?5:4,me=A+C[1].length+k;C[2]=C[2].substring(0,k),C[0]=C[0].substring(0,me).trim(),C[3]=""}var ee=C[2],Ue="";if(this.options.pedantic){var it=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ee);it?(ee=it[1],Ue=it[3]):Ue=""}else Ue=C[3]?C[3].slice(1,-1):"";ee=ee.trim().replace(/^<([\s\S]*)>$/,"$1");var pt=we(C,{href:ee&&ee.replace(this.rules.inline._escapes,"$1"),title:Ue&&Ue.replace(this.rules.inline._escapes,"$1")},C[0]);return pt}},H.reflink=function(x,C){var k;if((k=this.rules.inline.reflink.exec(x))||(k=this.rules.inline.nolink.exec(x))){var A=(k[2]||k[1]).replace(/\s+/g," ");if(A=C[A.toLowerCase()],!A||!A.href){var me=k[0].charAt(0);return{type:"text",raw:me,text:me}}var ee=we(k,A,k[0]);return ee}},H.strong=function(x,C,k){k===void 0&&(k="");var A=this.rules.inline.strong.start.exec(x);if(A&&(!A[1]||A[1]&&(k===""||this.rules.inline.punctuation.exec(k)))){C=C.slice(-1*x.length);var me=A[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;me.lastIndex=0;for(var ee;(A=me.exec(C))!=null;)if(ee=this.rules.inline.strong.middle.exec(C.slice(0,A.index+3)),ee)return{type:"strong",raw:x.slice(0,ee[0].length),text:x.slice(2,ee[0].length-2)}}},H.em=function(x,C,k){k===void 0&&(k="");var A=this.rules.inline.em.start.exec(x);if(A&&(!A[1]||A[1]&&(k===""||this.rules.inline.punctuation.exec(k)))){C=C.slice(-1*x.length);var me=A[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;me.lastIndex=0;for(var ee;(A=me.exec(C))!=null;)if(ee=this.rules.inline.em.middle.exec(C.slice(0,A.index+2)),ee)return{type:"em",raw:x.slice(0,ee[0].length),text:x.slice(1,ee[0].length-1)}}},H.codespan=function(x){var C=this.rules.inline.code.exec(x);if(C){var k=C[2].replace(/\n/g," "),A=/[^ ]/.test(k),me=k.startsWith(" ")&&k.endsWith(" ");return A&&me&&(k=k.substring(1,k.length-1)),k=M(k,!0),{type:"codespan",raw:C[0],text:k}}},H.br=function(x){var C=this.rules.inline.br.exec(x);if(C)return{type:"br",raw:C[0]}},H.del=function(x){var C=this.rules.inline.del.exec(x);if(C)return{type:"del",raw:C[0],text:C[1]}},H.autolink=function(x,C){var k=this.rules.inline.autolink.exec(x);if(k){var A,me;return k[2]==="@"?(A=M(this.options.mangle?C(k[1]):k[1]),me="mailto:"+A):(A=M(k[1]),me=A),{type:"link",raw:k[0],text:A,href:me,tokens:[{type:"text",raw:A,text:A}]}}},H.url=function(x,C){var k;if(k=this.rules.inline.url.exec(x)){var A,me;if(k[2]==="@")A=M(this.options.mangle?C(k[0]):k[0]),me="mailto:"+A;else{var ee;do ee=k[0],k[0]=this.rules.inline._backpedal.exec(k[0])[0];while(ee!==k[0]);A=M(k[0]),k[1]==="www."?me="http://"+A:me=A}return{type:"link",raw:k[0],text:A,href:me,tokens:[{type:"text",raw:A,text:A}]}}},H.inlineText=function(x,C,k){var A=this.rules.inline.text.exec(x);if(A){var me;return C?me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(A[0]):M(A[0]):A[0]:me=M(this.options.smartypants?k(A[0]):A[0]),{type:"text",raw:A[0],text:me}}},q}(),ve=T.noopTest,ie=T.edit,le=T.merge,$={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ve,table:ve,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};$._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,$._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,$.def=ie($.def).replace("label",$._label).replace("title",$._title).getRegex(),$.bullet=/(?:[*+-]|\d{1,9}[.)])/,$.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,$.item=ie($.item,"gm").replace(/bull/g,$.bullet).getRegex(),$.list=ie($.list).replace(/bull/g,$.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$.def.source+")").getRegex(),$._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",$._comment=/<!--(?!-?>)[\s\S]*?-->/,$.html=ie($.html,"i").replace("comment",$._comment).replace("tag",$._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$.paragraph=ie($._paragraph).replace("hr",$.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",$._tag).getRegex(),$.blockquote=ie($.blockquote).replace("paragraph",$.paragraph).getRegex(),$.normal=le({},$),$.gfm=le({},$.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*|$)"}),$.gfm.nptable=ie($.gfm.nptable).replace("hr",$.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",$._tag).getRegex(),$.gfm.table=ie($.gfm.table).replace("hr",$.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",$._tag).getRegex(),$.pedantic=le({},$.normal,{html:ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ve,paragraph:ie($.normal._paragraph).replace("hr",$.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",$.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var R={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ve,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ve,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};R._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",R.punctuation=ie(R.punctuation).replace(/punctuation/g,R._punctuation).getRegex(),R._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",R._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",R.em.start=ie(R.em.start).replace(/punctuation/g,R._punctuation).getRegex(),R.em.middle=ie(R.em.middle).replace(/punctuation/g,R._punctuation).replace(/overlapSkip/g,R._overlapSkip).getRegex(),R.em.endAst=ie(R.em.endAst,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.em.endUnd=ie(R.em.endUnd,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.strong.start=ie(R.strong.start).replace(/punctuation/g,R._punctuation).getRegex(),R.strong.middle=ie(R.strong.middle).replace(/punctuation/g,R._punctuation).replace(/blockSkip/g,R._blockSkip).getRegex(),R.strong.endAst=ie(R.strong.endAst,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.strong.endUnd=ie(R.strong.endUnd,"g").replace(/punctuation/g,R._punctuation).getRegex(),R.blockSkip=ie(R._blockSkip,"g").getRegex(),R.overlapSkip=ie(R._overlapSkip,"g").getRegex(),R._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,R._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,R._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])?)+(?![-_])/,R.autolink=ie(R.autolink).replace("scheme",R._scheme).replace("email",R._email).getRegex(),R._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,R.tag=ie(R.tag).replace("comment",$._comment).replace("attribute",R._attribute).getRegex(),R._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,R._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,R.link=ie(R.link).replace("label",R._label).replace("href",R._href).replace("title",R._title).getRegex(),R.reflink=ie(R.reflink).replace("label",R._label).getRegex(),R.reflinkSearch=ie(R.reflinkSearch,"g").replace("reflink",R.reflink).replace("nolink",R.nolink).getRegex(),R.normal=le({},R),R.pedantic=le({},R.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:ie(/^!?\[(label)\]\((.*?)\)/).replace("label",R._label).getRegex(),reflink:ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R._label).getRegex()}),R.gfm=le({},R.normal,{escape:ie(R.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),R.gfm.url=ie(R.gfm.url,"i").replace("email",R.gfm._extended_email).getRegex(),R.breaks=le({},R.gfm,{br:ie(R.br).replace("{2,}","*").getRegex(),text:ie(R.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var b={block:$,inline:R},P=N.defaults,E=b.block,de=b.inline;function xe(q){return q.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 G(q){var H="",X,x,C=q.length;for(X=0;X<C;X++)x=q.charCodeAt(X),Math.random()>.5&&(x="x"+x.toString(16)),H+="&#"+x+";";return H}var Ee=function(){function q(X){this.tokens=[],this.tokens.links=Object.create(null),this.options=X||P,this.options.tokenizer=this.options.tokenizer||new be,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var x={block:E.normal,inline:de.normal};this.options.pedantic?(x.block=E.pedantic,x.inline=de.pedantic):this.options.gfm&&(x.block=E.gfm,this.options.breaks?x.inline=de.breaks:x.inline=de.gfm),this.tokenizer.rules=x}q.lex=function(x,C){var k=new q(C);return k.lex(x)};var H=q.prototype;return H.lex=function(x){return x=x.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(x,this.tokens,!0),this.inline(this.tokens),this.tokens},H.blockTokens=function(x,C,k){C===void 0&&(C=[]),k===void 0&&(k=!0),x=x.replace(/^ +$/gm,"");for(var A,me,ee,Ue;x;){if(A=this.tokenizer.space(x)){x=x.substring(A.raw.length),A.type&&C.push(A);continue}if(A=this.tokenizer.code(x,C)){x=x.substring(A.raw.length),A.type?C.push(A):(Ue=C[C.length-1],Ue.raw+=`
|
|
`+A.raw,Ue.text+=`
|
|
`+A.text);continue}if(A=this.tokenizer.fences(x)){x=x.substring(A.raw.length),C.push(A);continue}if(A=this.tokenizer.heading(x)){x=x.substring(A.raw.length),C.push(A);continue}if(A=this.tokenizer.nptable(x)){x=x.substring(A.raw.length),C.push(A);continue}if(A=this.tokenizer.hr(x)){x=x.substring(A.raw.length),C.push(A);continue}if(A=this.tokenizer.blockquote(x)){x=x.substring(A.raw.length),A.tokens=this.blockTokens(A.text,[],k),C.push(A);continue}if(A=this.tokenizer.list(x)){for(x=x.substring(A.raw.length),ee=A.items.length,me=0;me<ee;me++)A.items[me].tokens=this.blockTokens(A.items[me].text,[],!1);C.push(A);continue}if(A=this.tokenizer.html(x)){x=x.substring(A.raw.length),C.push(A);continue}if(k&&(A=this.tokenizer.def(x))){x=x.substring(A.raw.length),this.tokens.links[A.tag]||(this.tokens.links[A.tag]={href:A.href,title:A.title});continue}if(A=this.tokenizer.table(x)){x=x.substring(A.raw.length),C.push(A);continue}if(A=this.tokenizer.lheading(x)){x=x.substring(A.raw.length),C.push(A);continue}if(k&&(A=this.tokenizer.paragraph(x))){x=x.substring(A.raw.length),C.push(A);continue}if(A=this.tokenizer.text(x,C)){x=x.substring(A.raw.length),A.type?C.push(A):(Ue=C[C.length-1],Ue.raw+=`
|
|
`+A.raw,Ue.text+=`
|
|
`+A.text);continue}if(x){var it="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(it);break}else throw new Error(it)}}return C},H.inline=function(x){var C,k,A,me,ee,Ue,it=x.length;for(C=0;C<it;C++){Ue=x[C];switch(Ue.type){case"paragraph":case"text":case"heading":{Ue.tokens=[],this.inlineTokens(Ue.text,Ue.tokens);break}case"table":{for(Ue.tokens={header:[],cells:[]},me=Ue.header.length,k=0;k<me;k++)Ue.tokens.header[k]=[],this.inlineTokens(Ue.header[k],Ue.tokens.header[k]);for(me=Ue.cells.length,k=0;k<me;k++)for(ee=Ue.cells[k],Ue.tokens.cells[k]=[],A=0;A<ee.length;A++)Ue.tokens.cells[k][A]=[],this.inlineTokens(ee[A],Ue.tokens.cells[k][A]);break}case"blockquote":{this.inline(Ue.tokens);break}case"list":{for(me=Ue.items.length,k=0;k<me;k++)this.inline(Ue.items[k].tokens);break}}}return x},H.inlineTokens=function(x,C,k,A,me){C===void 0&&(C=[]),k===void 0&&(k=!1),A===void 0&&(A=!1),me===void 0&&(me="");var ee,Ue=x,it;if(this.tokens.links){var pt=Object.keys(this.tokens.links);if(pt.length>0)for(;(it=this.tokenizer.rules.inline.reflinkSearch.exec(Ue))!=null;)pt.includes(it[0].slice(it[0].lastIndexOf("[")+1,-1))&&(Ue=Ue.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(it=this.tokenizer.rules.inline.blockSkip.exec(Ue))!=null;)Ue=Ue.slice(0,it.index)+"["+"a".repeat(it[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;x;){if(ee=this.tokenizer.escape(x)){x=x.substring(ee.raw.length),C.push(ee);continue}if(ee=this.tokenizer.tag(x,k,A)){x=x.substring(ee.raw.length),k=ee.inLink,A=ee.inRawBlock,C.push(ee);continue}if(ee=this.tokenizer.link(x)){x=x.substring(ee.raw.length),ee.type==="link"&&(ee.tokens=this.inlineTokens(ee.text,[],!0,A)),C.push(ee);continue}if(ee=this.tokenizer.reflink(x,this.tokens.links)){x=x.substring(ee.raw.length),ee.type==="link"&&(ee.tokens=this.inlineTokens(ee.text,[],!0,A)),C.push(ee);continue}if(ee=this.tokenizer.strong(x,Ue,me)){x=x.substring(ee.raw.length),ee.tokens=this.inlineTokens(ee.text,[],k,A),C.push(ee);continue}if(ee=this.tokenizer.em(x,Ue,me)){x=x.substring(ee.raw.length),ee.tokens=this.inlineTokens(ee.text,[],k,A),C.push(ee);continue}if(ee=this.tokenizer.codespan(x)){x=x.substring(ee.raw.length),C.push(ee);continue}if(ee=this.tokenizer.br(x)){x=x.substring(ee.raw.length),C.push(ee);continue}if(ee=this.tokenizer.del(x)){x=x.substring(ee.raw.length),ee.tokens=this.inlineTokens(ee.text,[],k,A),C.push(ee);continue}if(ee=this.tokenizer.autolink(x,G)){x=x.substring(ee.raw.length),C.push(ee);continue}if(!k&&(ee=this.tokenizer.url(x,G))){x=x.substring(ee.raw.length),C.push(ee);continue}if(ee=this.tokenizer.inlineText(x,A,xe)){x=x.substring(ee.raw.length),me=ee.raw.slice(-1),C.push(ee);continue}if(x){var ht="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(ht);break}else throw new Error(ht)}}return C},Te(q,null,[{key:"rules",get:function(){return{block:E,inline:de}}}]),q}(),Le=N.defaults,Me=T.cleanUrl,ke=T.escape,Ae=function(){function q(X){this.options=X||Le}var H=q.prototype;return H.code=function(x,C,k){var A=(C||"").match(/\S*/)[0];if(this.options.highlight){var me=this.options.highlight(x,A);me!=null&&me!==x&&(k=!0,x=me)}return A?'<pre><code class="'+this.options.langPrefix+ke(A,!0)+'">'+(k?x:ke(x,!0))+`</code></pre>
|
|
`:"<pre><code>"+(k?x:ke(x,!0))+`</code></pre>
|
|
`},H.blockquote=function(x){return`<blockquote>
|
|
`+x+`</blockquote>
|
|
`},H.html=function(x){return x},H.heading=function(x,C,k,A){return this.options.headerIds?"<h"+C+' id="'+this.options.headerPrefix+A.slug(k)+'">'+x+"</h"+C+`>
|
|
`:"<h"+C+">"+x+"</h"+C+`>
|
|
`},H.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},H.list=function(x,C,k){var A=C?"ol":"ul",me=C&&k!==1?' start="'+k+'"':"";return"<"+A+me+`>
|
|
`+x+"</"+A+`>
|
|
`},H.listitem=function(x){return"<li>"+x+`</li>
|
|
`},H.checkbox=function(x){return"<input "+(x?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},H.paragraph=function(x){return"<p>"+x+`</p>
|
|
`},H.table=function(x,C){return C&&(C="<tbody>"+C+"</tbody>"),`<table>
|
|
<thead>
|
|
`+x+`</thead>
|
|
`+C+`</table>
|
|
`},H.tablerow=function(x){return`<tr>
|
|
`+x+`</tr>
|
|
`},H.tablecell=function(x,C){var k=C.header?"th":"td",A=C.align?"<"+k+' align="'+C.align+'">':"<"+k+">";return A+x+"</"+k+`>
|
|
`},H.strong=function(x){return"<strong>"+x+"</strong>"},H.em=function(x){return"<em>"+x+"</em>"},H.codespan=function(x){return"<code>"+x+"</code>"},H.br=function(){return this.options.xhtml?"<br/>":"<br>"},H.del=function(x){return"<del>"+x+"</del>"},H.link=function(x,C,k){if(x=Me(this.options.sanitize,this.options.baseUrl,x),x===null)return k;var A='<a href="'+ke(x)+'"';return C&&(A+=' title="'+C+'"'),A+=">"+k+"</a>",A},H.image=function(x,C,k){if(x=Me(this.options.sanitize,this.options.baseUrl,x),x===null)return k;var A='<img src="'+x+'" alt="'+k+'"';return C&&(A+=' title="'+C+'"'),A+=this.options.xhtml?"/>":">",A},H.text=function(x){return x},q}(),Ne=function(){function q(){}var H=q.prototype;return H.strong=function(x){return x},H.em=function(x){return x},H.codespan=function(x){return x},H.del=function(x){return x},H.html=function(x){return x},H.text=function(x){return x},H.link=function(x,C,k){return""+k},H.image=function(x,C,k){return""+k},H.br=function(){return""},q}(),Je=function(){function q(){this.seen={}}var H=q.prototype;return H.slug=function(x){var C=x.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(C)){var k=C;do this.seen[k]++,C=k+"-"+this.seen[k];while(this.seen.hasOwnProperty(C))}return this.seen[C]=0,C},q}(),We=N.defaults,$e=T.unescape,Qe=function(){function q(X){this.options=X||We,this.options.renderer=this.options.renderer||new Ae,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ne,this.slugger=new Je}q.parse=function(x,C){var k=new q(C);return k.parse(x)};var H=q.prototype;return H.parse=function(x,C){C===void 0&&(C=!0);var k="",A,me,ee,Ue,it,pt,ht,St,Et,dt,Xt,Nt,Gt,Wt,Tt,Hn,ai,yt,Xn=x.length;for(A=0;A<Xn;A++){dt=x[A];switch(dt.type){case"space":continue;case"hr":{k+=this.renderer.hr();continue}case"heading":{k+=this.renderer.heading(this.parseInline(dt.tokens),dt.depth,$e(this.parseInline(dt.tokens,this.textRenderer)),this.slugger);continue}case"code":{k+=this.renderer.code(dt.text,dt.lang,dt.escaped);continue}case"table":{for(St="",ht="",Ue=dt.header.length,me=0;me<Ue;me++)ht+=this.renderer.tablecell(this.parseInline(dt.tokens.header[me]),{header:!0,align:dt.align[me]});for(St+=this.renderer.tablerow(ht),Et="",Ue=dt.cells.length,me=0;me<Ue;me++){for(pt=dt.tokens.cells[me],ht="",it=pt.length,ee=0;ee<it;ee++)ht+=this.renderer.tablecell(this.parseInline(pt[ee]),{header:!1,align:dt.align[ee]});Et+=this.renderer.tablerow(ht)}k+=this.renderer.table(St,Et);continue}case"blockquote":{Et=this.parse(dt.tokens),k+=this.renderer.blockquote(Et);continue}case"list":{for(Xt=dt.ordered,Nt=dt.start,Gt=dt.loose,Ue=dt.items.length,Et="",me=0;me<Ue;me++)Tt=dt.items[me],Hn=Tt.checked,ai=Tt.task,Wt="",Tt.task&&(yt=this.renderer.checkbox(Hn),Gt?Tt.tokens.length>0&&Tt.tokens[0].type==="text"?(Tt.tokens[0].text=yt+" "+Tt.tokens[0].text,Tt.tokens[0].tokens&&Tt.tokens[0].tokens.length>0&&Tt.tokens[0].tokens[0].type==="text"&&(Tt.tokens[0].tokens[0].text=yt+" "+Tt.tokens[0].tokens[0].text)):Tt.tokens.unshift({type:"text",text:yt}):Wt+=yt),Wt+=this.parse(Tt.tokens,Gt),Et+=this.renderer.listitem(Wt,ai,Hn);k+=this.renderer.list(Et,Xt,Nt);continue}case"html":{k+=this.renderer.html(dt.text);continue}case"paragraph":{k+=this.renderer.paragraph(this.parseInline(dt.tokens));continue}case"text":{for(Et=dt.tokens?this.parseInline(dt.tokens):dt.text;A+1<Xn&&x[A+1].type==="text";)dt=x[++A],Et+=`
|
|
`+(dt.tokens?this.parseInline(dt.tokens):dt.text);k+=C?this.renderer.paragraph(Et):Et;continue}default:{var on='Token with "'+dt.type+'" type was not found.';if(this.options.silent){console.error(on);return}else throw new Error(on)}}}return k},H.parseInline=function(x,C){C=C||this.renderer;var k="",A,me,ee=x.length;for(A=0;A<ee;A++){me=x[A];switch(me.type){case"escape":{k+=C.text(me.text);break}case"html":{k+=C.html(me.text);break}case"link":{k+=C.link(me.href,me.title,this.parseInline(me.tokens,C));break}case"image":{k+=C.image(me.href,me.title,me.text);break}case"strong":{k+=C.strong(this.parseInline(me.tokens,C));break}case"em":{k+=C.em(this.parseInline(me.tokens,C));break}case"codespan":{k+=C.codespan(me.text);break}case"br":{k+=C.br();break}case"del":{k+=C.del(this.parseInline(me.tokens,C));break}case"text":{k+=C.text(me.text);break}default:{var Ue='Token with "'+me.type+'" type was not found.';if(this.options.silent){console.error(Ue);return}else throw new Error(Ue)}}}return k},q}(),st=T.merge,et=T.checkSanitizeDeprecation,ot=T.escape,Oe=N.getDefaults,vt=N.changeDefaults,at=N.defaults;function Be(q,H,X){if(typeof q=="undefined"||q===null)throw new Error("marked(): input parameter is undefined or null");if(typeof q!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(q)+", string expected");if(typeof H=="function"&&(X=H,H=null),H=st({},Be.defaults,H||{}),et(H),X){var x=H.highlight,C;try{C=Ee.lex(q,H)}catch(ee){return X(ee)}var k=function(Ue){var it;if(!Ue)try{it=Qe.parse(C,H)}catch(pt){Ue=pt}return H.highlight=x,Ue?X(Ue):X(null,it)};if(!x||x.length<3)return k();if(delete H.highlight,!C.length)return k();var A=0;Be.walkTokens(C,function(ee){ee.type==="code"&&(A++,setTimeout(function(){x(ee.text,ee.lang,function(Ue,it){if(Ue)return k(Ue);it!=null&&it!==ee.text&&(ee.text=it,ee.escaped=!0),A--,A===0&&k()})},0))}),A===0&&k();return}try{var me=Ee.lex(q,H);return H.walkTokens&&Be.walkTokens(me,H.walkTokens),Qe.parse(me,H)}catch(ee){if(ee.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,H.silent)return"<p>An error occurred:</p><pre>"+ot(ee.message+"",!0)+"</pre>";throw ee}}Be.options=Be.setOptions=function(q){return st(Be.defaults,q),vt(Be.defaults),Be},Be.getDefaults=Oe,Be.defaults=at,Be.use=function(q){var H=st({},q);if(q.renderer&&function(){var x=Be.defaults.renderer||new Ae,C=function(me){var ee=x[me];x[me]=function(){for(var Ue=arguments.length,it=new Array(Ue),pt=0;pt<Ue;pt++)it[pt]=arguments[pt];var ht=q.renderer[me].apply(x,it);return ht===!1&&(ht=ee.apply(x,it)),ht}};for(var k in q.renderer)C(k);H.renderer=x}(),q.tokenizer&&function(){var x=Be.defaults.tokenizer||new be,C=function(me){var ee=x[me];x[me]=function(){for(var Ue=arguments.length,it=new Array(Ue),pt=0;pt<Ue;pt++)it[pt]=arguments[pt];var ht=q.tokenizer[me].apply(x,it);return ht===!1&&(ht=ee.apply(x,it)),ht}};for(var k in q.tokenizer)C(k);H.tokenizer=x}(),q.walkTokens){var X=Be.defaults.walkTokens;H.walkTokens=function(x){q.walkTokens(x),X&&X(x)}}Be.setOptions(H)},Be.walkTokens=function(q,H){for(var X=Se(q),x;!(x=X()).done;){var C=x.value;H(C);switch(C.type){case"table":{for(var k=Se(C.tokens.header),A;!(A=k()).done;){var me=A.value;Be.walkTokens(me,H)}for(var ee=Se(C.tokens.cells),Ue;!(Ue=ee()).done;)for(var it=Ue.value,pt=Se(it),ht;!(ht=pt()).done;){var St=ht.value;Be.walkTokens(St,H)}break}case"list":{Be.walkTokens(C.items,H);break}default:C.tokens&&Be.walkTokens(C.tokens,H)}}},Be.Parser=Qe,Be.parser=Qe.parse,Be.Renderer=Ae,Be.TextRenderer=Ne,Be.Lexer=Ee,Be.lexer=Ee.lex,Be.Tokenizer=be,Be.Slugger=Je,Be.parse=Be;var Ye=Be;return Ye})},ELLl:function(ct,Xe,y){(function(Q){Q(y("VrN/"))})(function(Q){var Te={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ye=Q.Pos;Q.defineOption("autoCloseBrackets",!1,function(F,Y,W){W&&W!=Q.Init&&(F.removeKeyMap(Se),F.state.closeBrackets=null),Y&&(se(De(Y,"pairs")),F.state.closeBrackets=Y,F.addKeyMap(Se))});function De(F,Y){return Y=="pairs"&&typeof F=="string"?F:typeof F=="object"&&F[Y]!=null?F[Y]:Te[Y]}var Se={Backspace:J,Enter:K};function se(F){for(var Y=0;Y<F.length;Y++){var W=F.charAt(Y),Z="'"+W+"'";Se[Z]||(Se[Z]=N(W))}}se(Te.pairs+"`");function N(F){return function(Y){return B(Y,F)}}function te(F){var Y=F.state.closeBrackets;if(!Y||Y.override)return Y;var W=F.getModeAt(F.getCursor());return W.closeBrackets||Y}function J(F){var Y=te(F);if(!Y||F.getOption("disableInput"))return Q.Pass;for(var W=De(Y,"pairs"),Z=F.listSelections(),ue=0;ue<Z.length;ue++){if(!Z[ue].empty())return Q.Pass;var je=oe(F,Z[ue].head);if(!je||W.indexOf(je)%2!=0)return Q.Pass}for(var ue=Z.length-1;ue>=0;ue--){var Ke=Z[ue].head;F.replaceRange("",ye(Ke.line,Ke.ch-1),ye(Ke.line,Ke.ch+1),"+delete")}}function K(F){var Y=te(F),W=Y&&De(Y,"explode");if(!W||F.getOption("disableInput"))return Q.Pass;for(var Z=F.listSelections(),ue=0;ue<Z.length;ue++){if(!Z[ue].empty())return Q.Pass;var je=oe(F,Z[ue].head);if(!je||W.indexOf(je)%2!=0)return Q.Pass}F.operation(function(){var Ke=F.lineSeparator()||`
|
|
`;F.replaceSelection(Ke+Ke,null),F.execCommand("goCharLeft"),Z=F.listSelections();for(var _e=0;_e<Z.length;_e++){var ge=Z[_e].head.line;F.indentLine(ge,null,!0),F.indentLine(ge+1,null,!0)}})}function D(F){var Y=Q.cmpPos(F.anchor,F.head)>0;return{anchor:new ye(F.anchor.line,F.anchor.ch+(Y?-1:1)),head:new ye(F.head.line,F.head.ch+(Y?1:-1))}}function B(F,Y){var W=te(F);if(!W||F.getOption("disableInput"))return Q.Pass;var Z=De(W,"pairs"),ue=Z.indexOf(Y);if(ue==-1)return Q.Pass;for(var je=De(W,"closeBefore"),Ke=De(W,"triples"),_e=Z.charAt(ue+1)==Y,ge=F.listSelections(),ze=ue%2==0,fe,Ce=0;Ce<ge.length;Ce++){var Pe=ge[Ce],pe=Pe.head,w,re=F.getRange(pe,ye(pe.line,pe.ch+1));if(ze&&!Pe.empty())w="surround";else if((_e||!ze)&&re==Y)_e&&V(F,pe)?w="both":Ke.indexOf(Y)>=0&&F.getRange(pe,ye(pe.line,pe.ch+3))==Y+Y+Y?w="skipThree":w="skip";else if(_e&&pe.ch>1&&Ke.indexOf(Y)>=0&&F.getRange(ye(pe.line,pe.ch-2),pe)==Y+Y){if(pe.ch>2&&/\bstring/.test(F.getTokenTypeAt(ye(pe.line,pe.ch-2))))return Q.Pass;w="addFour"}else if(_e){var j=pe.ch==0?" ":F.getRange(ye(pe.line,pe.ch-1),pe);if(!Q.isWordChar(re)&&j!=Y&&!Q.isWordChar(j))w="both";else return Q.Pass}else if(ze&&(re.length===0||/\s/.test(re)||je.indexOf(re)>-1))w="both";else return Q.Pass;if(!fe)fe=w;else if(fe!=w)return Q.Pass}var S=ue%2?Z.charAt(ue-1):Y,he=ue%2?Y:Z.charAt(ue+1);F.operation(function(){if(fe=="skip")F.execCommand("goCharRight");else if(fe=="skipThree")for(var z=0;z<3;z++)F.execCommand("goCharRight");else if(fe=="surround"){for(var O=F.getSelections(),z=0;z<O.length;z++)O[z]=S+O[z]+he;F.replaceSelections(O,"around"),O=F.listSelections().slice();for(var z=0;z<O.length;z++)O[z]=D(O[z]);F.setSelections(O)}else fe=="both"?(F.replaceSelection(S+he,null),F.triggerElectric(S+he),F.execCommand("goCharLeft")):fe=="addFour"&&(F.replaceSelection(S+S+S+S,"before"),F.execCommand("goCharRight"))})}function oe(F,Y){var W=F.getRange(ye(Y.line,Y.ch-1),ye(Y.line,Y.ch+1));return W.length==2?W:null}function V(F,Y){var W=F.getTokenAt(ye(Y.line,Y.ch+1));return/\bstring/.test(W.type)&&W.start==Y.ch&&(Y.ch==0||!/\bstring/.test(F.getTokenTypeAt(Y)))}})},GfqC:function(ct,Xe,y){"use strict";var Q=y("q1tI"),Te=y.n(Q),ye=y("TSYQ"),De=y.n(ye);function Se(T,m){var p="cannot "+T.method+" "+T.action+" "+m.status+"'",_=new Error(p);return _.status=m.status,_.method=T.method,_.url=T.action,_}function se(T){var m=T.responseText||T.response;if(!m)return m;try{return JSON.parse(m)}catch(p){return m}}function N(T){var m=new XMLHttpRequest;T.onProgress&&m.upload&&(m.upload.onprogress=function(ne){ne.total>0&&(ne.percent=ne.loaded/ne.total*100),T.onProgress(ne)});var p=new FormData;T.data&&Object.keys(T.data).forEach(function(M){var ne=T.data[M];if(Array.isArray(ne)){ne.forEach(function(we){p.append(M+"[]",we)});return}p.append(M,T.data[M])}),T.file instanceof Blob?p.append(T.filename,T.file,T.file.name):p.append(T.filename,T.file),m.onerror=function(ne){T.onError(ne)},m.onload=function(){return m.status<200||m.status>=300?T.onError(Se(T,m),se(m)):T.onSuccess(se(m),m)},m.open(T.method,T.action,!0),T.withCredentials&&"withCredentials"in m&&(m.withCredentials=!0);var _=T.headers||{};return _["X-Requested-With"]!==null&&m.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(_).forEach(function(M){_[M]!==null&&m.setRequestHeader(M,_[M])}),m.send(p),{abort:function(){m.abort()}}}var te=+new Date,J=0;function K(){return"rc-upload-"+te+"-"+ ++J}function D(T,m){return T.indexOf(m,T.length-m.length)!==-1}var B=function(T,m){if(T&&m){var p=Array.isArray(m)?m:m.split(","),_=T.name||"",M=T.type||"",ne=M.replace(/\/.*$/,"");return p.some(function(we){var Re=we.trim();return Re.charAt(0)==="."?D(_.toLowerCase(),Re.toLowerCase()):/\/\*$/.test(Re)?ne===Re.replace(/\/.*$/,""):M===Re})}return!0};function oe(T,m){var p=T.createReader(),_=[];function M(){p.readEntries(function(ne){var we=Array.prototype.slice.apply(ne);_=_.concat(we);var Re=!we.length;Re?m(_):M()})}M()}var V=function(m,p,_){var M=function ne(we,Re){Re=Re||"",we.isFile?we.file(function(be){_(be)&&(we.fullPath&&!be.webkitRelativePath&&(Object.defineProperties(be,{webkitRelativePath:{writable:!0}}),be.webkitRelativePath=we.fullPath.replace(/^\//,""),Object.defineProperties(be,{webkitRelativePath:{writable:!1}})),p([be]))}):we.isDirectory&&oe(we,function(be){be.forEach(function(ve){ne(ve,""+Re+we.name+"/")})})};m.forEach(function(ne){M(ne.webkitGetAsEntry())})},F=V,Y=Object.assign||function(T){for(var m=1;m<arguments.length;m++){var p=arguments[m];for(var _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(T[_]=p[_])}return T},W=function(){function T(m,p){var _=[],M=!0,ne=!1,we=void 0;try{for(var Re=m[Symbol.iterator](),be;!(M=(be=Re.next()).done)&&!(_.push(be.value),p&&_.length===p);M=!0);}catch(ve){ne=!0,we=ve}finally{try{!M&&Re.return&&Re.return()}finally{if(ne)throw we}}return _}return function(m,p){if(Array.isArray(m))return m;if(Symbol.iterator in Object(m))return T(m,p);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Z=function(){function T(m,p){for(var _=0;_<p.length;_++){var M=p[_];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(m,M.key,M)}}return function(m,p,_){return p&&T(m.prototype,p),_&&T(m,_),m}}();function ue(T,m,p){return m in T?Object.defineProperty(T,m,{value:p,enumerable:!0,configurable:!0,writable:!0}):T[m]=p,T}function je(T,m){var p={};for(var _ in T){if(m.indexOf(_)>=0)continue;if(!Object.prototype.hasOwnProperty.call(T,_))continue;p[_]=T[_]}return p}function Ke(T,m){if(!(T instanceof m))throw new TypeError("Cannot call a class as a function")}function _e(T,m){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:T}function ge(T,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);T.prototype=Object.create(m&&m.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(T,m):T.__proto__=m)}var ze=function(m){return Object.keys(m).reduce(function(p,_){return(_.substr(0,5)==="data-"||_.substr(0,5)==="aria-"||_==="role")&&(p[_]=m[_]),p},{})},fe=function(T){ge(m,T);function m(){var p,_,M,ne;Ke(this,m);for(var we=arguments.length,Re=Array(we),be=0;be<we;be++)Re[be]=arguments[be];return ne=(_=(M=_e(this,(p=m.__proto__||Object.getPrototypeOf(m)).call.apply(p,[this].concat(Re))),M),M.state={uid:K()},M.reqs={},M.onChange=function(ve){var ie=ve.target.files;M.uploadFiles(ie),M.reset()},M.onClick=function(ve){var ie=M.fileInput;if(!ie)return;var le=M.props,$=le.children,R=le.onClick;$&&$.type==="button"&&(ie.parentNode.focus(),ie.parentNode.querySelector("button").blur()),ie.click(),R&&R(ve)},M.onKeyDown=function(ve){ve.key==="Enter"&&M.onClick()},M.onFileDrop=function(ve){var ie=M.props.multiple;if(ve.preventDefault(),ve.type==="dragover")return;if(M.props.directory)F(Array.prototype.slice.call(ve.dataTransfer.items),M.uploadFiles,function($){return B($,M.props.accept)});else{var le=Array.prototype.slice.call(ve.dataTransfer.files).filter(function($){return B($,M.props.accept)});ie===!1&&(le=le.slice(0,1)),M.uploadFiles(le)}},M.uploadFiles=function(ve){var ie=Array.prototype.slice.call(ve);ie.map(function(le){return le.uid=K(),le}).forEach(function(le){M.upload(le,ie)})},M.saveFileInput=function(ve){M.fileInput=ve},_),_e(M,ne)}return Z(m,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(_,M){var ne=this,we=this.props;if(!we.beforeUpload)return setTimeout(function(){return ne.post(_)},0);var Re=we.beforeUpload(_,M);Re&&Re.then?Re.then(function(be){var ve=Object.prototype.toString.call(be);return ve==="[object File]"||ve==="[object Blob]"?ne.post(be):ne.post(_)}).catch(function(be){console.log(be)}):Re!==!1&&setTimeout(function(){return ne.post(_)},0);return}},{key:"post",value:function(_){var M=this;if(!this._isMounted)return;var ne=this.props,we=ne.onStart,Re=ne.onProgress,be=ne.transformFile,ve=be===void 0?function(ie){return ie}:be;new Promise(function(ie){var le=ne.action;return typeof le=="function"&&(le=le(_)),ie(le)}).then(function(ie){var le=_.uid,$=ne.customRequest||N,R=Promise.resolve(ve(_)).then(function(b){var P=ne.data;return typeof P=="function"&&(P=P(b)),Promise.all([b,P])}).catch(function(b){console.error(b)});R.then(function(b){var P=W(b,2),E=P[0],de=P[1],xe={action:ie,filename:ne.name,data:de,file:E,headers:ne.headers,withCredentials:ne.withCredentials,method:ne.method||"post",onProgress:Re?function(G){Re(G,_)}:null,onSuccess:function(Ee,Le){delete M.reqs[le],ne.onSuccess(Ee,_,Le)},onError:function(Ee,Le){delete M.reqs[le],ne.onError(Ee,Le,_)}};we(_),M.reqs[le]=$(xe)})})}},{key:"reset",value:function(){this.setState({uid:K()})}},{key:"abort",value:function(_){var M=this.reqs;if(_){var ne=_;_&&_.uid&&(ne=_.uid),M[ne]&&M[ne].abort&&M[ne].abort(),delete M[ne]}else Object.keys(M).forEach(function(we){M[we]&&M[we].abort&&M[we].abort(),delete M[we]})}},{key:"render",value:function(){var _,M=this.props,ne=M.component,we=M.prefixCls,Re=M.className,be=M.disabled,ve=M.id,ie=M.style,le=M.multiple,$=M.accept,R=M.children,b=M.directory,P=M.openFileDialogOnClick,E=M.onMouseEnter,de=M.onMouseLeave,xe=je(M,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),G=De()((_={},ue(_,we,!0),ue(_,we+"-disabled",be),ue(_,Re,Re),_)),Ee=be?{}:{onClick:P?this.onClick:function(){},onKeyDown:P?this.onKeyDown:function(){},onMouseEnter:E,onMouseLeave:de,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Te.a.createElement(ne,Y({},Ee,{className:G,role:"button",style:ie}),Te.a.createElement("input",Y({},ze(xe),{id:ve,type:"file",ref:this.saveFileInput,onClick:function(Me){return Me.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:$,directory:b?"directory":null,webkitdirectory:b?"webkitdirectory":null,multiple:le,onChange:this.onChange})),R)}}]),m}(Q.Component),Ce=fe,Pe=Object.assign||function(T){for(var m=1;m<arguments.length;m++){var p=arguments[m];for(var _ in p)Object.prototype.hasOwnProperty.call(p,_)&&(T[_]=p[_])}return T},pe=function(){function T(m,p){for(var _=0;_<p.length;_++){var M=p[_];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(m,M.key,M)}}return function(m,p,_){return p&&T(m.prototype,p),_&&T(m,_),m}}();function w(T,m){if(!(T instanceof m))throw new TypeError("Cannot call a class as a function")}function re(T,m){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:T}function j(T,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);T.prototype=Object.create(m&&m.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(T,m):T.__proto__=m)}function S(){}var he=function(T){j(m,T);function m(){var p,_,M,ne;w(this,m);for(var we=arguments.length,Re=Array(we),be=0;be<we;be++)Re[be]=arguments[be];return ne=(_=(M=re(this,(p=m.__proto__||Object.getPrototypeOf(m)).call.apply(p,[this].concat(Re))),M),M.saveUploader=function(ve){M.uploader=ve},_),re(M,ne)}return pe(m,[{key:"abort",value:function(_){this.uploader.abort(_)}},{key:"render",value:function(){return Te.a.createElement(Ce,Pe({},this.props,{ref:this.saveUploader}))}}]),m}(Q.Component);he.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:S,onError:S,onSuccess:S,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var z=he,O=Xe.a=z},Gytx:function(ct,Xe){ct.exports=function(Q,Te,ye,De){var Se=ye?ye.call(De,Q,Te):void 0;if(Se!==void 0)return!!Se;if(Q===Te)return!0;if(typeof Q!="object"||!Q||typeof Te!="object"||!Te)return!1;var se=Object.keys(Q),N=Object.keys(Te);if(se.length!==N.length)return!1;for(var te=Object.prototype.hasOwnProperty.bind(Te),J=0;J<se.length;J++){var K=se[J];if(!te(K))return!1;var D=Q[K],B=Te[K];if(Se=ye?ye.call(De,D,B,K):void 0,Se===!1||Se===void 0&&D!==B)return!1}return!0}},HmJG:function(ct,Xe,y){},IE1O:function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return ze});var Q=y("2qtc"),Te=y("kLXV"),ye=y("DZo9"),De=y("8z0m"),Se=y("+L6B"),se=y("2/Rp"),N=y("5NDa"),te=y("5rEg"),J=y("miYZ"),K=y("tsqr"),D=y("9og8"),B=y("y8nQ"),oe=y("Vl3Y"),V=y("tJVT"),F=y("WmNS"),Y=y.n(F),W=y("q1tI"),Z=y.n(W),ue=y("KeLC"),je=y.n(ue),Ke=y("m3rI"),_e=y("jN4g"),ge=function(Ce){var Pe,pe,w,re,j=Ce.visible,S=Ce.onOk,he=Ce.onCancel,z=Ce.title,O=z===void 0?"\u9009\u62E9\u8BA4\u8BC1\u56E2\u961F\u6559\u5E08":z,T=oe.a.useForm(),m=Object(V.a)(T,1),p=m[0],_=Object(W.useState)(!1),M=Object(V.a)(_,2),ne=M[0],we=M[1],Re=Object(W.useState)([]),be=Object(V.a)(Re,2),ve=be[0],ie=be[1],le=Object(W.useState)([]),$=Object(V.a)(le,2),R=$[0],b=$[1],P=Object(W.useState)(!1),E=Object(V.a)(P,2),de=E[0],xe=E[1];Object(W.useEffect)(function(){if(j!=null&&j.name){var Je,We,$e,Qe;p.setFieldsValue({name:j==null?void 0:j.name});var st=j!=null&&(Je=j.cover_url)!==null&&Je!==void 0&&Je.includes("attachments")?[{response:{id:j==null||((We=j.cover_url)===null||We===void 0)?void 0:We.split("/")[3]}}]:[],et=j!=null&&($e=j.backbground_image_url)!==null&&$e!==void 0&&$e.includes("attachments")?[{response:{id:j==null||((Qe=j.backbground_image_url)===null||Qe===void 0)?void 0:Qe.split("/")[3]}}]:[];ie(st),b(et)}},[j]);var G=function(){p.submit()},Ee=function(){he()},Le=function(){var Je=Object(D.a)(Y.a.mark(function We($e){var Qe,st,et,ot,Oe;return Y.a.wrap(function(at){for(;;)switch(at.prev=at.next){case 0:we(!0),console.log(ve,R,3333),Oe={name:$e==null?void 0:$e.name,cover_id:(ve==null||((Qe=ve[0])===null||Qe===void 0||((st=Qe.response)===null||st===void 0))?void 0:st.id)||"",backbground_image_id:(R==null||((et=R[0])===null||et===void 0||((ot=et.response)===null||ot===void 0))?void 0:ot.id)||""},S(Oe);case 4:case"end":return at.stop()}},We)}));return function($e){return Je.apply(this,arguments)}}(),Me=function(We,$e){var Qe=["uploading","done","removed"];Qe.includes(We.file.status)&&(We.file.status==="uploading"&&xe(!0),We.file.status==="done"&&xe(!1),$e===1?ie(We.fileList):b(We.fileList))},ke=function(We,$e){$e===1?ie([]):b([])},Ae=function(We,$e){var Qe=We.type==="image/jpeg"||We.type==="image/png";if(!Qe)return K.b.error("\u8BF7\u4E0A\u4F20jpg\u6216png\u7684\u56FE\u7247!"),!1;var st=We.size/1024/1024>2;return st?(K.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E2MB"),!1):($e===1?ie([]):b([]),!0)},Ne=function(We){var $e,Qe,st,et;return Z.a.createElement("div",{className:je.a.img},Z.a.createElement("img",{src:Ke.a.API_SERVER+"/api/attachments/"+(We===1?ve==null||(($e=ve[0])===null||$e===void 0||((Qe=$e.response)===null||Qe===void 0))?void 0:Qe.id:R==null||((st=R[0])===null||st===void 0||((et=st.response)===null||et===void 0))?void 0:et.id),alt:"avatar",style:{width:"100%"}}),Z.a.createElement("div",null,Z.a.createElement(_e.a,{onClick:function(){We===1?ie([]):b([])},style:{fontSize:"16px",color:"red"}})))};return Z.a.createElement(Te.a,{title:O,visible:j,onOk:G,centered:!0,onCancel:Ee,confirmLoading:ne,okButtonProps:{disabled:de},width:686,afterClose:function(){we(!1),ie([]),b([]),p.resetFields()},okText:j!=null&&j.name?"\u786E\u8BA4":"\u786E\u8BA4\u65B0\u5EFA",cancelText:"\u53D6\u6D88"},Z.a.createElement(oe.a,{form:p,colon:!1,onFinish:Le,labelCol:{span:4},wrapperCol:{span:18},className:je.a.form},Z.a.createElement(oe.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"}]},Z.a.createElement(te.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"})),Z.a.createElement(oe.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",valuePropName:"fileList"},Z.a.createElement("div",{className:je.a.upload},ve!=null&&(Pe=ve[0])!==null&&Pe!==void 0&&(pe=Pe.response)!==null&&pe!==void 0&&pe.id?Ne(1):Z.a.createElement(De.a,{fileList:ve,action:"".concat(Ke.a.API_SERVER,"/api/attachments.json"),onChange:function(We){return Me(We,1)},onRemove:function(We){return ke(We,1)},beforeUpload:function(We){return Ae(We,1)},withCredentials:!0,accept:"image/*"},Z.a.createElement(se.a,null,Z.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Z.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"))),Z.a.createElement(oe.a.Item,{name:"backbground_image_id",label:"\u8BE6\u60C5\u9876\u90E8\u80CC\u666F",valuePropName:"fileList"},Z.a.createElement("div",{className:je.a.upload},R!=null&&(w=R[0])!==null&&w!==void 0&&(re=w.response)!==null&&re!==void 0&&re.id?Ne(2):Z.a.createElement(De.a,{fileList:R,action:"".concat(Ke.a.API_SERVER,"/api/attachments.json"),onChange:function(We){return Me(We,2)},onRemove:function(We){return ke(We,2)},beforeUpload:function(We){return Ae(We,2)},withCredentials:!0,accept:"image/*"},Z.a.createElement(se.a,null,Z.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Z.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")))))},ze=function(Ce){var Pe,pe,w,re,j=Ce.data,S=Ce.onOk,he=oe.a.useForm(),z=Object(V.a)(he,1),O=z[0],T=Object(W.useState)(!1),m=Object(V.a)(T,2),p=m[0],_=m[1],M=Object(W.useState)([]),ne=Object(V.a)(M,2),we=ne[0],Re=ne[1],be=Object(W.useState)([]),ve=Object(V.a)(be,2),ie=ve[0],le=ve[1],$=Object(W.useState)(!1),R=Object(V.a)($,2),b=R[0],P=R[1];Object(W.useEffect)(function(){if(j!=null&&j.name){var Me,ke,Ae,Ne;O.setFieldsValue({name:j==null?void 0:j.name});var Je=j!=null&&(Me=j.cover_url)!==null&&Me!==void 0&&Me.includes("attachments")?[{response:{id:j==null||((ke=j.cover_url)===null||ke===void 0)?void 0:ke.split("/")[3]}}]:[],We=j!=null&&(Ae=j.backbground_image_url)!==null&&Ae!==void 0&&Ae.includes("attachments")?[{response:{id:j==null||((Ne=j.backbground_image_url)===null||Ne===void 0)?void 0:Ne.split("/")[3]}}]:[];Re(Je),le(We)}},[j]);var E=function(){O.submit()},de=function(){var Me=Object(D.a)(Y.a.mark(function ke(Ae){var Ne,Je,We,$e,Qe;return Y.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:_(!0),Qe={name:Ae==null?void 0:Ae.name,cover_id:(we==null||((Ne=we[0])===null||Ne===void 0||((Je=Ne.response)===null||Je===void 0))?void 0:Je.id)||"",backbground_image_id:(ie==null||((We=ie[0])===null||We===void 0||(($e=We.response)===null||$e===void 0))?void 0:$e.id)||""},S(Qe,function(){_(!1)});case 3:case"end":return et.stop()}},ke)}));return function(Ae){return Me.apply(this,arguments)}}(),xe=function(ke,Ae){var Ne=["uploading","done","removed"];Ne.includes(ke.file.status)&&(ke.file.status==="uploading"&&P(!0),ke.file.status==="done"&&P(!1),Ae===1?Re(ke.fileList):le(ke.fileList))},G=function(ke,Ae){Ae===1?Re([]):le([])},Ee=function(ke,Ae){var Ne=ke.type==="image/jpeg"||ke.type==="image/png";if(!Ne)return K.b.error("\u8BF7\u4E0A\u4F20jpg\u6216png\u7684\u56FE\u7247!"),!1;var Je=ke.size/1024/1024>2;return Je?(K.b.info("\u6587\u4EF6\u5927\u5C0F\u5FC5\u987B\u5C0F\u4E8E2MB"),!1):(Ae===1?Re([]):le([]),!0)},Le=function(ke){var Ae,Ne,Je,We;return Z.a.createElement("div",{className:je.a.img},Z.a.createElement("img",{src:Ke.a.API_SERVER+"/api/attachments/"+(ke===1?we==null||((Ae=we[0])===null||Ae===void 0||((Ne=Ae.response)===null||Ne===void 0))?void 0:Ne.id:ie==null||((Je=ie[0])===null||Je===void 0||((We=Je.response)===null||We===void 0))?void 0:We.id),alt:"avatar",style:{width:"100%"}}),Z.a.createElement("div",null,Z.a.createElement(_e.a,{onClick:function(){ke===1?Re([]):le([])},style:{fontSize:"16px",color:"red"}})))};return Z.a.createElement(oe.a,{form:O,colon:!1,onFinish:de,labelCol:{span:3},wrapperCol:{span:19},className:je.a.form},Z.a.createElement(oe.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"}]},Z.a.createElement(te.a,{maxLength:60,placeholder:"\u8BF7\u8F93\u5165\u793E\u533A\u540D\u79F0"})),Z.a.createElement(oe.a.Item,{name:"cover_id",label:"\u5C01\u9762\u56FE",valuePropName:"fileList"},Z.a.createElement("div",{className:je.a.upload},we!=null&&(Pe=we[0])!==null&&Pe!==void 0&&(pe=Pe.response)!==null&&pe!==void 0&&pe.id?Le(1):Z.a.createElement(De.a,{fileList:we,action:"".concat(Ke.a.API_SERVER,"/api/attachments.json"),onChange:function(ke){return xe(ke,1)},onRemove:function(ke){return G(ke,1)},beforeUpload:function(ke){return Ee(ke,1)},withCredentials:!0,accept:"image/*"},Z.a.createElement(se.a,null,Z.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Z.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"))),Z.a.createElement(oe.a.Item,{name:"backbground_image_id",label:"\u8BE6\u60C5\u9876\u90E8\u80CC\u666F",valuePropName:"fileList"},Z.a.createElement("div",{className:je.a.upload},ie!=null&&(w=ie[0])!==null&&w!==void 0&&(re=w.response)!==null&&re!==void 0&&re.id?Le(2):Z.a.createElement(De.a,{fileList:ie,action:"".concat(Ke.a.API_SERVER,"/api/attachments.json"),onChange:function(ke){return xe(ke,2)},onRemove:function(ke){return G(ke,2)},beforeUpload:function(ke){return Ee(ke,2)},withCredentials:!0,accept:"image/*"},Z.a.createElement(se.a,null,Z.a.createElement("i",{className:"iconfont icon-shangchuantupian2 mr10"}),"\u4E0A\u4F20\u56FE\u7247")),Z.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"))),Z.a.createElement(se.a,{disabled:b,loading:p,type:"primary",onClick:E,style:{marginLeft:120}},"\u786E\u8BA4"))};Xe.b=ge},KeLC:function(ct,Xe,y){ct.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(ct,Xe,y){"use strict";y.d(Xe,"b",function(){return je}),y.d(Xe,"a",function(){return _e});var Q=y("1OyB"),Te=y("vuIU"),ye=y("Ji7U"),De=y("LK+K"),Se=y("q1tI"),se=y("rePB"),N=y("Ff2n"),te=y("ODXe"),J=y("4IlW"),K=y("bX4T"),D=y("YrtM"),B=y("TSYQ"),oe=y.n(B),V=y("+nKL"),F=y("8OUc"),Y=function(_,M){var ne=_.prefixCls,we=_.id,Re=_.flattenOptions,be=_.childrenAsData,ve=_.values,ie=_.searchValue,le=_.multiple,$=_.defaultActiveFirstOption,R=_.height,b=_.itemHeight,P=_.notFoundContent,E=_.open,de=_.menuItemSelectedIcon,xe=_.virtual,G=_.onSelect,Ee=_.onToggleOpen,Le=_.onActiveValue,Me=_.onScroll,ke=_.onMouseEnter,Ae="".concat(ne,"-item"),Ne=Object(D.a)(function(){return Re},[E,Re],function(Ye,q){return q[0]&&Ye[1]!==q[1]}),Je=Se.useRef(null),We=function(q){q.preventDefault()},$e=function(q){Je.current&&Je.current.scrollTo({index:q})},Qe=function(q){for(var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,X=Ne.length,x=0;x<X;x+=1){var C=(q+x*H+X)%X,k=Ne[C],A=k.group,me=k.data;if(!A&&!me.disabled)return C}return-1},st=Se.useState(function(){return Qe(0)}),et=Object(te.a)(st,2),ot=et[0],Oe=et[1],vt=function(q){Oe(q);var H=Ne[q];if(!H){Le(null,-1);return}Le(H.data.value,q)};Se.useEffect(function(){vt($!==!1?Qe(0):-1)},[Ne.length,ie]),Se.useEffect(function(){var Ye=setTimeout(function(){if(!le&&E&&ve.size===1){var q=Array.from(ve)[0],H=Ne.findIndex(function(X){var x=X.data;return x.value===q});vt(H),$e(H)}});return function(){return clearTimeout(Ye)}},[E]);var at=function(q){q!==void 0&&G(q,{selected:!ve.has(q)}),le||Ee(!1)};if(Se.useImperativeHandle(M,function(){return{onKeyDown:function(q){var H=q.which;switch(H){case J.a.UP:case J.a.DOWN:{var X=0;if(H===J.a.UP?X=-1:H===J.a.DOWN&&(X=1),X!==0){var x=Qe(ot+X,X);$e(x),vt(x)}break}case J.a.ENTER:{var C=Ne[ot];C&&!C.data.disabled?at(C.data.value):at(void 0),E&&q.preventDefault();break}case J.a.ESC:Ee(!1)}},onKeyUp:function(){},scrollTo:function(q){$e(q)}}}),Ne.length===0)return Se.createElement("div",{role:"listbox",id:"".concat(we,"_list"),className:"".concat(Ae,"-empty"),onMouseDown:We},P);function Be(Ye){var q=Ne[Ye];if(!q)return null;var H=q.data||{},X=H.value,x=H.label,C=H.children,k=Object(K.a)(H,!0),A=be?C:x;return q?Se.createElement("div",Object.assign({"aria-label":typeof A=="string"?A:null},k,{key:Ye,role:"option",id:"".concat(we,"_list_").concat(Ye),"aria-selected":ve.has(X)}),X):null}return Se.createElement(Se.Fragment,null,Se.createElement("div",{role:"listbox",id:"".concat(we,"_list"),style:{height:0,width:0,overflow:"hidden"}},Be(ot-1),Be(ot),Be(ot+1)),Se.createElement(V.a,{itemKey:"key",ref:Je,data:Ne,height:R,itemHeight:b,fullHeight:!1,onMouseDown:We,onScroll:Me,virtual:xe,onMouseEnter:ke},function(Ye,q){var H,X=Ye.group,x=Ye.groupOption,C=Ye.data,k=C.label,A=C.key;if(X)return Se.createElement("div",{className:oe()(Ae,"".concat(Ae,"-group"))},k!==void 0?k:A);var me=C.disabled,ee=C.value,Ue=C.title,it=C.children,pt=C.style,ht=C.className,St=Object(N.a)(C,["disabled","value","title","children","style","className"]),Et=ve.has(ee),dt="".concat(Ae,"-option"),Xt=oe()(Ae,dt,ht,(H={},Object(se.a)(H,"".concat(dt,"-grouped"),x),Object(se.a)(H,"".concat(dt,"-active"),ot===q&&!me),Object(se.a)(H,"".concat(dt,"-disabled"),me),Object(se.a)(H,"".concat(dt,"-selected"),Et),H)),Nt=be?it:k,Gt=!de||typeof de=="function"||Et;return Se.createElement("div",Object.assign({},St,{"aria-selected":Et,className:Xt,title:Ue,onMouseMove:function(){if(ot===q||me)return;vt(q)},onClick:function(){me||at(ee)},style:pt}),Se.createElement("div",{className:"".concat(dt,"-content")},Nt||ee),Se.isValidElement(de)||Et,Gt&&Se.createElement(F.a,{className:"".concat(Ae,"-option-state"),customizeIcon:de,customizeIconProps:{isSelected:Et}},Et?"\u2713":null))}))},W=Se.forwardRef(Y);W.displayName="OptionList";var Z=W,ue=function(){return null};ue.isSelectOption=!0;var je=ue,Ke=function(){return null};Ke.isSelectOptGroup=!0;var _e=Ke,ge=y("VTBJ"),ze=y("Zm9Q");function fe(p){var _=p.key,M=p.props,ne=M.children,we=M.value,Re=Object(N.a)(M,["children","value"]);return Object(ge.a)({key:_,value:we!==void 0?we:_,children:ne},Re)}function Ce(p){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(ze.a)(p).map(function(M,ne){if(!Se.isValidElement(M)||!M.type)return null;var we=M.type.isSelectOptGroup,Re=M.key,be=M.props,ve=be.children,ie=Object(N.a)(be,["children"]);return _||!we?fe(M):Object(ge.a)(Object(ge.a)({key:"__RC_SELECT_GRP__".concat(Re===null?ne:Re,"__"),label:Re},ie),{},{options:Ce(ve)})}).filter(function(M){return M})}var Pe=y("2Qr1"),pe=y("qNPg"),w=y("U8pU"),re=y("Kwbf"),j=y("WKfj");function S(p){var _=p.mode,M=p.options,ne=p.children,we=p.backfill,Re=p.allowClear,be=p.placeholder,ve=p.getInputElement,ie=p.showSearch,le=p.onSearch,$=p.defaultOpen,R=p.autoFocus,b=p.labelInValue,P=p.value,E=p.inputValue,de=p.optionLabelProp,xe=_==="multiple"||_==="tags",G=ie!==void 0?ie:xe||_==="combobox",Ee=M||Ce(ne);if(Object(re.a)(_!=="tags"||Ee.every(function(Ae){return!Ae.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),_==="tags"||_==="combobox"){var Le=Ee.some(function(Ae){return Ae.options?Ae.options.some(function(Ne){return typeof("value"in Ne?Ne.value:Ne.key)=="number"}):typeof("value"in Ae?Ae.value:Ae.key)=="number"});Object(re.a)(!Le,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(re.a)(_!=="combobox"||!de,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(re.a)(_==="combobox"||!we,"`backfill` only works with `combobox` mode."),Object(re.a)(_==="combobox"||!ve,"`getInputElement` only work with `combobox` mode."),Object(re.b)(_!=="combobox"||!ve||!Re||!be,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),le&&!G&&_!=="combobox"&&_!=="tags"&&Object(re.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(re.b)(!$||R,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),P!=null){var Me=Object(j.d)(P);Object(re.a)(!b||Me.every(function(Ae){return Object(w.a)(Ae)==="object"&&("key"in Ae||"value"in Ae)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(re.a)(!xe||Array.isArray(P),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var ke=null;Object(ze.a)(ne).some(function(Ae){if(!Se.isValidElement(Ae)||!Ae.type)return!1;var Ne=Ae.type;if(Ne.isSelectOption)return!1;if(Ne.isSelectOptGroup){var Je=Object(ze.a)(Ae.props.children).every(function(We){return!Se.isValidElement(We)||!Ae.type||We.type.isSelectOption?!0:(ke=We.type,!1)});return!Je}return ke=Ne,!0}),ke&&Object(re.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ke.displayName||ke.name||ke,"`.")),Object(re.a)(E===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var he=S,z=Object(pe.a)({prefixCls:"rc-select",components:{optionList:Z},convertChildrenToData:Ce,flattenOptions:Pe.d,getLabeledValue:Pe.e,filterOptions:Pe.b,isValueDisabled:Pe.g,findValueOption:Pe.c,warningProps:he,fillOptionsWithMissingValue:Pe.a}),O=function(p){Object(ye.a)(M,p);var _=Object(De.a)(M);function M(){var ne;return Object(Q.a)(this,M),ne=_.apply(this,arguments),ne.selectRef=Se.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(Te.a)(M,[{key:"render",value:function(){return Se.createElement(z,Object.assign({ref:this.selectRef},this.props))}}]),M}(Se.Component);O.Option=je,O.OptGroup=_e;var T=O,m=Xe.c=T},M8RZ:function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return J});var Q=y("fWQN"),Te=y("mtLc"),ye=y("yKVA"),De=y("879j"),Se=y("q1tI"),se=y.n(Se),N=y("i8i4"),te=y.n(N),J=function(K){Object(ye.a)(B,K);var D=Object(De.a)(B);function B(oe){var V;Object(Q.a)(this,B),V=D.call(this,oe);var F=window.document;return V.node=F.createElement("div"),F.body.appendChild(V.node),V}return Object(Te.a)(B,[{key:"render",value:function(){var V=this.props.children;return Object(N.createPortal)(V,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),B}(se.a.Component)},NLgs:function(ct,Xe,y){"use strict";y.d(Xe,"e",function(){return Ke}),y.d(Xe,"f",function(){return _e}),y.d(Xe,"d",function(){return ze}),y.d(Xe,"c",function(){return fe}),y.d(Xe,"a",function(){return Ce}),y.d(Xe,"b",function(){return Pe});var Q=y("miYZ"),Te=y("tsqr"),ye=y("9og8"),De=y("2qtc"),Se=y("kLXV"),se=y("WmNS"),N=y.n(se),te=y("q1tI"),J=y.n(te),K=y("9kvl"),D=y("xKgJ"),B=y("1vsH"),oe=y("RCxd"),V=y("mOS8"),F=y.n(V),Y=y("1ZF9"),W=y.n(Y),Z=y("WdTA"),ue=y.n(Z),je=y("m3rI"),Ke=function(w){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(_e(w)&&ge(re))},_e=function(w){return Object(D.p)()?!0:(w({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},ge=function(){var w,re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,j=Object(K.c)()._store.getState(),S=j.user;return(w=S.userInfo)!==null&&w!==void 0&&w.profile_completed?!0:(Se.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:re?"\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(){K.d.push("/account/profile/edit")}}),!1)},ze=function(){var w,re=Object(K.c)()._store.getState(),j=re.user;return(w=j.userInfo)!==null&&w!==void 0&&w.professional_certification?!0:(Se.a.confirm({title:"\u63D0\u793A",centered:!0,content:J.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(B.O)("/account/certification")}}),!1)},fe=function(){return Object(D.a)()?!0:(Se.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:J.a.createElement("div",{className:"tc",style:{marginLeft:-38}},J.a.createElement("p",null,"\u60A8\u53EF\u4EE5\u626B\u7801\u52A0\u7FA4@\u7FA4\u7BA1\u7406\u5458\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650\u54E6\uFF01"),J.a.createElement("img",{src:Object(D.t)()?ue.a:"".concat(je.a.IMG_SERVER,"/images/educoder/qqqun20191230.png"),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},Ce=function(w,re){return w?!0:(Se.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:J.a.createElement("div",null,J.a.createElement("p",null,re||"\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"),J.a.createElement("div",{style:{marginLeft:"110px"}},J.a.createElement("img",{src:W.a,width:200}),J.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(B.O)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},Pe=function(w){var re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",j=Object(K.c)()._store.getState(),S=j.shixunsDetail.detail;return(S==null?void 0:S.public)===2||(S==null?void 0:S.public)===1||(S==null?void 0:S.shixun_status)===3?(Se.a.info({centered:!0,icon:J.a.createElement(oe.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:J.a.createElement("div",{className:"tc",style:{marginLeft:-38}},J.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},J.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(S==null?void 0:S.public)===2?"\u5DF2\u516C\u5F00":(S==null?void 0:S.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",re,"\u3002"),J.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),J.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:F.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(S==null?void 0:S.shixun_status)===2?(Se.a.confirm({centered:!0,icon:J.a.createElement(oe.a,null),title:"\u63D0\u793A",content:J.a.createElement("div",null,J.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",re,"\u3002"),J.a.createElement("br",null),J.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(){Se.a.confirm({width:440,centered:!0,icon:J.a.createElement(oe.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 z=Object(ye.a)(N.a.mark(function T(){var m;return N.a.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,w({type:"shixunsDetail/cancelRelease",payload:{id:S==null?void 0:S.identifier}});case 2:m=_.sent,m.status!==401&&(Te.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),w({type:"shixunsDetail/getShixunsDetail",payload:{id:S==null?void 0:S.identifier}}),w({type:"practiceSetting/getCommonData",payload:{id:S==null?void 0:S.identifier}}));case 4:case"end":return _.stop()}},T)}));function O(){return z.apply(this,arguments)}return O}()})}}),!0):!1}},OLES:function(ct,Xe,y){"use strict";var Q=y("U8pU"),Te=y("VTBJ"),ye=y("Ff2n"),De=y("q1tI"),Se=y("uciX"),se=y("7ixt"),N=function(oe){var V=oe.overlay,F=oe.prefixCls,Y=oe.id,W=oe.overlayInnerStyle;return De.createElement("div",{className:"".concat(F,"-inner"),id:Y,role:"tooltip",style:W},typeof V=="function"?V():V)},te=N,J=function(oe,V){var F=oe.overlayClassName,Y=oe.trigger,W=Y===void 0?["hover"]:Y,Z=oe.mouseEnterDelay,ue=Z===void 0?0:Z,je=oe.mouseLeaveDelay,Ke=je===void 0?.1:je,_e=oe.overlayStyle,ge=oe.prefixCls,ze=ge===void 0?"rc-tooltip":ge,fe=oe.children,Ce=oe.onVisibleChange,Pe=oe.afterVisibleChange,pe=oe.transitionName,w=oe.animation,re=oe.placement,j=re===void 0?"right":re,S=oe.align,he=S===void 0?{}:S,z=oe.destroyTooltipOnHide,O=z===void 0?!1:z,T=oe.defaultVisible,m=oe.getTooltipContainer,p=oe.overlayInnerStyle,_=Object(ye.a)(oe,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),M=Object(De.useRef)(null);Object(De.useImperativeHandle)(V,function(){return M.current});var ne=Object(Te.a)({},_);"visible"in oe&&(ne.popupVisible=oe.visible);var we=function(){var le=oe.arrowContent,$=le===void 0?null:le,R=oe.overlay,b=oe.id;return[De.createElement("div",{className:"".concat(ze,"-arrow"),key:"arrow"},$),De.createElement(te,{key:"content",prefixCls:ze,id:b,overlay:R,overlayInnerStyle:p})]},Re=!1,be=!1;if(typeof O=="boolean")Re=O;else if(O&&Object(Q.a)(O)==="object"){var ve=O.keepParent;Re=ve===!0,be=ve===!1}return De.createElement(Se.a,Object.assign({popupClassName:F,prefixCls:ze,popup:we,action:W,builtinPlacements:se.a,popupPlacement:j,ref:M,popupAlign:he,getPopupContainer:m,onPopupVisibleChange:Ce,afterPopupVisibleChange:Pe,popupTransitionName:pe,popupAnimation:w,defaultPopupVisible:T,destroyPopupOnHide:Re,autoDestroy:be,mouseLeaveDelay:Ke,popupStyle:_e,mouseEnterDelay:ue},ne),fe)},K=Object(De.forwardRef)(J),D=Xe.a=K},Ot1p:function(ct,Xe,y){"use strict";var Q=y("2qtc"),Te=y("kLXV"),ye=y("rAM+"),De=y("miYZ"),Se=y("tsqr"),se=y("9og8"),N=y("tJVT"),te=y("jrin"),J=y("WmNS"),K=y.n(J),D=y("q1tI"),B=y.n(D),oe=y("VrN/"),V=y.n(oe),F=y("bdgK"),Y=y("p77/"),W=y("Bd2K"),Z=y("ELLl"),ue=y("19Vz"),je=y("lZu9"),Ke=y("+NIl"),_e=y("kSUc"),ge=y("9Bee"),ze=function(ee){var Ue=ee.value,it=Ue===void 0?"":Ue,pt=ee.className,ht=ee.showTextOnly,St=ee.showLines,Et=ee.style,dt=Et===void 0?{}:Et,Xt=Object(D.useMemo)(function(){return""},[it]);return B.a.createElement(B.a.Fragment,null,B.a.createElement("div",{dangerouslySetInnerHTML:{__html:Xt}}))},fe=y("0Owb"),Ce=y("dejd"),Pe=y("C+DQ"),pe=y("1vsH"),w=y("m3rI"),re=[{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 j(ee){var Ue=ee.onActionCallback,it=ee.title,pt=ee.icon,ht=ee.actionName,St=ee.className,Et=St===void 0?"":St,dt=ee.children;function Xt(){Ue(ht)}return B.a.createElement("a",{title:it,className:Et,onClick:Xt},B.a.createElement("i",{className:"md-iconfont ".concat(pt)}),dt)}var S=function(ee){var Ue=ee.watch,it=ee.showNullButton,pt=ee.onActionCallback,ht=ee.fullScreen,St=ee.insertTemp,Et=ee.hidetoolBar,dt=ee.uuid,Xt=ee.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(pe.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(pe.D)("_educoder_session"),"&key=").concat(dt,"&api=").concat(encodeURIComponent(w.a.PROXY_SERVER)));var Nt=[].concat(re,[{title:"".concat(Ue?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ue?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return B.a.createElement("ul",{className:"markdown-toolbar-container"},!Et&&Nt.map(function(Gt,Wt){return B.a.createElement("li",{key:Wt},Gt.actionName?B.a.createElement(j,Object(fe.a)({},Gt,{onActionCallback:pt})):B.a.createElement("span",{className:"v-line"}))}),it?B.a.createElement("li",null,B.a.createElement(j,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:pt},B.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,St&&B.a.createElement("li",null,B.a.createElement(j,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(St),onActionCallback:pt},B.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),B.a.createElement("li",{className:"btn-full-screen"},B.a.createElement(j,{icon:"".concat(ht?"icon-shrink":"icon-enlarge"),title:ht?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:pt})))},he=y("M8RZ"),z=y("+L6B"),O=y("2/Rp"),T=y("y8nQ"),m=y("Vl3Y"),p=y("5NDa"),_=y("5rEg"),M={labelCol:{span:4},wrapperCol:{span:20}},ne=function(ee){var Ue=ee.callback,it=ee.onCancel;function pt(ht){Ue(ht)}return B.a.createElement(m.a,Object(fe.a)({},M,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:pt}),B.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},B.a.createElement(_.a,null)),B.a.createElement(m.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},B.a.createElement(_.a,null)),B.a.createElement("div",{className:"flex-container flex-end"},B.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),B.a.createElement(O.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},we=y("7ahc"),Re=y("k1fw"),be=y("HmJG"),ve=y("BjJ7"),ie=m.a.useForm,le={width:280,marginRight:10},$={labelCol:{span:5},wrapperCol:{span:19}},R=function(ee){var Ue=ee.callback,it=ee.onCancel,pt=ie(),ht=Object(N.a)(pt,1),St=ht[0],Et=Object(D.useRef)();function dt(Gt){Ue(Object(Re.a)(Object(Re.a)({},Gt),{},{name:Et.current}))}function Xt(Gt,Wt){St.setFieldsValue({src:"/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type),type:Wt.type})}function Nt(Gt){var Wt=Gt.target.files[0];Et.current=Wt.name,P(Wt,Xt)}return B.a.createElement(m.a,Object(fe.a)({form:St},$,{className:"upload-image-panel",onFinish:dt}),B.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},B.a.createElement("div",{className:"flex-container"},B.a.createElement(m.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},B.a.createElement(_.a,{style:le})),B.a.createElement(b,{onFileChange:Nt}))),B.a.createElement(m.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},B.a.createElement(_.a,{style:{width:264}})),B.a.createElement(m.a.Item,{style:{textAlign:"right"}},B.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),B.a.createElement(O.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))};function b(ee){var Ue=ee.onFileChange;return B.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",B.a.createElement("input",{type:"file",onChange:Ue}))}function P(ee,Ue){if(!ee)throw new String("\u6CA1\u6709\u6587\u4EF6");var it=new FormData;it.append("editormd-image-file",ee),it.append("file_param_name","editormd-image-file"),it.append("byxhr","true");var pt=new window.XMLHttpRequest;pt.withCredentials=!0,pt.addEventListener("load",function(ht){Ue(JSON.parse(ht.target.responseText),ee)},!1),pt.addEventListener("error",function(ht){console.error(ht)},!1),pt.open("POST","".concat(ve.a,"/api/attachments.json")),pt.send(it)}var E=y("giR+"),de=y("fyUT"),xe=y("7Kak"),G=y("9yH6"),Ee=G.a.Group,Le={margin:"0 8px"},Me=function(ee){var Ue=ee.callback,it=ee.onCancel;function pt(ht){Ue(ht)}return B.a.createElement(m.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:pt},B.a.createElement("div",{className:"flex-container"},B.a.createElement("span",{style:Le},"\u5355\u5143\u683C\u6570\uFF1A"),B.a.createElement("span",{style:Le},"\u884C\u6570"),B.a.createElement(m.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},B.a.createElement(de.a,null)),B.a.createElement("span",{style:Le},"\u5217\u6570"),B.a.createElement(m.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},B.a.createElement(de.a,null))),B.a.createElement("div",{className:"flex-container",style:{marginTop:12}},B.a.createElement("span",{style:Le},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),B.a.createElement(m.a.Item,{name:"align"},B.a.createElement(Ee,null,B.a.createElement(G.a,{value:"default"},B.a.createElement("i",{className:"fa fa-align-justify"})),B.a.createElement(G.a,{value:"left"},B.a.createElement("i",{className:"fa fa-align-left"})),B.a.createElement(G.a,{value:"center"},B.a.createElement("i",{className:"fa fa-align-center"})),B.a.createElement(G.a,{value:"right"},B.a.createElement("i",{className:"fa fa-align-right"}))))),B.a.createElement("div",{className:"flex-container flex-end"},B.a.createElement(O.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),B.a.createElement(O.a,{type:"ghost",onClick:it},"\u53D6\u6D88")))},ke=y("ErOA"),Ae=y("7Cbv"),Ne="link",Je="upload-image",We="code-block",$e="add-table",Qe="------------",st={default:Qe,left:":".concat(Qe),center:":".concat(Qe,":"),right:"".concat(Qe,":")},et=y("9VGf"),ot,Oe;function vt(){}var at=0,Be=1e4,Ye="\u2581",q=`
|
|
**\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 H(ee){return/^\d+$/.test(ee)?"".concat(ee,"px"):ee}var X=navigator.platform.toUpperCase().indexOf("MAC")>=0,x=X?"Cmd":"Ctrl",C=["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"],k=(ot={},Object(te.a)(ot,x+"-B","bold"),Object(te.a)(ot,x+"-I","italic"),ot),A=(Oe={},Object(te.a)(Oe,Ne,"\u6DFB\u52A0\u94FE\u63A5"),Object(te.a)(Oe,We,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(te.a)(Oe,Je,"\u6DFB\u52A0\u6587\u4EF6"),Object(te.a)(Oe,$e,"\u6DFB\u52A0\u8868\u683C"),Oe),me=Xe.a=function(ee){var Ue=ee.defaultValue,it=Ue===void 0?"":Ue,pt=ee.onChange,ht=ee.width,St=ht===void 0?"100%":ht,Et=ee.height,dt=Et===void 0?400:Et,Xt=ee.miniToolbar,Nt=Xt===void 0?!1:Xt,Gt=ee.isFocus,Wt=Gt===void 0?!1:Gt,Tt=ee.watch,Hn=ee.insertTemp,ai=ee.mode,yt=ai===void 0?"markdown":ai,Xn=ee.id,on=Xn===void 0?"markdown-editor-id":Xn,fn=ee.showResizeBar,zn=fn===void 0?!1:fn,si=ee.noStorage,li=si===void 0?!1:si,Dt=ee.showNullButton,ft=Dt===void 0?!1:Dt,Pn=ee.hidetoolBar,ui=Pn===void 0?!1:Pn,Cn=ee.fullScreen,At=Cn===void 0?!1:Cn,Nn=ee.onBlur,$n=ee.onCMBeforeChange,hi=ee.onFullScreen,Ve=ee.className,_t=Ve===void 0?"":Ve,ci=ee.disablePaste,Ai=ci===void 0?!1:ci,di=ee.placeholder,Oi=di===void 0?"":di,c=ee.values,o=c===void 0?"":c,a=Object(D.useState)(null),u=Object(N.a)(a,2),d=u[0],h=u[1],U=Object(D.useState)(it),Fe=Object(N.a)(U,2),qe=Fe[0],lt=Fe[1],He=Object(D.useState)(Tt),Ct=Object(N.a)(He,2),Lt=Ct[0],Vt=Ct[1],In=Object(D.useState)(At),jn=Object(N.a)(In,2),an=jn[0],Gn=jn[1],zi=Object(D.useState)(""),_n=Object(N.a)(zi,2),Bn=_n[0],Ln=_n[1],vi=Object(D.useState)(0),Yn=Object(N.a)(vi,2),fi=Yn[0],ti=Yn[1],cr=Object(D.useState)(dt),Gi=Object(N.a)(cr,2),Jn=Gi[0],Un=Gi[1],Li=Object(D.useState)(!1),Mi=Object(N.a)(Li,2),dr=Mi[0],Jt=Mi[1],It=Object(D.useRef)(Object(Ae.a)()),pn=Object(D.useRef)(!1),Pt=Object(D.useRef)(),en=Object(D.useRef)(),Ut=Object(D.useRef)(),ni=Object(D.useRef)(),Qt=Object(D.useRef)(),wn=function(){var mt=Object(se.a)(K.a.mark(function wt(){var bt,Ot;return K.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(ke.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:It.current}});case 2:Ot=Ht.sent,Ot!=null&&(bt=Ot.attachments)!==null&&bt!==void 0&&bt.length&&(console.log("cm:",d,en),Ot.attachments.map(function(Rt){Rt.content_type.indexOf("image")>-1?d.replaceSelection(".concat(Rt.content_type,")")):Rt.content_type.indexOf("video")>-1?d.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Rt.content_type.indexOf("pdf")>-1?d.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,'&disposition=inline" target="_blank">').concat(Rt.name,"</a>")):d.replaceSelection("[".concat(Rt.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}));case 4:case"end":return Ht.stop()}},wt)}));return function(){return mt.apply(this,arguments)}}();Object(D.useEffect)(function(){lt(o),d==null||d.setValue(o)},[o]),Object(D.useEffect)(function(){hi==null||hi(an)},[an]),Object(D.useEffect)(function(){if(en.current){var mt=V.a.fromTextArea(en.current,{mode:yt,lineNumbers:!Nt,lineWrapping:!0,value:it,autoCloseTags:!0,autoCloseBrackets:!0});Wt&&mt.focus();function wt(bt,Ot){if(Ai){Ot.preventDefault();return}var jt=Ot.clipboardData;if(jt){var Ht=jt.types.toString(),Rt=jt.items;if(Ht==="Files"||jt.types.indexOf("Files")>-1){if(Ot.preventDefault(),yt=="stex")return;try{var tn,En=Rt[1];((tn=Rt[0])===null||tn===void 0?void 0:tn.kind)==="file"&&(En=Rt[0]);var Mt=En.getAsFile(),bi=Mt.name.split(".").pop();P(Mt,function(Bt){if(Bt.id){var ln,Vn,Kn;(Mt==null||((ln=Mt.type)===null||ln===void 0)?void 0:ln.indexOf("image"))>-1?mt.replaceSelection(".concat(Bt.content_type,")")):(Mt==null||((Vn=Mt.type)===null||Vn===void 0)?void 0:Vn.indexOf("video"))>-1?mt.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(Bt.id,'"></video>')):(Mt==null||((Kn=Mt.type)===null||Kn===void 0)?void 0:Kn.indexOf("pdf"))>-1?mt.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):C.includes(bi)?mt.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(Bt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):mt.replaceSelection("[".concat(Mt.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}else(Bt==null?void 0:Bt.status)===401&&(document.location.href="/user/login")})}catch(Bt){Se.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return mt.on("paste",wt),mt.on("dragleave",function(bt,Ot){Ut.current.classList.remove("mouse-hover-md")}),mt.on("dragover",function(bt,Ot){Ut.current.classList.add("mouse-hover-md")}),mt.on("drop",function(bt,Ot){Ut.current.classList.add("mouse-hover-md");var jt;if(jt=Ot.dataTransfer.files,jt.length>0){Ot.preventDefault(),Ot.stopPropagation();for(var Ht=function(En){var Mt=jt[En],bi=Mt.name.split(".").pop();P(Mt,function(Bt){if(Bt.id){var ln,Vn,Kn;(Mt==null||((ln=Mt.type)===null||ln===void 0)?void 0:ln.indexOf("image"))>-1?mt.replaceSelection(".concat(Bt.content_type,")")):(Mt==null||((Vn=Mt.type)===null||Vn===void 0)?void 0:Vn.indexOf("video"))>-1?mt.replaceSelection('<video width="100%" controls src="'.concat(w.a.API_SERVER,"/api/attachments/").concat(Bt.id,'"></video>')):(Mt==null||((Kn=Mt.type)===null||Kn===void 0)?void 0:Kn.indexOf("pdf"))>-1?mt.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Mt.type,'&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):C.includes(bi)?mt.replaceSelection('<a href="'.concat(w.a.API_SERVER,"/api/attachments/").concat(Bt.id,'?type=office&disposition=inline" target="_blank">').concat(Mt.name,"</a>")):mt.replaceSelection("[".concat(Mt.name,"](").concat(w.a.API_SERVER,"/api/attachments/").concat(Bt.id,"?type=").concat(Bt.content_type,")"))}else(Bt==null?void 0:Bt.status)===401&&(document.location.href="/user/login")})},Rt=0;Rt<jt.length;Rt++)Ht(Rt)}}),h(mt),function(){mt.off("paste",wt)}}},[]);var Vi=Object(D.useCallback)(function(){if(Ut.current)try{}catch(mt){console.log(mt,"---- to set md editor body height")}},[Jn,Ut,an]);Object(D.useEffect)(function(){function mt(){var bt=new F.default(function(Ot){var jt=Object(ye.a)(Ot),Ht;try{for(jt.s();!(Ht=jt.n()).done;){var Rt=Ht.value;(Rt.target.offsetHeight>0||Rt.target.offsetWidth>0)&&(Vi(),d.setSize("100%","100%"),d.refresh())}}catch(tn){jt.e(tn)}finally{jt.f()}});return bt.observe(en.current.parentElement),bt}if(d){var wt=mt();return function(){wt.unobserve(en.current.parentElement)}}},[d,Vi]),Object(D.useEffect)(function(){if(d){for(var mt=[],wt=function(){var Rt=Ot[bt];jt=Object(N.a)(Rt,2);var tn=jt[0],En=jt[1],Mt=Object(te.a)({},tn,function(){Ki(En)});mt.push(Mt),d.addKeyMap(Mt)},bt=0,Ot=Object.entries(k);bt<Ot.length;bt++){var jt;wt()}return Pt.current=setInterval(function(){pn.current&&wn()},4e3),function(){clearInterval(Pt.current);var Ht=Object(ye.a)(mt),Rt;try{for(Ht.s();!(Rt=Ht.n()).done;){var tn=Rt.value;d.removeKeyMap(tn)}}catch(En){Ht.e(En)}finally{Ht.f()}}}},[d]),Object(D.useEffect)(function(){At!==an&&Gn(At)},[At]),Object(et.a)(function(){if(!li&&fi>0){var mt=new Date().getTime(),wt=window.sessionStorage.getItem(on);mt>=fi+Be&&(!wt||wt!==qe)&&(window.sessionStorage.setItem(on,qe),Jt(!0))}},Be),Object(D.useEffect)(function(){Vt(Tt)},[d,Tt]),Object(D.useEffect)(function(){d&&(Wt&&d.focus())},[d,Wt]),Object(D.useEffect)(function(){if(Lt&&d){var mt=d.getScrollerElement();function wt(bt){var Ot=bt.target;if(Qt.current){var jt=Ot.scrollTop/Ot.scrollHeight;Qt.current.scrollTop=Qt.current.scrollHeight*jt}}return mt.addEventListener("scroll",wt),function(){mt.removeEventListener("scroll",wt)}}},[d,Lt]),Object(D.useEffect)(function(){if(d&&$n){function mt(wt,bt){$n(wt,bt)}return d.on("beforeChange",mt),function(){d.off("beforeChange",mt)}}},[d,$n]),Object(D.useEffect)(function(){if(d&&Nn){function mt(){Nn(d.getValue())}return d.on("blur",mt),function(){d.off("blur",mt)}}},[d,Nn]),Object(D.useEffect)(function(){if(d){function mt(wt){var bt=wt.getValue();lt(bt),ti(new Date().getTime()),wt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),pt&&pt(bt)}return d.on("change",mt),function(){d.off("change",mt)}}},[d,pt]),Object(D.useEffect)(function(){d&&(it==null?(d.setValue(""),lt("")):it!==d.getValue()&&(d.setValue(it),lt(it),d.setCursor(d.lineCount(),0)))},[d,it]);var Ki=Object(D.useCallback)(function(mt){var wt=d.getCursor(),bt=d.getSelection(),Ot=bt.split(`
|
|
`);switch(mt){case"bold":return d.replaceSelection("**"+bt+"**"),bt===""&&d.setCursor(wt.line,wt.ch+2),d.focus();case"italic":return d.replaceSelection("*"+bt+"*"),bt===""&&d.setCursor(wt.line,wt.ch+1),d.focus();case"code":return d.replaceSelection("`"+bt+"`"),bt===""&&d.setCursor(wt.line,wt.ch+1),d.focus();case"inline-latex":return d.replaceSelection("`$$"+bt+"$$`"),bt===""&&d.setCursor(wt.line,wt.ch+3),d.focus();case"latex":return d.replaceSelection("```latex\n"+bt+"\n```"),d.setCursor(wt.line+1,bt.length+1),d.focus();case"line-break":return d.replaceSelection(`<br/>
|
|
`),d.focus();case"list-ul":return bt===""?d.replaceSelection("- "+bt):d.replaceSelection(Ot.map(function(jt){return jt===""?"":"- ".concat(jt)}).join(`
|
|
`)),d.focus();case"list-ol":return bt===""?d.replaceSelection("1. "+bt):d.replaceSelection(Ot.map(function(jt,Ht){return jt===""?"":"".concat(Ht+1,". ").concat(jt)}).join(`
|
|
`)),d.focus();case"add-null-ch":return bt===""&&d.setCursor(wt.line,wt.ch+1),d.replaceSelection(Ye),d.focus();case"inster-template-1":return bt===""&&d.setCursor(wt.line,wt.ch),d.replaceSelection(q),d.focus();case"eraser":return d.setValue(""),d.focus();case"trigger-watch":return Vt(!Lt),d.focus();case"trigger-full-screen":return Gn(!an),d.focus();case Ne:Ln(Ne);return;case We:Ln(We);return;case Je:Ln(Je);return;case $e:Ln($e);return;default:throw new Error}},[d,Lt,an]),yi=Object(D.useCallback)(function(mt){Ln("");switch(Bn){case Ne:var wt=mt.title,bt=mt.link;return d.replaceSelection("[".concat(wt,"](").concat(bt,")")),d.focus();case We:var Ot=mt.language,jt=mt.content;return d.replaceSelection(["```"+Ot,jt,"```"].join(`
|
|
`)),d.focus();case Je:var Ht=mt.src,Rt=mt.alt,tn=mt.name;return Ht.indexOf("type=image")>-1?d.replaceSelection(".concat(Ht,' "').concat(Rt||"",'" )')):Ht.indexOf("type=application/pdf")>-1?d.replaceSelection('<a href="'.concat(Ht,'&disposition=inline" target="_blank">').concat(tn,"</a>")):d.replaceSelection('<a href="'.concat(Ht,'" target="_blank">').concat(tn,"</a>")),d.focus();case $e:for(var En=mt.row,Mt=mt.col,bi=mt.align,Bt=`
|
|
`,ln=0;ln<En;ln++){for(var Vn=[],Kn=[],Wr=0;Wr<Mt;Wr++)ln===1&&Kn.push(st[bi]),Vn.push(" ");ln===1&&(Bt+="| ".concat(Kn.join(" | "),` |
|
|
`)),Bt+="| ".concat(Vn.join(Mt===1?"":" | "),` |
|
|
`)}return d.replaceSelection(Bt+`
|
|
`),d.focus();default:throw new Error}},[d,Bn]),Ur=Object(D.useMemo)(function(){switch(Bn){case Ne:return B.a.createElement(ne,{callback:yi,onCancel:Mn});case We:return B.a.createElement(we.b,{callback:yi,onCancel:Mn});case Je:return B.a.createElement(R,{callback:yi,onCancel:Mn});case $e:return B.a.createElement(Me,{callback:yi,onCancel:Mn});default:return null}},[Bn]);function Mn(){Ln("")}Object(D.useEffect)(function(){if(ni.current){var mt=ni.current,wt=!1,bt=0;function Ot(Rt){wt=!0,bt=Rt.pageY}function jt(){wt=!1}function Ht(Rt){if(wt){var tn=Rt.pageY-bt;tn<0&&(tn=0),tn>300&&(tn=300);var En=dt+tn+"px";Un(En)}}return mt.addEventListener("mousedown",Ot),document.addEventListener("mousemove",Ht),document.addEventListener("mouseup",jt),function(){mt.removeEventListener("mousedown",Ot),document.removeEventListener("mousemove",Ht),document.removeEventListener("mouseup",jt)}}},[d,ni]),Object(D.useEffect)(function(){Un(dt)},[dt]);var fr=H(St),Zn=H(Jn),Xi={width:fr,height:Zn},Fr=Object(D.useMemo)(function(){if(fi){var mt=new Date(fi),wt=mt.getHours(),bt=mt.getMinutes(),Ot=mt.getSeconds();return wt=wt<10?"0"+wt:wt,bt=bt<10?"0"+bt:bt,Ot=Ot<10?"0"+Ot:Ot,"".concat(wt,":").concat(bt,":").concat(Ot)}return 0},[fi]);function Ri(){window.sessionStorage.removeItem(on),Jt(!1),ti(0)}function Jo(){Jt(!1),ti(0),d.setValue(window.sessionStorage.getItem(on))}function ho(mt,wt){var bt=d.getValue();bt=bt.replace(mt,wt),lt(bt),d==null||d.setValue(bt)}return B.a.createElement(D.Fragment,null,B.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ut},B.a.createElement("div",{className:"markdown-editor-container ".concat(_t," ").concat(Lt?"on-preview":""," ").concat(Nt?"mini":""," ").concat(an?"full-screen":""),style:Xi},B.a.createElement(S,{insertTemp:Hn,watch:Lt,fullScreen:an,showNullButton:ft,onActionCallback:Ki,hidetoolBar:ui,uuid:It.current,setOpenPhones:function(){pn.current=!0}}),B.a.createElement("div",{className:"markdown-editor-body"},B.a.createElement("div",{className:"codemirror-container"},B.a.createElement("textarea",{ref:en,placeholder:Oi})),Lt?B.a.createElement("div",{ref:Qt,className:"preview-container"},yt==="stex"&&B.a.createElement(ze,{value:qe}),yt!=="stex"&&B.a.createElement(ge.a,{edit:!0,value:qe,replaces:ho})):null))),zn?B.a.createElement("a",{ref:ni,className:"editor-resize"}):null,B.a.createElement(he.a,null,A[Bn]?B.a.createElement(Te.a,{centered:!0,title:A[Bn],visible:!0,onCancel:Mn,footer:null},Ur):null))}},SJMd:function(ct,Xe){/**
|
|
* @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 y,Q,Te,ye=!1,De,Se;window.PR_SHOULD_USE_CONTINUATION=!0;var se,N;(function(){var te=window,J=["break,continue,do,else,for,if,return,while"],K=[J,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],D=[K,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],B=[D,"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"],oe=[D,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],V=[D,"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"],F="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",Y=[D,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],W="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",Z=[J,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],ue=[J,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],je=[J,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ke=[B,V,oe,Y,W,Z,ue,je],_e=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ge="str",ze="kwd",fe="com",Ce="typ",Pe="lit",pe="pun",w="pln",re="tag",j="dec",S="src",he="atn",z="atv",O="nocode",T="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(G){for(var Ee=0,Le=!1,Me=!1,ke=0,Ae=G.length;ke<Ae;++ke){var Ne=G[ke];if(Ne.ignoreCase)Me=!0;else if(/[a-z]/i.test(Ne.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Le=!0,Me=!1;break}}var Je={b:8,t:9,n:10,v:11,f:12,r:13};function We(ot){var Oe=ot.charCodeAt(0);if(Oe!==92)return Oe;var vt=ot.charAt(1);return Oe=Je[vt],Oe||("0"<=vt&&vt<="7"?parseInt(ot.substring(1),8):vt==="u"||vt==="x"?parseInt(ot.substring(2),16):ot.charCodeAt(1))}function $e(ot){if(ot<32)return(ot<16?"\\x0":"\\x")+ot.toString(16);var Oe=String.fromCharCode(ot);return Oe==="\\"||Oe==="-"||Oe==="]"||Oe==="^"?"\\"+Oe:Oe}function Qe(ot){var Oe=ot.substring(1,ot.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=[],at=Oe[0]==="^",Be=["["];at&&Be.push("^");for(var Ye=at?1:0,q=Oe.length;Ye<q;++Ye){var H=Oe[Ye];if(/\\[bdsw]/i.test(H))Be.push(H);else{var X=We(H),x;Ye+2<q&&Oe[Ye+1]==="-"?(x=We(Oe[Ye+2]),Ye+=2):x=X,vt.push([X,x]),x<65||X>122||(x<65||X>90||vt.push([Math.max(65,X)|32,Math.min(x,90)|32]),x<97||X>122||vt.push([Math.max(97,X)&~32,Math.min(x,122)&~32]))}}vt.sort(function(me,ee){return me[0]-ee[0]||ee[1]-me[1]});for(var C=[],k=[],Ye=0;Ye<vt.length;++Ye){var A=vt[Ye];A[0]<=k[1]+1?k[1]=Math.max(k[1],A[1]):C.push(k=A)}for(var Ye=0;Ye<C.length;++Ye){var A=C[Ye];Be.push($e(A[0])),A[1]>A[0]&&(A[1]+1>A[0]&&Be.push("-"),Be.push($e(A[1])))}return Be.push("]"),Be.join("")}function st(ot){for(var Oe=ot.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=Oe.length,at=[],Be=0,Ye=0;Be<vt;++Be){var q=Oe[Be];if(q==="(")++Ye;else if(q.charAt(0)==="\\"){var H=+q.substring(1);H&&(H<=Ye?at[H]=-1:Oe[Be]=$e(H))}}for(var Be=1;Be<at.length;++Be)at[Be]===-1&&(at[Be]=++Ee);for(var Be=0,Ye=0;Be<vt;++Be){var q=Oe[Be];if(q==="(")++Ye,at[Ye]||(Oe[Be]="(?:");else if(q.charAt(0)==="\\"){var H=+q.substring(1);H&&H<=Ye&&(Oe[Be]="\\"+at[H])}}for(var Be=0;Be<vt;++Be)Oe[Be]==="^"&&Oe[Be+1]!=="^"&&(Oe[Be]="");if(ot.ignoreCase&&Le)for(var Be=0;Be<vt;++Be){var q=Oe[Be],X=q.charAt(0);q.length>=2&&X==="["?Oe[Be]=Qe(q):X!=="\\"&&(Oe[Be]=q.replace(/[a-zA-Z]/g,function(k){var A=k.charCodeAt(0);return"["+String.fromCharCode(A&~32,A|32)+"]"}))}return Oe.join("")}for(var et=[],ke=0,Ae=G.length;ke<Ae;++ke){var Ne=G[ke];if(Ne.global||Ne.multiline)throw new Error(""+Ne);et.push("(?:"+st(Ne)+")")}return new RegExp(et.join("|"),Me?"gi":"g")}function p(G,Ee){var Le=/(?:^|\s)nocode(?:\s|$)/,Me=[],ke=0,Ae=[],Ne=0;function Je(We){var $e=We.nodeType;if($e==1){if(Le.test(We.className))return;for(var Qe=We.firstChild;Qe;Qe=Qe.nextSibling)Je(Qe);var st=We.nodeName.toLowerCase();(st==="br"||st==="li")&&(Me[Ne]=`
|
|
`,Ae[Ne<<1]=ke++,Ae[Ne++<<1|1]=We)}else if($e==3||$e==4){var et=We.nodeValue;et.length&&(Ee?et=et.replace(/\r\n?/g,`
|
|
`):et=et.replace(/[ \t\r\n]+/g," "),Me[Ne]=et,Ae[Ne<<1]=ke,ke+=et.length,Ae[Ne++<<1|1]=We)}}return Je(G),{sourceCode:Me.join("").replace(/\n$/,""),spans:Ae}}function _(G,Ee,Le,Me,ke){if(!Le)return;var Ae={sourceNode:G,pre:1,langExtension:null,numberLines:null,sourceCode:Le,spans:null,basePos:Ee,decorations:null};Me(Ae),ke.push.apply(ke,Ae.decorations)}var M=/\S/;function ne(G){for(var Ee=void 0,Le=G.firstChild;Le;Le=Le.nextSibling){var Me=Le.nodeType;Ee=Me===1?Ee?G:Le:Me===3&&M.test(Le.nodeValue)?G:Ee}return Ee===G?void 0:Ee}function we(G,Ee){var Le={},Me;(function(){for(var Ne=G.concat(Ee),Je=[],We={},$e=0,Qe=Ne.length;$e<Qe;++$e){var st=Ne[$e],et=st[3];if(et)for(var ot=et.length;--ot>=0;)Le[et.charAt(ot)]=st;var Oe=st[1],vt=""+Oe;We.hasOwnProperty(vt)||(Je.push(Oe),We[vt]=null)}Je.push(/[\0-\uffff]/),Me=m(Je)})();var ke=Ee.length,Ae=function(Ne){for(var Je=Ne.sourceCode,We=Ne.basePos,$e=Ne.sourceNode,Qe=[We,w],st=0,et=Je.match(Me)||[],ot={},Oe=0,vt=et.length;Oe<vt;++Oe){var at=et[Oe],Be=ot[at],Ye=void 0,q;if(typeof Be=="string")q=!1;else{var H=Le[at.charAt(0)];if(H)Ye=at.match(H[1]),Be=H[0];else{for(var X=0;X<ke;++X)if(H=Ee[X],Ye=at.match(H[1]),Ye){Be=H[0];break}Ye||(Be=w)}q=Be.length>=5&&Be.substring(0,5)==="lang-",q&&!(Ye&&typeof Ye[1]=="string")&&(q=!1,Be=S),q||(ot[at]=Be)}var x=st;if(st+=at.length,!q)Qe.push(We+x,Be);else{var C=Ye[1],k=at.indexOf(C),A=k+C.length;Ye[2]&&(A=at.length-Ye[2].length,k=A-C.length);var me=Be.substring(5);_($e,We+x,at.substring(0,k),Ae,Qe),_($e,We+x+k,C,R(me,C),Qe),_($e,We+x+A,at.substring(A),Ae,Qe)}}Ne.decorations=Qe};return Ae}function Re(G){var Ee=[],Le=[];G.tripleQuotedStrings?Ee.push([ge,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):G.multiLineStrings?Ee.push([ge,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ee.push([ge,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),G.verbatimStrings&&Le.push([ge,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Me=G.hashComments;Me&&(G.cStyleComments?(Me>1?Ee.push([fe,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ee.push([fe,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Le.push([ge,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ee.push([fe,/^#[^\r\n]*/,null,"#"])),G.cStyleComments&&(Le.push([fe,/^\/\/[^\r\n]*/,null]),Le.push([fe,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ke=G.regexLiterals;if(ke){var Ae=ke>1?"":`
|
|
\r`,Ne=Ae?".":"[\\S\\s]",Je="/(?=[^/*"+Ae+"])(?:[^/\\x5B\\x5C"+Ae+"]|\\x5C"+Ne+"|\\x5B(?:[^\\x5C\\x5D"+Ae+"]|\\x5C"+Ne+")*(?:\\x5D|$))+/";Le.push(["lang-regex",RegExp("^"+T+"("+Je+")")])}var We=G.types;We&&Le.push([Ce,We]);var $e=(""+G.keywords).replace(/^ | $/g,"");$e.length&&Le.push([ze,new RegExp("^(?:"+$e.replace(/[\s,]+/g,"|")+")\\b"),null]),Ee.push([w,/^\s+/,null,` \r
|
|
\xA0`]);var Qe="^.[^\\s\\w.$@'\"`/\\\\]*";return G.regexLiterals&&(Qe+="(?!s*/)"),Le.push([Pe,/^@[a-z_$][a-z_$@0-9]*/i,null],[Ce,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[w,/^[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"],[w,/^\\[\s\S]?/,null],[pe,new RegExp(Qe),null]),we(Ee,Le)}var be=Re({keywords:Ke,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ve(G,Ee,Le){for(var Me=/(?:^|\s)nocode(?:\s|$)/,ke=/\r\n?|\n/,Ae=G.ownerDocument,Ne=Ae.createElement("li");G.firstChild;)Ne.appendChild(G.firstChild);var Je=[Ne];function We(Oe){var vt=Oe.nodeType;if(vt==1&&!Me.test(Oe.className))if(Oe.nodeName==="br")$e(Oe),Oe.parentNode&&Oe.parentNode.removeChild(Oe);else for(var at=Oe.firstChild;at;at=at.nextSibling)We(at);else if((vt==3||vt==4)&&Le){var Be=Oe.nodeValue,Ye=Be.match(ke);if(Ye){var q=Be.substring(0,Ye.index);Oe.nodeValue=q;var H=Be.substring(Ye.index+Ye[0].length);if(H){var X=Oe.parentNode;X.insertBefore(Ae.createTextNode(H),Oe.nextSibling)}$e(Oe),q||Oe.parentNode.removeChild(Oe)}}}function $e(Oe){for(;!Oe.nextSibling;)if(Oe=Oe.parentNode,!Oe)return;function vt(Ye,q){var H=q?Ye.cloneNode(!1):Ye,X=Ye.parentNode;if(X){var x=vt(X,1),C=Ye.nextSibling;x.appendChild(H);for(var k=C;k;k=C)C=k.nextSibling,x.appendChild(k)}return H}for(var at=vt(Oe.nextSibling,0),Be;(Be=at.parentNode)&&Be.nodeType===1;)at=Be;Je.push(at)}for(var Qe=0;Qe<Je.length;++Qe)We(Je[Qe]);Ee===(Ee|0)&&Je[0].setAttribute("value",Ee);var st=Ae.createElement("ol");st.className="linenums";for(var et=Math.max(0,Ee-1|0)||0,Qe=0,ot=Je.length;Qe<ot;++Qe)Ne=Je[Qe],Ne.className="L"+(Qe+et)%10,Ne.firstChild||Ne.appendChild(Ae.createTextNode("\xA0")),st.appendChild(Ne);G.appendChild(st)}function ie(G){var Ee=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ee=Ee&&+Ee[1]<=8;var Le=/\n/g,Me=G.sourceCode,ke=Me.length,Ae=0,Ne=G.spans,Je=Ne.length,We=0,$e=G.decorations,Qe=$e.length,st=0;$e[Qe]=ke;var et,ot;for(ot=et=0;ot<Qe;)$e[ot]!==$e[ot+2]?($e[et++]=$e[ot++],$e[et++]=$e[ot++]):ot+=2;for(Qe=et,ot=et=0;ot<Qe;){for(var Oe=$e[ot],vt=$e[ot+1],at=ot+2;at+2<=Qe&&$e[at+1]===vt;)at+=2;$e[et++]=Oe,$e[et++]=vt,ot=at}Qe=$e.length=et;var Be=G.sourceNode,Ye="";Be&&(Ye=Be.style.display,Be.style.display="none");try{for(var q=null;We<Je;){var H=Ne[We],X=Ne[We+2]||ke,x=$e[st+2]||ke,at=Math.min(X,x),C=Ne[We+1],k;if(C.nodeType!==1&&(k=Me.substring(Ae,at))){Ee&&(k=k.replace(Le,"\r")),C.nodeValue=k;var A=C.ownerDocument,me=A.createElement("span");me.className=$e[st+1];var ee=C.parentNode;ee.replaceChild(me,C),me.appendChild(C),Ae<X&&(Ne[We+1]=C=A.createTextNode(Me.substring(at,X)),ee.insertBefore(C,me.nextSibling))}Ae=at,Ae>=X&&(We+=2),Ae>=x&&(st+=2)}}finally{Be&&(Be.style.display=Ye)}}var le={};function $(G,Ee){for(var Le=Ee.length;--Le>=0;){var Me=Ee[Le];le.hasOwnProperty(Me)?te.console&&console.warn("cannot override language handler %s",Me):le[Me]=G}}function R(G,Ee){return G&&le.hasOwnProperty(G)||(G=/^\s*</.test(Ee)?"default-markup":"default-code"),le[G]}$(be,["default-code"]),$(we([],[[w,/^[^<?]+/],[j,/^<!\w[^>]*(?:>|$)/],[fe,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[pe,/^(?:<[%?]|[%?]>)/],["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"]),$(we([[w,/^[\s]+/,null,` \r
|
|
`],[z,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[re,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[he,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[pe,/^[=<>\/]+/],["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"]),$(we([],[[z,/^[\s\S]+/]]),["uq.val"]),$(Re({keywords:B,hashComments:!0,cStyleComments:!0,types:_e}),["c","cc","cpp","cxx","cyc","m"]),$(Re({keywords:"null,true,false"}),["json"]),$(Re({keywords:V,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_e}),["cs"]),$(Re({keywords:oe,cStyleComments:!0}),["java"]),$(Re({keywords:je,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),$(Re({keywords:Z,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),$(Re({keywords:W,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),$(Re({keywords:ue,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),$(Re({keywords:Y,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),$(Re({keywords:F,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),$(we([],[[ge,/^[\s\S]+/]]),["regex"]);function b(G){var Ee=G.langExtension;try{var Le=p(G.sourceNode,G.pre),Me=Le.sourceCode;G.sourceCode=Me,G.spans=Le.spans,G.basePos=0,R(Ee,Me)(G),ie(G)}catch(ke){te.console&&console.log(ke&&ke.stack||ke)}}function P(G,Ee,Le){var Me=Le||!1,ke=Ee||null,Ae=document.createElement("div");Ae.innerHTML="<pre>"+G+"</pre>",Ae=Ae.firstChild,Me&&ve(Ae,Me,!0);var Ne={langExtension:ke,numberLines:Me,sourceNode:Ae,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return b(Ne),Ae.innerHTML}function E(G,Ee){var Le=Ee||document.body,Me=Le.ownerDocument||document;function ke(H){return Le.getElementsByTagName(H)}for(var Ae=[ke("pre"),ke("code"),ke("xmp")],Ne=[],Je=0;Je<Ae.length;++Je)for(var We=0,$e=Ae[Je].length;We<$e;++We)Ne.push(Ae[Je][We]);Ae=null;var Qe=Date;Qe.now||(Qe={now:function(){return+new Date}});var st=0,et=/\blang(?:uage)?-([\w.]+)(?!\S)/,ot=/\bprettyprint\b/,Oe=/\bprettyprinted\b/,vt=/pre|xmp/i,at=/^code$/i,Be=/^(?:pre|code|xmp)$/i,Ye={};function q(){for(var H=te.PR_SHOULD_USE_CONTINUATION?Qe.now()+250:Infinity;st<Ne.length&&Qe.now()<H;st++){for(var X=Ne[st],x=Ye,C=X;C=C.previousSibling;){var k=C.nodeType,A=(k===7||k===8)&&C.nodeValue;if(A?!/^\??prettify\b/.test(A):k!==3||/\S/.test(C.nodeValue))break;if(A){x={},A.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Wt,Tt,Hn){x[Tt]=Hn});break}}var me=X.className;if((x!==Ye||ot.test(me))&&!Oe.test(me)){for(var ee=!1,Ue=X.parentNode;Ue;Ue=Ue.parentNode){var it=Ue.tagName;if(Be.test(it)&&Ue.className&&ot.test(Ue.className)){ee=!0;break}}if(!ee){X.className+=" prettyprinted";var pt=x.lang;if(!pt){pt=me.match(et);var ht;!pt&&(ht=ne(X))&&at.test(ht.tagName)&&(pt=ht.className.match(et)),pt&&(pt=pt[1])}var St;if(vt.test(X.tagName))St=1;else{var Et=X.currentStyle,dt=Me.defaultView,Xt=Et?Et.whiteSpace:dt&&dt.getComputedStyle?dt.getComputedStyle(X,null).getPropertyValue("white-space"):0;St=Xt&&Xt.substring(0,3)==="pre"}var Nt=x.linenums;(Nt=Nt==="true"||+Nt)||(Nt=me.match(/\blinenums\b(?::(\d+))?/),Nt=Nt?Nt[1]&&Nt[1].length?+Nt[1]:!0:!1),Nt&&ve(X,Nt,St);var Gt={langExtension:pt,sourceNode:X,numberLines:Nt,pre:St,sourceCode:null,basePos:null,spans:null,decorations:null};b(Gt)}}}st<Ne.length?te.setTimeout(q,250):typeof G=="function"&&G()}q()}var de=te.PR={createSimpleLexer:we,registerLangHandler:$,sourceDecorator:Re,PR_ATTRIB_NAME:he,PR_ATTRIB_VALUE:z,PR_COMMENT:fe,PR_DECLARATION:j,PR_KEYWORD:ze,PR_LITERAL:Pe,PR_NOCODE:O,PR_PLAIN:w,PR_PUNCTUATION:pe,PR_SOURCE:S,PR_STRING:ge,PR_TAG:re,PR_TYPE:Ce,prettyPrintOne:ye?te.prettyPrintOne=P:se=P,prettyPrint:N=ye?te.prettyPrint=E:N=E},xe=te.define;typeof xe=="function"&&xe.amd&&xe("google-code-prettify",[],function(){return de})})()},"VrN/":function(ct,Xe,y){(function(Q,Te){ct.exports=Te()})(this,function(){"use strict";var Q=navigator.userAgent,Te=navigator.platform,ye=/gecko\/\d/i.test(Q),De=/MSIE \d/.test(Q),Se=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Q),se=/Edge\/(\d+)/.exec(Q),N=De||Se||se,te=N&&(De?document.documentMode||6:+(se||Se)[1]),J=!se&&/WebKit\//.test(Q),K=J&&/Qt\/\d+\.\d+/.test(Q),D=!se&&/Chrome\//.test(Q),B=/Opera\//.test(Q),oe=/Apple Computer/.test(navigator.vendor),V=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Q),F=/PhantomJS/.test(Q),Y=!se&&/AppleWebKit/.test(Q)&&/Mobile\/\w+/.test(Q),W=/Android/.test(Q),Z=Y||W||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Q),ue=Y||/Mac/.test(Te),je=/\bCrOS\b/.test(Q),Ke=/win/i.test(Te),_e=B&&Q.match(/Version\/(\d*\.\d*)/);_e&&(_e=Number(_e[1])),_e&&_e>=15&&(B=!1,J=!0);var ge=ue&&(K||B&&(_e==null||_e<12.11)),ze=ye||N&&te>=9;function fe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ce=function(e,t){var i=e.className,n=fe(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 pe(e,t){return Pe(e).appendChild(t)}function w(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 re(e,t,i,n){var r=w(e,t,i,n);return r.setAttribute("role","presentation"),r}var j;document.createRange?j=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:j=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 S(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 he(){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 z(e,t){var i=e.className;fe(t).test(i)||(e.className+=(i?" ":"")+t)}function O(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!fe(i[n]).test(t)&&(t+=" "+i[n]);return t}var T=function(e){e.select()};Y?T=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:N&&(T=function(e){try{e.select()}catch(t){}});function m(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function p(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 _(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 M=function(){this.id=null,this.f=null,this.time=0,this.handler=m(this.onTimeout,this)};M.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},M.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 ne(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var we=50,Re={toString:function(){return"CodeMirror.Pass"}},be={scroll:!1},ve={origin:"*mouse"},ie={origin:"+move"};function le(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 $=[""];function R(e){for(;$.length<=e;)$.push(b($)+" ");return $[e]}function b(e){return e[e.length-1]}function P(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function E(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function de(){}function xe(e,t){var i;return Object.create?i=Object.create(e):(de.prototype=e,i=new de),t&&p(t,i),i}var G=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ee(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||G.test(e))}function Le(e,t){return t?t.source.indexOf("\\w")>-1&&Ee(e)?!0:t.test(e):Ee(e)}function Me(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ke=/[\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 Ae(e){return e.charCodeAt(0)>=768&&ke.test(e)}function Ne(e,t,i){for(;(i<0?t>0:t<e.length)&&Ae(e.charAt(t));)t+=i;return t}function Je(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 We(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 $e=null;function Qe(e,t,i){var n;$e=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:$e=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:$e=r)}return n!=null?n:$e}var st=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,f=/[1n]/;function g(v,L,I){this.level=v,this.from=L,this.to=I}return function(v,L){var I=L=="ltr"?"L":"R";if(v.length==0||L=="ltr"&&!n.test(v))return!1;for(var ce=v.length,ae=[],Ie=0;Ie<ce;++Ie)ae.push(i(v.charCodeAt(Ie)));for(var Ge=0,Ze=I;Ge<ce;++Ge){var tt=ae[Ge];tt=="m"?ae[Ge]=Ze:Ze=tt}for(var rt=0,nt=I;rt<ce;++rt){var ut=ae[rt];ut=="1"&&nt=="r"?ae[rt]="n":s.test(ut)&&(nt=ut,ut=="r"&&(ae[rt]="R"))}for(var xt=1,gt=ae[0];xt<ce-1;++xt){var kt=ae[xt];kt=="+"&>=="1"&&ae[xt+1]=="1"?ae[xt]="1":kt==","&>==ae[xt+1]&&(gt=="1"||gt=="n")&&(ae[xt]=gt),gt=kt}for(var Kt=0;Kt<ce;++Kt){var cn=ae[Kt];if(cn==",")ae[Kt]="N";else if(cn=="%"){var Yt=void 0;for(Yt=Kt+1;Yt<ce&&ae[Yt]=="%";++Yt);for(var Dn=Kt&&ae[Kt-1]=="!"||Yt<ce&&ae[Yt]=="1"?"1":"N",Tn=Kt;Tn<Yt;++Tn)ae[Tn]=Dn;Kt=Yt-1}}for(var nn=0,An=I;nn<ce;++nn){var gn=ae[nn];An=="L"&&gn=="1"?ae[nn]="L":s.test(gn)&&(An=gn)}for(var sn=0;sn<ce;++sn)if(r.test(ae[sn])){var rn=void 0;for(rn=sn+1;rn<ce&&r.test(ae[rn]);++rn);for(var Zt=(sn?ae[sn-1]:I)=="L",On=(rn<ce?ae[rn]:I)=="L",ur=Zt==On?Zt?"L":"R":I,Ti=sn;Ti<rn;++Ti)ae[Ti]=ur;sn=rn-1}for(var yn=[],oi,dn=0;dn<ce;)if(l.test(ae[dn])){var $o=dn;for(++dn;dn<ce&&l.test(ae[dn]);++dn);yn.push(new g(0,$o,dn))}else{var gi=dn,Wi=yn.length,Hi=L=="rtl"?1:0;for(++dn;dn<ce&&ae[dn]!="L";++dn);for(var xn=gi;xn<dn;)if(f.test(ae[xn])){gi<xn&&(yn.splice(Wi,0,new g(1,gi,xn)),Wi+=Hi);var hr=xn;for(++xn;xn<dn&&f.test(ae[xn]);++xn);yn.splice(Wi,0,new g(2,hr,xn)),Wi+=Hi,gi=xn}else++xn;gi<dn&&yn.splice(Wi,0,new g(1,gi,dn))}return L=="ltr"&&(yn[0].level==1&&(oi=v.match(/^\s+/))&&(yn[0].from=oi[0].length,yn.unshift(new g(0,0,oi[0].length))),b(yn).level==1&&(oi=v.match(/\s+$/))&&(b(yn).to-=oi[0].length,yn.push(new g(0,ce-oi[0].length,ce)))),L=="rtl"?yn.reverse():yn}}();function et(e,t){var i=e.order;return i==null&&(i=e.order=st(e.text,t)),i}var ot=[],Oe=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]||ot).concat(i)}};function vt(e,t){return e._handlers&&e._handlers[t]||ot}function at(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=ne(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),k(t)||t.codemirrorIgnore}function q(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)ne(i,t[n])==-1&&i.push(t[n])}function H(e,t){return vt(e,t).length>0}function X(e){e.prototype.on=function(t,i){Oe(this,t,i)},e.prototype.off=function(t,i){at(this,t,i)}}function x(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function C(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function k(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function A(e){x(e),C(e)}function me(e){return e.target||e.srcElement}function ee(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ue&&e.ctrlKey&&t==1&&(t=3),t}var Ue=function(){if(N&&te<9)return!1;var e=w("div");return"draggable"in e||"dragDrop"in e}(),it;function pt(e){if(it==null){var t=w("span","\u200B");pe(e,w("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(it=t.offsetWidth<=1&&t.offsetHeight>2&&!(N&&te<8))}var i=it?w("span","\u200B"):w("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ht;function St(e){if(ht!=null)return ht;var t=pe(e,document.createTextNode("A\u062EA")),i=j(t,0,1).getBoundingClientRect(),n=j(t,1,2).getBoundingClientRect();return Pe(e),!i||i.left==i.right?!1:ht=n.right-i.right<3}var Et=`
|
|
|
|
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/)},dt=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},Xt=function(){var e=w("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Nt=null;function Gt(e){if(Nt!=null)return Nt;var t=pe(e,w("span","x")),i=t.getBoundingClientRect(),n=j(t,0,1).getBoundingClientRect();return Nt=Math.abs(i.left-n.left)>1}var Wt={},Tt={};function Hn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wt[e]=t}function ai(e,t){Tt[e]=t}function yt(e){if(typeof e=="string"&&Tt.hasOwnProperty(e))e=Tt[e];else if(e&&typeof e.name=="string"&&Tt.hasOwnProperty(e.name)){var t=Tt[e.name];typeof t=="string"&&(t={name:t}),e=xe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return yt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return yt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Xn(e,t){t=yt(t);var i=Wt[t.name];if(!i)return Xn(e,"text/plain");var n=i(e,t);if(on.hasOwnProperty(t.name)){var r=on[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 on={};function fn(e,t){var i=on.hasOwnProperty(e)?on[e]:on[e]={};p(t,i)}function zn(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 si(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 li(e,t,i){return e.startState?e.startState(t,i):!0}var Dt=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};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Dt.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},Dt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=_(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},Dt.prototype.indentation=function(){return _(this.string,null,this.tabSize)-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},Dt.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)}},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ft(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 Pn(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 Cn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function At(e){if(e.parent==null)return null;for(var t=e.parent,i=ne(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 Nn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var f=e.lines[l],g=f.height;if(t<g)break;t-=g}return i+l}function $n(e,t){return t>=e.first&&t<e.first+e.size}function hi(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Ve(e,t,i){if(i===void 0&&(i=null),!(this instanceof Ve))return new Ve(e,t,i);this.line=e,this.ch=t,this.sticky=i}function _t(e,t){return e.line-t.line||e.ch-t.ch}function ci(e,t){return e.sticky==t.sticky&&_t(e,t)==0}function Ai(e){return Ve(e.line,e.ch)}function di(e,t){return _t(e,t)<0?t:e}function Oi(e,t){return _t(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 Ve(e.first,0);var i=e.first+e.size-1;return t.line>i?Ve(i,ft(e,i).text.length):a(t,ft(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Ve(e.line,t):i<0?Ve(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 d=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 d?new h(e,zn(e.mode,t.state),i,t.lookAhead):new h(e,zn(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?zn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new d(t,this.maxLookAhead):t};function U(e,t,i,n){var r=[e.state.modeGen],s={};jn(e,t.text,e.doc.mode,i,function(v,L){return r.push(v,L)},s,n);for(var l=i.state,f=function(v){i.baseTokens=r;var L=e.state.overlays[v],I=1,ce=0;i.state=!0,jn(e,t.text,L.mode,i,function(ae,Ie){for(var Ge=I;ce<ae;){var Ze=r[I];Ze>ae&&r.splice(I,1,ae,r[I+1],Ze),I+=2,ce=Math.min(ae,Ze)}if(!Ie)return;if(L.opaque)r.splice(Ge,I-Ge,ae,"overlay "+Ie),I=Ge+2;else for(;Ge<I;Ge+=2){var tt=r[Ge+1];r[Ge+1]=(tt?tt+" ":"")+"overlay "+Ie}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)f(g);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Fe(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=qe(e,At(t)),r=t.text.length>e.options.maxHighlightLength&&zn(e.doc.mode,n.state),s=U(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 qe(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=an(e,t,i),l=s>n.first&&ft(n,s-1).stateAfter,f=l?h.fromSaved(n,l,s):new h(n,li(n.mode),s);return n.iter(s,t,function(g){lt(e,g.text,f);var v=f.line;g.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&v<r.viewTo?f.save():null,f.nextLine()}),i&&(n.modeFrontier=f.line),f}function lt(e,t,i,n){var r=e.doc.mode,s=new Dt(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&He(r,i.state);!s.eol();)Ct(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=si(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Ct(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=si(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 Lt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Vt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var f=ft(r,t.line),g=qe(e,t.line,i),v=new Dt(f.text,e.options.tabSize,g),L;for(n&&(L=[]);(n||v.pos<t.ch)&&!v.eol();)v.start=v.pos,l=Ct(s,v,g.state),n&&L.push(new Lt(v,l,zn(r.mode,g.state)));return n?L:new Lt(v,l,g.state)}function In(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 jn(e,t,i,n,r,s,l){var f=i.flattenSpans;f==null&&(f=e.options.flattenSpans);var g=0,v=null,L=new Dt(t,e.options.tabSize,n),I,ce=e.options.addModeClass&&[null];for(t==""&&In(He(i,n.state),s);!L.eol();){if(L.pos>e.options.maxHighlightLength?(f=!1,l&<(e,t,n,L.pos),L.pos=t.length,I=null):I=In(Ct(i,L,n.state,ce),s),ce){var ae=ce[0].name;ae&&(I="m-"+(I?ae+" "+I:ae))}if(!f||v!=I){for(;g<L.start;)g=Math.min(L.start,g+5e3),r(g,v);v=I}L.start=L.pos}for(;g<L.pos;){var Ie=Math.min(L.pos,g+5e3);r(Ie,v),g=Ie}}function an(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),f=t;f>l;--f){if(f<=s.first)return s.first;var g=ft(s,f-1),v=g.stateAfter;if(v&&(!i||f+(v instanceof d?v.lookAhead:0)<=s.modeFrontier))return f;var L=_(g.text,null,e.options.tabSize);(r==null||n>L)&&(r=f-1,n=L)}return r}function Gn(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=ft(e,n).stateAfter;if(r&&(!(r instanceof d)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var zi=!1,_n=!1;function Bn(){zi=!0}function Ln(){_n=!0}function vi(e,t,i){this.marker=e,this.from=t,this.to=i}function Yn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function fi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function ti(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function cr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(f||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var g=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new vi(l,s.from,g?null:s.to))}}return n}function Gi(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(f||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var g=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new vi(l,g?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Jn(e,t){if(t.full)return null;var i=$n(e,t.from.line)&&ft(e,t.from.line).markedSpans,n=$n(e,t.to.line)&&ft(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=_t(t.from,t.to)==0,f=cr(i,r,l),g=Gi(n,s,l),v=t.text.length==1,L=b(t.text).length+(v?r:0);if(f)for(var I=0;I<f.length;++I){var ce=f[I];if(ce.to==null){var ae=Yn(g,ce.marker);ae?v&&(ce.to=ae.to==null?null:ae.to+L):ce.to=r}}if(g)for(var Ie=0;Ie<g.length;++Ie){var Ge=g[Ie];if(Ge.to!=null&&(Ge.to+=L),Ge.from==null){var Ze=Yn(f,Ge.marker);Ze||(Ge.from=L,v&&(f||(f=[])).push(Ge))}else Ge.from+=L,v&&(f||(f=[])).push(Ge)}f&&(f=Un(f)),g&&g!=f&&(g=Un(g));var tt=[f];if(!v){var rt=t.text.length-2,nt;if(rt>0&&f)for(var ut=0;ut<f.length;++ut)f[ut].to==null&&(nt||(nt=[])).push(new vi(f[ut].marker,null,null));for(var xt=0;xt<rt;++xt)tt.push(nt);tt.push(g)}return tt}function Un(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 Li(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(ae){if(ae.markedSpans)for(var Ie=0;Ie<ae.markedSpans.length;++Ie){var Ge=ae.markedSpans[Ie].marker;Ge.readOnly&&(!n||ne(n,Ge)==-1)&&(n||(n=[])).push(Ge)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],f=l.find(0),g=0;g<r.length;++g){var v=r[g];if(_t(v.to,f.from)<0||_t(v.from,f.to)>0)continue;var L=[g,1],I=_t(v.from,f.from),ce=_t(v.to,f.to);(I<0||!l.inclusiveLeft&&!I)&&L.push({from:v.from,to:f.from}),(ce>0||!l.inclusiveRight&&!ce)&&L.push({from:f.to,to:v.to}),r.splice.apply(r,L),g+=L.length-3}return r}function Mi(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 dr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Jt(e){return e.inclusiveLeft?-1:0}function It(e){return e.inclusiveRight?1:0}function pn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=_t(n.from,r.from)||Jt(e)-Jt(t);if(s)return-s;var l=_t(n.to,r.to)||It(e)-It(t);return l||t.id-e.id}function Pt(e,t){var i=_n&&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||pn(n,r.marker)<0)&&(n=r.marker);return n}function en(e){return Pt(e,!0)}function Ut(e){return Pt(e,!1)}function ni(e,t){var i=_n&&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||pn(n,s.marker)<0)&&(n=s.marker)}return n}function Qt(e,t,i,n,r){var s=ft(e,t),l=_n&&s.markedSpans;if(l)for(var f=0;f<l.length;++f){var g=l[f];if(!g.marker.collapsed)continue;var v=g.marker.find(0),L=_t(v.from,i)||Jt(g.marker)-Jt(r),I=_t(v.to,n)||It(g.marker)-It(r);if(L>=0&&I<=0||L<=0&&I>=0)continue;if(L<=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?_t(v.to,i)>=0:_t(v.to,i)>0)||L>=0&&(g.marker.inclusiveRight&&r.inclusiveLeft?_t(v.from,n)<=0:_t(v.from,n)<0))return!0}}function wn(e){for(var t;t=en(e);)e=t.find(-1,!0).line;return e}function Vi(e){for(var t;t=Ut(e);)e=t.find(1,!0).line;return e}function Ki(e){for(var t,i;t=Ut(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function yi(e,t){var i=ft(e,t),n=wn(i);return i==n?t:At(n)}function Ur(e,t){if(t>e.lastLine())return t;var i=ft(e,t),n;if(!Mn(e,i))return t;for(;n=Ut(i);)i=n.find(1,!0).line;return At(i)+1}function Mn(e,t){var i=_n&&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&&fr(e,t,n))return!0}}function fr(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return fr(e,n.line,Yn(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)&&fr(e,t,r))return!0}function Zn(e){e=wn(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 Xi(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=en(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Ut(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 Fr(e){var t=e.display,i=e.doc;t.maxLine=ft(i,i.first),t.maxLineLength=Xi(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Xi(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Ri=function(e,t,i){this.text=e,dr(this,t),this.height=i?i(this):1};Ri.prototype.lineNo=function(){return At(this)},X(Ri);function Jo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Mi(e),dr(e,i);var r=n?n(e):1;r!=e.height&&Cn(e,r)}function ho(e){e.parent=null,Mi(e)}var mt={},wt={};function bt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?wt:mt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Ot(e,t){var i=re("span",null,null,J?"padding-right: .1px":null),n={pre:re("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=Ht,St(e.display.measure)&&(l=et(s,e.doc.direction))&&(n.addToken=tn(n.addToken,l)),n.map=[];var f=t!=e.display.externalMeasured&&At(s);Mt(s,n,Fe(e,s,f)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=O(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=O(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(pt(e.display.measure))),r==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(J){var g=n.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Be(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=O(n.pre.className,n.textClass||"")),n}function jt(e){var t=w("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ht(e,t,i,n,r,s,l){if(!t)return;var f=e.splitSpaces?Rt(t,e.trailingSpace):t,g=e.cm.state.specialChars,v=!1,L;if(!g.test(t))e.col+=t.length,L=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,L),N&&te<9&&(v=!0),e.pos+=t.length;else{L=document.createDocumentFragment();for(var I=0;;){g.lastIndex=I;var ce=g.exec(t),ae=ce?ce.index-I:t.length-I;if(ae){var Ie=document.createTextNode(f.slice(I,I+ae));N&&te<9?L.appendChild(w("span",[Ie])):L.appendChild(Ie),e.map.push(e.pos,e.pos+ae,Ie),e.col+=ae,e.pos+=ae}if(!ce)break;I+=ae+1;var Ge=void 0;if(ce[0]==" "){var Ze=e.cm.options.tabSize,tt=Ze-e.col%Ze;Ge=L.appendChild(w("span",R(tt),"cm-tab")),Ge.setAttribute("role","presentation"),Ge.setAttribute("cm-text"," "),e.col+=tt}else ce[0]=="\r"||ce[0]==`
|
|
`?(Ge=L.appendChild(w("span",ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ge.setAttribute("cm-text",ce[0]),e.col+=1):(Ge=e.cm.options.specialCharPlaceholder(ce[0]),Ge.setAttribute("cm-text",ce[0]),N&&te<9?L.appendChild(w("span",[Ge])):L.appendChild(Ge),e.col+=1);e.map.push(e.pos,e.pos+1,Ge),e.pos++}}if(e.trailingSpace=f.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var rt=i||"";n&&(rt+=n),r&&(rt+=r);var nt=w("span",[L],rt,s);if(l)for(var ut in l)l.hasOwnProperty(ut)&&ut!="style"&&ut!="class"&&nt.setAttribute(ut,l[ut]);return e.content.appendChild(nt)}e.content.appendChild(L)}function Rt(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 tn(e,t){return function(i,n,r,s,l,f,g){r=r?r+" cm-force-border":"cm-force-border";for(var v=i.pos,L=v+n.length;;){for(var I=void 0,ce=0;ce<t.length&&!(I=t[ce],I.to>v&&I.from<=v);ce++);if(I.to>=L)return e(i,n,r,s,l,f,g);e(i,n.slice(0,I.to-v),r,s,null,f,g),s=null,n=n.slice(I.to-v),v=I.to}}}function En(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 Mt(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]),bt(i[l+1],t.cm.options));return}for(var f=r.length,g=0,v=1,L="",I,ce,ae=0,Ie,Ge,Ze,tt,rt;;){if(ae==g){Ie=Ge=Ze=ce="",rt=null,tt=null,ae=Infinity;for(var nt=[],ut=void 0,xt=0;xt<n.length;++xt){var gt=n[xt],kt=gt.marker;if(kt.type=="bookmark"&>.from==g&&kt.widgetNode)nt.push(kt);else if(gt.from<=g&&(gt.to==null||gt.to>g||kt.collapsed&>.to==g&>.from==g)){if(gt.to!=null&>.to!=g&&ae>gt.to&&(ae=gt.to,Ge=""),kt.className&&(Ie+=" "+kt.className),kt.css&&(ce=(ce?ce+";":"")+kt.css),kt.startStyle&>.from==g&&(Ze+=" "+kt.startStyle),kt.endStyle&>.to==ae&&(ut||(ut=[])).push(kt.endStyle,gt.to),kt.title&&((rt||(rt={})).title=kt.title),kt.attributes)for(var Kt in kt.attributes)(rt||(rt={}))[Kt]=kt.attributes[Kt];kt.collapsed&&(!tt||pn(tt.marker,kt)<0)&&(tt=gt)}else gt.from>g&&ae>gt.from&&(ae=gt.from)}if(ut)for(var cn=0;cn<ut.length;cn+=2)ut[cn+1]==ae&&(Ge+=" "+ut[cn]);if(!tt||tt.from==g)for(var Yt=0;Yt<nt.length;++Yt)En(t,0,nt[Yt]);if(tt&&(tt.from||0)==g){if(En(t,(tt.to==null?f+1:tt.to)-g,tt.marker,tt.from==null),tt.to==null)return;tt.to==g&&(tt=!1)}}if(g>=f)break;for(var Dn=Math.min(f,ae);;){if(L){var Tn=g+L.length;if(!tt){var nn=Tn>Dn?L.slice(0,Dn-g):L;t.addToken(t,nn,I?I+Ie:Ie,Ze,g+nn.length==ae?Ge:"",ce,rt)}if(Tn>=Dn){L=L.slice(Dn-g),g=Dn;break}g=Tn,Ze=""}L=r.slice(s,s=i[v++]),I=bt(i[v++],t.cm.options)}}}function bi(e,t,i){this.line=t,this.rest=Ki(t),this.size=this.rest?At(b(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Mn(e,t)}function Bt(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new bi(e.doc,ft(e.doc,s),s);r=s+l.size,n.push(l)}return n}var ln=null;function Vn(e){ln?ln.ops.push(e):e.ownsGroup=ln={ops:[e],delayedCallbacks:[]}}function Kn(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 Wr(e,t){var i=e.ownsGroup;if(!i)return;try{Kn(i)}finally{ln=null,t(i)}}var pr=null;function mn(e,t){var i=vt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;ln?r=ln.delayedCallbacks:pr?r=pr:(r=pr=[],setTimeout(Rs,0));for(var s=function(f){r.push(function(){return i[f].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Rs(){var e=pr;pr=null;for(var t=0;t<e.length;++t)e[t]()}function Zo(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"?qo(e,t,i,n):s=="class"?co(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=w("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),N&&te<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(w("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):Ot(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,co(e,t)):i&&(t.text.className=i)}function co(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 qo(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=w("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=w("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(w("div",hi(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var g=0;g<e.display.gutterSpecs.length;++g){var v=e.display.gutterSpecs[g].className,L=s.hasOwnProperty(v)&&s[v];L&&f.appendChild(w("div",[L],"CodeMirror-gutter-elt","left: "+n.gutterLeft[v]+"px; width: "+n.gutterWidth[v]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=fe("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ea(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),co(e,t),qo(e,t,i,n),ea(e,t,n),t.node}function ea(e,t,i){if(ta(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)ta(e,t.rest[n],t,i,!1)}function ta(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),l=0,f=t.widgets;l<f.length;++l){var g=f[l],v=w("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),js(g,v,i,n),e.display.input.setUneditable(v),r&&g.above?s.insertBefore(v,i.gutter||i.text):s.appendChild(v),mn(g,"redraw")}}function js(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!S(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;"),pe(t.display.measure,w("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function pi(e,t){for(var i=me(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Hr(e){return e.lineSpace.offsetTop}function fo(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function na(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=pe(e.measure,w("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 ii(e){return we-e.display.nativeBarWidth}function Di(e){return e.display.scroller.clientWidth-ii(e)-e.display.barWidth}function po(e){return e.display.scroller.clientHeight-ii(e)-e.display.barHeight}function Bs(e,t,i){var n=e.options.lineWrapping,r=n&&Di(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),f=0;f<l.length-1;f++){var g=l[f],v=l[f+1];Math.abs(g.bottom-v.bottom)>2&&s.push((g.bottom+v.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ia(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(At(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=wn(t);var i=At(t),n=e.display.externalMeasured=new bi(e.doc,t,i);n.lineN=i;var r=n.built=Ot(e,n);return n.text=r.pre,pe(e.display.lineMeasure,r.pre),n}function ra(e,t,i,n){return ri(e,$i(e,t),i,n)}function mo(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ii(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function $i(e,t){var i=At(t),n=mo(e,i);n&&!n.text?n=null:n&&n.changes&&(Zo(e,n,i,Co(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var r=ia(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ri(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 oa={left:0,right:0,top:0,bottom:0};function aa(e,t,i){for(var n,r,s,l,f,g,v=0;v<e.length;v+=3)if(f=e[v],g=e[v+1],t<f?(r=0,s=1,l="left"):t<g?(r=t-f,s=r+1):(v==e.length-3||t==g&&e[v+3]>t)&&(s=g-f,r=s-1,t>=g&&(l="right")),r!=null){if(n=e[v+2],f==g&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)n=e[(v-=3)+2],l="left";if(i=="right"&&r==g-f)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)n=e[(v+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:f,coverEnd:g}}function Fs(e,t){var i=oa;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=aa(t.map,i,n),s=r.node,l=r.start,f=r.end,g=r.collapse,v;if(s.nodeType==3){for(var L=0;L<4;L++){for(;l&&Ae(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+f<r.coverEnd&&Ae(t.line.text.charAt(r.coverStart+f));)++f;if(N&&te<9&&l==0&&f==r.coverEnd-r.coverStart?v=s.parentNode.getBoundingClientRect():v=Fs(j(s,l,f).getClientRects(),n),v.left||v.right||l==0)break;f=l,l=l-1,g="right"}N&&te<11&&(v=Hs(e.display.measure,v))}else{l>0&&(g=n="right");var I;e.options.lineWrapping&&(I=s.getClientRects()).length>1?v=I[n=="right"?I.length-1:0]:v=s.getBoundingClientRect()}if(N&&te<9&&!l&&(!v||!v.left&&!v.right)){var ce=s.parentNode.getClientRects()[0];ce?v={left:ce.left,right:ce.left+Ji(e.display),top:ce.top,bottom:ce.bottom}:v=oa}for(var ae=v.top-t.rect.top,Ie=v.bottom-t.rect.top,Ge=(ae+Ie)/2,Ze=t.view.measure.heights,tt=0;tt<Ze.length-1&&!(Ge<Ze[tt]);tt++);var rt=tt?Ze[tt-1]:0,nt=Ze[tt],ut={left:(g=="right"?v.right:v.left)-t.rect.left,right:(g=="left"?v.left:v.right)-t.rect.left,top:rt,bottom:nt};return!v.left&&!v.right&&(ut.bogus=!0),e.options.singleCursorHeightPerLine||(ut.rtop=ae,ut.rbottom=Ie),ut}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Gt(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 sa(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 la(e){e.display.externalMeasure=null,Pe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)sa(e.display.view[t])}function vr(e){la(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ua(){return D&&W?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return D&&W?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function go(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 zr(e,t,i,n,r){if(!r){var s=go(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=Zn(t);if(n=="local"?l+=Hr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var f=e.display.lineSpace.getBoundingClientRect();l+=f.top+(n=="window"?0:ha());var g=f.left+(n=="window"?0:ua());i.left+=g,i.right+=g}return i.top+=l,i.bottom+=l,i}function ca(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ua(),r-=ha();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 vo(e,t,i,n,r){return n||(n=ft(e.doc,t.line)),zr(e,n,ra(e,n,t.ch,r),i)}function Qn(e,t,i,n,r,s){n=n||ft(e.doc,t.line),r||(r=$i(e,n));function l(Ie,Ge){var Ze=ri(e,r,Ie,Ge?"right":"left",s);return Ge?Ze.left=Ze.right:Ze.right=Ze.left,zr(e,n,Ze,i)}var f=et(n,e.doc.direction),g=t.ch,v=t.sticky;if(g>=n.text.length?(g=n.text.length,v="before"):g<=0&&(g=0,v="after"),!f)return l(v=="before"?g-1:g,v=="before");function L(Ie,Ge,Ze){var tt=f[Ge],rt=tt.level==1;return l(Ze?Ie-1:Ie,rt!=Ze)}var I=Qe(f,g,v),ce=$e,ae=L(g,I,v=="before");return ce!=null&&(ae.other=L(g,ce,v!="before")),ae}function da(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Ji(e.display)*t.ch);var n=ft(e.doc,t.line),r=Zn(n)+Hr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function yo(e,t,i,n,r){var s=Ve(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function bo(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return yo(n.first,0,null,-1,-1);var r=Nn(n,i),s=n.first+n.size-1;if(r>s)return yo(n.first+n.size-1,ft(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=ft(n,r);;){var f=zs(e,l,r,t,i),g=ni(l,f.ch+(f.xRel>0||f.outside>0?1:0));if(!g)return f;var v=g.find(1);if(v.line==r)return v;l=ft(n,r=v.line)}}function fa(e,t,i,n){n-=go(t);var r=t.text.length,s=Je(function(l){return ri(e,i,l-1).bottom<=n},r,0);return r=Je(function(l){return ri(e,i,l).top>n},s,r),{begin:s,end:r}}function pa(e,t,i,n){i||(i=$i(e,t));var r=zr(e,t,ri(e,i,n),"line").top;return fa(e,t,i,r)}function xo(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-=Zn(t);var s=$i(e,t),l=go(t),f=0,g=t.text.length,v=!0,L=et(t,e.doc.direction);if(L){var I=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,L,n,r);v=I.level!=1,f=v?I.from:I.to-1,g=v?I.to:I.from-1}var ce=null,ae=null,Ie=Je(function(xt){var gt=ri(e,s,xt);return gt.top+=l,gt.bottom+=l,xo(gt,n,r,!1)?(gt.top<=r&>.left<=n&&(ce=xt,ae=gt),!0):!1},f,g),Ge,Ze,tt=!1;if(ae){var rt=n-ae.left<ae.right-n,nt=rt==v;Ie=ce+(nt?0:1),Ze=nt?"after":"before",Ge=rt?ae.left:ae.right}else{!v&&(Ie==g||Ie==f)&&Ie++,Ze=Ie==0?"after":Ie==t.text.length?"before":ri(e,s,Ie-(v?1:0)).bottom+l<=r==v?"after":"before";var ut=Qn(e,Ve(i,Ie,Ze),"line",t,s);Ge=ut.left,tt=r<ut.top?-1:r>=ut.bottom?1:0}return Ie=Ne(t.text,Ie,1),yo(i,Ie,Ze,tt,n-Ge)}function Gs(e,t,i,n,r,s,l){var f=Je(function(I){var ce=r[I],ae=ce.level!=1;return xo(Qn(e,Ve(i,ae?ce.to:ce.from,ae?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),g=r[f];if(f>0){var v=g.level!=1,L=Qn(e,Ve(i,v?g.from:g.to,v?"after":"before"),"line",t,n);xo(L,s,l,!0)&&L.top>l&&(g=r[f-1])}return g}function Vs(e,t,i,n,r,s,l){var f=fa(e,t,n,l),g=f.begin,v=f.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var L=null,I=null,ce=0;ce<r.length;ce++){var ae=r[ce];if(ae.from>=v||ae.to<=g)continue;var Ie=ae.level!=1,Ge=ri(e,n,Ie?Math.min(v,ae.to)-1:Math.max(g,ae.from)).right,Ze=Ge<s?s-Ge+1e9:Ge-s;(!L||I>Ze)&&(L=ae,I=Ze)}return L||(L=r[r.length-1]),L.from<g&&(L={from:g,to:L.to,level:L.level}),L.to>v&&(L={from:L.from,to:v,level:L.level}),L}var Pi;function Yi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Pi==null){Pi=w("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(w("br"));Pi.appendChild(document.createTextNode("x"))}pe(e.measure,Pi);var i=Pi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Pe(e.measure),i||1}function Ji(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=w("span","xxxxxxxxxx"),i=w("pre",[t],"CodeMirror-line-like");pe(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Co(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var f=e.display.gutterSpecs[l].className;i[f]=s.offsetLeft+s.clientLeft+r,n[f]=s.clientWidth}return{fixedPos:_o(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _o(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ma(e){var t=Yi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Ji(e.display)-3);return function(r){if(Mn(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 wo(e){var t=e.doc,i=ma(e);t.iter(function(n){var r=i(n);r!=n.height&&Cn(n,r)})}function Ni(e,t,i,n){var r=e.display;if(!i&&me(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(I){return null}var g=bo(e,s,l),v;if(n&&g.xRel>0&&(v=ft(e.doc,g.line).text).length==g.ch){var L=_(v,v.length,e.options.tabSize)-v.length;g=Ve(g.line,Math.max(0,Math.round((s-na(e.display).left)/Ji(e.display))-L))}return g}function Ii(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 Sn(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)_n&&yi(e.doc,t)<r.viewTo&&Ci(e);else if(i<=r.viewFrom)_n&&Ur(e.doc,i+n)>r.viewFrom?Ci(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ci(e);else if(t<=r.viewFrom){var s=Gr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Ci(e)}else if(i>=r.viewTo){var l=Gr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ci(e)}else{var f=Gr(e,t,t,-1),g=Gr(e,i,i+n,1);f&&g?(r.view=r.view.slice(0,f.index).concat(Bt(e,f.lineN,g.lineN)).concat(r.view.slice(g.index)),r.viewTo+=n):Ci(e)}var v=r.externalMeasured;v&&(i<v.lineN?v.lineN+=n:t<v.lineN+v.size&&(r.externalMeasured=null))}function xi(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[Ii(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);ne(l,i)==-1&&l.push(i)}function Ci(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,i,n){var r=Ii(e,t),s,l=e.display.view;if(!_n||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var f=e.display.viewFrom,g=0;g<r;g++)f+=l[g].size;if(f!=t){if(n>0){if(r==l.length-1)return null;s=f+l[r].size-t,r++}else s=f-t;t+=s,i+=s}for(;yi(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=Bt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Bt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Ii(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Bt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Ii(e,i)))),n.viewTo=i}function ga(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 va(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var f=i.sel.ranges[l];if(f.from().line>=e.display.viewTo||f.to().line<e.display.viewFrom)continue;var g=f.empty();(g||e.options.showCursorWhenSelecting)&&ya(e,f.head,r),g||Xs(e,f,s)}return n}function ya(e,t,i){var n=Qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(w("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(w("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 Vr(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=na(e.display),f=l.left,g=Math.max(n.sizerWidth,Di(e)-n.sizer.offsetLeft)-l.right,v=r.direction=="ltr";function L(nt,ut,xt,gt){ut<0&&(ut=0),ut=Math.round(ut),gt=Math.round(gt),s.appendChild(w("div",null,"CodeMirror-selected","position: absolute; left: "+nt+`px;
|
|
top: `+ut+"px; width: "+(xt==null?g-nt:xt)+`px;
|
|
height: `+(gt-ut)+"px"))}function I(nt,ut,xt){var gt=ft(r,nt),kt=gt.text.length,Kt,cn;function Yt(nn,An){return vo(e,Ve(nt,nn),"div",gt,An)}function Dn(nn,An,gn){var sn=pa(e,gt,null,nn),rn=An=="ltr"==(gn=="after")?"left":"right",Zt=gn=="after"?sn.begin:sn.end-(/\s/.test(gt.text.charAt(sn.end-1))?2:1);return Yt(Zt,rn)[rn]}var Tn=et(gt,r.direction);return We(Tn,ut||0,xt==null?kt:xt,function(nn,An,gn,sn){var rn=gn=="ltr",Zt=Yt(nn,rn?"left":"right"),On=Yt(An-1,rn?"right":"left"),ur=ut==null&&nn==0,Ti=xt==null&&An==kt,yn=sn==0,oi=!Tn||sn==Tn.length-1;if(On.top-Zt.top<=3){var dn=(v?ur:Ti)&&yn,$o=(v?Ti:ur)&&oi,gi=dn?f:(rn?Zt:On).left,Wi=$o?g:(rn?On:Zt).right;L(gi,Zt.top,Wi-gi,Zt.bottom)}else{var Hi,xn,hr,Yo;rn?(Hi=v&&ur&&yn?f:Zt.left,xn=v?g:Dn(nn,gn,"before"),hr=v?f:Dn(An,gn,"after"),Yo=v&&Ti&&oi?g:On.right):(Hi=v?Dn(nn,gn,"before"):f,xn=!v&&ur&&yn?g:Zt.right,hr=!v&&Ti&&oi?f:On.left,Yo=v?Dn(An,gn,"after"):g),L(Hi,Zt.top,xn-Hi,Zt.bottom),Zt.bottom<On.top&&L(f,Zt.bottom,null,On.top),L(hr,On.top,Yo-hr,On.bottom)}(!Kt||Vr(Zt,Kt)<0)&&(Kt=Zt),Vr(On,Kt)<0&&(Kt=On),(!cn||Vr(Zt,cn)<0)&&(cn=Zt),Vr(On,cn)<0&&(cn=On)}),{start:Kt,end:cn}}var ce=t.from(),ae=t.to();if(ce.line==ae.line)I(ce.line,ce.ch,ae.ch);else{var Ie=ft(r,ce.line),Ge=ft(r,ae.line),Ze=wn(Ie)==wn(Ge),tt=I(ce.line,ce.ch,Ze?Ie.text.length+1:null).end,rt=I(ae.line,Ze?0:null,ae.ch).start;Ze&&(tt.top<rt.top-2?(L(tt.right,tt.top,null,tt.bottom),L(f,rt.top,rt.left,rt.bottom)):L(tt.right,tt.top,rt.left-tt.right,tt.bottom)),tt.bottom<rt.top&&L(f,tt.bottom,null,rt.top)}i.appendChild(s)}function Eo(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()||Zi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function ba(e){e.state.focused||(e.display.input.focus(),So(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zi(e))},100)}function So(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,z(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),J&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Eo(e)}function Zi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(Be(e,"blur",e,t),e.state.focused=!1,Ce(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Kr(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(N&&te<8){var g=r.node.offsetTop+r.node.offsetHeight;l=g-i,i=g}else{var v=r.node.getBoundingClientRect();l=v.bottom-v.top,!s&&r.text.firstChild&&(f=r.text.firstChild.getBoundingClientRect().right-v.left-1)}var L=r.line.height-l;if((L>.005||L<-.005)&&(Cn(r.line,l),Ca(r.line),r.rest))for(var I=0;I<r.rest.length;I++)Ca(r.rest[I]);if(f>e.display.sizerWidth){var ce=Math.ceil(f/Ji(e.display));ce>e.display.maxLineLength&&(e.display.maxLineLength=ce,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ca(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Xr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Hr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Nn(t,n),l=Nn(t,r);if(i&&i.ensure){var f=i.ensure.from.line,g=i.ensure.to.line;f<s?(s=f,l=Nn(t,Zn(ft(t,f))+e.wrapper.clientHeight)):Math.min(g,t.lastLine())>=l&&(s=Nn(t,Zn(ft(t,g))-e.wrapper.clientHeight),l=g)}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&&!F){var s=w("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Hr(e.display))+`px;
|
|
height: `+(t.bottom-t.top+ii(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?Ve(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Ve(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,f=Qn(e,t),g=!i||i==t?f:Qn(e,i);r={left:Math.min(f.left,g.left),top:Math.min(f.top,g.top)-n,right:Math.max(f.left,g.left),bottom:Math.max(f.bottom,g.bottom)+n};var v=ko(e,r),L=e.doc.scrollTop,I=e.doc.scrollLeft;if(v.scrollTop!=null&&(xr(e,v.scrollTop),Math.abs(e.doc.scrollTop-L)>1&&(l=!0)),v.scrollLeft!=null&&(ji(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-I)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=ko(e,t);i.scrollTop!=null&&xr(e,i.scrollTop),i.scrollLeft!=null&&ji(e,i.scrollLeft)}function ko(e,t){var i=e.display,n=Yi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=po(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var f=e.doc.height+fo(i),g=t.top<n,v=t.bottom>f-n;if(t.top<r)l.scrollTop=g?0:t.top;else if(t.bottom>r+s){var L=Math.min(t.top,(v?f:t.bottom)-s);L!=r&&(l.scrollTop=L)}var I=e.options.fixedGutter?0:i.gutters.offsetWidth,ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-I,ae=Di(e)-i.gutters.offsetWidth,Ie=t.right-t.left>ae;return Ie&&(t.right=t.left+ae),t.left<10?l.scrollLeft=0:t.left<ce?l.scrollLeft=Math.max(0,t.left+I-(Ie?0:10)):t.right>ae+ce-3&&(l.scrollLeft=t.right+(Ie?0:10)-ae),l}function To(e,t){if(t==null)return;$r(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qi(e){$r(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)&&$r(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){$r(e),e.curOp.scrollToPos=t}function $r(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=da(e,t.from),n=da(e,t.to);_a(e,i,n,t.margin)}}function _a(e,t,i,n){var r=ko(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;ye||Oo(e,{top:t}),wa(e,t,!0),ye&&Oo(e),wr(e,100)}function wa(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 ji(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,Aa(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+fo(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+ii(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Bi=function(e,t,i){this.cm=i;var n=this.vert=w("div",[w("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=w("div",[w("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Oe(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Oe(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,N&&te<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Bi.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}},Bi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bi.prototype.zeroWidthHack=function(){var e=ue&&!V?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new M,this.disableVert=new M},Bi.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)},Bi.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 qi(e,t){t||(t=Cr(e));var i=e.display.barWidth,n=e.display.barHeight;Ea(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Kr(e),Ea(e,Cr(e)),i=e.display.barWidth,n=e.display.barHeight}function Ea(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 Sa={native:Bi,null:_r};function ka(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ce(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Sa[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Oe(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"?ji(e,t):xr(e,t)},e),e.display.scrollbars.addClass&&z(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Ui(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},Vn(e.curOp)}function Fi(e){var t=e.curOp;t&&Wr(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&&Fr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ao(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Kr(t),e.barMeasure=Cr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ra(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+ii(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Di(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&&ji(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==he();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&qi(t,e.barMeasure),e.updatedDisplay&&Mo(t,e.barMeasure),e.selectionChanged&&Eo(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&ba(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Ta(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&wa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ji(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 g=0;g<l.length;++g)l[g].lines.length&&Be(l[g],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Be(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Rn(e,t){if(e.curOp)return t();Ui(e);try{return t()}finally{Fi(e)}}function un(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ui(e);try{return t.apply(e,arguments)}finally{Fi(e)}}}function bn(e){return function(){if(this.curOp)return e.apply(this,arguments);Ui(this);try{return e.apply(this,arguments)}finally{Fi(this)}}}function hn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ui(t);try{return e.apply(this,arguments)}finally{Fi(t)}}}function wr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,m(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=qe(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?zn(t.mode,n.state):null,g=U(e,s,n,!0);f&&(n.state=f),s.styles=g.styles;var v=s.styleClasses,L=g.classes;L?s.styleClasses=L:v&&(s.styleClasses=null);for(var I=!l||l.length!=s.styles.length||v!=L&&(!v||!L||v.bgClass!=L.bgClass||v.textClass!=L.textClass),ce=0;!I&&ce<l.length;++ce)I=l[ce]!=s.styles[ce];I&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&<(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&&Rn(e,function(){for(var s=0;s<r.length;s++)xi(e,r[s],"text")})}var Yr=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Xr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Di(e),this.force=i,this.dims=Co(e),this.events=[]};Yr.prototype.signal=function(e,t){H(e,t)&&this.events.push(arguments)},Yr.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=ii(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ii(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=he();if(!t||!S(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&S(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==he())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&S(document.body,e.anchorNode)&&S(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 Ao(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Ci(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&&ga(e)==0)return!1;Oa(e)&&(Ci(e),t.dims=Co(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),_n&&(s=yi(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=Zn(ft(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var g=ga(e);if(!f&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=sl(e);return g>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(v),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 Ta(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Di(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+fo(e.display)-po(e),i.top)}),t.visible=Xr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Xr(e.display,e.doc,i));if(!Ao(e,t))break;Kr(e);var r=Cr(e);yr(e),qi(e,r),Mo(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 Oo(e,t){var i=new Yr(e,t);if(Ao(e,i)){Kr(e),Ta(e,i);var n=Cr(e);yr(e),qi(e,n),Mo(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(Ie){var Ge=Ie.nextSibling;return J&&ue&&e.display.currentWheelTarget==Ie?Ie.style.display="none":Ie.parentNode.removeChild(Ie),Ge}for(var g=n.view,v=n.viewFrom,L=0;L<g.length;L++){var I=g[L];if(!I.hidden)if(!I.node||I.node.parentNode!=s){var ce=Is(e,I,v,i);s.insertBefore(ce,l)}else{for(;l!=I.node;)l=f(l);var ae=r&&t!=null&&t<=v&&I.lineNumber;I.changes&&(ne(I.changes,"gutter")>-1&&(ae=!1),Zo(e,I,v,i)),ae&&(Pe(I.lineNumber),I.lineNumber.appendChild(document.createTextNode(hi(e.options,v)))),l=I.node.nextSibling}v+=I.size}for(;l;)l=f(l)}function Lo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Mo(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+ii(e)+"px"}function Aa(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_o(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var f=i[l].alignable;if(f)for(var g=0;g<f.length;g++)f[g].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function Oa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=hi(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(w("div",[w("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",Lo(e.display),!0}return!1}function Ro(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 La(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(w("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",Lo(e)}function Er(e){La(e.display),Sn(e),Aa(e)}function hl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=w("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=w("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=re("div",null,"CodeMirror-code"),r.selectionDiv=w("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=w("div",null,"CodeMirror-cursors"),r.measure=w("div",null,"CodeMirror-measure"),r.lineMeasure=w("div",null,"CodeMirror-measure"),r.lineSpace=re("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=re("div",[r.lineSpace],"CodeMirror-lines");r.mover=w("div",[s],null,"position: relative"),r.sizer=w("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=w("div",null,null,"position: absolute; height: "+we+"px; width: 1px;"),r.gutters=w("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=w("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=w("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),N&&te<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!J&&!(ye&&Z)&&(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=Ro(n.gutters,n.lineNumbers),La(r),i.init(r)}var Jr=0,Fn=null;N?Fn=-.53:ye?Fn=15:D?Fn=-.7:oe&&(Fn=-1/3);function Ma(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=Ma(e);return t.x*=Fn,t.y*=Fn,t}function Ra(e,t){var i=Ma(t),n=i.x,r=i.y,s=e.display,l=s.scroller,f=l.scrollWidth>l.clientWidth,g=l.scrollHeight>l.clientHeight;if(!(n&&f||r&&g))return;if(r&&ue&&J){e:for(var v=t.target,L=s.view;v!=l;v=v.parentNode)for(var I=0;I<L.length;I++)if(L[I].node==v){e.display.currentWheelTarget=v;break e}}if(n&&!ye&&!B&&Fn!=null){r&&g&&xr(e,Math.max(0,l.scrollTop+r*Fn)),ji(e,Math.max(0,l.scrollLeft+n*Fn)),(!r||r&&g)&&x(t),s.wheelStartX=null;return}if(r&&Fn!=null){var ce=r*Fn,ae=e.doc.scrollTop,Ie=ae+s.wrapper.clientHeight;ce<0?ae=Math.max(0,ae+ce-50):Ie=Math.min(e.doc.height,Ie+ce+50),Oo(e,{top:ae,bottom:Ie})}Jr<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 Ge=l.scrollLeft-s.wheelStartX,Ze=l.scrollTop-s.wheelStartY,tt=Ze&&s.wheelDY&&Ze/s.wheelDY||Ge&&s.wheelDX&&Ge/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!tt)return;Fn=(Fn*Jr+tt)/(Jr+1),++Jr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Wn=function(e,t){this.ranges=e,this.primIndex=t};Wn.prototype.primary=function(){return this.ranges[this.primIndex]},Wn.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(!ci(i.anchor,n.anchor)||!ci(i.head,n.head))return!1}return!0},Wn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ft(Ai(this.ranges[t].anchor),Ai(this.ranges[t].head));return new Wn(e,this.primIndex)},Wn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Wn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(_t(t,n.from())>=0&&_t(e,n.to())<=0)return i}return-1};var Ft=function(e,t){this.anchor=e,this.head=t};Ft.prototype.from=function(){return Oi(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(ce,ae){return _t(ce.from(),ae.from())}),i=ne(t,r);for(var s=1;s<t.length;s++){var l=t[s],f=t[s-1],g=_t(f.to(),l.from());if(n&&!l.empty()?g>0:g>=0){var v=Oi(f.from(),l.from()),L=di(f.to(),l.to()),I=f.empty()?l.from()==l.head:f.from()==f.head;s<=i&&--i,t.splice(--s,2,new Ft(I?L:v,I?v:L))}}return new Wn(t,i)}function _i(e,t){return new Wn([new Ft(e,t||e)],0)}function wi(e){return e.text?Ve(e.from.line+e.text.length-1,b(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Da(e,t){if(_t(e,t.from)<0)return e;if(_t(e,t.to)<=0)return wi(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+=wi(t).ch-t.to.ch),Ve(i,n)}function Do(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Ft(Da(r.anchor,t),Da(r.head,t)))}return qn(e.cm,i,e.sel.primIndex)}function Pa(e,t,i){return e.line==t.line?Ve(i.line,e.ch-t.ch+i.ch):Ve(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=Ve(e.first,0),s=r,l=0;l<t.length;l++){var f=t[l],g=Pa(f.from,r,s),v=Pa(wi(f),r,s);if(r=f.to,s=v,i=="around"){var L=e.sel.ranges[l],I=_t(L.head,L.anchor)<0;n[l]=new Ft(I?v:g,I?g:v)}else n[l]=new Ft(g,g)}return new Wn(n,e.sel.primIndex)}function Po(e){e.doc.mode=Xn(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&&Sn(e)}function Na(e,t){return t.from.ch==0&&t.to.ch==0&&b(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function No(e,t,i,n){function r(rt){return i?i[rt]:null}function s(rt,nt,ut){Jo(rt,nt,ut,n),mn(rt,"change",rt,t)}function l(rt,nt){for(var ut=[],xt=rt;xt<nt;++xt)ut.push(new Ri(v[xt],r(xt),n));return ut}var f=t.from,g=t.to,v=t.text,L=ft(e,f.line),I=ft(e,g.line),ce=b(v),ae=r(v.length-1),Ie=g.line-f.line;if(t.full)e.insert(0,l(0,v.length)),e.remove(v.length,e.size-v.length);else if(Na(e,t)){var Ge=l(0,v.length-1);s(I,I.text,ae),Ie&&e.remove(f.line,Ie),Ge.length&&e.insert(f.line,Ge)}else if(L==I)if(v.length==1)s(L,L.text.slice(0,f.ch)+ce+L.text.slice(g.ch),ae);else{var Ze=l(1,v.length-1);Ze.push(new Ri(ce+L.text.slice(g.ch),ae,n)),s(L,L.text.slice(0,f.ch)+v[0],r(0)),e.insert(f.line+1,Ze)}else if(v.length==1)s(L,L.text.slice(0,f.ch)+v[0]+I.text.slice(g.ch),r(0)),e.remove(f.line+1,Ie);else{s(L,L.text.slice(0,f.ch)+v[0],r(0)),s(I,ce+I.text.slice(g.ch),ae);var tt=l(1,v.length-1);Ie>1&&e.remove(f.line+1,Ie-1),e.insert(f.line+1,tt)}mn(e,"change",e,t)}function Ei(e,t,i){function n(r,s,l){if(r.linked)for(var f=0;f<r.linked.length;++f){var g=r.linked[f];if(g.doc==s)continue;var v=l&&g.sharedHist;if(i&&!v)continue;t(g.doc,v),n(g.doc,r,v)}}n(e,null,!0)}function Ia(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,wo(e),Po(e),ja(e),e.options.lineWrapping||Fr(e),e.options.mode=t.modeOption,Sn(e)}function ja(e){(e.doc.direction=="rtl"?z:Ce)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Rn(e,function(){ja(e),Sn(e)})}function Zr(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 Io(e,t){var i={from:Ai(t.from),to:wi(t),text:Pn(e,t.from,t.to)};return Fa(e,i,t.from.line,t.to.line+1),Ei(e,function(n){return Fa(n,i,t.from.line,t.to.line+1)},!0),i}function Ba(e){for(;e.length;){var t=b(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ba(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 Ua(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),_t(t.from,t.to)==0&&_t(t.from,f.to)==0?f.to=wi(t):l.changes.push(Io(e,t));else{var g=b(r.done);for((!g||!g.ranges)&&Qr(e.sel,r.done),l={changes:[Io(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:Qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ba(r.undone)}function Qr(e,t){var i=b(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fa(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 Wa(e,t){var i=yl(e,t),n=Jn(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var f=0;f<l.length;++f){for(var g=l[f],v=0;v<s.length;++v)if(s[v].marker==g.marker)continue e;s.push(g)}}else l&&(i[r]=l)}return i}function er(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Wn.prototype.deepCopy.call(s):s);continue}var l=s.changes,f=[];n.push({changes:f});for(var g=0;g<l.length;++g){var v=l[g],L=void 0;if(f.push({from:v.from,to:v.to,text:v.text}),t)for(var I in v)(L=I.match(/^spans_(\d+)$/))&&(ne(t,Number(L[1]))>-1&&(b(f)[I]=v[I],delete v[I]))}}return n}function jo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=_t(t,r)<0;s!=_t(i,r)<0?(r=t,t=i):s!=_t(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)),vn(e,new Wn([jo(e.sel.primary(),t,i,r)],0),n)}function Ha(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]=jo(e.sel.ranges[s],t[s],null,r);var l=qn(e.cm,n,e.sel.primIndex);vn(e,l,i)}function Bo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,vn(e,qn(e.cm,r,e.sel.primIndex),n)}function za(e,t,i,n){vn(e,_i(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 Ga(e,t,i){var n=e.history.done,r=b(n);r&&r.ranges?(n[n.length-1]=t,eo(e,t,i)):vn(e,t,i)}function vn(e,t,i){eo(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function eo(e,t,i){(H(e,"beforeSelectionChange")||e.cm&&H(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(_t(t.primary().head,e.sel.primary().head)<0?-1:1);Va(e,Xa(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Qi(e.cm)}function Va(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,q(e.cm)),mn(e,"cursorActivity",e)}function Ka(e){Va(e,Xa(e,e.sel,null,!1))}function Xa(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],f=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],g=to(e,l.anchor,f&&f.anchor,i,n),v=to(e,l.head,f&&f.head,i,n);(r||g!=l.anchor||v!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Ft(g,v))}return r?qn(e.cm,r,t.primIndex):t}function tr(e,t,i,n,r){var s=ft(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var f=s.markedSpans[l],g=f.marker,v="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,L="selectRight"in g?!g.selectRight:g.inclusiveRight;if((f.from==null||(v?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(L?f.to>=t.ch:f.to>t.ch))){if(r&&(Be(g,"beforeCursorEnter"),g.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!g.atomic)continue;if(i){var I=g.find(n<0?1:-1),ce=void 0;if((n<0?L:v)&&(I=$a(e,I,-n,I&&I.line==t.line?s:null)),I&&I.line==t.line&&(ce=_t(I,i))&&(n<0?ce<0:ce>0))return tr(e,I,t,n,r)}var ae=g.find(n<0?-1:1);return(n<0?v:L)&&(ae=$a(e,ae,n,ae.line==t.line?s:null)),ae?tr(e,ae,t,n,r):null}}return t}function to(e,t,i,n,r){var s=n||1,l=tr(e,t,i,s,r)||!r&&tr(e,t,i,s,!0)||tr(e,t,i,-s,r)||!r&&tr(e,t,i,-s,!0);return l||(e.cantEdit=!0,Ve(e.first,0))}function $a(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Ve(t.line-1)):null:i>0&&t.ch==(n||ft(e,t.line)).text.length?t.line<e.first+e.size-1?Ve(t.line+1,0):null:new Ve(t.line,t.ch+i)}function Ya(e){e.setSelection(Ve(e.firstLine(),0),Ve(e.lastLine()),be)}function Ja(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 nr(e,t,i){if(e.cm){if(!e.cm.curOp)return un(e.cm,nr)(e,t,i);if(e.cm.state.suppressEdits)return}if((H(e,"beforeChange")||e.cm&&H(e.cm,"beforeChange"))&&(t=Ja(e,t,!0),!t))return;var n=zi&&!i&&Li(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Za(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Za(e,t)}function Za(e,t){if(t.text.length==1&&t.text[0]==""&&_t(t.from,t.to)==0)return;var i=Do(e,t);Ua(e,t,i,e.cm?e.cm.curOp.id:NaN),kr(e,t,i,Jn(e,t));var n=[];Ei(e,function(r,s){!s&&ne(n,r.history)==-1&&(ts(r.history,t),n.push(r.history)),kr(r,t,null,Jn(r,t))})}function no(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,f=t=="undo"?r.done:r.undone,g=t=="undo"?r.undone:r.done,v=0;v<f.length&&!(s=f[v],i?s.ranges&&!s.equals(e.sel):!s.ranges);v++);if(v==f.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=f.pop(),s.ranges){if(Qr(s,g),i&&!s.equals(e.sel)){vn(e,s,{clearRedo:!1});return}l=s}else if(n){f.push(s);return}else break;var L=[];Qr(l,g),g.push({changes:L,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var I=H(e,"beforeChange")||e.cm&&H(e.cm,"beforeChange"),ce=function(Ge){var Ze=s.changes[Ge];if(Ze.origin=t,I&&!Ja(e,Ze,!1))return f.length=0,{};L.push(Io(e,Ze));var tt=Ge?Do(e,Ze):b(f);kr(e,Ze,tt,Wa(e,Ze)),!Ge&&e.cm&&e.cm.scrollIntoView({from:Ze.from,to:wi(Ze)});var rt=[];Ei(e,function(nt,ut){!ut&&ne(rt,nt.history)==-1&&(ts(nt.history,Ze),rt.push(nt.history)),kr(nt,Ze,null,Wa(nt,Ze))})},ae=s.changes.length-1;ae>=0;--ae){var Ie=ce(ae);if(Ie)return Ie.v}}function Qa(e,t){if(t==0)return;if(e.first+=t,e.sel=new Wn(P(e.sel.ranges,function(r){return new Ft(Ve(r.anchor.line+t,r.anchor.ch),Ve(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Sn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)xi(e.cm,n,"gutter")}}function kr(e,t,i,n){if(e.cm&&!e.cm.curOp)return un(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:Ve(e.first,0),to:Ve(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:Ve(s,ft(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Pn(e,t.from,t.to),i||(i=Do(e,t)),e.cm?xl(e.cm,t,n):No(e,t,n),eo(e,i,be),e.cantEdit&&to(e,Ve(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,f=!1,g=s.line;e.options.lineWrapping||(g=At(wn(ft(n,s.line))),n.iter(g,l.line+1,function(ae){if(ae==r.maxLine)return f=!0,!0})),n.sel.contains(t.from,t.to)>-1&&q(e),No(n,t,i,ma(e)),e.options.lineWrapping||(n.iter(g,s.line+t.text.length,function(ae){var Ie=Xi(ae);Ie>r.maxLineLength&&(r.maxLine=ae,r.maxLineLength=Ie,r.maxLineChanged=!0,f=!1)}),f&&(e.curOp.updateMaxLine=!0)),Gn(n,s.line),wr(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?Sn(e):s.line==l.line&&t.text.length==1&&!Na(e.doc,t)?xi(e,s.line,"text"):Sn(e,s.line,l.line+1,v);var L=H(e,"changes"),I=H(e,"change");if(I||L){var ce={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};I&&mn(e,"change",e,ce),L&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ce)}e.display.selForContextMenu=null}function ir(e,t,i,n,r){var s;n||(n=i),_t(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),nr(e,{from:i,to:n,text:t,origin:r})}function qa(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function es(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++)qa(s.ranges[f].anchor,t,i,n),qa(s.ranges[f].head,t,i,n);continue}for(var g=0;g<s.changes.length;++g){var v=s.changes[g];if(i<v.from.line)v.from=Ve(v.from.line+n,v.from.ch),v.to=Ve(v.to.line+n,v.to.ch);else if(t<=v.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ts(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;es(e.done,i,n,r),es(e.undone,i,n,r)}function Tr(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=ft(e,c(e,t)):r=At(t),r==null?null:(n(s,r)&&e.cm&&xi(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),mn(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 g=new Ar(r.lines.slice(f,f+=25));r.height-=g.height,this.children.splice(++n,0,g),g.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Or(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=ne(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=At(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);Cn(i,Math.max(0,i.height-s)),e&&(Rn(e,function(){ns(e,i,-s),xi(e,n,"widget")}),mn(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;Mn(this.doc,n)||Cn(n,n.height+r),i&&Rn(i,function(){i.curOp.forceUpdate=!0,ns(i,n,r),mn(i,"lineWidgetChanged",i,e,At(n))})},X(Lr);function ns(e,t,i){Zn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&To(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&&!Mn(e,l)){var g=Zn(l)<e.scrollTop;Cn(l,l.height+gr(r)),g&&To(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&mn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:At(t)),r}var is=0,Si=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++is};Si.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ui(e),H(this,"clear")){var i=this.find();i&&mn(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=Yn(l.markedSpans,this);e&&!this.collapsed?xi(e,At(l),"text"):e&&(f.to!=null&&(r=At(l)),f.from!=null&&(n=At(l))),l.markedSpans=fi(l.markedSpans,f),f.from==null&&this.collapsed&&!Mn(this.doc,l)&&e&&Cn(l,Yi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var g=0;g<this.lines.length;++g){var v=wn(this.lines[g]),L=Xi(v);L>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=L,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Sn(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ka(e.doc)),e&&mn(e,"markerCleared",e,this,n,r),t&&Fi(e),this.parent&&this.parent.clear()},Si.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=Yn(s.markedSpans,this);if(l.from!=null&&(i=Ve(t?s:At(s),l.from),e==-1))return i;if(l.to!=null&&(n=Ve(t?s:At(s),l.to),e==1))return n}return i&&{from:i,to:n}},Si.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Rn(n,function(){var r=t.line,s=At(t.line),l=mo(n,s);if(l&&(sa(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Mn(i.doc,r)&&i.height!=null){var f=i.height;i.height=null;var g=gr(i)-f;g&&Cn(r,r.height+g)}mn(n,"markerChanged",n,e)})},Si.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ne(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Si.prototype.detachLine=function(e){if(this.lines.splice(ne(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},X(Si);function rr(e,t,i,n,r){if(n&&n.shared)return _l(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return un(e.cm,rr)(e,t,i,n,r);var s=new Si(e,r),l=_t(t,i);if(n&&p(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=re("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Qt(e,t.line,t,i,s)||t.line!=i.line&&Qt(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ln()}s.addToHistory&&Ua(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var f=t.line,g=e.cm,v;if(e.iter(f,i.line+1,function(I){g&&s.collapsed&&!g.options.lineWrapping&&wn(I)==g.display.maxLine&&(v=!0),s.collapsed&&f!=t.line&&Cn(I,0),ti(I,new vi(s,f==t.line?t.ch:null,f==i.line?i.ch:null)),++f}),s.collapsed&&e.iter(t.line,i.line+1,function(I){Mn(e,I)&&Cn(I,0)}),s.clearOnEnter&&Oe(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(Bn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++is,s.atomic=!0),g){if(v&&(g.curOp.updateMaxLine=!0),s.collapsed)Sn(g,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var L=t.line;L<=i.line;L++)xi(g,L,"text");s.atomic&&Ka(g.doc),mn(g,"markerAdded",g,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();mn(this,"clear")},Mr.prototype.find=function(e,t){return this.primary.find(e,t)},X(Mr);function _l(e,t,i,n,r){n=p(n),n.shared=!1;var s=[rr(e,t,i,n,r)],l=s[0],f=n.widgetNode;return Ei(e,function(g){f&&(n.widgetNode=f.cloneNode(!0)),s.push(rr(g,o(g,t),o(g,i),n,r));for(var v=0;v<g.linked.length;++v)if(g.linked[v].isParent)return;l=b(s)}),new Mr(s,l)}function rs(e){return e.findMarks(Ve(e.first,0),e.clipPos(Ve(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(_t(s,l)){var f=rr(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];Ei(r.primary.doc,function(g){return s.push(g)});for(var l=0;l<r.markers.length;l++){var f=r.markers[l];ne(s,f.doc)==-1&&(f.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,kn=function(e,t,i,n,r){if(!(this instanceof kn))return new kn(e,t,i,n,r);i==null&&(i=0),Or.call(this,[new Ar([new Ri("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Ve(i,0);this.sel=_i(s),this.history=new Zr(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)),No(this,{from:s,to:s,text:e}),vn(this,_i(s),be)};kn.prototype=xe(Or.prototype,{constructor:kn,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:hn(function(e){var t=Ve(this.first,0),i=this.first+this.size-1;nr(this,{from:t,to:Ve(i,ft(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),vn(this,_i(t),be)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,ir(this,e,t,i,n)},getRange:function(e,t,i){var n=Pn(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($n(this,e))return ft(this,e)},getLineNumber:function(e){return At(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ft(this,e)),wn(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:hn(function(e,t,i){za(this,o(this,typeof e=="number"?Ve(e,t||0):e),null,i)}),setSelection:hn(function(e,t,i){za(this,o(this,e),o(this,t||e),i)}),extendSelection:hn(function(e,t,i){qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:hn(function(e,t){Ha(this,u(this,e),t)}),extendSelectionsBy:hn(function(e,t){var i=P(this.sel.ranges,e);Ha(this,u(this,i),t)}),setSelections:hn(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)),vn(this,qn(this.cm,n,t),i)}),addSelection:hn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Ft(o(this,e),o(this,t||e))),vn(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=Pn(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=Pn(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:hn(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var f=t&&t!="end"&&dl(this,n,t),g=n.length-1;g>=0;g--)nr(this,n[g]);f?Ga(this,f):this.cm&&Qi(this.cm)}),undo:hn(function(){no(this,"undo")}),redo:hn(function(){no(this,"redo")}),undoSelection:hn(function(){no(this,"undo",!0)}),redoSelection:hn(function(){no(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 Zr(this.history.maxGeneration),Ei(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:er(this.history.done),undone:er(this.history.undone)}},setHistory:function(e){var t=this.history=new Zr(this.history.maxGeneration);t.done=er(e.done.slice(0),null,!0),t.undone=er(e.undone.slice(0),null,!0)},setGutterMarker:hn(function(e,t,i){return Tr(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Me(r)&&(n.gutterMarkers=null),!0})}),clearGutter:hn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Tr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Me(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!$n(this,e))return null;if(t=e,e=ft(this,e),!e)return null}else if(t=At(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:hn(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(fe(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:hn(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(fe(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:hn(function(e,t,i){return Cl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return rr(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),rr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=ft(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var f=0;f<l.length;f++){var g=l[f];!(g.to!=null&&r==e.line&&e.ch>=g.to||g.from==null&&r!=e.line||g.from!=null&&r==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&n.push(g.marker.parent||g.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,Ve(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 kn(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 kn(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,rs(this)),n},unlinkDoc:function(e){if(e instanceof $t&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),El(rs(this));break}if(e.history==this.history){var n=[e.id];Ei(e,function(r){return n.push(r.id)},!0),e.history=new Zr(null),e.history.done=er(this.history.done,n),e.history.undone=er(this.history.undone,n)}},iterLinkedDocs:function(e){Ei(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Et(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:hn(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)})}),kn.prototype.eachLine=kn.prototype.iter;var os=0;function kl(e){var t=this;if(as(t),Ye(t,e)||pi(t.display,e))return;x(e),N&&(os=+new Date);var i=Ni(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&&un(t,function(){i=o(t.doc,i);var ae={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ie){return Ie!=null}).join(t.doc.lineSeparator())),origin:"paste"};nr(t.doc,ae),Ga(t.doc,_i(o(t.doc,i),o(t.doc,wi(ae))))})()},g=function(ae,Ie){if(t.options.allowDropFileTypes&&ne(t.options.allowDropFileTypes,ae.type)==-1){f();return}var Ge=new FileReader;Ge.onerror=function(){return f()},Ge.onload=function(){var Ze=Ge.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ze)){f();return}s[Ie]=Ze,f()},Ge.readAsText(ae)},v=0;v<n.length;v++)g(n[v],v);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var L=e.dataTransfer.getData("Text");if(L){var I;if(t.state.draggingText&&!t.state.draggingText.copy&&(I=t.listSelections()),eo(t.doc,_i(i,i)),I)for(var ce=0;ce<I.length;++ce)ir(t.doc,"",I[ce].anchor,I[ce].head,"drag");t.replaceSelection(L,"around","paste"),t.display.input.focus()}}catch(ae){}}}function Tl(e,t){if(N&&(!e.state.draggingText||+new Date-os<100)){A(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&&!oe){var i=w("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",B&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),B&&i.parentNode.removeChild(i)}}function Al(e,t){var i=Ni(e,t);if(!i)return;var n=document.createDocumentFragment();ya(e,i,n),e.display.dragCursor||(e.display.dragCursor=w("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),pe(e.display.dragCursor,n)}function as(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ss(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 ls=!1;function Ol(){if(ls)return;Ll(),ls=!0}function Ll(){var e;Oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ss(Ml)},100))}),Oe(window,"blur",function(){return ss(Zi)})}function Ml(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var ki={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++)ki[Rr+48]=ki[Rr+96]=String(Rr);for(var io=65;io<=90;io++)ki[io]=String.fromCharCode(io);for(var Dr=1;Dr<=12;Dr++)ki[Dr+111]=ki[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=ue?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=P(i.split(" "),Rl),s=0;s<r.length;s++){var l=void 0,f=void 0;s==r.length-1?(f=r.join(" "),l=n):(f=r.slice(0,s+1).join(" "),l="...");var g=t[f];if(!g)t[f]=l;else if(g!=l)throw new Error("Inconsistent bindings for "+f)}delete e[i]}for(var v in t)e[v]=t[v];return e}function or(e,t,i,n){t=ro(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 or(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=or(e,t.fallthrough[s],i,n);if(l)return l}}}function us(e){var t=typeof e=="string"?e:ki[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ge?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ge?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function cs(e,t){if(B&&e.keyCode==34&&e.char)return!1;var i=ki[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),hs(i,e,t))}function ro(e){return typeof e=="string"?mi[e]:e}function ar(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&_t(s.from,b(n).to)<=0;){var l=n.pop();if(_t(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Rn(e,function(){for(var f=n.length-1;f>=0;f--)ir(e.doc,"",n[f].from,n[f].to,"+delete");Qi(e)})}function Uo(e,t,i){var n=Ne(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Fo(e,t,i){var n=Uo(e,t.ch,i);return n==null?null:new Ve(t.line,n,i<0?"after":"before")}function Wo(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=et(i,t.doc.direction);if(s){var l=r<0?b(s):s[0],f=r<0==(l.level==1),g=f?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var L=$i(t,i);v=r<0?i.text.length-1:0;var I=ri(t,L,v).top;v=Je(function(ce){return ri(t,L,ce).top==I},r<0==(l.level==1)?l.from:l.to-1,v),g=="before"&&(v=Uo(i,v,1))}else v=r<0?l.to:l.from;return new Ve(n,v,g)}}return new Ve(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=et(t,e.doc.direction);if(!r)return Fo(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 Fo(t,i,n);var f=function(tt,rt){return Uo(t,tt instanceof Ve?tt.ch:tt,rt)},g,v=function(tt){return e.options.lineWrapping?(g=g||$i(e,t),pa(e,t,g,tt)):{begin:0,end:t.text.length}},L=v(i.sticky=="before"?f(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var I=l.level==1==n<0,ce=f(i,I?1:-1);if(ce!=null&&(I?ce<=l.to&&ce<=L.end:ce>=l.from&&ce>=L.begin)){var ae=I?"before":"after";return new Ve(i.line,ce,ae)}}var Ie=function(tt,rt,nt){for(var ut=function(Kt,cn){return cn?new Ve(i.line,f(Kt,1),"before"):new Ve(i.line,Kt,"after")};tt>=0&&tt<r.length;tt+=rt){var xt=r[tt],gt=rt>0==(xt.level!=1),kt=gt?nt.begin:f(nt.end,-1);if(xt.from<=kt&&kt<xt.to)return ut(kt,gt);if(kt=gt?xt.from:f(xt.to,-1),nt.begin<=kt&&kt<nt.end)return ut(kt,gt)}},Ge=Ie(s+n,n,L);if(Ge)return Ge;var Ze=n>0?L.end:f(L.begin,-1);return Ze!=null&&!(n>0&&Ze==t.text.length)&&(Ge=Ie(n>0?0:r.length-1,n,v(Ze)),Ge)?Ge:null}var Pr={selectAll:Ya,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),be)},killLine:function(e){return ar(e,function(t){if(t.empty()){var i=ft(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Ve(t.head.line+1,0)}:{from:t.head,to:Ve(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ar(e,function(t){return{from:Ve(t.from().line,0),to:o(e.doc,Ve(t.to().line+1,0))}})},delLineLeft:function(e){return ar(e,function(t){return{from:Ve(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ar(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 ar(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(Ve(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ve(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ds(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return fs(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")},ie)},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")},ie)},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/)?fs(e,t.head):n},ie)},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=_(e.getLine(s.line),s.ch,n);t.push(R(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Rn(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=ft(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Ve(r.line,r.ch-1)),r.ch>0)r=new Ve(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Ve(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=ft(e.doc,r.line-1).text;l&&(r=new Ve(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),Ve(r.line-1,l.length-1),r,"+transpose"))}}i.push(new Ft(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Rn(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);Qi(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ds(e,t){var i=ft(e.doc,t),n=wn(i);return n!=i&&(t=At(n)),Wo(!0,e,n,t,1)}function Nl(e,t){var i=ft(e.doc,t),n=Vi(i);return n!=i&&(t=At(n)),Wo(!0,e,i,t,-1)}function fs(e,t){var i=ds(e,t.line),n=ft(e.doc,i.line),r=et(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 Ve(i.line,l?0:s,i.sticky)}return i}function oo(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)!=Re}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=or(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&or(t,e.options.extraKeys,i,e)||or(t,e.options.keyMap,i,e)}var jl=new M;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(us(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())}),ps(e,r+" "+t,i,n))return!0}return ps(e,t,i,n)}function ps(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&mn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(x(i),Eo(e)),!!r}function ms(e,t){var i=cs(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return oo(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return oo(e,n)}):Nr(e,i,t,function(n){return oo(e,n)}):!1}function Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return oo(e,n,!0)})}var Ho=null;function gs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=he(),Ye(t,e))return;N&&te<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=ms(t,e);B&&(Ho=n?i:null,!n&&i==88&&!Xt&&(ue?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),ye&&!ue&&!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;z(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(Ce(t,"CodeMirror-crosshair"),at(document,"keyup",i),at(document,"mouseover",i))}Oe(document,"keyup",i),Oe(document,"mouseover",i)}function vs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ye(this,e)}function ys(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||ue&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(B&&i==Ho){Ho=null,x(e);return}if(B&&(!e.which||e.which<10)&&ms(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Bl(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,zo=function(e,t,i){this.time=e,this.pos=t,this.button=i};zo.prototype.compare=function(e,t,i){return this.time+Fl>e&&_t(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 zo(i,e,t),Ir=null,"double"):(Ir=new zo(i,e,t),jr=null,"single")}function bs(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)){J||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Go(t,e))return;var n=Ni(t,e),r=ee(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):me(e)==i.scroller&&x(e):r==2?(n&&qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(ze?t.display.input.onContextMenu(e):xa(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,hs(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)!=Re}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=je?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=ue?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(ue?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){N?setTimeout(m(ba,e),0):e.curOp.focus=he();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Ue&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(_t((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(_t(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=un(e,function(v){J&&(r.scroller.draggable=!1),e.state.draggingText=!1,at(r.wrapper.ownerDocument,"mouseup",l),at(r.wrapper.ownerDocument,"mousemove",f),at(r.scroller,"dragstart",g),at(r.scroller,"drop",l),s||(x(v),n.addNew||qr(e.doc,i,null,null,n.extend),J&&!oe||N&&te==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),f=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},g=function(){return s=!0};J&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Oe(r.wrapper.ownerDocument,"mouseup",l),Oe(r.wrapper.ownerDocument,"mousemove",f),Oe(r.scroller,"dragstart",g),Oe(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,i){if(i=="char")return new Ft(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Ft(Ve(t.line,0),o(e.doc,Ve(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;x(t);var l,f,g=s.sel,v=g.ranges;if(n.addNew&&!n.extend?(f=s.sel.contains(i),f>-1?l=v[f]:l=new Ft(i,i)):(l=s.sel.primary(),f=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new Ft(i,i)),i=Ni(e,t,!0,!0),f=-1;else{var L=xs(e,i,n.unit);n.extend?l=jo(l,L.anchor,L.head,n.extend):l=L}n.addNew?f==-1?(f=v.length,vn(s,qn(e,v.concat([l]),f),{scroll:!1,origin:"*mouse"})):v.length>1&&v[f].empty()&&n.unit=="char"&&!n.extend?(vn(s,qn(e,v.slice(0,f).concat(v.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),g=s.sel):Bo(s,f,l,ve):(f=0,vn(s,new Wn([l],0),ve),g=s.sel);var I=i;function ce(nt){if(_t(I,nt)==0)return;if(I=nt,n.unit=="rectangle"){for(var ut=[],xt=e.options.tabSize,gt=_(ft(s,i.line).text,i.ch,xt),kt=_(ft(s,nt.line).text,nt.ch,xt),Kt=Math.min(gt,kt),cn=Math.max(gt,kt),Yt=Math.min(i.line,nt.line),Dn=Math.min(e.lastLine(),Math.max(i.line,nt.line));Yt<=Dn;Yt++){var Tn=ft(s,Yt).text,nn=le(Tn,Kt,xt);Kt==cn?ut.push(new Ft(Ve(Yt,nn),Ve(Yt,nn))):Tn.length>nn&&ut.push(new Ft(Ve(Yt,nn),Ve(Yt,le(Tn,cn,xt))))}ut.length||ut.push(new Ft(i,i)),vn(s,qn(e,g.ranges.slice(0,f).concat(ut),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(nt)}else{var An=l,gn=xs(e,nt,n.unit),sn=An.anchor,rn;_t(gn.anchor,sn)>0?(rn=gn.head,sn=Oi(An.from(),gn.anchor)):(rn=gn.anchor,sn=di(An.to(),gn.head));var Zt=g.ranges.slice(0);Zt[f]=Xl(e,new Ft(o(s,sn),rn)),vn(s,qn(e,Zt,f),ve)}}var ae=r.wrapper.getBoundingClientRect(),Ie=0;function Ge(nt){var ut=++Ie,xt=Ni(e,nt,!0,n.unit=="rectangle");if(!xt)return;if(_t(xt,I)!=0){e.curOp.focus=he(),ce(xt);var gt=Xr(r,s);(xt.line>=gt.to||xt.line<gt.from)&&setTimeout(un(e,function(){Ie==ut&&Ge(nt)}),150)}else{var kt=nt.clientY<ae.top?-20:nt.clientY>ae.bottom?20:0;kt&&setTimeout(un(e,function(){if(Ie!=ut)return;r.scroller.scrollTop+=kt,Ge(nt)}),50)}}function Ze(nt){e.state.selectingText=!1,Ie=Infinity,nt&&(x(nt),r.input.focus()),at(r.wrapper.ownerDocument,"mousemove",tt),at(r.wrapper.ownerDocument,"mouseup",rt),s.history.lastSelOrigin=null}var tt=un(e,function(nt){nt.buttons===0||!ee(nt)?Ze(nt):Ge(nt)}),rt=un(e,Ze);e.state.selectingText=rt,Oe(r.wrapper.ownerDocument,"mousemove",tt),Oe(r.wrapper.ownerDocument,"mouseup",rt)}function Xl(e,t){var i=t.anchor,n=t.head,r=ft(e.doc,i.line);if(_t(i,n)==0&&i.sticky==n.sticky)return t;var s=et(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 g=l+(f.from==i.ch==(f.level!=1)?0:1);if(g==0||g==s.length)return t;var v;if(n.line!=i.line)v=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var L=Qe(s,n.ch,n.sticky),I=L-l||(n.ch-i.ch)*(f.level==1?-1:1);L==g-1||L==g?v=I<0:v=I>0}var ce=s[g+(v?-1:0)],ae=v==(ce.level==1),Ie=ae?ce.from:ce.to,Ge=ae?"after":"before";return i.ch==Ie&&i.sticky==Ge?t:new Ft(new Ve(i.line,Ie,Ge),n)}function Cs(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(ce){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&x(t);var l=e.display,f=l.lineDiv.getBoundingClientRect();if(s>f.bottom||!H(e,i))return k(t);s-=f.top-l.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var v=l.gutters.childNodes[g];if(v&&v.getBoundingClientRect().right>=r){var L=Nn(e.doc,s),I=e.display.gutterSpecs[g];return Be(e,i,e,L,I.className,t),k(t)}}}function Go(e,t){return Cs(e,t,"gutterClick",!0)}function _s(e,t){if(pi(e.display,t)||$l(e,t))return;if(Ye(e,t,"contextmenu"))return;ze||e.display.input.onContextMenu(t)}function $l(e,t){return H(e,"gutterContextMenu")?Cs(e,t,"gutterContextMenu",!1):!1}function ws(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 sr={toString:function(){return"CodeMirror.Init"}},Es={},ao={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(f,g,v){v!=sr&&s(f,g,v)}:s)}e.defineOption=i,e.Init=sr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,Po(n)},!0),i("indentUnit",2,Po,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Sr(n),vr(n),Sn(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(g){for(var v=0;;){var L=g.text.indexOf(r,v);if(L==-1)break;v=L+r.length,s.push(Ve(l,L))}l++});for(var f=s.length-1;f>=0;f--)ir(n.doc,r,s[f],Ve(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!=sr&&n.refresh()}),i("specialCharPlaceholder",jt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",Z?"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",!Ke),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){ws(n),Er(n)},!0),i("keyMap","default",function(n,r,s){var l=ro(r),f=s!=sr&&ro(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=Ro(r,n.options.lineNumbers),Er(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?_o(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return qi(n)},!0),i("scrollbarStyle","native",function(n){ka(n),qi(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=Ro(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"&&(Zi(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!=sr;if(!t!=!n){var r=e.display.dragFunctions,s=t?Oe:at;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?(z(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ce(e.display.wrapper,"CodeMirror-wrap"),Fr(e)),wo(e),Sn(e),vr(e),setTimeout(function(){return qi(e)},100)}function $t(e,t){var i=this;if(!(this instanceof $t))return new $t(e,t);this.options=t=t?p(t):{},p(Es,t,!1);var n=t.value;typeof n=="string"?n=new kn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new $t.inputStyles[t.inputStyle](this),s=this.display=new hl(e,n,r,t);s.wrapper.CodeMirror=this,ws(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ka(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 M,keySeq:null,specialChars:null},t.autofocus&&!Z&&s.input.focus(),N&&te<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Ol(),Ui(this),this.curOp.forceUpdate=!0,Ia(this,n),t.autofocus&&!Z||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&So(i)},20):Zi(this);for(var l in ao)ao.hasOwnProperty(l)&&ao[l](this,t[l],sr);Oa(this),t.finishInit&&t.finishInit(this);for(var f=0;f<Vo.length;++f)Vo[f](this);Fi(this),J&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}$t.defaults=Es,$t.optionHandlers=ao;function Ql(e){var t=e.display;Oe(t.scroller,"mousedown",un(e,bs)),N&&te<11?Oe(t.scroller,"dblclick",un(e,function(g){if(Ye(e,g))return;var v=Ni(e,g);if(!v||Go(e,g)||pi(e.display,g))return;x(g);var L=e.findWordAt(v);qr(e.doc,L.anchor,L.head)})):Oe(t.scroller,"dblclick",function(g){return Ye(e,g)||x(g)}),Oe(t.scroller,"contextmenu",function(g){return _s(e,g)}),Oe(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||_s(e,g)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(g){if(g.touches.length!=1)return!1;var v=g.touches[0];return v.radiusX<=1&&v.radiusY<=1}function l(g,v){if(v.left==null)return!0;var L=v.left-g.left,I=v.top-g.top;return L*L+I*I>20*20}Oe(t.scroller,"touchstart",function(g){if(!Ye(e,g)&&!s(g)&&!Go(e,g)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),Oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Oe(t.scroller,"touchend",function(g){var v=t.activeTouch;if(v&&!pi(t,g)&&v.left!=null&&!v.moved&&new Date-v.start<300){var L=e.coordsChar(t.activeTouch,"page"),I;!v.prev||l(v,v.prev)?I=new Ft(L,L):!v.prev.prev||l(v,v.prev.prev)?I=e.findWordAt(L):I=new Ft(Ve(L.line,0),o(e.doc,Ve(L.line+1,0))),e.setSelection(I.anchor,I.head),e.focus(),x(g)}r()}),Oe(t.scroller,"touchcancel",r),Oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xr(e,t.scroller.scrollTop),ji(e,t.scroller.scrollLeft,!0),Be(e,"scroll",e))}),Oe(t.scroller,"mousewheel",function(g){return Ra(e,g)}),Oe(t.scroller,"DOMMouseScroll",function(g){return Ra(e,g)}),Oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){Ye(e,g)||A(g)},over:function(g){Ye(e,g)||(Al(e,g),A(g))},start:function(g){return Tl(e,g)},drop:un(e,kl),leave:function(g){Ye(e,g)||as(e)}};var f=t.input.getField();Oe(f,"keyup",function(g){return vs.call(e,g)}),Oe(f,"keydown",un(e,gs)),Oe(f,"keypress",un(e,ys)),Oe(f,"focus",function(g){return So(e,g)}),Oe(f,"blur",function(g){return Zi(e,g)})}var Vo=[];$t.defineInitHook=function(e){return Vo.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=qe(e,t).state:i="prev");var l=e.options.tabSize,f=ft(r,t),g=_(f.text,null,l);f.stateAfter&&(f.stateAfter=null);var v=f.text.match(/^\s*/)[0],L;if(!n&&!/\S/.test(f.text))L=0,i="not";else if(i=="smart"&&(L=r.mode.indent(s,f.text.slice(v.length),f.text),L==Re||L>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?L=_(ft(r,t-1).text,null,l):L=0:i=="add"?L=g+e.options.indentUnit:i=="subtract"?L=g-e.options.indentUnit:typeof i=="number"&&(L=g+i),L=Math.max(0,L);var I="",ce=0;if(e.options.indentWithTabs)for(var ae=Math.floor(L/l);ae;--ae)ce+=l,I+=" ";if(ce<L&&(I+=R(L-ce)),I!=v)return ir(r,I,Ve(t,0),Ve(t,v.length),"+input"),f.stateAfter=null,!0;for(var Ie=0;Ie<r.sel.ranges.length;Ie++){var Ge=r.sel.ranges[Ie];if(Ge.head.line==t&&Ge.head.ch<v.length){var Ze=Ve(t,v.length);Bo(r,Ie,new Ft(Ze,Ze));break}}}var ei=null;function so(e){ei=e}function Ko(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,f=r=="paste"||e.state.pasteIncoming>l,g=Et(t),v=null;if(f&&n.ranges.length>1)if(ei&&ei.text.join(`
|
|
`)==t){if(n.ranges.length%ei.text.length==0){v=[];for(var L=0;L<ei.text.length;L++)v.push(s.splitLines(ei.text[L]))}}else g.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(v=P(g,function(tt){return[tt]}));for(var I=e.curOp.updateInput,ce=n.ranges.length-1;ce>=0;ce--){var ae=n.ranges[ce],Ie=ae.from(),Ge=ae.to();ae.empty()&&(i&&i>0?Ie=Ve(Ie.line,Ie.ch-i):e.state.overwrite&&!f?Ge=Ve(Ge.line,Math.min(ft(s,Ge.line).text.length,Ge.ch+b(g).length)):f&&ei&&ei.lineWise&&ei.text.join(`
|
|
`)==g.join(`
|
|
`)&&(Ie=Ge=Ve(Ie.line,0)));var Ze={from:Ie,to:Ge,text:v?v[ce%v.length]:g,origin:r||(f?"paste":e.state.cutIncoming>l?"cut":"+input")};nr(e.doc,Ze),mn(e,"inputRead",e,Ze)}t&&!f&&ks(e,t),Qi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=I),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ss(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Rn(t,function(){return Ko(t,i,0,null,"paste")}),!0}function ks(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(ft(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&mn(e,"electricInput",e,r.head.line)}}function Ts(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:Ve(r,0),head:Ve(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function As(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Os(){var e=w("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=w("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return J?e.style.width="1000px":e.setAttribute("wrap","off"),Y&&(e.style.border="1px solid black"),As(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)&&un(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"](ro(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:bn(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");E(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Sn(this)}),removeOverlay:bn(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++,Sn(this);return}}}),indentLine:bn(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),$n(this.doc,n)&&Br(this,n,r,s)}),indentSelection:bn(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&&Qi(this));else{var g=f.from(),v=f.to(),L=Math.max(s,g.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var I=L;I<s;++I)Br(this,I,n);var ce=this.doc.sel.ranges;g.ch==0&&r.length==ce.length&&ce[l].from().ch>0&&Bo(this.doc,l,new Ft(g,ce[l].to()),be)}}}),getTokenAt:function(n,r){return Vt(this,n,r)},getLineTokens:function(n,r){return Vt(this,Ve(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Fe(this,ft(this.doc,n.line)),s=0,l=(r.length-1)/2,f=n.ch,g;if(f==0)g=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=f)l=v;else if(r[v*2+1]<f)s=v+1;else{g=r[v*2+2];break}}var L=g?g.indexOf("overlay "):-1;return L<0?g:L==0?null:g.slice(0,L-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],f=this.getModeAt(n);if(typeof f[r]=="string")l[f[r]]&&s.push(l[f[r]]);else if(f[r])for(var g=0;g<f[r].length;g++){var v=l[f[r][g]];v&&s.push(v)}else f.helperType&&l[f.helperType]?s.push(l[f.helperType]):l[f.name]&&s.push(l[f.name]);for(var L=0;L<l._global.length;L++){var I=l._global[L];I.pred(f,this)&&ne(s,I.val)==-1&&s.push(I.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=c(s,n==null?s.first+s.size-1:n),qe(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 vo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=ca(this,n,r||"page"),bo(this,n.left,n.top)},lineAtHeight:function(n,r){return n=ca(this,{top:n,left:0},r||"page").top,Nn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,f;if(typeof n=="number"){var g=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>g&&(n=g,l=!0),f=ft(this.doc,n)}else f=n;return zr(this,f,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Zn(f):0)},defaultTextHeight:function(){return Yi(this.display)},defaultCharWidth:function(){return Ji(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,f){var g=this.display;n=Qn(this,o(this.doc,n));var v=n.bottom,L=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),g.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var I=Math.max(g.wrapper.clientHeight,this.doc.height),ce=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>I)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=I&&(v=n.bottom),L+r.offsetWidth>ce&&(L=ce-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",f=="right"?(L=g.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(f=="left"?L=0:f=="middle"&&(L=(g.sizer.clientWidth-r.offsetWidth)/2),r.style.left=L+"px"),s&&Js(this,{left:L,top:v,right:L+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:bn(gs),triggerOnKeyPress:bn(ys),triggerOnKeyUp:vs,triggerOnMouseDown:bn(bs),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:bn(function(n){ks(this,n)}),findPosH:function(n,r,s,l){var f=1;r<0&&(f=-1,r=-r);for(var g=o(this.doc,n),v=0;v<r&&!(g=Xo(this.doc,g,f,s,l),g.hitSide);++v);return g},moveH:bn(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?Xo(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},ie)}),deleteH:bn(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ar(this,function(f){var g=Xo(l,f.head,n,r,!1);return n<0?{from:g,to:f.head}:{from:f.head,to:g}})}),findPosV:function(n,r,s,l){var f=1,g=l;r<0&&(f=-1,r=-r);for(var v=o(this.doc,n),L=0;L<r;++L){var I=Qn(this,v,"div");if(g==null?g=I.left:I.left=g,v=Ls(this,I,f,s),v.hitSide)break}return v},moveV:bn(function(n,r){var s=this,l=this.doc,f=[],g=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(L){if(g)return n<0?L.from():L.to();var I=Qn(s,L.head,"div");L.goalColumn!=null&&(I.left=L.goalColumn),f.push(I.left);var ce=Ls(s,I,n,r);return r=="page"&&L==l.sel.primary()&&To(s,vo(s,ce,"div").top-I.top),ce},ie),f.length)for(var v=0;v<l.sel.ranges.length;v++)l.sel.ranges[v].goalColumn=f[v]}),findWordAt:function(n){var r=this.doc,s=ft(r,n.line).text,l=n.ch,f=n.ch;if(s){var g=this.getHelper(n,"wordChars");(n.sticky=="before"||f==s.length)&&l?--l:++f;for(var v=s.charAt(l),L=Le(v,g)?function(I){return Le(I,g)}:/\s/.test(v)?function(I){return/\s/.test(I)}:function(I){return!/\s/.test(I)&&!Le(I)};l>0&&L(s.charAt(l-1));)--l;for(;f<s.length&&L(s.charAt(f));)++f}return new Ft(Ve(n.line,l),Ve(n.line,f))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?z(this.display.cursorDiv,"CodeMirror-overwrite"):Ce(this.display.cursorDiv,"CodeMirror-overwrite"),Be(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==he()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:bn(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-ii(this)-this.display.barHeight,width:n.scrollWidth-ii(this)-this.display.barWidth,clientHeight:po(this),clientWidth:Di(this)}},scrollIntoView:bn(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:Ve(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):_a(this,n.from,n.to,n.margin)}),setSize:bn(function(n,r){var s=this,l=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&la(this);var f=this.display.viewFrom;this.doc.iter(f,this.display.viewTo,function(g){if(g.widgets){for(var v=0;v<g.widgets.length;v++)if(g.widgets[v].noHScroll){xi(s,f,"widget");break}}++f}),this.curOp.forceUpdate=!0,Be(this,"refresh",this)}),operation:function(n){return Rn(this,n)},startOperation:function(){return Ui(this)},endOperation:function(){return Fi(this)},refresh:bn(function(){var n=this.display.cachedTextHeight;Sn(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Lo(this.display),(n==null||Math.abs(n-Yi(this.display))>.5||this.options.lineWrapping)&&wo(this),Be(this,"refresh",this)}),swapDoc:bn(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ia(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,mn(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}},X(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 Xo(e,t,i,n,r){var s=t,l=i,f=ft(e,t.line),g=r&&e.direction=="rtl"?-i:i;function v(){var rt=t.line+g;return rt<e.first||rt>=e.first+e.size?!1:(t=new Ve(rt,t.ch,t.sticky),f=ft(e,rt))}function L(rt){var nt;if(n=="codepoint"){var ut=f.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(ut)?nt=null:nt=new Ve(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(ut>=55296&&ut<56320?2:1))),-i)}else r?nt=Pl(e.cm,f,t,i):nt=Fo(f,t,i);if(nt==null)if(!rt&&v())t=Wo(r,e.cm,f,t.line,g);else return!1;else t=nt;return!0}if(n=="char"||n=="codepoint")L();else if(n=="column")L(!0);else if(n=="word"||n=="group")for(var I=null,ce=n=="group",ae=e.cm&&e.cm.getHelper(t,"wordChars"),Ie=!0;!(i<0&&!L(!Ie));Ie=!1){var Ge=f.text.charAt(t.ch)||`
|
|
`,Ze=Le(Ge,ae)?"w":ce&&Ge==`
|
|
`?"n":!ce||/\s/.test(Ge)?null:"p";if(ce&&!Ie&&!Ze&&(Ze="s"),I&&I!=Ze){i<0&&(i=1,L(),t.sticky="after");break}if(Ze&&(I=Ze),i>0&&!L(!Ie))break}var tt=to(e,t,s,l,!0);return ci(s,tt)&&(tt.hitSide=!0),tt}function Ls(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var f=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),g=Math.max(f-.5*Yi(e.display),3);l=(i>0?t.bottom:t.top)+i*g}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var v;!(v=bo(e,s,l),!v.outside);){if(i<0?l<=0:l>=r.height){v.hitSide=!0;break}l+=i*5}return v}var zt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new M,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};zt.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;As(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(f){for(var g=f.target;g;g=g.parentNode){if(g==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}Oe(r,"paste",function(f){if(!s(f)||Ye(n,f)||Ss(f,n))return;te<=11&&setTimeout(un(n,function(){return t.updateFromDOM()}),20)}),Oe(r,"compositionstart",function(f){t.composing={data:f.data,done:!1}}),Oe(r,"compositionupdate",function(f){t.composing||(t.composing={data:f.data,done:!1})}),Oe(r,"compositionend",function(f){t.composing&&(f.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Oe(r,"touchstart",function(){return i.forceCompositionEnd()}),Oe(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(f){if(!s(f)||Ye(n,f))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()}),f.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var g=Ts(n);so({lineWise:!0,text:g.text}),f.type=="cut"&&n.operation(function(){n.setSelections(g.ranges,0,be),n.replaceSelection("",null,"cut")})}else return;if(f.clipboardData){f.clipboardData.clearData();var v=ei.text.join(`
|
|
`);if(f.clipboardData.setData("Text",v),f.clipboardData.getData("Text")==v){f.preventDefault();return}}var L=Os(),I=L.firstChild;n.display.lineSpace.insertBefore(L,n.display.lineSpace.firstChild),I.value=ei.text.join(`
|
|
`);var ce=document.activeElement;T(I),setTimeout(function(){n.display.lineSpace.removeChild(L),ce.focus(),ce==r&&i.showPrimarySelection()},50)}Oe(r,"copy",l),Oe(r,"cut",l)},zt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},zt.prototype.prepareSelection=function(){var e=va(this.cm,!1);return e.focus=document.activeElement==this.div,e},zt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},zt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},zt.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=lo(t,e.anchorNode,e.anchorOffset),l=lo(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&_t(Oi(s,l),n)==0&&_t(di(s,l),r)==0)return;var f=t.display.view,g=n.line>=t.display.viewFrom&&Ms(t,n)||{node:f[0].measure.map[2],offset:0},v=r.line<t.display.viewTo&&Ms(t,r);if(!v){var L=f[f.length-1].measure,I=L.maps?L.maps[L.maps.length-1]:L.map;v={node:I[I.length-1],offset:I[I.length-2]-I[I.length-3]}}if(!g||!v){e.removeAllRanges();return}var ce=e.rangeCount&&e.getRangeAt(0),ae;try{ae=j(g.node,g.offset,v.offset,v.node)}catch(Ie){}ae&&(!ye&&t.state.focused?(e.collapse(g.node,g.offset),ae.collapsed||(e.removeAllRanges(),e.addRange(ae))):(e.removeAllRanges(),e.addRange(ae)),ce&&e.anchorNode==null?e.addRange(ce):ye&&this.startGracePeriod()),this.rememberSelection()},zt.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)},zt.prototype.showMultipleSelections=function(e){pe(this.cm.display.cursorDiv,e.cursors),pe(this.cm.display.selectionDiv,e.selection)},zt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},zt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return S(this.div,t)},zt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},zt.prototype.blur=function(){this.div.blur()},zt.prototype.getField=function(){return this.div},zt.prototype.supportsTouch=function(){return!0},zt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Rn(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)},zt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},zt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(W&&D&&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=lo(t,e.anchorNode,e.anchorOffset),n=lo(t,e.focusNode,e.focusOffset);i&&n&&Rn(t,function(){vn(t.doc,_i(i,n),be),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},zt.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=Ve(n.line-1,ft(e.doc,n.line-1).length)),r.ch==ft(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Ve(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,f;n.line==t.viewFrom||(s=Ii(e,n.line))==0?(l=At(t.view[0].line),f=t.view[0].node):(l=At(t.view[s].line),f=t.view[s-1].node.nextSibling);var g=Ii(e,r.line),v,L;if(g==t.view.length-1?(v=t.viewTo-1,L=t.lineDiv.lastChild):(v=At(t.view[g+1].line)-1,L=t.view[g+1].node.previousSibling),!f)return!1;for(var I=e.doc.splitLines(tu(e,f,L,l,v)),ce=Pn(e.doc,Ve(l,0),Ve(v,ft(e.doc,v).text.length));I.length>1&&ce.length>1;)if(b(I)==b(ce))I.pop(),ce.pop(),v--;else if(I[0]==ce[0])I.shift(),ce.shift(),l++;else break;for(var ae=0,Ie=0,Ge=I[0],Ze=ce[0],tt=Math.min(Ge.length,Ze.length);ae<tt&&Ge.charCodeAt(ae)==Ze.charCodeAt(ae);)++ae;for(var rt=b(I),nt=b(ce),ut=Math.min(rt.length-(I.length==1?ae:0),nt.length-(ce.length==1?ae:0));Ie<ut&&rt.charCodeAt(rt.length-Ie-1)==nt.charCodeAt(nt.length-Ie-1);)++Ie;if(I.length==1&&ce.length==1&&l==n.line)for(;ae&&ae>n.ch&&rt.charCodeAt(rt.length-Ie-1)==nt.charCodeAt(nt.length-Ie-1);)ae--,Ie++;I[I.length-1]=rt.slice(0,rt.length-Ie).replace(/^\u200b+/,""),I[0]=I[0].slice(ae).replace(/\u200b+$/,"");var xt=Ve(l,ae),gt=Ve(v,ce.length?b(ce).length-Ie:0);if(I.length>1||I[0]||_t(xt,gt))return ir(e.doc,I,xt,gt,"+input"),!0},zt.prototype.ensurePolled=function(){this.forceCompositionEnd()},zt.prototype.reset=function(){this.forceCompositionEnd()},zt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},zt.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)},zt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Rn(this.cm,function(){return Sn(e.cm)})},zt.prototype.setUneditable=function(e){e.contentEditable="false"},zt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||un(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},zt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},zt.prototype.onContextMenu=function(){},zt.prototype.resetPosition=function(){},zt.prototype.needsContentAttribute=!0;function Ms(e,t){var i=mo(e,t.line);if(!i||i.hidden)return null;var n=ft(e.doc,t.line),r=ia(i,n,t.line),s=et(n,e.doc.direction),l="left";if(s){var f=Qe(s,t.ch);l=f%2?"right":"left"}var g=aa(r.map,t.ch,l);return g.offset=g.collapse=="right"?g.end:g.start,g}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,f=e.doc.lineSeparator(),g=!1;function v(ae){return function(Ie){return Ie.id==ae}}function L(){l&&(s+=f,g&&(s+=f),l=g=!1)}function I(ae){ae&&(L(),s+=ae)}function ce(ae){if(ae.nodeType==1){var Ie=ae.getAttribute("cm-text");if(Ie){I(Ie);return}var Ge=ae.getAttribute("cm-marker"),Ze;if(Ge){var tt=e.findMarks(Ve(n,0),Ve(r+1,0),v(+Ge));tt.length&&(Ze=tt[0].find(0))&&I(Pn(e.doc,Ze.from,Ze.to).join(f));return}if(ae.getAttribute("contenteditable")=="false")return;var rt=/^(pre|div|p|li|table|br)$/i.test(ae.nodeName);if(!/^br$/i.test(ae.nodeName)&&ae.textContent.length==0)return;rt&&L();for(var nt=0;nt<ae.childNodes.length;nt++)ce(ae.childNodes[nt]);/^(pre|p)$/i.test(ae.nodeName)&&(g=!0),rt&&(l=!0)}else ae.nodeType==3&&I(ae.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ce(t),t==i);)t=t.nextSibling,g=!1;return s}function lo(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return lr(e.clipPos(Ve(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||!S(n,t))return lr(Ve(At(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 lr(Ve(At(s),s.text.length),r)}var l=t.nodeType==3?t:null,f=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));f.parentNode!=n;)f=f.parentNode;var g=e.measure,v=g.maps;function L(Ze,tt,rt){for(var nt=-1;nt<(v?v.length:0);nt++)for(var ut=nt<0?g.map:v[nt],xt=0;xt<ut.length;xt+=3){var gt=ut[xt+2];if(gt==Ze||gt==tt){var kt=At(nt<0?e.line:e.rest[nt]),Kt=ut[xt]+rt;return(rt<0||gt!=Ze)&&(Kt=ut[xt+(rt?1:0)]),Ve(kt,Kt)}}}var I=L(l,f,i);if(I)return lr(I,r);for(var ce=f.nextSibling,ae=l?l.nodeValue.length-i:0;ce;ce=ce.nextSibling){if(I=L(ce,ce.firstChild,0),I)return lr(Ve(I.line,I.ch-ae),r);ae+=ce.textContent.length}for(var Ie=f.previousSibling,Ge=i;Ie;Ie=Ie.previousSibling){if(I=L(Ie,Ie.firstChild,-1),I)return lr(Ve(I.line,I.ch+Ge),r);Ge+=Ie.textContent.length}}var qt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new M,this.hasSelection=!1,this.composing=null};qt.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),Y&&(r.style.width="0px"),Oe(r,"input",function(){N&&te>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Oe(r,"paste",function(l){if(Ye(n,l)||Ss(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Ye(n,l))return;if(n.somethingSelected())so({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var f=Ts(n);so({lineWise:!0,text:f.text}),l.type=="cut"?n.setSelections(f.ranges,null,be):(i.prevInput="",r.value=f.text.join(`
|
|
`),T(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Oe(r,"cut",s),Oe(r,"copy",s),Oe(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)}),Oe(e.lineSpace,"selectstart",function(l){pi(e,l)||x(l)}),Oe(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"})}}),Oe(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},qt.prototype.createField=function(e){this.wrapper=Os(),this.textarea=this.wrapper.firstChild},qt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=va(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},qt.prototype.showSelection=function(e){var t=this.cm,i=t.display;pe(i.cursorDiv,e.cursors),pe(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qt.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&&T(this.textarea),N&&te>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",N&&te>=9&&(this.hasSelection=null))},qt.prototype.getField=function(){return this.textarea},qt.prototype.supportsTouch=function(){return!1},qt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Z||he()!=this.textarea))try{this.textarea.focus()}catch(e){}},qt.prototype.blur=function(){this.textarea.blur()},qt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qt.prototype.receivedFocus=function(){this.slowPoll()},qt.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()})},qt.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)},qt.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||dt(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(N&&te>=9&&this.hasSelection===r||ue&&/[\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 Rn(t,function(){Ko(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qt.prototype.onKeyPress=function(){N&&te>=9&&(this.hasSelection=null),this.fastPoll()},qt.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Ni(i,e),l=n.scroller.scrollTop;if(!s||B)return;var f=i.options.resetSelectionOnContextMenu;f&&i.doc.sel.contains(s)==-1&&un(i,vn)(i.doc,_i(s),be);var g=r.style.cssText,v=t.wrapper.style.cssText,L=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-L.top-5)+"px; left: "+(e.clientX-L.left-5)+`px;
|
|
z-index: 1000; background: `+(N?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var I;J&&(I=window.scrollY),n.input.focus(),J&&window.scrollTo(null,I),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=ae,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ce(){if(r.selectionStart!=null){var Ge=i.somethingSelected(),Ze="\u200B"+(Ge?r.value:"");r.value="\u21DA",r.value=Ze,t.prevInput=Ge?"":"\u200B",r.selectionStart=1,r.selectionEnd=Ze.length,n.selForContextMenu=i.doc.sel}}function ae(){if(t.contextMenuPending!=ae)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=g,N&&te<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!N||N&&te<9)&&ce();var Ge=0,Ze=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?un(i,Ya)(i):Ge++<10?n.detectingSelectAll=setTimeout(Ze,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ze,200)}}if(N&&te>=9&&ce(),ze){A(e);var Ie=function(){at(window,"mouseup",Ie),setTimeout(ae,20)};Oe(window,"mouseup",Ie)}else setTimeout(ae,50)},qt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qt.prototype.setUneditable=function(){},qt.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?p(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=he();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=f.getValue()}var r;if(e.form&&(Oe(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(g){}}t.finishInit=function(g){g.save=n,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,n(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(at(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var f=$t(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return f}function ru(e){e.off=at,e.on=Oe,e.wheelEventPixels=cl,e.Doc=kn,e.splitLines=Et,e.countColumn=_,e.findColumn=le,e.isWordChar=Ee,e.Pass=Re,e.signal=Be,e.Line=Ri,e.changeEnd=wi,e.scrollbarModel=Sa,e.Pos=Ve,e.cmpPos=_t,e.modes=Wt,e.mimeModes=Tt,e.resolveMode=yt,e.getMode=Xn,e.modeExtensions=on,e.extendMode=fn,e.copyState=zn,e.startState=li,e.innerMode=si,e.commands=Pr,e.keyMap=mi,e.keyName=cs,e.isModifierKey=us,e.lookupKey=or,e.normalizeKeyMap=Dl,e.StringStream=Dt,e.SharedTextMarker=Mr,e.TextMarker=Si,e.LineWidget=Lr,e.e_preventDefault=x,e.e_stopPropagation=C,e.e_stop=A,e.addClass=z,e.contains=S,e.rmClass=Ce,e.keyNames=ki}Yl($t),ql($t);var ou="iter insert remove copy getEditor constructor".split(" ");for(var uo in kn.prototype)kn.prototype.hasOwnProperty(uo)&&ne(ou,uo)<0&&($t.prototype[uo]=function(e){return function(){return e.apply(this.doc,arguments)}}(kn.prototype[uo]));return X(kn),$t.inputStyles={textarea:qt,contenteditable:zt},$t.defineMode=function(e){!$t.defaults.mode&&e!="null"&&($t.defaults.mode=e),Hn.apply(this,arguments)},$t.defineMIME=ai,$t.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),$t.defineMIME("text/plain","null"),$t.defineExtension=function(e,t){$t.prototype[e]=t},$t.defineDocExtension=function(e,t){kn.prototype[e]=t},$t.fromTextArea=iu,ru($t),$t.version="5.58.2",$t})},WdTA:function(ct,Xe,y){ct.exports=y.p+"static/studnetqun.598eeb43.png"},Y1PL:function(ct,Xe,y){"use strict";y.r(Xe),y.d(Xe,"ResizableTextArea",function(){return ne});var Q=y("wx14"),Te=y("1OyB"),ye=y("vuIU"),De=y("Ji7U"),Se=y("LK+K"),se=y("q1tI"),N=y("VTBJ"),te=y("rePB"),J=y("Zm9Q"),K=y("Kwbf"),D=y("c+Xe"),B=y("m+aA"),oe=y("bdgK"),V=new Map;function F(be){be.forEach(function(ve){var ie,le=ve.target;(ie=V.get(le))===null||ie===void 0||ie.forEach(function($){return $(le)})})}var Y=new oe.default(F),W=null,Z=null;function ue(be,ve){V.has(be)||(V.set(be,new Set),Y.observe(be)),V.get(be).add(ve)}function je(be,ve){V.has(be)&&(V.get(be).delete(ve),V.get(be).size||(Y.unobserve(be),V.delete(be)))}var Ke=function(be){Object(De.a)(ie,be);var ve=Object(Se.a)(ie);function ie(){return Object(Te.a)(this,ie),ve.apply(this,arguments)}return Object(ye.a)(ie,[{key:"render",value:function(){return this.props.children}}]),ie}(se.Component),_e=se.createContext(null);function ge(be){var ve=be.children,ie=be.onBatchResize,le=se.useRef(0),$=se.useRef([]),R=se.useContext(_e),b=se.useCallback(function(P,E,de){le.current+=1;var xe=le.current;$.current.push({size:P,element:E,data:de}),Promise.resolve().then(function(){xe===le.current&&(ie==null||ie($.current),$.current=[])}),R==null||R(P,E,de)},[ie,R]);return se.createElement(_e.Provider,{value:b},ve)}function ze(be){var ve=be.children,ie=be.disabled,le=se.useRef(null),$=se.useRef(null),R=se.useContext(_e),b=se.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),P=se.isValidElement(ve)&&Object(D.c)(ve),E=P?ve.ref:null,de=se.useMemo(function(){return Object(D.a)(E,le)},[E,le]),xe=se.useRef(be);xe.current=be;var G=se.useCallback(function(Ee){var Le=xe.current,Me=Le.onResize,ke=Le.data,Ae=Ee.getBoundingClientRect(),Ne=Ae.width,Je=Ae.height,We=Ee.offsetWidth,$e=Ee.offsetHeight,Qe=Math.floor(Ne),st=Math.floor(Je);if(b.current.width!==Qe||b.current.height!==st||b.current.offsetWidth!==We||b.current.offsetHeight!==$e){var et={width:Qe,height:st,offsetWidth:We,offsetHeight:$e};b.current=et;var ot=We===Math.round(Ne)?Ne:We,Oe=$e===Math.round(Je)?Je:$e,vt=Object(N.a)(Object(N.a)({},et),{},{offsetWidth:ot,offsetHeight:Oe});R==null||R(vt,Ee,ke),Me&&Promise.resolve().then(function(){Me(vt,Ee)})}},[]);return se.useEffect(function(){var Ee=Object(B.a)(le.current)||Object(B.a)($.current);return Ee&&!ie&&ue(Ee,G),function(){return je(Ee,G)}},[le.current,ie]),se.createElement(Ke,{ref:$},P?se.cloneElement(ve,{ref:de}):ve)}var fe="rc-observer-key";function Ce(be){var ve=be.children,ie=Object(J.a)(ve);return ie.map(function(le,$){var R=(le==null?void 0:le.key)||"".concat(fe,"-").concat($);return se.createElement(ze,Object(Q.a)({},be,{key:R}),le)})}Ce.Collection=ge;var Pe=Ce,pe=y("bT9E"),w=y("TSYQ"),re=y.n(w),j=`
|
|
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
|
|
`,S=["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"],he={},z;function O(be){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ie=be.getAttribute("id")||be.getAttribute("data-reactid")||be.getAttribute("name");if(ve&&he[ie])return he[ie];var le=window.getComputedStyle(be),$=le.getPropertyValue("box-sizing")||le.getPropertyValue("-moz-box-sizing")||le.getPropertyValue("-webkit-box-sizing"),R=parseFloat(le.getPropertyValue("padding-bottom"))+parseFloat(le.getPropertyValue("padding-top")),b=parseFloat(le.getPropertyValue("border-bottom-width"))+parseFloat(le.getPropertyValue("border-top-width")),P=S.map(function(de){return"".concat(de,":").concat(le.getPropertyValue(de))}).join(";"),E={sizingStyle:P,paddingSize:R,borderSize:b,boxSizing:$};return ve&&ie&&(he[ie]=E),E}function T(be){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ie=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,le=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;z||(z=document.createElement("textarea"),z.setAttribute("tab-index","-1"),z.setAttribute("aria-hidden","true"),document.body.appendChild(z)),be.getAttribute("wrap")?z.setAttribute("wrap",be.getAttribute("wrap")):z.removeAttribute("wrap");var $=O(be,ve),R=$.paddingSize,b=$.borderSize,P=$.boxSizing,E=$.sizingStyle;z.setAttribute("style","".concat(E,";").concat(j)),z.value=be.value||be.placeholder||"";var de=Number.MIN_SAFE_INTEGER,xe=Number.MAX_SAFE_INTEGER,G=z.scrollHeight,Ee;if(P==="border-box"?G+=b:P==="content-box"&&(G-=R),ie!==null||le!==null){z.value=" ";var Le=z.scrollHeight-R;ie!==null&&(de=Le*ie,P==="border-box"&&(de=de+R+b),G=Math.max(de,G)),le!==null&&(xe=Le*le,P==="border-box"&&(xe=xe+R+b),Ee=G>xe?"":"hidden",G=Math.min(xe,G))}return{height:G,minHeight:de,maxHeight:xe,overflowY:Ee,resize:"none"}}var m=y("Gytx"),p=y.n(m),_;(function(be){be[be.NONE=0]="NONE",be[be.RESIZING=1]="RESIZING",be[be.RESIZED=2]="RESIZED"})(_||(_={}));var M=function(be){Object(De.a)(ie,be);var ve=Object(Se.a)(ie);function ie(le){var $;return Object(Te.a)(this,ie),$=ve.call(this,le),$.nextFrameActionId=void 0,$.resizeFrameId=void 0,$.textArea=void 0,$.saveTextArea=function(R){$.textArea=R},$.handleResize=function(R){var b=$.state.resizeStatus,P=$.props,E=P.autoSize,de=P.onResize;if(b!==_.NONE)return;typeof de=="function"&&de(R),E&&$.resizeOnNextFrame()},$.resizeOnNextFrame=function(){cancelAnimationFrame($.nextFrameActionId),$.nextFrameActionId=requestAnimationFrame($.resizeTextarea)},$.resizeTextarea=function(){var R=$.props.autoSize;if(!R||!$.textArea)return;var b=R.minRows,P=R.maxRows,E=T($.textArea,!1,b,P);$.setState({textareaStyles:E,resizeStatus:_.RESIZING},function(){cancelAnimationFrame($.resizeFrameId),$.resizeFrameId=requestAnimationFrame(function(){$.setState({resizeStatus:_.RESIZED},function(){$.resizeFrameId=requestAnimationFrame(function(){$.setState({resizeStatus:_.NONE}),$.fixFirefoxAutoScroll()})})})})},$.renderTextArea=function(){var R=$.props,b=R.prefixCls,P=b===void 0?"rc-textarea":b,E=R.autoSize,de=R.onResize,xe=R.className,G=R.disabled,Ee=$.state,Le=Ee.textareaStyles,Me=Ee.resizeStatus,ke=Object(pe.a)($.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ae=re()(P,xe,Object(te.a)({},"".concat(P,"-disabled"),G));"value"in ke&&(ke.value=ke.value||"");var Ne=Object(N.a)(Object(N.a)(Object(N.a)({},$.props.style),Le),Me===_.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return se.createElement(Pe,{onResize:$.handleResize,disabled:!(E||de)},se.createElement("textarea",Object(Q.a)({},ke,{className:Ae,style:Ne,ref:$.saveTextArea})))},$.state={textareaStyles:{},resizeStatus:_.NONE},$}return Object(ye.a)(ie,[{key:"componentDidUpdate",value:function($){($.value!==this.props.value||!p()($.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 $=this.textArea.selectionStart,R=this.textArea.selectionEnd;this.textArea.setSelectionRange($,R)}}catch(b){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ie}(se.Component),ne=M,we=function(be){Object(De.a)(ie,be);var ve=Object(Se.a)(ie);function ie(le){var $;Object(Te.a)(this,ie),$=ve.call(this,le),$.resizableTextArea=void 0,$.focus=function(){$.resizableTextArea.textArea.focus()},$.saveTextArea=function(b){$.resizableTextArea=b},$.handleChange=function(b){var P=$.props.onChange;$.setValue(b.target.value,function(){$.resizableTextArea.resizeTextarea()}),P&&P(b)},$.handleKeyDown=function(b){var P=$.props,E=P.onPressEnter,de=P.onKeyDown;b.keyCode===13&&E&&E(b),de&&de(b)};var R=typeof le.value=="undefined"||le.value===null?le.defaultValue:le.value;return $.state={value:R},$}return Object(ye.a)(ie,[{key:"setValue",value:function($,R){"value"in this.props||this.setState({value:$},R)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return se.createElement(ne,Object(Q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function($){return"value"in $?{value:$.value}:null}}]),ie}(se.Component),Re=Xe.default=we},ZW9T:function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return Ke});var Q=y("k1fw"),Te=y("miYZ"),ye=y("tsqr"),De=y("rAM+"),Se=y("tJVT"),se=y("PpiC"),N=y("q1tI"),te=y.n(N),J=y("bdgK");function K(_e,ge,ze,fe,Ce){var Pe=ge.getWordUntilPosition(ze),pe={startLineNumber:ze.lineNumber,endLineNumber:ze.lineNumber,startColumn:Pe.startColumn,endColumn:Pe.endColumn},w=fe.map(function(re){return{label:re,kind:_e.languages.CompletionItemKind.Keyword,insertText:re,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}});return Ce.map(function(re){w.push(Object(Q.a)(Object(Q.a)({},re),{},{range:pe}))}),w}var D=function(_e){var ge={label:"ifelse",kind:_e.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet},ze=["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"];_e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(pe,w){var re=K(_e,pe,w,ze,[ge]);return{suggestions:re}}});var fe=["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"];_e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(pe,w){var re=[{label:"print",kind:_e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet}],j=K(_e,pe,w,fe,re);return{suggestions:j}}});var Ce=["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"];_e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(pe,w){var re=[ge,{label:"main",kind:_e.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:_e.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet}],j=K(_e,pe,w,Ce,re);return{suggestions:j}}})},B="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",oe=y("LvDl");function V(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}function F(){}var Y=!1,W={"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 Z(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ge=_e;if(Array.isArray(_e)){for(var ze=0;ze<_e.length;ze++){var fe=W[_e[ze]];if(fe)return fe}return ge[0]}return W[ge]||ge}var ue=null,je=Xe.b=function(_e){var ge=_e.width,ze=ge===void 0?"100%":ge,fe=_e.height,Ce=fe===void 0?"100%":fe,Pe=_e.value,pe=_e.language,w=pe===void 0?"javascript":pe,re=_e.style,j=re===void 0?{}:re,S=_e.options,he=S===void 0?{}:S,z=_e.overrideServices,O=z===void 0?{}:z,T=_e.theme,m=T===void 0?"vs-dark":T,p=_e.onEditBlur,_=_e.onSave,M=_e.autoHeight,ne=M===void 0?!1:M,we=_e.forbidCopy,Re=we===void 0?!1:we,be=_e.onChange,ve=be===void 0?F:be,ie=_e.editorDidMount,le=ie===void 0?F:ie,$=_e.onFocus,R=$===void 0?F:$,b=_e.filename,P=b===void 0?"educoder.txt":b,E=Object(se.a)(_e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),de=Object(N.useRef)(),xe=Object(N.useRef)({}),G=Object(N.useRef)(),Ee=Object(N.useRef)(!1),Le=Object(N.useRef)(),Me=Object(N.useState)(!1),ke=Object(Se.a)(Me,2),Ae=ke[0],Ne=ke[1];function Je(){var k;return de.current&&(k=new J.default(function(A){var me=Object(De.a)(A),ee;try{for(me.s();!(ee=me.n()).done;){var Ue=ee.value;(Ue.target.offsetHeight>0||Ue.target.offsetWidth>0)&&xe.current.instance.layout()}}catch(it){me.e(it)}finally{me.f()}}),k.observe(de.current)),k}function We(){ye.b.warn(decodeURIComponent(B))}var $e=function(){var A=xe.current.instance;if(Pe!=null&&A&&Ae){var me=A.getModel();me&&Pe!==me.getValue()&&(Y=!0,me.setValue(Pe),A.layout(),Y=!1)}};Object(N.useEffect)(function(){G.current&&clearTimeout(G.current),G.current=setTimeout(function(){$e()},500)},[Pe,Ae,xe.current]);function Qe(){var k=xe.current.instance;if(k){var A=k.getSelection(),me=xe.current.pastePos||{},ee=new ue.Range(me.startLineNumber||A.endLineNumber,me.startColumn||A.endColumn,me.endLineNumber||A.endLineNumber,me.endColumn||A.endColumn);setTimeout(function(){k.executeEdits("",[{range:ee,text:""}])},300)}}function st(k){(window.navigator.platform.match("Mac")?k.metaKey:k.ctrlKey)&&k.keyCode==83&&(k.preventDefault(),_())}var et=function(){if(ne&&xe.current.instance){var A=xe.current.instance.getContentHeight();x(A<Ce?Ce:A)}else x(Ce)};function ot(k){var A=document.createEvent("MouseEvents");A.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),k.dispatchEvent(A)}function Oe(k,A){var me=window.URL||window.webkitURL||window,ee=new Blob([A]),Ue=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ue.href=me.createObjectURL(ee),Ue.download=k,ot(Ue)}Object(N.useEffect)(function(){et()},[et]),Object(N.useEffect)(function(){de.current&&!Ae&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(k){try{ue=k,xe.current.instance=ue.editor.create(de.current,{value:Pe,language:Z(w),theme:m,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},O);var A=xe.current.instance;if(le(A,ue),setTimeout(function(){et(),xe.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Oe(P||"educoder.txt",A.getValue())}})},500),xe.current.subscription=A.onDidChangeModelContent(function(ee){Ee.current?clearTimeout(Le.current):(et(),ve(A.getValue(),ee)),Le.current=setTimeout(function(){Ee.current=!1},500)}),window.Monaco||D(ue),Re&&(A.addCommand(ue.KeyMod.CtrlCmd|ue.KeyMod.Shift|ue.KeyCode.KEY_V,function(){return We(),null}),A.addCommand(ue.KeyMod.CtrlCmd|ue.KeyCode.KEY_C,function(){return We(),null})),window.Monaco=ue,p&&A.onDidBlurEditorWidget(function(){p(A.getValue())}),R&&A.onDidFocusEditorText(function(){R(A.getValue())}),Re){A.addCommand(ue.KeyMod.CtrlCmd|ue.KeyCode.KEY_V,function(){return We(),null}),A.onDidPaste(function(ee){xe.current.pastePos=ee});try{window.addEventListener("paste",Qe)}catch(ee){}}var me=Je();return Ne(!0),function(){var ee=xe.current.instance;ee.dispose();var Ue=ee.getModel();Ue&&Ue.dispose(),xe.current.subscription&&xe.current.subscription.dispose(),Re&&window.removeEventListener("paste",Qe),me.unobserve(de.current)}}catch(ee){}})},[]),Object(N.useEffect)(function(){var k=xe.current.instance;if(k&&Ae)return document.addEventListener("keydown",st,!1),function(){document.removeEventListener("keydown",st)}},[_,Ae]),Object(N.useEffect)(function(){var k=xe.current.instance;if(k&&Ae){var A=Z(w);ue.editor.setModelLanguage(k.getModel(),A),console.log("language:",w,k.getModel(),A)}},[w,Ae]),Object(N.useEffect)(function(){var k=xe.current.instance;k&&Ae&&ue.editor.setTheme(m)},[m,Ae]),Object(N.useEffect)(function(){var k=xe.current.instance;k&&Ae&&(k.updateOptions(Object(Q.a)({},he)),setTimeout(function(){k.getModel().updateOptions(Object(Q.a)({},he))},200))},[JSON.stringify(he),Ae]),Object(N.useEffect)(function(){var k=xe.current.instance;k&&Ae&&k.layout()},[ze,Ce,Ae]);var vt=Object(N.useState)(V(ze)),at=Object(Se.a)(vt,2),Be=at[0],Ye=at[1],q=Object(N.useState)(V(Ce)),H=Object(Se.a)(q,2),X=H[0],x=H[1],C=Object(Q.a)(Object(Q.a)({},j),{},{width:Be,height:X});return te.a.createElement("div",{className:"my-monaco-editor",ref:de,style:C})};function Ke(_e){var ge=_e.width,ze=ge===void 0?"100%":ge,fe=_e.height,Ce=fe===void 0?"100%":fe,Pe=_e.original,pe=_e.modified,w=_e.language,re=_e.options,j=re===void 0?{}:re,S=Object(N.useRef)(),he=Object(N.useState)(null),z=Object(Se.a)(he,2),O=z[0],T=z[1];function m(ne){var we;return S.current&&(we=new J.default(function(Re){var be=Object(De.a)(Re),ve;try{for(be.s();!(ve=be.n()).done;){var ie=ve.value;(ie.target.offsetHeight>0||ie.target.offsetWidth>0)&&ne.layout()}}catch(le){be.e(le)}finally{be.f()}}),we.observe(S.current)),we}Object(N.useEffect)(function(){S.current&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(ne){ue=ne;var we=ue.editor.createDiffEditor(S.current,Object(Q.a)(Object(Q.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},j),{},{wordWrap:!0}));T(we);var Re=m(we);return function(){we.dispose();var be=we.getModel();be&&be.dispose(),Re.unobserve(S.current)}})},[]),Object(N.useEffect)(function(){O&&O.setModel({original:ue.editor.createModel(Pe,w),modified:ue.editor.createModel(pe,w)})},[Pe,pe,w,O]);var p=V(ze),_=V(Ce),M={width:p,height:_};return te.a.createElement("div",{className:"my-diff-editor",ref:S,style:M})}},ZpRC:function(ct,Xe,y){"use strict";function Q(D){return typeof D=="object"&&D!=null&&D.nodeType===1}function Te(D,B){return(!B||D!=="hidden")&&D!=="visible"&&D!=="clip"}function ye(D,B){if(D.clientHeight<D.scrollHeight||D.clientWidth<D.scrollWidth){var oe=getComputedStyle(D,null);return Te(oe.overflowY,B)||Te(oe.overflowX,B)||function(V){var F=function(Y){if(!Y.ownerDocument||!Y.ownerDocument.defaultView)return null;try{return Y.ownerDocument.defaultView.frameElement}catch(W){return null}}(V);return!!F&&(F.clientHeight<V.scrollHeight||F.clientWidth<V.scrollWidth)}(D)}return!1}function De(D,B,oe,V,F,Y,W,Z){return Y<D&&W>B||Y>D&&W<B?0:Y<=D&&Z<=oe||W>=B&&Z>=oe?Y-D-V:W>B&&Z<oe||Y<D&&Z>oe?W-B+F:0}var Se=function(D,B){var oe=window,V=B.scrollMode,F=B.block,Y=B.inline,W=B.boundary,Z=B.skipOverflowHiddenElements,ue=typeof W=="function"?W:function(Le){return Le!==W};if(!Q(D))throw new TypeError("Invalid target");for(var je=document.scrollingElement||document.documentElement,Ke=[],_e=D;Q(_e)&&ue(_e);){if((_e=_e.parentElement)===je){Ke.push(_e);break}_e!=null&&_e===document.body&&ye(_e)&&!ye(document.documentElement)||_e!=null&&ye(_e,Z)&&Ke.push(_e)}for(var ge=oe.visualViewport?oe.visualViewport.width:innerWidth,ze=oe.visualViewport?oe.visualViewport.height:innerHeight,fe=window.scrollX||pageXOffset,Ce=window.scrollY||pageYOffset,Pe=D.getBoundingClientRect(),pe=Pe.height,w=Pe.width,re=Pe.top,j=Pe.right,S=Pe.bottom,he=Pe.left,z=F==="start"||F==="nearest"?re:F==="end"?S:re+pe/2,O=Y==="center"?he+w/2:Y==="end"?j:he,T=[],m=0;m<Ke.length;m++){var p=Ke[m],_=p.getBoundingClientRect(),M=_.height,ne=_.width,we=_.top,Re=_.right,be=_.bottom,ve=_.left;if(V==="if-needed"&&re>=0&&he>=0&&S<=ze&&j<=ge&&re>=we&&S<=be&&he>=ve&&j<=Re)return T;var ie=getComputedStyle(p),le=parseInt(ie.borderLeftWidth,10),$=parseInt(ie.borderTopWidth,10),R=parseInt(ie.borderRightWidth,10),b=parseInt(ie.borderBottomWidth,10),P=0,E=0,de="offsetWidth"in p?p.offsetWidth-p.clientWidth-le-R:0,xe="offsetHeight"in p?p.offsetHeight-p.clientHeight-$-b:0;if(je===p)P=F==="start"?z:F==="end"?z-ze:F==="nearest"?De(Ce,Ce+ze,ze,$,b,Ce+z,Ce+z+pe,pe):z-ze/2,E=Y==="start"?O:Y==="center"?O-ge/2:Y==="end"?O-ge:De(fe,fe+ge,ge,le,R,fe+O,fe+O+w,w),P=Math.max(0,P+Ce),E=Math.max(0,E+fe);else{P=F==="start"?z-we-$:F==="end"?z-be+b+xe:F==="nearest"?De(we,be,M,$,b+xe,z,z+pe,pe):z-(we+M/2)+xe/2,E=Y==="start"?O-ve-le:Y==="center"?O-(ve+ne/2)+de/2:Y==="end"?O-Re+R+de:De(ve,Re,ne,le,R+de,O,O+w,w);var G=p.scrollLeft,Ee=p.scrollTop;z+=Ee-(P=Math.max(0,Math.min(Ee+P,p.scrollHeight-M+xe))),O+=G-(E=Math.max(0,Math.min(G+E,p.scrollWidth-ne+de)))}T.push({el:p,top:P,left:E})}return T};function se(D){return D===Object(D)&&Object.keys(D).length!==0}function N(D,B){B===void 0&&(B="auto");var oe="scrollBehavior"in document.body.style;D.forEach(function(V){var F=V.el,Y=V.top,W=V.left;F.scroll&&oe?F.scroll({top:Y,left:W,behavior:B}):(F.scrollTop=Y,F.scrollLeft=W)})}function te(D){return D===!1?{block:"end",inline:"nearest"}:se(D)?D:{block:"start",inline:"nearest"}}function J(D,B){var oe=!D.ownerDocument.documentElement.contains(D);if(se(B)&&typeof B.behavior=="function")return B.behavior(oe?[]:Se(D,B));if(oe)return;var V=te(B);return N(Se(D,V),V.behavior)}var K=Xe.a=J},Zss7:function(ct,Xe,y){var Q;(function(Te){var ye=/^\s+/,De=/\s+$/,Se=0,se=Te.round,N=Te.min,te=Te.max,J=Te.random;function K(b,P){if(b=b||"",P=P||{},b instanceof K)return b;if(!(this instanceof K))return new K(b,P);var E=D(b);this._originalInput=b,this._r=E.r,this._g=E.g,this._b=E.b,this._a=E.a,this._roundA=se(100*this._a)/100,this._format=P.format||E.format,this._gradientType=P.gradientType,this._r<1&&(this._r=se(this._r)),this._g<1&&(this._g=se(this._g)),this._b<1&&(this._b=se(this._b)),this._ok=E.ok,this._tc_id=Se++}K.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(),P,E,de,xe,G,Ee;return P=b.r/255,E=b.g/255,de=b.b/255,P<=.03928?xe=P/12.92:xe=Te.pow((P+.055)/1.055,2.4),E<=.03928?G=E/12.92:G=Te.pow((E+.055)/1.055,2.4),de<=.03928?Ee=de/12.92:Ee=Te.pow((de+.055)/1.055,2.4),.2126*xe+.7152*G+.0722*Ee},setAlpha:function(b){return this._a=T(b),this._roundA=se(100*this._a)/100,this},toHsv:function(){var b=F(this._r,this._g,this._b);return{h:b.h*360,s:b.s,v:b.v,a:this._a}},toHsvString:function(){var b=F(this._r,this._g,this._b),P=se(b.h*360),E=se(b.s*100),de=se(b.v*100);return this._a==1?"hsv("+P+", "+E+"%, "+de+"%)":"hsva("+P+", "+E+"%, "+de+"%, "+this._roundA+")"},toHsl:function(){var b=oe(this._r,this._g,this._b);return{h:b.h*360,s:b.s,l:b.l,a:this._a}},toHslString:function(){var b=oe(this._r,this._g,this._b),P=se(b.h*360),E=se(b.s*100),de=se(b.l*100);return this._a==1?"hsl("+P+", "+E+"%, "+de+"%)":"hsla("+P+", "+E+"%, "+de+"%, "+this._roundA+")"},toHex:function(b){return W(this._r,this._g,this._b,b)},toHexString:function(b){return"#"+this.toHex(b)},toHex8:function(b){return Z(this._r,this._g,this._b,this._a,b)},toHex8String:function(b){return"#"+this.toHex8(b)},toRgb:function(){return{r:se(this._r),g:se(this._g),b:se(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+se(this._r)+", "+se(this._g)+", "+se(this._b)+")":"rgba("+se(this._r)+", "+se(this._g)+", "+se(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:se(m(this._r,255)*100)+"%",g:se(m(this._g,255)*100)+"%",b:se(m(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+se(m(this._r,255)*100)+"%, "+se(m(this._g,255)*100)+"%, "+se(m(this._b,255)*100)+"%)":"rgba("+se(m(this._r,255)*100)+"%, "+se(m(this._g,255)*100)+"%, "+se(m(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:z[W(this._r,this._g,this._b,!0)]||!1},toFilter:function(b){var P="#"+ue(this._r,this._g,this._b,this._a),E=P,de=this._gradientType?"GradientType = 1, ":"";if(b){var xe=K(b);E="#"+ue(xe._r,xe._g,xe._b,xe._a)}return"progid:DXImageTransform.Microsoft.gradient("+de+"startColorstr="+P+",endColorstr="+E+")"},toString:function(b){var P=!!b;b=b||this._format;var E=!1,de=this._a<1&&this._a>=0,xe=!P&&de&&(b==="hex"||b==="hex6"||b==="hex3"||b==="hex4"||b==="hex8"||b==="name");return xe?b==="name"&&this._a===0?this.toName():this.toRgbString():(b==="rgb"&&(E=this.toRgbString()),b==="prgb"&&(E=this.toPercentageRgbString()),(b==="hex"||b==="hex6")&&(E=this.toHexString()),b==="hex3"&&(E=this.toHexString(!0)),b==="hex4"&&(E=this.toHex8String(!0)),b==="hex8"&&(E=this.toHex8String()),b==="name"&&(E=this.toName()),b==="hsl"&&(E=this.toHslString()),b==="hsv"&&(E=this.toHsvString()),E||this.toHexString())},clone:function(){return K(this.toString())},_applyModification:function(b,P){var E=b.apply(null,[this].concat([].slice.call(P)));return this._r=E._r,this._g=E._g,this._b=E._b,this.setAlpha(E._a),this},lighten:function(){return this._applyModification(ge,arguments)},brighten:function(){return this._applyModification(ze,arguments)},darken:function(){return this._applyModification(fe,arguments)},desaturate:function(){return this._applyModification(je,arguments)},saturate:function(){return this._applyModification(Ke,arguments)},greyscale:function(){return this._applyModification(_e,arguments)},spin:function(){return this._applyModification(Ce,arguments)},_applyCombination:function(b,P){return b.apply(null,[this].concat([].slice.call(P)))},analogous:function(){return this._applyCombination(j,arguments)},complement:function(){return this._applyCombination(Pe,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(re,arguments)},triad:function(){return this._applyCombination(pe,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},K.fromRatio=function(b,P){if(typeof b=="object"){var E={};for(var de in b)b.hasOwnProperty(de)&&(de==="a"?E[de]=b[de]:E[de]=Re(b[de]));b=E}return K(b,P)};function D(b){var P={r:0,g:0,b:0},E=1,de=null,xe=null,G=null,Ee=!1,Le=!1;return typeof b=="string"&&(b=$(b)),typeof b=="object"&&(le(b.r)&&le(b.g)&&le(b.b)?(P=B(b.r,b.g,b.b),Ee=!0,Le=String(b.r).substr(-1)==="%"?"prgb":"rgb"):le(b.h)&&le(b.s)&&le(b.v)?(de=Re(b.s),xe=Re(b.v),P=Y(b.h,de,xe),Ee=!0,Le="hsv"):le(b.h)&&le(b.s)&&le(b.l)&&(de=Re(b.s),G=Re(b.l),P=V(b.h,de,G),Ee=!0,Le="hsl"),b.hasOwnProperty("a")&&(E=b.a)),E=T(E),{ok:Ee,format:b.format||Le,r:N(255,te(P.r,0)),g:N(255,te(P.g,0)),b:N(255,te(P.b,0)),a:E}}function B(b,P,E){return{r:m(b,255)*255,g:m(P,255)*255,b:m(E,255)*255}}function oe(b,P,E){b=m(b,255),P=m(P,255),E=m(E,255);var de=te(b,P,E),xe=N(b,P,E),G,Ee,Le=(de+xe)/2;if(de==xe)G=Ee=0;else{var Me=de-xe;Ee=Le>.5?Me/(2-de-xe):Me/(de+xe);switch(de){case b:G=(P-E)/Me+(P<E?6:0);break;case P:G=(E-b)/Me+2;break;case E:G=(b-P)/Me+4;break}G/=6}return{h:G,s:Ee,l:Le}}function V(b,P,E){var de,xe,G;b=m(b,360),P=m(P,100),E=m(E,100);function Ee(ke,Ae,Ne){return Ne<0&&(Ne+=1),Ne>1&&(Ne-=1),Ne<1/6?ke+(Ae-ke)*6*Ne:Ne<1/2?Ae:Ne<2/3?ke+(Ae-ke)*(2/3-Ne)*6:ke}if(P===0)de=xe=G=E;else{var Le=E<.5?E*(1+P):E+P-E*P,Me=2*E-Le;de=Ee(Me,Le,b+1/3),xe=Ee(Me,Le,b),G=Ee(Me,Le,b-1/3)}return{r:de*255,g:xe*255,b:G*255}}function F(b,P,E){b=m(b,255),P=m(P,255),E=m(E,255);var de=te(b,P,E),xe=N(b,P,E),G,Ee,Le=de,Me=de-xe;if(Ee=de===0?0:Me/de,de==xe)G=0;else{switch(de){case b:G=(P-E)/Me+(P<E?6:0);break;case P:G=(E-b)/Me+2;break;case E:G=(b-P)/Me+4;break}G/=6}return{h:G,s:Ee,v:Le}}function Y(b,P,E){b=m(b,360)*6,P=m(P,100),E=m(E,100);var de=Te.floor(b),xe=b-de,G=E*(1-P),Ee=E*(1-xe*P),Le=E*(1-(1-xe)*P),Me=de%6,ke=[E,Ee,G,G,Le,E][Me],Ae=[Le,E,E,Ee,G,G][Me],Ne=[G,G,Le,E,E,Ee][Me];return{r:ke*255,g:Ae*255,b:Ne*255}}function W(b,P,E,de){var xe=[we(se(b).toString(16)),we(se(P).toString(16)),we(se(E).toString(16))];return de&&xe[0].charAt(0)==xe[0].charAt(1)&&xe[1].charAt(0)==xe[1].charAt(1)&&xe[2].charAt(0)==xe[2].charAt(1)?xe[0].charAt(0)+xe[1].charAt(0)+xe[2].charAt(0):xe.join("")}function Z(b,P,E,de,xe){var G=[we(se(b).toString(16)),we(se(P).toString(16)),we(se(E).toString(16)),we(be(de))];return xe&&G[0].charAt(0)==G[0].charAt(1)&&G[1].charAt(0)==G[1].charAt(1)&&G[2].charAt(0)==G[2].charAt(1)&&G[3].charAt(0)==G[3].charAt(1)?G[0].charAt(0)+G[1].charAt(0)+G[2].charAt(0)+G[3].charAt(0):G.join("")}function ue(b,P,E,de){var xe=[we(be(de)),we(se(b).toString(16)),we(se(P).toString(16)),we(se(E).toString(16))];return xe.join("")}K.equals=function(b,P){return!b||!P?!1:K(b).toRgbString()==K(P).toRgbString()},K.random=function(){return K.fromRatio({r:J(),g:J(),b:J()})};function je(b,P){P=P===0?0:P||10;var E=K(b).toHsl();return E.s-=P/100,E.s=p(E.s),K(E)}function Ke(b,P){P=P===0?0:P||10;var E=K(b).toHsl();return E.s+=P/100,E.s=p(E.s),K(E)}function _e(b){return K(b).desaturate(100)}function ge(b,P){P=P===0?0:P||10;var E=K(b).toHsl();return E.l+=P/100,E.l=p(E.l),K(E)}function ze(b,P){P=P===0?0:P||10;var E=K(b).toRgb();return E.r=te(0,N(255,E.r-se(255*-(P/100)))),E.g=te(0,N(255,E.g-se(255*-(P/100)))),E.b=te(0,N(255,E.b-se(255*-(P/100)))),K(E)}function fe(b,P){P=P===0?0:P||10;var E=K(b).toHsl();return E.l-=P/100,E.l=p(E.l),K(E)}function Ce(b,P){var E=K(b).toHsl(),de=(E.h+P)%360;return E.h=de<0?360+de:de,K(E)}function Pe(b){var P=K(b).toHsl();return P.h=(P.h+180)%360,K(P)}function pe(b){var P=K(b).toHsl(),E=P.h;return[K(b),K({h:(E+120)%360,s:P.s,l:P.l}),K({h:(E+240)%360,s:P.s,l:P.l})]}function w(b){var P=K(b).toHsl(),E=P.h;return[K(b),K({h:(E+90)%360,s:P.s,l:P.l}),K({h:(E+180)%360,s:P.s,l:P.l}),K({h:(E+270)%360,s:P.s,l:P.l})]}function re(b){var P=K(b).toHsl(),E=P.h;return[K(b),K({h:(E+72)%360,s:P.s,l:P.l}),K({h:(E+216)%360,s:P.s,l:P.l})]}function j(b,P,E){P=P||6,E=E||30;var de=K(b).toHsl(),xe=360/E,G=[K(b)];for(de.h=(de.h-(xe*P>>1)+720)%360;--P;)de.h=(de.h+xe)%360,G.push(K(de));return G}function S(b,P){P=P||6;for(var E=K(b).toHsv(),de=E.h,xe=E.s,G=E.v,Ee=[],Le=1/P;P--;)Ee.push(K({h:de,s:xe,v:G})),G=(G+Le)%1;return Ee}K.mix=function(b,P,E){E=E===0?0:E||50;var de=K(b).toRgb(),xe=K(P).toRgb(),G=E/100,Ee={r:(xe.r-de.r)*G+de.r,g:(xe.g-de.g)*G+de.g,b:(xe.b-de.b)*G+de.b,a:(xe.a-de.a)*G+de.a};return K(Ee)},K.readability=function(b,P){var E=K(b),de=K(P);return(Te.max(E.getLuminance(),de.getLuminance())+.05)/(Te.min(E.getLuminance(),de.getLuminance())+.05)},K.isReadable=function(b,P,E){var de=K.readability(b,P),xe,G;G=!1,xe=R(E);switch(xe.level+xe.size){case"AAsmall":case"AAAlarge":G=de>=4.5;break;case"AAlarge":G=de>=3;break;case"AAAsmall":G=de>=7;break}return G},K.mostReadable=function(b,P,E){var de=null,xe=0,G,Ee,Le,Me;E=E||{},Ee=E.includeFallbackColors,Le=E.level,Me=E.size;for(var ke=0;ke<P.length;ke++)G=K.readability(b,P[ke]),G>xe&&(xe=G,de=K(P[ke]));return K.isReadable(b,de,{level:Le,size:Me})||!Ee?de:(E.includeFallbackColors=!1,K.mostReadable(b,["#fff","#000"],E))};var he=K.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"},z=K.hexNames=O(he);function O(b){var P={};for(var E in b)b.hasOwnProperty(E)&&(P[b[E]]=E);return P}function T(b){return b=parseFloat(b),(isNaN(b)||b<0||b>1)&&(b=1),b}function m(b,P){M(b)&&(b="100%");var E=ne(b);return b=N(P,te(0,parseFloat(b))),E&&(b=parseInt(b*P,10)/100),Te.abs(b-P)<1e-6?1:b%P/parseFloat(P)}function p(b){return N(1,te(0,b))}function _(b){return parseInt(b,16)}function M(b){return typeof b=="string"&&b.indexOf(".")!=-1&&parseFloat(b)===1}function ne(b){return typeof b=="string"&&b.indexOf("%")!=-1}function we(b){return b.length==1?"0"+b:""+b}function Re(b){return b<=1&&(b=b*100+"%"),b}function be(b){return Te.round(parseFloat(b)*255).toString(16)}function ve(b){return _(b)/255}var ie=function(){var b="[-\\+]?\\d+%?",P="[-\\+]?\\d*\\.\\d+%?",E="(?:"+P+")|(?:"+b+")",de="[\\s|\\(]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")\\s*\\)?",xe="[\\s|\\(]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")[,|\\s]+("+E+")\\s*\\)?";return{CSS_UNIT:new RegExp(E),rgb:new RegExp("rgb"+de),rgba:new RegExp("rgba"+xe),hsl:new RegExp("hsl"+de),hsla:new RegExp("hsla"+xe),hsv:new RegExp("hsv"+de),hsva:new RegExp("hsva"+xe),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 le(b){return!!ie.CSS_UNIT.exec(b)}function $(b){b=b.replace(ye,"").replace(De,"").toLowerCase();var P=!1;if(he[b])b=he[b],P=!0;else if(b=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var E;return(E=ie.rgb.exec(b))?{r:E[1],g:E[2],b:E[3]}:(E=ie.rgba.exec(b))?{r:E[1],g:E[2],b:E[3],a:E[4]}:(E=ie.hsl.exec(b))?{h:E[1],s:E[2],l:E[3]}:(E=ie.hsla.exec(b))?{h:E[1],s:E[2],l:E[3],a:E[4]}:(E=ie.hsv.exec(b))?{h:E[1],s:E[2],v:E[3]}:(E=ie.hsva.exec(b))?{h:E[1],s:E[2],v:E[3],a:E[4]}:(E=ie.hex8.exec(b))?{r:_(E[1]),g:_(E[2]),b:_(E[3]),a:ve(E[4]),format:P?"name":"hex8"}:(E=ie.hex6.exec(b))?{r:_(E[1]),g:_(E[2]),b:_(E[3]),format:P?"name":"hex"}:(E=ie.hex4.exec(b))?{r:_(E[1]+""+E[1]),g:_(E[2]+""+E[2]),b:_(E[3]+""+E[3]),a:ve(E[4]+""+E[4]),format:P?"name":"hex8"}:(E=ie.hex3.exec(b))?{r:_(E[1]+""+E[1]),g:_(E[2]+""+E[2]),b:_(E[3]+""+E[3]),format:P?"name":"hex"}:!1}function R(b){var P,E;return b=b||{level:"AA",size:"small"},P=(b.level||"AA").toUpperCase(),E=(b.size||"small").toLowerCase(),P!=="AA"&&P!=="AAA"&&(P="AA"),E!=="small"&&E!=="large"&&(E="small"),{level:P,size:E}}ct.exports?ct.exports=K:!(Q=function(){return K}.call(Xe,y,Xe,ct),Q!==void 0&&(ct.exports=Q))})(Math)},bT9E:function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return Te});var Q=y("VTBJ");function Te(ye,De){var Se=Object(Q.a)({},ye);return Array.isArray(De)&&De.forEach(function(se){delete Se[se]}),Se}},c5Ni:function(ct,Xe,y){},dejd:function(ct,Xe,y){},dmUQ:function(ct,Xe,y){"use strict";var Q=y("Ff2n"),Te=y("rePB"),ye=y("1OyB"),De=y("vuIU"),Se=y("Ji7U"),se=y("md7G"),N=y("foSv"),te=y("q1tI"),J=y.n(te),K=y("TSYQ"),D=y.n(K),B=y("4IlW");function oe(pe,w){var re=Object.keys(pe);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(pe);w&&(j=j.filter(function(S){return Object.getOwnPropertyDescriptor(pe,S).enumerable})),re.push.apply(re,j)}return re}function V(pe){for(var w=1;w<arguments.length;w++){var re=arguments[w]!=null?arguments[w]:{};w%2?oe(Object(re),!0).forEach(function(j){Object(Te.a)(pe,j,re[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(pe,Object.getOwnPropertyDescriptors(re)):oe(Object(re)).forEach(function(j){Object.defineProperty(pe,j,Object.getOwnPropertyDescriptor(re,j))})}return pe}function F(pe){var w=Y();return function(){var j=Object(N.a)(pe),S;if(w){var he=Object(N.a)(this).constructor;S=Reflect.construct(j,arguments,he)}else S=j.apply(this,arguments);return Object(se.a)(this,S)}}function Y(){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(pe){return!1}}function W(){}function Z(pe){pe.preventDefault()}var ue=function(w){return w.replace(/[^\w.-]+/g,"")},je=200,Ke=600,_e=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ge=function(w){return w!=null},ze=function(w,re){return re===w||typeof re=="number"&&typeof w=="number"&&isNaN(re)&&isNaN(w)},fe=function(pe){Object(Se.a)(re,pe);var w=F(re);function re(j){var S;Object(ye.a)(this,re),S=w.call(this,j),S.onKeyDown=function(O){var T=S.props,m=T.onKeyDown,p=T.onPressEnter;if(O.keyCode===B.a.UP){var _=S.getRatio(O);S.up(O,_,null),S.stop()}else if(O.keyCode===B.a.DOWN){var M=S.getRatio(O);S.down(O,M,null),S.stop()}else O.keyCode===B.a.ENTER&&p&&p(O);if(S.recordCursorPosition(),S.lastKeyCode=O.keyCode,m){for(var ne=arguments.length,we=new Array(ne>1?ne-1:0),Re=1;Re<ne;Re++)we[Re-1]=arguments[Re];m.apply(void 0,[O].concat(we))}},S.onKeyUp=function(O){var T=S.props.onKeyUp;if(S.stop(),S.recordCursorPosition(),T){for(var m=arguments.length,p=new Array(m>1?m-1:0),_=1;_<m;_++)p[_-1]=arguments[_];T.apply(void 0,[O].concat(p))}},S.onChange=function(O){var T=S.props.onChange;S.state.focused&&(S.inputting=!0),S.rawInput=S.props.parser(S.getValueFromEvent(O)),S.setState({inputValue:S.rawInput}),T(S.toNumber(S.rawInput))},S.onMouseUp=function(){var O=S.props.onMouseUp;S.recordCursorPosition(),O&&O.apply(void 0,arguments)},S.onFocus=function(){var O;S.setState({focused:!0}),(O=S.props).onFocus.apply(O,arguments)},S.onBlur=function(){var O=S.props.onBlur;S.inputting=!1,S.setState({focused:!1});var T=S.getCurrentValidValue(S.state.inputValue),m=S.setValue(T,W);if(O){var p=S.input.value,_=S.getInputDisplayValue({focus:!1,value:m});S.input.value=_&&Number(_),O.apply(void 0,arguments),S.input.value=p}},S.getRatio=function(O){var T=1;return O.metaKey||O.ctrlKey?T=.1:O.shiftKey&&(T=10),T},S.getFullNum=function(O){return isNaN(O)?O:/e/i.test(String(O))?Number(O).toFixed(18).replace(/\.?0+$/,""):O},S.getPrecision=function(O){if(ge(S.props.precision))return S.props.precision;var T=String(O);if(T.indexOf("e-")>=0)return parseInt(T.slice(T.indexOf("e-")+2),10);var m=0;return T.indexOf(".")>=0&&(m=T.length-T.indexOf(".")-1),m},S.getInputDisplayValue=function(O){var T=O||S.state,m=T.focused,p=T.inputValue,_=T.value,M;m?M=p:M=S.toPrecisionAsStep(_),M==null&&(M="");var ne=S.formatWrapper(M);return ge(S.props.decimalSeparator)&&(ne=ne.toString().replace(".",S.props.decimalSeparator)),ne},S.recordCursorPosition=function(){try{S.cursorStart=S.input.selectionStart,S.cursorEnd=S.input.selectionEnd,S.currentValue=S.input.value,S.cursorBefore=S.input.value.substring(0,S.cursorStart),S.cursorAfter=S.input.value.substring(S.cursorEnd)}catch(O){}},S.restoreByAfter=function(O){if(O===void 0)return!1;var T=S.input.value,m=T.lastIndexOf(O);if(m===-1)return!1;var p=S.cursorBefore.length;return S.lastKeyCode===B.a.DELETE&&S.cursorBefore.charAt(p-1)===O[0]?(S.fixCaret(p,p),!0):m+O.length===T.length?(S.fixCaret(m,m),!0):!1},S.partRestoreByAfter=function(O){return O===void 0?!1:Array.prototype.some.call(O,function(T,m){var p=O.substring(m);return S.restoreByAfter(p)})},S.isNotCompleteNumber=function(O){return isNaN(O)||O===""||O===null||O&&O.toString().indexOf(".")===O.toString().length-1},S.stop=function(){S.autoStepTimer&&clearTimeout(S.autoStepTimer)},S.down=function(O,T,m){S.pressingUpOrDown=!0,S.step("down",O,T,m)},S.up=function(O,T,m){S.pressingUpOrDown=!0,S.step("up",O,T,m)},S.saveInput=function(O){S.input=O};var he=j.value;he===void 0&&(he=j.defaultValue),S.state={focused:j.autoFocus};var z=S.getValidValue(S.toNumber(he));return S.state=V(V({},S.state),{},{inputValue:S.toPrecisionAsStep(z),value:z}),S}return Object(De.a)(re,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(S){var he=this.props,z=he.value,O=he.onChange,T=he.max,m=he.min,p=this.state.focused;if(S){if(!ze(S.value,z)||!ze(S.max,T)||!ze(S.min,m)){var _=p?z:this.getValidValue(z),M;this.pressingUpOrDown?M=_:this.inputting?M=this.rawInput:M=this.toPrecisionAsStep(_),this.setState({value:_,inputValue:M})}var ne="value"in this.props?z:this.state.value;"max"in this.props&&S.max!==T&&typeof ne=="number"&&ne>T&&O&&O(T),"min"in this.props&&S.min!==m&&typeof ne=="number"&&ne<m&&O&&O(m)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var we=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===B.a.BACKSPACE?we=this.cursorStart-1:this.lastKeyCode===B.a.DELETE&&(we=this.cursorStart):we=this.input.value.length,this.fixCaret(we,we)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case B.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case B.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Re){}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(S){var he=S;return he===""?he="":this.isNotCompleteNumber(parseFloat(he))?he=this.state.value:he=this.getValidValue(he),this.toNumber(he)}},{key:"getValueFromEvent",value:function(S){var he=S.target.value.trim().replace(/。/g,".");return ge(this.props.decimalSeparator)&&(he=he.replace(this.props.decimalSeparator,".")),he}},{key:"getValidValue",value:function(S){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,O=parseFloat(S);return isNaN(O)?S:(O<he&&(O=he),O>z&&(O=z),O)}},{key:"setValue",value:function(S,he){var z=this.props.precision,O=this.isNotCompleteNumber(parseFloat(S))?null:parseFloat(S),T=this.state.value,m=T===void 0?null:T,p=this.state.inputValue,_=p===void 0?null:p,M=typeof O=="number"?O.toFixed(z):"".concat(O),ne=O!==m||M!=="".concat(_);return"value"in this.props?(_=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:_},he)):this.setState({value:O,inputValue:this.toPrecisionAsStep(S)},he),ne&&this.props.onChange(O),O}},{key:"getMaxPrecision",value:function(S){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.props,O=z.precision,T=z.step;if(ge(O))return O;var m=this.getPrecision(he),p=this.getPrecision(T),_=this.getPrecision(S);return S?Math.max(_,m+p):m+p}},{key:"getPrecisionFactor",value:function(S){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,z=this.getMaxPrecision(S,he);return Math.pow(10,z)}},{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(S){return this.props.formatter?this.props.formatter(S):S}},{key:"toPrecisionAsStep",value:function(S){if(this.isNotCompleteNumber(S)||S==="")return S;var he=Math.abs(this.getMaxPrecision(S));return isNaN(he)?S.toString():Number(S).toFixed(he)}},{key:"toNumber",value:function(S){var he=this.props.precision,z=this.state.focused,O=S&&S.length>16&&z;return this.isNotCompleteNumber(S)||O?S:ge(he)?Math.round(S*Math.pow(10,he))/Math.pow(10,he):Number(S)}},{key:"upStep",value:function(S,he){var z=this.props.step,O=this.getPrecisionFactor(S,he),T=Math.abs(this.getMaxPrecision(S,he)),m=((O*S+O*z*he)/O).toFixed(T);return this.toNumber(m)}},{key:"downStep",value:function(S,he){var z=this.props.step,O=this.getPrecisionFactor(S,he),T=Math.abs(this.getMaxPrecision(S,he)),m=((O*S-O*z*he)/O).toFixed(T);return this.toNumber(m)}},{key:"step",value:function(S,he){var z=this,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,T=arguments.length>3?arguments[3]:void 0;this.stop(),he&&(he.persist(),he.preventDefault());var m=this.props;if(m.disabled)return;var p=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(p))return;var _=this["".concat(S,"Step")](p,O),M=_>m.max||_<m.min;if(_>m.max?_=m.max:_<m.min&&(_=m.min),this.setValue(_,null),this.setState({focused:!0},function(){z.pressingUpOrDown=!1}),M)return;this.autoStepTimer=setTimeout(function(){z[S](he,O,!0)},T?je:Ke)}},{key:"fixCaret",value:function(S,he){if(S===void 0||he===void 0||!this.input||!this.input.value)return;try{var z=this.input.selectionStart,O=this.input.selectionEnd;(S!==z||he!==O)&&this.input.setSelectionRange(S,he)}catch(T){}}},{key:"render",value:function(){var S,he=this.props,z=he.prefixCls,O=he.disabled,T=he.readOnly,m=he.useTouch,p=he.autoComplete,_=he.upHandler,M=he.downHandler,ne=he.className,we=he.max,Re=he.min,be=he.style,ve=he.title,ie=he.onMouseEnter,le=he.onMouseLeave,$=he.onMouseOver,R=he.onMouseOut,b=he.required,P=he.onClick,E=he.tabIndex,de=he.type,xe=he.placeholder,G=he.id,Ee=he.inputMode,Le=he.pattern,Me=he.step,ke=he.maxLength,Ae=he.autoFocus,Ne=he.name,Je=he.onPaste,We=he.onInput,$e=Object(Q.a)(he,["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,st=Qe.value,et=Qe.focused,ot=D()(z,(S={},Object(Te.a)(S,ne,!!ne),Object(Te.a)(S,"".concat(z,"-disabled"),O),Object(Te.a)(S,"".concat(z,"-focused"),et),S)),Oe={};Object.keys($e).forEach(function(A){(A.substr(0,5)==="data-"||A.substr(0,5)==="aria-"||A==="role")&&(Oe[A]=$e[A])});var vt=!T&&!O,at=this.getInputDisplayValue(null),Be=(st||st===0)&&(isNaN(st)||Number(st)>=we),Ye=(st||st===0)&&(isNaN(st)||Number(st)<=Re),q=Be||O||T,H=Ye||O||T,X=D()("".concat(z,"-handler"),"".concat(z,"-handler-up"),Object(Te.a)({},"".concat(z,"-handler-up-disabled"),q)),x=D()("".concat(z,"-handler"),"".concat(z,"-handler-down"),Object(Te.a)({},"".concat(z,"-handler-down-disabled"),H)),C=m?{onTouchStart:q?W:this.up,onTouchEnd:this.stop}:{onMouseDown:q?W:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},k=m?{onTouchStart:H?W:this.down,onTouchEnd:this.stop}:{onMouseDown:H?W:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return J.a.createElement("div",{className:ot,style:be,title:ve,onMouseEnter:ie,onMouseLeave:le,onMouseOver:$,onMouseOut:R,onFocus:function(){return null},onBlur:function(){return null}},J.a.createElement("div",{className:"".concat(z,"-handler-wrap")},J.a.createElement("span",Object.assign({unselectable:"on"},C,{role:"button","aria-label":"Increase Value","aria-disabled":q,className:X}),_||J.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-up-inner"),onClick:Z})),J.a.createElement("span",Object.assign({unselectable:"on"},k,{role:"button","aria-label":"Decrease Value","aria-disabled":H,className:x}),M||J.a.createElement("span",{unselectable:"on",className:"".concat(z,"-handler-down-inner"),onClick:Z}))),J.a.createElement("div",{className:"".concat(z,"-input-wrap")},J.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Re,"aria-valuemax":we,"aria-valuenow":st,required:b,type:de,placeholder:xe,onPaste:Je,onClick:P,onMouseUp:this.onMouseUp,className:"".concat(z,"-input"),tabIndex:E,autoComplete:p,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:vt?this.onKeyDown:W,onKeyUp:vt?this.onKeyUp:W,autoFocus:Ae,maxLength:ke,readOnly:T,disabled:O,max:we,min:Re,step:Me,name:Ne,title:ve,id:G,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(at),pattern:Le,inputMode:Ee,onInput:We},Oe))))}}]),re}(J.a.Component);fe.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:_e,min:-_e,step:1,style:{},onChange:W,onKeyDown:W,onPressEnter:W,onFocus:W,onBlur:W,parser:ue,required:!1,autoComplete:"off"};var Ce=fe,Pe=Xe.a=Ce},gHQ5:function(ct,Xe,y){"use strict";y.r(Xe);var Q=y("+L6B"),Te=y("2/Rp"),ye=y("5NDa"),De=y("5rEg"),Se=y("k1fw"),se=y("9og8"),N=y("y8nQ"),te=y("Vl3Y"),J=y("tJVT"),K=y("CiB2"),D=y("WmNS"),B=y.n(D),oe=y("q1tI"),V=y.n(oe),F=y("3vs6"),Y=y("l3Yi"),W=y.n(Y),Z=y("Ot1p"),ue=y("500L"),je=y("ErOA"),Ke=y("Ty5D"),_e=y("9kvl"),ge=function(fe){var Ce;Object(K.a)(fe);var Pe=Object(oe.useState)({}),pe=Object(J.a)(Pe,2),w=pe[0],re=pe[1],j=te.a.useForm(),S=Object(J.a)(j,1),he=S[0],z=Object(oe.useState)(!0),O=Object(J.a)(z,2),T=O[0],m=O[1],p=Object(oe.useState)(!1),_=Object(J.a)(p,2),M=_[0],ne=_[1],we=Object(oe.useState)(!1),Re=Object(J.a)(we,2),be=Re[0],ve=Re[1],ie=Object(Ke.i)(),le=ie==null?void 0:ie.virtual_spacesId;Object(oe.useEffect)(function(){ie!=null&&ie.id?$():ve(!0)},[]);var $=function(){var b=Object(se.a)(B.a.mark(function P(){var E,de;return B.a.wrap(function(G){for(;;)switch(G.prev=G.next){case 0:return G.next=2,Object(je.a)("/api/virtual_classrooms/".concat(le,"/syllabuses/").concat(ie==null?void 0:ie.id,"/edit.json"),{method:"get"});case 2:E=G.sent,E&&(de={title:E.title,description:E.description,attachment_ids:Object(ue.a)(E.attachments)},console.log(de,"formData"),he.setFieldsValue(Object(Se.a)({},de)),re(Object(Se.a)({},de)),ve(!0));case 4:case"end":return G.stop()}},P)}));return function(){return b.apply(this,arguments)}}(),R=function(){var b=Object(se.a)(B.a.mark(function P(E){var de,xe,G,Ee,Le;return B.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:if(xe=Object(Se.a)({},w),xe.attachment_ids&&(xe.attachment_ids=xe==null||((G=xe.attachment_ids)===null||G===void 0)?void 0:G.map(function(Ae){return Ae.response.id})),ne(!0),!(ie!=null&&ie.id)){ke.next=9;break}return ke.next=6,Object(je.a)("/api/virtual_classrooms/".concat(le,"/syllabuses/").concat(ie==null?void 0:ie.id,".json"),{method:"put",body:Object(Se.a)({},xe)});case 6:Ee=ke.sent,ke.next=12;break;case 9:return ke.next=11,Object(je.a)("/api/virtual_classrooms/".concat(le,"/syllabuses.json"),{method:"post",body:Object(Se.a)({},xe)});case 11:Ee=ke.sent;case 12:(de=Ee)!==null&&de!==void 0&&de.virtual_classroom_id&&_e.d.push("/vspaces/".concat(le,"/syllabuses/").concat((Le=Ee)===null||Le===void 0?void 0:Le.id,"/detail")),ne(!1);case 14:case"end":return ke.stop()}},P)}));return function(E){return b.apply(this,arguments)}}();return V.a.createElement("div",{className:W.a.wrap},V.a.createElement(F.a,null),V.a.createElement("div",{className:W.a.form},V.a.createElement("div",{className:W.a.title},V.a.createElement("span",{onClick:function(){return _e.d.push("/vspaces/".concat(le,"/syllabuses"))}},V.a.createElement("i",{className:"iconfont icon-zuoshangjiaofanhui"}),"\u8FD4\u56DE"),V.a.createElement("span",null,"\u65B0\u5EFA\u6559\u5B66\u5927\u7EB2")),V.a.createElement(te.a,{colon:!1,form:he,scrollToFirstError:!0,onValuesChange:function(){re(Object(Se.a)({},he.getFieldsValue()))},onFinish:R},V.a.createElement(te.a.Item,{name:"title",label:"\u5927\u7EB2\u6807\u9898",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5927\u7EB2\u6807\u9898"}]},V.a.createElement(De.a,{maxLength:60,suffix:"".concat(((Ce=w.title)===null||Ce===void 0?void 0:Ce.length)||0,"/60"),placeholder:"\u8BF7\u8F93\u5165\u5927\u7EB2\u6807\u9898"})),V.a.createElement("div",{style:{margin:"20px 0 12px 10px"}},"\u5927\u7EB2\u5185\u5BB9"),V.a.createElement(te.a.Item,{className:"ml10",name:"description",rules:[{max:5e4,message:"\u4F5C\u4E1A\u7B80\u4ECB\u6700\u5927\u9650\u523650000\u4E2A\u5B57\u7B26"}]},V.a.createElement(Z.a,{watch:!0,defaultValue:w.description})),V.a.createElement(te.a.Item,{className:"ml10",name:"attachment_ids",label:"\u9644\u4EF6"},be&&V.a.createElement(ue.b,{className:W.a.file,title:V.a.createElement("span",null,V.a.createElement("i",{className:"iconfont icon-shangchuan1 font14 mr5"}),"\u4E0A\u4F20\u9644\u4EF6")})),V.a.createElement("div",{style:{textAlign:"right"}},V.a.createElement(te.a.Item,null,V.a.createElement(Te.a,{onClick:function(){return _e.d.push("/vspaces/".concat(le,"/syllabuses"))},className:"mr10"},"\u53D6\u6D88"),V.a.createElement(Te.a,{type:"primary",htmlType:"submit",loading:M},"\u786E\u8BA4"))))))};Xe.default=ge},h78n:function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return S});var Q=y("q1tI"),Te=y.n(Q),ye=y("TSYQ"),De=y.n(ye),Se={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},se=function(O){var T=O.map(function(){return Object(Q.useRef)()}),m=Object(Q.useRef)();return Object(Q.useEffect)(function(){var p=Date.now(),_=!1;Object.keys(T).forEach(function(M){var ne=T[M].current;if(!ne)return;_=!0;var we=ne.style;we.transitionDuration=".3s, .3s, .3s, .06s",m.current&&p-m.current<100&&(we.transitionDuration="0s, 0s")}),_&&(m.current=Date.now())}),[T]};function N(){return N=Object.assign||function(z){for(var O=1;O<arguments.length;O++){var T=arguments[O];for(var m in T)Object.prototype.hasOwnProperty.call(T,m)&&(z[m]=T[m])}return z},N.apply(this,arguments)}function te(z,O){return oe(z)||B(z,O)||K(z,O)||J()}function J(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K(z,O){if(!z)return;if(typeof z=="string")return D(z,O);var T=Object.prototype.toString.call(z).slice(8,-1);if(T==="Object"&&z.constructor&&(T=z.constructor.name),T==="Map"||T==="Set")return Array.from(z);if(T==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return D(z,O)}function D(z,O){(O==null||O>z.length)&&(O=z.length);for(var T=0,m=new Array(O);T<O;T++)m[T]=z[T];return m}function B(z,O){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(z)))return;var T=[],m=!0,p=!1,_=void 0;try{for(var M=z[Symbol.iterator](),ne;!(m=(ne=M.next()).done)&&!(T.push(ne.value),O&&T.length===O);m=!0);}catch(we){p=!0,_=we}finally{try{!m&&M.return!=null&&M.return()}finally{if(p)throw _}}return T}function oe(z){if(Array.isArray(z))return z}function V(z,O){if(z==null)return{};var T=F(z,O),m,p;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(z);for(p=0;p<_.length;p++){if(m=_[p],O.indexOf(m)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,m))continue;T[m]=z[m]}}return T}function F(z,O){if(z==null)return{};var T={},m=Object.keys(z),p,_;for(_=0;_<m.length;_++){if(p=m[_],O.indexOf(p)>=0)continue;T[p]=z[p]}return T}var Y=function(O){var T=O.className,m=O.percent,p=O.prefixCls,_=O.strokeColor,M=O.strokeLinecap,ne=O.strokeWidth,we=O.style,Re=O.trailColor,be=O.trailWidth,ve=O.transition,ie=V(O,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete ie.gapPosition;var le=Array.isArray(m)?m:[m],$=Array.isArray(_)?_:[_],R=se(le),b=te(R,1),P=b[0],E=ne/2,de=100-ne/2,xe="M ".concat(M==="round"?E:0,",").concat(E,`
|
|
L `).concat(M==="round"?de:100,",").concat(E),G="0 0 100 ".concat(ne),Ee=0;return Te.a.createElement("svg",N({className:De()("".concat(p,"-line"),T),viewBox:G,preserveAspectRatio:"none",style:we},ie),Te.a.createElement("path",{className:"".concat(p,"-line-trail"),d:xe,strokeLinecap:M,stroke:Re,strokeWidth:be||ne,fillOpacity:"0"}),le.map(function(Le,Me){var ke={strokeDasharray:"".concat(Le,"px, 100px"),strokeDashoffset:"-".concat(Ee,"px"),transition:ve||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Ae=$[Me]||$[$.length-1];return Ee+=Le,Te.a.createElement("path",{key:Me,className:"".concat(p,"-line-path"),d:xe,strokeLinecap:M,stroke:Ae,strokeWidth:ne,fillOpacity:"0",ref:P[Me],style:ke})}))};Y.defaultProps=Se;var W=Y;function Z(){return Z=Object.assign||function(z){for(var O=1;O<arguments.length;O++){var T=arguments[O];for(var m in T)Object.prototype.hasOwnProperty.call(T,m)&&(z[m]=T[m])}return z},Z.apply(this,arguments)}function ue(z,O){return ze(z)||ge(z,O)||Ke(z,O)||je()}function je(){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 Ke(z,O){if(!z)return;if(typeof z=="string")return _e(z,O);var T=Object.prototype.toString.call(z).slice(8,-1);if(T==="Object"&&z.constructor&&(T=z.constructor.name),T==="Map"||T==="Set")return Array.from(z);if(T==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return _e(z,O)}function _e(z,O){(O==null||O>z.length)&&(O=z.length);for(var T=0,m=new Array(O);T<O;T++)m[T]=z[T];return m}function ge(z,O){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(z)))return;var T=[],m=!0,p=!1,_=void 0;try{for(var M=z[Symbol.iterator](),ne;!(m=(ne=M.next()).done)&&!(T.push(ne.value),O&&T.length===O);m=!0);}catch(we){p=!0,_=we}finally{try{!m&&M.return!=null&&M.return()}finally{if(p)throw _}}return T}function ze(z){if(Array.isArray(z))return z}function fe(z,O){if(z==null)return{};var T=Ce(z,O),m,p;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(z);for(p=0;p<_.length;p++){if(m=_[p],O.indexOf(m)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(z,m))continue;T[m]=z[m]}}return T}function Ce(z,O){if(z==null)return{};var T={},m=Object.keys(z),p,_;for(_=0;_<m.length;_++){if(p=m[_],O.indexOf(p)>=0)continue;T[p]=z[p]}return T}var Pe=0;function pe(z){return+z.replace("%","")}function w(z){return Array.isArray(z)?z:[z]}function re(z,O,T,m){var p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,_=arguments.length>5?arguments[5]:void 0,M=50-m/2,ne=0,we=-M,Re=0,be=-2*M;switch(_){case"left":ne=-M,we=0,Re=2*M,be=0;break;case"right":ne=M,we=0,Re=-2*M,be=0;break;case"bottom":we=M,be=2*M;break;default:}var ve="M 50,50 m ".concat(ne,",").concat(we,`
|
|
a `).concat(M,",").concat(M," 0 1 1 ").concat(Re,",").concat(-be,`
|
|
a `).concat(M,",").concat(M," 0 1 1 ").concat(-Re,",").concat(be),ie=Math.PI*2*M,le={stroke:T,strokeDasharray:"".concat(O/100*(ie-p),"px ").concat(ie,"px"),strokeDashoffset:"-".concat(p/2+z/100*(ie-p),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:ve,pathStyle:le}}var j=function(O){var T=O.prefixCls,m=O.strokeWidth,p=O.trailWidth,_=O.gapDegree,M=O.gapPosition,ne=O.trailColor,we=O.strokeLinecap,Re=O.style,be=O.className,ve=O.strokeColor,ie=O.percent,le=fe(O,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),$=Object(Q.useMemo)(function(){return Pe+=1,Pe},[]),R=re(0,100,ne,m,_,M),b=R.pathString,P=R.pathStyle,E=w(ie),de=w(ve),xe=de.find(function(ke){return Object.prototype.toString.call(ke)==="[object Object]"}),G=se(E),Ee=ue(G,1),Le=Ee[0],Me=function(){var Ae=0;return E.map(function(Ne,Je){var We=de[Je]||de[de.length-1],$e=Object.prototype.toString.call(We)==="[object Object]"?"url(#".concat(T,"-gradient-").concat($,")"):"",Qe=re(Ae,Ne,We,m,_,M);return Ae+=Ne,Te.a.createElement("path",{key:Je,className:"".concat(T,"-circle-path"),d:Qe.pathString,stroke:$e,strokeLinecap:we,strokeWidth:m,opacity:Ne===0?0:1,fillOpacity:"0",style:Qe.pathStyle,ref:Le[Je]})})};return Te.a.createElement("svg",Z({className:De()("".concat(T,"-circle"),be),viewBox:"0 0 100 100",style:Re},le),xe&&Te.a.createElement("defs",null,Te.a.createElement("linearGradient",{id:"".concat(T,"-gradient-").concat($),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(xe).sort(function(ke,Ae){return pe(ke)-pe(Ae)}).map(function(ke,Ae){return Te.a.createElement("stop",{key:Ae,offset:ke,stopColor:xe[ke]})}))),Te.a.createElement("path",{className:"".concat(T,"-circle-trail"),d:b,stroke:ne,strokeLinecap:we,strokeWidth:p||m,fillOpacity:"0",style:P}),Me().reverse())};j.defaultProps=Se;var S=j,he={Line:W,Circle:S}},kSUc:function(ct,Xe,y){},l3Yi:function(ct,Xe,y){ct.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(ct,Xe,y){(function(Q){Q(y("VrN/"),y("1eCo"),y("8EBN"))})(function(Q){"use strict";Q.defineMode("markdown",function(Te,ye){var De=Q.getMode(Te,"text/html"),Se=De.name=="null";function se(m){if(Q.findModeByName){var p=Q.findModeByName(m);p&&(m=p.mime||p.mimes[0])}var _=Q.getMode(Te,m);return _.name=="null"?null:_}ye.highlightFormatting===void 0&&(ye.highlightFormatting=!1),ye.maxBlockquoteDepth===void 0&&(ye.maxBlockquoteDepth=0),ye.taskLists===void 0&&(ye.taskLists=!1),ye.strikethrough===void 0&&(ye.strikethrough=!1),ye.emoji===void 0&&(ye.emoji=!1),ye.fencedCodeBlockHighlighting===void 0&&(ye.fencedCodeBlockHighlighting=!0),ye.fencedCodeBlockDefaultMode===void 0&&(ye.fencedCodeBlockDefaultMode="text/plain"),ye.xml===void 0&&(ye.xml=!0),ye.tokenTypeOverrides===void 0&&(ye.tokenTypeOverrides={});var N={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 te in N)N.hasOwnProperty(te)&&ye.tokenTypeOverrides[te]&&(N[te]=ye.tokenTypeOverrides[te]);var J=/^([*\-_])(?:\s*\1){2,}\s*$/,K=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,D=/^\[(x| )\](?=\s)/i,B=ye.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,oe=/^ {0,3}(?:\={1,}|-{2,})\s*$/,V=/^[^#!\[\]*_\\<>` "'(~:]+/,F=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,Y=/^\s*\[[^\]]+?\]:.*$/,W=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Z=" ";function ue(m,p,_){return p.f=p.inline=_,_(m,p)}function je(m,p,_){return p.f=p.block=_,_(m,p)}function Ke(m){return!m||!/\S/.test(m.string)}function _e(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==ze){var p=Se;if(!p){var _=Q.innerMode(De,m.htmlState);p=_.mode.name=="xml"&&_.state.tagStart===null&&!_.state.context&&_.state.tokenize.isInText}p&&(m.f=pe,m.block=ge,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function ge(m,p){var _=m.column()===p.indentation,M=Ke(p.prevLine.stream),ne=p.indentedCode,we=p.prevLine.hr,Re=p.list!==!1,be=(p.listStack[p.listStack.length-1]||0)+3;p.indentedCode=!1;var ve=p.indentation;if(p.indentationDiff===null&&(p.indentationDiff=p.indentation,Re)){for(p.list=null;ve<p.listStack[p.listStack.length-1];)p.listStack.pop(),p.listStack.length?p.indentation=p.listStack[p.listStack.length-1]:p.list=!1;p.list!==!1&&(p.indentationDiff=ve-p.listStack[p.listStack.length-1])}var ie=!M&&!we&&!p.prevLine.header&&(!Re||!ne)&&!p.prevLine.fencedCodeEnd,le=(p.list===!1||we||M)&&p.indentation<=be&&m.match(J),$=null;if(p.indentationDiff>=4&&(ne||p.prevLine.fencedCodeEnd||p.prevLine.header||M))return m.skipToEnd(),p.indentedCode=!0,N.code;if(m.eatSpace())return null;if(_&&p.indentation<=be&&($=m.match(B))&&$[1].length<=6)return p.quote=0,p.header=$[1].length,p.thisLine.header=!0,ye.highlightFormatting&&(p.formatting="header"),p.f=p.inline,Ce(p);if(p.indentation<=be&&m.eat(">"))return p.quote=_?1:p.quote+1,ye.highlightFormatting&&(p.formatting="quote"),m.eatSpace(),Ce(p);if(!le&&!p.setext&&_&&p.indentation<=be&&($=m.match(K))){var R=$[1]?"ol":"ul";return p.indentation=ve+m.current().length,p.list=!0,p.quote=0,p.listStack.push(p.indentation),p.em=!1,p.strong=!1,p.code=!1,p.strikethrough=!1,ye.taskLists&&m.match(D,!1)&&(p.taskList=!0),p.f=p.inline,ye.highlightFormatting&&(p.formatting=["list","list-"+R]),Ce(p)}else{if(_&&p.indentation<=be&&($=m.match(F,!0)))return p.quote=0,p.fencedEndRE=new RegExp($[1]+"+ *$"),p.localMode=ye.fencedCodeBlockHighlighting&&se($[2]||ye.fencedCodeBlockDefaultMode),p.localMode&&(p.localState=Q.startState(p.localMode)),p.f=p.block=fe,ye.highlightFormatting&&(p.formatting="code-block"),p.code=-1,Ce(p);if(p.setext||(!ie||!Re)&&!p.quote&&p.list===!1&&!p.code&&!le&&!Y.test(m.string)&&($=m.lookAhead(1))&&($=$.match(oe)))return p.setext?(p.header=p.setext,p.setext=0,m.skipToEnd(),ye.highlightFormatting&&(p.formatting="header")):(p.header=$[0].charAt(0)=="="?1:2,p.setext=p.header),p.thisLine.header=!0,p.f=p.inline,Ce(p);if(le)return m.skipToEnd(),p.hr=!0,p.thisLine.hr=!0,N.hr;if(m.peek()==="[")return ue(m,p,he)}return ue(m,p,p.inline)}function ze(m,p){var _=De.token(m,p.htmlState);if(!Se){var M=Q.innerMode(De,p.htmlState);(M.mode.name=="xml"&&M.state.tagStart===null&&!M.state.context&&M.state.tokenize.isInText||p.md_inside&&m.current().indexOf(">")>-1)&&(p.f=pe,p.block=ge,p.htmlState=null)}return _}function fe(m,p){var _=p.listStack[p.listStack.length-1]||0,M=p.indentation<_,ne=_+3;if(p.fencedEndRE&&p.indentation<=ne&&(M||m.match(p.fencedEndRE))){ye.highlightFormatting&&(p.formatting="code-block");var we;return M||(we=Ce(p)),p.localMode=p.localState=null,p.block=ge,p.f=pe,p.fencedEndRE=null,p.code=0,p.thisLine.fencedCodeEnd=!0,M?je(m,p,p.block):we}else return p.localMode?p.localMode.token(m,p.localState):(m.skipToEnd(),N.code)}function Ce(m){var p=[];if(m.formatting){p.push(N.formatting),typeof m.formatting=="string"&&(m.formatting=[m.formatting]);for(var _=0;_<m.formatting.length;_++)p.push(N.formatting+"-"+m.formatting[_]),m.formatting[_]==="header"&&p.push(N.formatting+"-"+m.formatting[_]+"-"+m.header),m.formatting[_]==="quote"&&(!ye.maxBlockquoteDepth||ye.maxBlockquoteDepth>=m.quote?p.push(N.formatting+"-"+m.formatting[_]+"-"+m.quote):p.push("error"))}if(m.taskOpen)return p.push("meta"),p.length?p.join(" "):null;if(m.taskClosed)return p.push("property"),p.length?p.join(" "):null;if(m.linkHref?p.push(N.linkHref,"url"):(m.strong&&p.push(N.strong),m.em&&p.push(N.em),m.strikethrough&&p.push(N.strikethrough),m.emoji&&p.push(N.emoji),m.linkText&&p.push(N.linkText),m.code&&p.push(N.code),m.image&&p.push(N.image),m.imageAltText&&p.push(N.imageAltText,"link"),m.imageMarker&&p.push(N.imageMarker)),m.header&&p.push(N.header,N.header+"-"+m.header),m.quote&&(p.push(N.quote),!ye.maxBlockquoteDepth||ye.maxBlockquoteDepth>=m.quote?p.push(N.quote+"-"+m.quote):p.push(N.quote+"-"+ye.maxBlockquoteDepth)),m.list!==!1){var M=(m.listStack.length-1)%3;M?M===1?p.push(N.list2):p.push(N.list3):p.push(N.list1)}return m.trailingSpaceNewLine?p.push("trailing-space-new-line"):m.trailingSpace&&p.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),p.length?p.join(" "):null}function Pe(m,p){return m.match(V,!0)?Ce(p):void 0}function pe(m,p){var _=p.text(m,p);if(typeof _!="undefined")return _;if(p.list)return p.list=null,Ce(p);if(p.taskList){var M=m.match(D,!0)[1]===" ";return M?p.taskOpen=!0:p.taskClosed=!0,ye.highlightFormatting&&(p.formatting="task"),p.taskList=!1,Ce(p)}if(p.taskOpen=!1,p.taskClosed=!1,p.header&&m.match(/^#+$/,!0))return ye.highlightFormatting&&(p.formatting="header"),Ce(p);var ne=m.next();if(p.linkTitle){p.linkTitle=!1;var we=ne;ne==="("&&(we=")"),we=(we+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Re="^\\s*(?:[^"+we+"\\\\]+|\\\\\\\\|\\\\.)"+we;if(m.match(new RegExp(Re),!0))return N.linkHref}if(ne==="`"){var be=p.formatting;ye.highlightFormatting&&(p.formatting="code"),m.eatWhile("`");var ve=m.current().length;if(p.code==0&&(!p.quote||ve==1))return p.code=ve,Ce(p);if(ve==p.code){var ie=Ce(p);return p.code=0,ie}else return p.formatting=be,Ce(p)}else if(p.code)return Ce(p);if(ne==="\\"&&(m.next(),ye.highlightFormatting)){var le=Ce(p),$=N.formatting+"-escape";return le?le+" "+$:$}if(ne==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return p.imageMarker=!0,p.image=!0,ye.highlightFormatting&&(p.formatting="image"),Ce(p);if(ne==="["&&p.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return p.imageMarker=!1,p.imageAltText=!0,ye.highlightFormatting&&(p.formatting="image"),Ce(p);if(ne==="]"&&p.imageAltText){ye.highlightFormatting&&(p.formatting="image");var le=Ce(p);return p.imageAltText=!1,p.image=!1,p.inline=p.f=re,le}if(ne==="["&&!p.image)return p.linkText&&m.match(/^.*?\]/)||(p.linkText=!0,ye.highlightFormatting&&(p.formatting="link")),Ce(p);if(ne==="]"&&p.linkText){ye.highlightFormatting&&(p.formatting="link");var le=Ce(p);return p.linkText=!1,p.inline=p.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?re:pe,le}if(ne==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){p.f=p.inline=w,ye.highlightFormatting&&(p.formatting="link");var le=Ce(p);return le?le+=" ":le="",le+N.linkInline}if(ne==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){p.f=p.inline=w,ye.highlightFormatting&&(p.formatting="link");var le=Ce(p);return le?le+=" ":le="",le+N.linkEmail}if(ye.xml&&ne==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var R=m.string.indexOf(">",m.pos);if(R!=-1){var b=m.string.substring(m.start,R);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(p.md_inside=!0)}return m.backUp(1),p.htmlState=Q.startState(De),je(m,p,ze)}if(ye.xml&&ne==="<"&&m.match(/^\/\w*?>/))return p.md_inside=!1,"tag";if(ne==="*"||ne==="_"){for(var P=1,E=m.pos==1?" ":m.string.charAt(m.pos-2);P<3&&m.eat(ne);)P++;var de=m.peek()||" ",xe=!/\s/.test(de)&&(!W.test(de)||/\s/.test(E)||W.test(E)),G=!/\s/.test(E)&&(!W.test(E)||/\s/.test(de)||W.test(de)),Ee=null,Le=null;if(P%2&&(!p.em&&xe&&(ne==="*"||!G||W.test(E))?Ee=!0:p.em==ne&&G&&(ne==="*"||!xe||W.test(de))&&(Ee=!1)),P>1&&(!p.strong&&xe&&(ne==="*"||!G||W.test(E))?Le=!0:p.strong==ne&&G&&(ne==="*"||!xe||W.test(de))&&(Le=!1)),Le!=null||Ee!=null){ye.highlightFormatting&&(p.formatting=Ee==null?"strong":Le==null?"em":"strong em"),Ee===!0&&(p.em=ne),Le===!0&&(p.strong=ne);var ie=Ce(p);return Ee===!1&&(p.em=!1),Le===!1&&(p.strong=!1),ie}}else if(ne===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return Ce(p);m.backUp(1)}if(ye.strikethrough){if(ne==="~"&&m.eatWhile(ne)){if(p.strikethrough){ye.highlightFormatting&&(p.formatting="strikethrough");var ie=Ce(p);return p.strikethrough=!1,ie}else if(m.match(/^[^\s]/,!1))return p.strikethrough=!0,ye.highlightFormatting&&(p.formatting="strikethrough"),Ce(p)}else if(ne===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return Ce(p);m.backUp(2)}}if(ye.emoji&&ne===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){p.emoji=!0,ye.highlightFormatting&&(p.formatting="emoji");var Me=Ce(p);return p.emoji=!1,Me}return ne===" "&&(m.match(/^ +$/,!1)?p.trailingSpace++:p.trailingSpace&&(p.trailingSpaceNewLine=!0)),Ce(p)}function w(m,p){var _=m.next();if(_===">"){p.f=p.inline=pe,ye.highlightFormatting&&(p.formatting="link");var M=Ce(p);return M?M+=" ":M="",M+N.linkInline}return m.match(/^[^>]+/,!0),N.linkInline}function re(m,p){if(m.eatSpace())return null;var _=m.next();return _==="("||_==="["?(p.f=p.inline=S(_==="("?")":"]"),ye.highlightFormatting&&(p.formatting="link-string"),p.linkHref=!0,Ce(p)):"error"}var j={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function S(m){return function(p,_){var M=p.next();if(M===m){_.f=_.inline=pe,ye.highlightFormatting&&(_.formatting="link-string");var ne=Ce(_);return _.linkHref=!1,ne}return p.match(j[m]),_.linkHref=!0,Ce(_)}}function he(m,p){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(p.f=z,m.next(),ye.highlightFormatting&&(p.formatting="link"),p.linkText=!0,Ce(p)):ue(m,p,pe)}function z(m,p){if(m.match(/^\]:/,!0)){p.f=p.inline=O,ye.highlightFormatting&&(p.formatting="link");var _=Ce(p);return p.linkText=!1,_}return m.match(/^([^\]\\]|\\.)+/,!0),N.linkText}function O(m,p){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?p.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),p.f=p.inline=pe,N.linkHref+" url")}var T={startState:function(){return{f:ge,prevLine:{stream:null},thisLine:{stream:null},block:ge,htmlState:null,indentation:0,inline:pe,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(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&Q.copyState(De,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?Q.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,p){if(p.formatting=!1,m!=p.thisLine.stream){if(p.header=0,p.hr=!1,m.match(/^\s*$/,!0))return _e(p),null;if(p.prevLine=p.thisLine,p.thisLine={stream:m},p.taskList=!1,p.trailingSpace=0,p.trailingSpaceNewLine=!1,!p.localState&&(p.f=p.block,p.f!=ze)){var _=m.match(/^\s*/,!0)[0].replace(/\t/g,Z).length;if(p.indentation=_,p.indentationDiff=null,_>0)return null}}return p.f(m,p)},innerMode:function(m){return m.block==ze?{state:m.htmlState,mode:De}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:T}},indent:function(m,p,_){return m.block==ze&&De.indent?De.indent(m.htmlState,p,_):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,p,_):Q.Pass},blankLine:_e,getType:Ce,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return T},"xml"),Q.defineMIME("text/markdown","markdown"),Q.defineMIME("text/x-markdown","markdown")})},mOS8:function(ct,Xe,y){ct.exports=y.p+"static/403Qrcode.6c17b6f4.png"},osHv:function(ct,Xe,y){(function(Q){Q(y("VrN/"))})(function(Q){"use strict";var Te=Q.Pos;function ye(W,Z){return W.line-Z.line||W.ch-Z.ch}var De="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",Se=De+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",se=new RegExp("<(/?)(["+De+"]["+Se+"]*)","g");function N(W,Z,ue,je){this.line=Z,this.ch=ue,this.cm=W,this.text=W.getLine(Z),this.min=je?Math.max(je.from,W.firstLine()):W.firstLine(),this.max=je?Math.min(je.to-1,W.lastLine()):W.lastLine()}function te(W,Z){var ue=W.cm.getTokenTypeAt(Te(W.line,Z));return ue&&/\btag\b/.test(ue)}function J(W){return W.line>=W.max?void 0:(W.ch=0,W.text=W.cm.getLine(++W.line),!0)}function K(W){return W.line<=W.min?void 0:(W.text=W.cm.getLine(--W.line),W.ch=W.text.length,!0)}function D(W){for(;;){var Z=W.text.indexOf(">",W.ch);if(Z==-1){if(J(W))continue;return}if(!te(W,Z+1)){W.ch=Z+1;continue}var ue=W.text.lastIndexOf("/",Z),je=ue>-1&&!/\S/.test(W.text.slice(ue+1,Z));return W.ch=Z+1,je?"selfClose":"regular"}}function B(W){for(;;){var Z=W.ch?W.text.lastIndexOf("<",W.ch-1):-1;if(Z==-1){if(K(W))continue;return}if(!te(W,Z+1)){W.ch=Z;continue}se.lastIndex=Z,W.ch=Z;var ue=se.exec(W.text);if(ue&&ue.index==Z)return ue}}function oe(W){for(;;){se.lastIndex=W.ch;var Z=se.exec(W.text);if(!Z){if(J(W))continue;return}if(!te(W,Z.index+1)){W.ch=Z.index+1;continue}return W.ch=Z.index+Z[0].length,Z}}function V(W){for(;;){var Z=W.ch?W.text.lastIndexOf(">",W.ch-1):-1;if(Z==-1){if(K(W))continue;return}if(!te(W,Z+1)){W.ch=Z;continue}var ue=W.text.lastIndexOf("/",Z),je=ue>-1&&!/\S/.test(W.text.slice(ue+1,Z));return W.ch=Z+1,je?"selfClose":"regular"}}function F(W,Z){for(var ue=[];;){var je=oe(W),Ke,_e=W.line,ge=W.ch-(je?je[0].length:0);if(!je||!(Ke=D(W)))return;if(Ke=="selfClose")continue;if(je[1]){for(var ze=ue.length-1;ze>=0;--ze)if(ue[ze]==je[2]){ue.length=ze;break}if(ze<0&&(!Z||Z==je[2]))return{tag:je[2],from:Te(_e,ge),to:Te(W.line,W.ch)}}else ue.push(je[2])}}function Y(W,Z){for(var ue=[];;){var je=V(W);if(!je)return;if(je=="selfClose"){B(W);continue}var Ke=W.line,_e=W.ch,ge=B(W);if(!ge)return;if(ge[1])ue.push(ge[2]);else{for(var ze=ue.length-1;ze>=0;--ze)if(ue[ze]==ge[2]){ue.length=ze;break}if(ze<0&&(!Z||Z==ge[2]))return{tag:ge[2],from:Te(W.line,W.ch),to:Te(Ke,_e)}}}}Q.registerHelper("fold","xml",function(W,Z){for(var ue=new N(W,Z.line,0);;){var je=oe(ue);if(!je||ue.line!=Z.line)return;var Ke=D(ue);if(!Ke)return;if(!je[1]&&Ke!="selfClose"){var _e=Te(ue.line,ue.ch),ge=F(ue,je[2]);return ge&&ye(ge.from,_e)>0?{from:_e,to:ge.from}:null}}}),Q.findMatchingTag=function(W,Z,ue){var je=new N(W,Z.line,Z.ch,ue);if(je.text.indexOf(">")==-1&&je.text.indexOf("<")==-1)return;var Ke=D(je),_e=Ke&&Te(je.line,je.ch),ge=Ke&&B(je);if(!Ke||!ge||ye(je,Z)>0)return;var ze={from:Te(je.line,je.ch),to:_e,tag:ge[2]};return Ke=="selfClose"?{open:ze,close:null,at:"open"}:ge[1]?{open:Y(je,ge[2]),close:ze,at:"close"}:(je=new N(W,_e.line,_e.ch,ue),{open:ze,close:F(je,ge[2]),at:"open"})},Q.findEnclosingTag=function(W,Z,ue,je){for(var Ke=new N(W,Z.line,Z.ch,ue);;){var _e=Y(Ke,je);if(!_e)break;var ge=new N(W,Z.line,Z.ch,ue),ze=F(ge,_e.tag);if(ze)return{open:_e,close:ze}}},Q.scanForClosingTag=function(W,Z,ue,je){var Ke=new N(W,Z.line,Z.ch,je?{from:0,to:je}:null);return F(Ke,ue)}})},p5ED:function(ct,Xe,y){"use strict";var Q=y("+L6B"),Te=y("2/Rp"),ye=y("5Dmo"),De=y("3S7+"),Se=y("k1fw"),se=y("9og8"),N=y("tJVT"),te=y("WmNS"),J=y.n(te),K=y("q1tI"),D=y.n(K),B=y("vHTk"),oe=y.n(B),V=y("yEEn"),F=y("ZW9T"),Y=y("1vsH"),W=y("V0Rq"),Z=y("m3rI"),ue=function(Ke){var _e=Ke.name,ge=Ke.data,ze=Ke.theme,fe=Ke.type,Ce=Ke.filename,Pe=Ke.monacoEditor,pe=Ke.className,w=Ke.style,re=Ke.close,j=Ke.onClose,S=Ke.hasMask,he=Ke.otherData,z=he===void 0?{}:he,O=Object(K.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),T=Object(N.a)(O,2),m=T[0],p=T[1],_=Object(K.useState)(""),M=Object(N.a)(_,2),ne=M[0],we=M[1],Re=Object(K.useState)(),be=Object(N.a)(Re,2),ve=be[0],ie=be[1],le=window.ENV==="build"?"/react/build/office.html":"/office.html",$,R=1024*1024,b=10*R,P=Object(K.useRef)();fe==="office"&&($=Object(Y.P)(ge).filesize,$>b&&(fe="other")),Ce&&(Pe.filename=Ce),Object(K.useEffect)(function(){var G,Ee,Le=(G=document.cookie)===null||G===void 0||((Ee=G.replace(/\s/g,""))===null||Ee===void 0)?void 0:Ee.split(";");Le==null||Le.map(function(Me){var ke=Me.split("=");ke[0]==="_educoder_session"&&we(ke[1])})},[]),Object(K.useEffect)(function(){fe==="office"&&E()},[fe]);var E=function(){var G=Object(se.a)(J.a.mark(function Ee(){var Le,Me,ke;return J.a.wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:return console.log("data:",ge),Le=ge,ge.startsWith("http")||(Le=location.origin+Le),Me=new URL(Le).pathname.split("/").pop(),Ne.next=6,Object(W.U)({attachment_id:Me});case 6:ke=Ne.sent,ie(ke);case 8:case"end":return Ne.stop()}},Ee)}));return function(){return G.apply(this,arguments)}}(),de=function(){if(ge.startsWith("http")||ge.startsWith("blob:")){xe();return}Object(Y.x)(Ce||"educoder",ge,Ce)},xe=function(){Object(Y.v)(Ce||"educoder",decodeURIComponent(ge))};return D.a.createElement("div",{style:Object(Se.a)({},w||{}),className:"".concat(S&&oe.a.bgBlack," ").concat(fe?oe.a.wrp:"hide")},re&&D.a.createElement("div",{className:oe.a.close,ref:P},D.a.createElement(De.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return P.current}},D.a.createElement("span",{onClick:xe},D.a.createElement("i",{className:"icon-quxiaozhiding"}))),D.a.createElement(De.a,{title:"\u5173\u95ED",getPopupContainer:function(){return P.current}},D.a.createElement("span",{className:"",onClick:function(){j(),ie(null)}},D.a.createElement("i",{className:"icon-guanbi1"})))),D.a.createElement("div",{className:"".concat(oe.a[pe]," ").concat(pe," ").concat(oe.a.monaco," ").concat(fe==="txt"?"show":"hide")},fe==="txt"&&D.a.createElement(F.b,Pe)),fe==="audio"&&D.a.createElement("audio",{src:"".concat((ge==null?void 0:ge.indexOf("http://"))>-1||(ge==null?void 0:ge.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(ge),autoPlay:!0}),fe==="video"&&D.a.createElement(D.a.Fragment,null,(ge==null?void 0:ge.indexOf("/api"))>-1?D.a.createElement("video",{controls:!0,src:"".concat(ge),autoPlay:!0}):D.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(ge),autoPlay:!0})),fe==="office"&&ve&&D.a.createElement("iframe",{src:"".concat(le,"?key=").concat(ve.key,"&url=").concat(Z.a.API_SERVER+ve.url,"&callbackUrl=").concat(Z.a.API_SERVER+ve.callbackUrl,"&fileType=").concat(ve.fileType,"&title=").concat(ve.title,"&model=view")}),(fe==="xlsx"||fe==="doc"||fe==="pptx"||fe==="docx")&&D.a.createElement("iframe",{src:"".concat(le,"?key=").concat(z.key,"&url=").concat(Z.a.API_SERVER+z.url,"&callbackUrl=").concat(Z.a.API_SERVER+z.callbackUrl,"&fileType=").concat(z.fileType,"&title=").concat(z.title,"&model=").concat(z.model)}),fe==="html"&&D.a.createElement("iframe",{src:ge+"&disposition=inline"}),fe==="pdf"&&D.a.createElement("embed",{className:oe.a.embed,src:ge,type:"application/pdf"}),fe==="image"&&D.a.createElement("img",{src:"".concat((ge==null?void 0:ge.indexOf("http://"))>-1||(ge==null?void 0:ge.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(ge)}),fe==="other"&&D.a.createElement("div",null,D.a.createElement(Te.a,{type:"primary",size:"large",onClick:de},D.a.createElement(V.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),fe==="download"&&D.a.createElement(Te.a,{type:"primary",size:"large",onClick:de},D.a.createElement(V.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Xe.a=ue},"p77/":function(ct,Xe,y){},"rAM+":function(ct,Xe,y){"use strict";y.d(Xe,"a",function(){return Te});var Q=y("Qw5x");function Te(ye,De){var Se;if(typeof Symbol=="undefined"||ye[Symbol.iterator]==null){if(Array.isArray(ye)||(Se=Object(Q.a)(ye))||De&&ye&&typeof ye.length=="number"){Se&&(ye=Se);var se=0,N=function(){};return{s:N,n:function(){return se>=ye.length?{done:!0}:{done:!1,value:ye[se++]}},e:function(B){throw B},f:N}}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 te=!0,J=!1,K;return{s:function(){Se=ye[Symbol.iterator]()},n:function(){var B=Se.next();return te=B.done,B},e:function(B){J=!0,K=B},f:function(){try{!te&&Se.return!=null&&Se.return()}finally{if(J)throw K}}}}},rUJ1:function(ct,Xe){const y=/[&<>"']/,Q=/[&<>"']/g,Te=/[<>"']|&(?!#?\w+;)/,ye=/[<>"']|&(?!#?\w+;)/g,De={"&":"&","<":"<",">":">",'"':""","'":"'"},Se=fe=>De[fe];function se(fe,Ce){if(Ce){if(y.test(fe))return fe.replace(Q,Se)}else if(Te.test(fe))return fe.replace(ye,Se);return fe}const N=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function te(fe){return fe.replace(N,(Ce,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 J=/(^|[^\[])\^/g;function K(fe,Ce){fe=fe.source||fe,Ce=Ce||"";const Pe={replace:(pe,w)=>(w=w.source||w,w=w.replace(J,"$1"),fe=fe.replace(pe,w),Pe),getRegex:()=>new RegExp(fe,Ce)};return Pe}const D=/[^\w:]/g,B=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function oe(fe,Ce,Pe){if(fe){let pe;try{pe=decodeURIComponent(te(Pe)).replace(D,"").toLowerCase()}catch(w){return null}if(pe.indexOf("javascript:")===0||pe.indexOf("vbscript:")===0||pe.indexOf("data:")===0)return null}Ce&&!B.test(Pe)&&(Pe=Z(Ce,Pe));try{Pe=encodeURI(Pe).replace(/%25/g,"%")}catch(pe){return null}return Pe}const V={},F=/^[^:]+:\/*[^/]*$/,Y=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Z(fe,Ce){V[" "+fe]||(F.test(fe)?V[" "+fe]=fe+"/":V[" "+fe]=_e(fe,"/",!0)),fe=V[" "+fe];const Pe=fe.indexOf(":")===-1;return Ce.substring(0,2)==="//"?Pe?Ce:fe.replace(Y,"$1")+Ce:Ce.charAt(0)==="/"?Pe?Ce:fe.replace(W,"$1")+Ce:fe+Ce}const ue={exec:function(){}};function je(fe){let Ce=1,Pe,pe;for(;Ce<arguments.length;Ce++){Pe=arguments[Ce];for(pe in Pe)Object.prototype.hasOwnProperty.call(Pe,pe)&&(fe[pe]=Pe[pe])}return fe}function Ke(fe,Ce){const Pe=fe.replace(/\|/g,(re,j,S)=>{let he=!1,z=j;for(;--z>=0&&S[z]==="\\";)he=!he;return he?"|":" |"}),pe=Pe.split(/ \|/);let w=0;if(pe.length>Ce)pe.splice(Ce);else for(;pe.length<Ce;)pe.push("");for(;w<pe.length;w++)pe[w]=pe[w].trim().replace(/\\\|/g,"|");return pe}function _e(fe,Ce,Pe){const pe=fe.length;if(pe===0)return"";let w=0;for(;w<pe;){const re=fe.charAt(pe-w-1);if(re===Ce&&!Pe)w++;else if(re!==Ce&&Pe)w++;else break}return fe.substr(0,pe-w)}function ge(fe,Ce){if(fe.indexOf(Ce[1])===-1)return-1;const Pe=fe.length;let pe=0,w=0;for(;w<Pe;w++)if(fe[w]==="\\")w++;else if(fe[w]===Ce[0])pe++;else if(fe[w]===Ce[1]&&(pe--,pe<0))return w;return-1}function ze(fe){fe&&fe.sanitize&&!fe.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")}ct.exports={escape:se,unescape:te,edit:K,cleanUrl:oe,resolveUrl:Z,noopTest:ue,merge:je,splitCells:Ke,rtrim:_e,findClosingBracket:ge,checkSanitizeDeprecation:ze}},ttuQ:function(ct,Xe,y){ct.exports={bg:"bg___3F6Km",name:"name___1NsJT",member:"member___2pzzt"}},vHTk:function(ct,Xe,y){ct.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wzkS:function(ct,Xe,y){"use strict";y.d(Xe,"c",function(){return Se}),y.d(Xe,"b",function(){return se}),y.d(Xe,"d",function(){return N}),y.d(Xe,"a",function(){return J}),y.d(Xe,"e",function(){return K});var Q=y("9og8"),Te=y("WmNS"),ye=y.n(Te),De=y("ErOA");function Se(D){return Object(De.c)("libraries/".concat(D,".json"))}function se(){return Object(De.c)("library_tags.json")}function N(D){return te.apply(this,arguments)}function te(){return te=Object(Q.a)(ye.a.mark(function D(B){var oe;return ye.a.wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Object(De.b)("attachments/".concat(B,".json"));case 2:return oe=F.sent,F.abrupt("return",oe.status===0);case 4:case"end":return F.stop()}},D)})),te.apply(this,arguments)}function J(D){return Object(De.f)("libraries.json",D)}function K(D,B){return Object(De.g)("libraries/".concat(D,".json"),B)}},y5JW:function(ct,Xe,y){"use strict";y.d(Xe,"c",function(){return Y}),y.d(Xe,"a",function(){return W});var Q=y("DZo9"),Te=y("8z0m"),ye=y("+L6B"),De=y("2/Rp"),Se=y("9og8"),se=y("k1fw"),N=y("oBTY"),te=y("miYZ"),J=y("tsqr"),K=y("WmNS"),D=y.n(K),B=y("q1tI"),oe=y.n(B),V=y("m3rI"),F=y("wzkS"),Y="\u3000\u3000";function W(Z){var ue=["Bytes","KB","MB","GB","TB"];if(Z==0)return"0 Byte";var je=parseInt(""+Math.floor(Math.log(Z)/Math.log(1024)),10);return(Z/Math.pow(1024,je)).toFixed(1)+" "+ue[je]}Xe.b=function(Z){var ue=Z.value,je=ue===void 0?[]:ue,Ke=Z.action,_e=Z.onChange,ge=Z.className,ze=Z.maxSize,fe=ze===void 0?150:ze,Ce=Z.title,Pe=Ce===void 0?"\u6587\u4EF6\u4E0A\u4F20":Ce,pe=Z.accept,w=pe===void 0?null:pe,re={multiple:!1,fileList:je,accept:w,withCredentials:!0,beforeUpload:function(he){var z=he.size/1024/1024;return z<fe?!0:(J.b.error("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4E0A\u4F20\u3002\u8D85\u8FC7\u6587\u4EF6\u5927\u5C0F\u9650\u5236(".concat(fe,"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(V.a.API_SERVER,"/api/attachments.json"),onChange:function(he){var z=Object(N.a)(he.fileList);z=z.map(function(O){return O.name.indexOf(Y)===-1&&(O.name="".concat(O.name).concat(Y).concat(W(O.size))),Object(se.a)({},O)}),_e(z)},onRemove:function(){var S=Object(Se.a)(D.a.mark(function z(O){var T,m,p;return D.a.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(T=O.size/1024/1024,!(O.status==="uploading")){M.next=3;break}return M.abrupt("return",!0);case 3:if(T<fe){M.next=7;break}return M.abrupt("return",!0);case 7:if(m=O.response?O.response.id:O.uid,!m){M.next=15;break}return M.next=11,Object(F.d)(O.response?O.response.id:O.id);case 11:return p=M.sent,M.abrupt("return",p);case 15:return M.abrupt("return",!0);case 16:case"end":return M.stop()}},z)}));function he(z){return S.apply(this,arguments)}return he}()};function j(S){S.preventDefault(),S.stopPropagation()}return oe.a.createElement("div",{className:"single-upload ".concat(ge||"")},oe.a.createElement(Te.a,re,oe.a.createElement(De.a,{type:"primary",title:je.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:je.length>0,ghost:!0},Pe),oe.a.createElement("span",{onClick:j,style:{marginLeft:10}},"(\u5355\u4E2A\u6587\u4EF6\u6700\u5927",fe,"M) ")))}}}]);
|